(function(Ot,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("@abi-software/map-utilities"),require("pinia"),require("@abi-software/svg-sprite"),require("@abi-software/sparc-annotation")):typeof define=="function"&&define.amd?define(["exports","vue","@abi-software/map-utilities","pinia","@abi-software/svg-sprite","@abi-software/sparc-annotation"],a):(Ot=typeof globalThis<"u"?globalThis:Ot||self,a(Ot.ScaffoldVuer={},Ot.Vue,Ot["@abi-software/map-utilities"],Ot.pinia,Ot["@abi-software/svg-sprite"],Ot["@abi-software/sparc-annotation"]))})(this,function(Ot,a,Ua,Ga,Of,Wx){"use strict";const oi=(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 jx=Object.defineProperty,$x=Object.defineProperties,Zx=Object.getOwnPropertyDescriptors,Nf=Object.getOwnPropertySymbols,Xx=Object.prototype.hasOwnProperty,Yx=Object.prototype.propertyIsEnumerable,Bf=(n,e,t)=>e in n?jx(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Jx=(n,e)=>{for(var t in e||(e={}))Xx.call(e,t)&&Bf(n,t,e[t]);if(Nf)for(var t of Nf(e))Yx.call(e,t)&&Bf(n,t,e[t]);return n},Kx=(n,e)=>$x(n,Zx(e));function Df(n,e){var t;const i=a.shallowRef();return a.watchEffect(()=>{i.value=n()},Kx(Jx({},e),{flush:(t=void 0)!=null?t:"sync"})),a.readonly(i)}var Vf;const Rt=typeof window<"u",qx=n=>typeof n=="string",kf=()=>{},Yc=Rt&&((Vf=window==null?void 0:window.navigator)==null?void 0:Vf.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function zf(n){return typeof n=="function"?n():a.unref(n)}function Qx(n){return n}function Ha(n){return a.getCurrentScope()?(a.onScopeDispose(n),!0):!1}function ew(n,e=!0){a.getCurrentInstance()?a.onMounted(n):e?n():a.nextTick(n)}function ai(n){var e;const t=zf(n);return(e=t==null?void 0:t.$el)!=null?e:t}const _o=Rt?window:void 0,tw=Rt?window.document:void 0;function kt(...n){let e,t,i,r;if(qx(n[0])||Array.isArray(n[0])?([t,i,r]=n,e=_o):[e,t,i,r]=n,!e)return kf;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],o=()=>{s.forEach(f=>f()),s.length=0},l=(f,d,p,v)=>(f.addEventListener(d,p,v),()=>f.removeEventListener(d,p,v)),u=a.watch(()=>[ai(e),zf(r)],([f,d])=>{o(),f&&s.push(...t.flatMap(p=>i.map(v=>l(f,p,v,d))))},{immediate:!0,flush:"post"}),c=()=>{u(),o()};return Ha(c),c}let Uf=!1;function nw(n,e,t={}){const{window:i=_o,ignore:r=[],capture:s=!0,detectIframe:o=!1}=t;if(!i)return;Yc&&!Uf&&(Uf=!0,Array.from(i.document.body.children).forEach(p=>p.addEventListener("click",kf)));let l=!0;const u=p=>r.some(v=>{if(typeof v=="string")return Array.from(i.document.querySelectorAll(v)).some(m=>m===p.target||p.composedPath().includes(m));{const m=ai(v);return m&&(p.target===m||p.composedPath().includes(m))}}),f=[kt(i,"click",p=>{const v=ai(n);if(!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!u(p)),!l){l=!0;return}e(p)}},{passive:!0,capture:s}),kt(i,"pointerdown",p=>{const v=ai(n);v&&(l=!p.composedPath().includes(v)&&!u(p))},{passive:!0}),o&&kt(i,"blur",p=>{var v;const m=ai(n);((v=i.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(m!=null&&m.contains(i.document.activeElement))&&e(p)})].filter(Boolean);return()=>f.forEach(p=>p())}function Gf(n,e=!1){const t=a.ref(),i=()=>t.value=!!n();return i(),ew(i,e),t}const Hf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wf="__vueuse_ssr_handlers__";Hf[Wf]=Hf[Wf]||{};function iw({document:n=tw}={}){if(!n)return a.ref("visible");const e=a.ref(n.visibilityState);return kt(n,"visibilitychange",()=>{e.value=n.visibilityState}),e}var jf=Object.getOwnPropertySymbols,rw=Object.prototype.hasOwnProperty,sw=Object.prototype.propertyIsEnumerable,ow=(n,e)=>{var t={};for(var i in n)rw.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&jf)for(var i of jf(n))e.indexOf(i)<0&&sw.call(n,i)&&(t[i]=n[i]);return t};function bn(n,e,t={}){const i=t,{window:r=_o}=i,s=ow(i,["window"]);let o;const l=Gf(()=>r&&"ResizeObserver"in r),u=()=>{o&&(o.disconnect(),o=void 0)},c=a.watch(()=>ai(n),d=>{u(),l.value&&r&&d&&(o=new ResizeObserver(e),o.observe(d,s))},{immediate:!0,flush:"post"}),f=()=>{u(),c()};return Ha(f),{isSupported:l,stop:f}}var $f=Object.getOwnPropertySymbols,aw=Object.prototype.hasOwnProperty,lw=Object.prototype.propertyIsEnumerable,cw=(n,e)=>{var t={};for(var i in n)aw.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&$f)for(var i of $f(n))e.indexOf(i)<0&&lw.call(n,i)&&(t[i]=n[i]);return t};function uw(n,e,t={}){const i=t,{window:r=_o}=i,s=cw(i,["window"]);let o;const l=Gf(()=>r&&"MutationObserver"in r),u=()=>{o&&(o.disconnect(),o=void 0)},c=a.watch(()=>ai(n),d=>{u(),l.value&&r&&d&&(o=new MutationObserver(e),o.observe(d,s))},{immediate:!0}),f=()=>{u(),c()};return Ha(f),{isSupported:l,stop:f}}var Zf;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(Zf||(Zf={}));var hw=Object.defineProperty,Xf=Object.getOwnPropertySymbols,dw=Object.prototype.hasOwnProperty,fw=Object.prototype.propertyIsEnumerable,Yf=(n,e,t)=>e in n?hw(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,pw=(n,e)=>{for(var t in e||(e={}))dw.call(e,t)&&Yf(n,t,e[t]);if(Xf)for(var t of Xf(e))fw.call(e,t)&&Yf(n,t,e[t]);return n};pw({linear:Qx},{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 mw({window:n=_o}={}){if(!n)return a.ref(!1);const e=a.ref(n.document.hasFocus());return kt(n,"blur",()=>{e.value=!1}),kt(n,"focus",()=>{e.value=!0}),e}const gw=()=>Rt&&/firefox/i.test(window.navigator.userAgent);/** * @vue/shared v3.5.13 * (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 To=()=>{},vw=Object.prototype.hasOwnProperty,Jf=(n,e)=>vw.call(n,e),sn=Array.isArray,Jt=n=>typeof n=="function",Ht=n=>typeof n=="string",en=n=>n!==null&&typeof n=="object",yw=Object.prototype.toString,bw=n=>yw.call(n),Jc=n=>bw(n).slice(8,-1),Kc=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},xw=/-(\w)/g,ww=Kc(n=>n.replace(xw,(e,t)=>t?t.toUpperCase():"")),Mw=/\B([A-Z])/g,Aw=Kc(n=>n.replace(Mw,"-$1").toLowerCase()),Sw=Kc(n=>n.charAt(0).toUpperCase()+n.slice(1));var Kf=typeof global=="object"&&global&&global.Object===Object&&global,_w=typeof self=="object"&&self&&self.Object===Object&&self,Gn=Kf||_w||Function("return this")(),Hn=Gn.Symbol,qf=Object.prototype,Tw=qf.hasOwnProperty,Ew=qf.toString,Eo=Hn?Hn.toStringTag:void 0;function Cw(n){var e=Tw.call(n,Eo),t=n[Eo];try{n[Eo]=void 0;var i=!0}catch{}var r=Ew.call(n);return i&&(e?n[Eo]=t:delete n[Eo]),r}var Lw=Object.prototype,Rw=Lw.toString;function Fw(n){return Rw.call(n)}var Pw="[object Null]",Iw="[object Undefined]",Qf=Hn?Hn.toStringTag:void 0;function ls(n){return n==null?n===void 0?Iw:Pw:Qf&&Qf in Object(n)?Cw(n):Fw(n)}function cs(n){return n!=null&&typeof n=="object"}var Ow="[object Symbol]";function Wa(n){return typeof n=="symbol"||cs(n)&&ls(n)==Ow}function Nw(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t0){if(++e>=lM)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function dM(n){return function(){return n}}var ja=function(){try{var n=wr(Object,"defineProperty");return n({},"",{}),n}catch{}}(),fM=ja?function(n,e){return ja(n,"toString",{configurable:!0,enumerable:!1,value:dM(e),writable:!0})}:sp,pM=hM(fM);function mM(n,e,t,i){n.length;for(var r=t+1;r--;)if(e(n[r],r,n))return r;return-1}var gM=9007199254740991,vM=/^(?:0|[1-9]\d*)$/;function eu(n,e){var t=typeof n;return e=e??gM,!!e&&(t=="number"||t!="symbol"&&vM.test(n))&&n>-1&&n%1==0&&n-1&&n%1==0&&n<=AM}function SM(n){return n!=null&&nu(n.length)&&!op(n)}var _M=Object.prototype;function TM(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||_M;return n===t}function EM(n,e){for(var t=-1,i=Array(n);++t-1}function O1(n,e){var t=this.__data__,i=$a(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function li(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 d=-1,p=!0,v=t&AA?new Ya:void 0;for(s.set(n,e),s.set(e,n);++d=e||F<0||d&&R>=s}function y(){var M=fu();if(b(M))return g(M);l=setTimeout(y,h(M))}function g(M){return l=void 0,p&&i?v(M):(i=r=void 0,o)}function w(){l!==void 0&&clearTimeout(l),c=0,i=u=r=l=void 0}function A(){return l===void 0?o:g(fu())}function S(){var M=fu(),F=b(M);if(i=arguments,r=this,u=M,F){if(l===void 0)return m(u);if(d)return clearTimeout(l),l=setTimeout(y,e),v(u)}return l===void 0&&(l=setTimeout(y,e)),o}return S.cancel=w,S.flush=A,S}function uS(n,e,t){var i=n==null?0:n.length;if(!i)return-1;var r=i-1;return mM(n,oS(e),r)}function qa(n){for(var e=-1,t=n==null?0:n.length,i={};++en===void 0,Po=n=>typeof n=="boolean",tt=n=>typeof n=="number",Ar=n=>typeof Element>"u"?!1:n instanceof Element,Dp=n=>jn(n),gS=n=>Ht(n)?!Number.isNaN(Number(n)):!1,vS=(n="")=>n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Vi=n=>Sw(n),Vp=n=>Object.keys(n);class kp extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function us(n,e){throw new kp(`[${n}] ${e}`)}function gt(n,e){if(process.env.NODE_ENV!=="production"){const t=Ht(n)?new kp(`[${n}] ${e}`):n;console.warn(t)}}const yS="utils/dom/style",zp=(n="")=>n.split(" ").filter(e=>!!e.trim()),Up=(n,e)=>{!n||!e.trim()||n.classList.add(...zp(e))},Qa=(n,e)=>{!n||!e.trim()||n.classList.remove(...zp(e))},Io=(n,e)=>{var t;if(!Rt||!n||!e)return"";let i=ww(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 el(n,e="px"){if(!n)return"";if(tt(n)||gS(n))return`${n}${e}`;if(Ht(n))return n;gt(yS,"binding value must be a string or number")}function bS(n,e){if(!Rt)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 xS=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"})]))}}),gu=xS,wS=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"})]))}}),ki=wS,MS=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"})]))}}),zi=MS,AS=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"})]))}}),SS=AS,_S=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"})]))}}),TS=_S,ES=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"})]))}}),vu=ES,CS=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"})]))}}),yu=CS,LS=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"})]))}}),tl=LS,RS=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"})]))}}),FS=RS,PS=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"})]))}}),Gp=PS,IS=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"})]))}}),OS=IS,NS=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"})]))}}),nl=NS,BS=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"})]))}}),DS=BS,VS=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"})]))}}),Hp=VS;const Wp="__epPropKey",Ve=n=>n,kS=n=>en(n)&&!!n[Wp],il=(n,e)=>{if(!en(n)||kS(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,d=[];if(t&&(d=Array.from(t),Jf(n,"default")&&d.push(r),f||(f=d.includes(c))),o&&(f||(f=o(c))),!f&&d.length>0){const p=[...new Set(d)].map(v=>JSON.stringify(v)).join(", ");a.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(c)}.`)}return f}:void 0,[Wp]:!0};return Jf(n,"default")&&(u.default=r),u},$e=n=>qa(Object.entries(n).map(([e,t])=>[e,il(t,e)])),Ui=Ve([String,Object,Function]),jp={validating:Gp,success:TS,error:vu},Nt=(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},zS=(n,e)=>(n.install=t=>{t.directive(e,n)},n),En=n=>(n.install=To,n),$n={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"},ot="update:modelValue",di="change",Sr="input",$p=["","default","small","large"],rl=n=>{const e=sn(n)?n:[n],t=[];return e.forEach(i=>{var r;sn(i)?t.push(...rl(i)):a.isVNode(i)&&sn(i.children)?t.push(...rl(i.children)):(t.push(i),a.isVNode(i)&&((r=i.component)!=null&&r.subTree)&&t.push(...rl(i.component.subTree)))}),t},US=n=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(n),fi=n=>n,GS=["class","style"],HS=/^on[A-Z]/,WS=(n={})=>{const{excludeListeners:e=!1,excludeKeys:t}=n,i=a.computed(()=>((t==null?void 0:t.value)||[]).concat(GS)),r=a.getCurrentInstance();return r?a.computed(()=>{var s;return qa(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([o])=>!i.value.includes(o)&&!(e&&HS.test(o))))}):(gt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),a.computed(()=>({})))},Zp=({from:n,replacement:e,scope:t,version:i,ref:r,type:s="API"},o)=>{a.watch(()=>a.unref(o),l=>{l&>(t,`[${s}] ${n} is about to be deprecated in version ${i}, please use ${e} instead. For more detail, please visit: ${r} `)},{immediate:!0})};var jS={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 $S=n=>(e,t)=>ZS(e,t,a.unref(n)),ZS=(n,e,t)=>ui(t,n,n).replace(/\{(\w+)\}/g,(i,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),XS=n=>{const e=a.computed(()=>a.unref(n).name),t=a.isRef(n)?n:a.ref(n);return{lang:e,locale:t,t:$S(n)}},Xp=Symbol("localeContextKey"),sl=n=>{const e=n||a.inject(Xp,a.ref());return XS(a.computed(()=>e.value||jS))},ol="el",YS="is-",_r=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},Yp=Symbol("namespaceContextKey"),bu=n=>{const e=n||(a.getCurrentInstance()?a.inject(Yp,a.ref(ol)):a.ref(ol));return a.computed(()=>a.unref(e)||ol)},Ge=(n,e)=>{const t=bu(e);return{namespace:t,b:(h="")=>_r(t.value,n,h,"",""),e:h=>h?_r(t.value,n,"",h,""):"",m:h=>h?_r(t.value,n,"","",h):"",be:(h,b)=>h&&b?_r(t.value,n,h,b,""):"",em:(h,b)=>h&&b?_r(t.value,n,"",h,b):"",bm:(h,b)=>h&&b?_r(t.value,n,h,"",b):"",bem:(h,b,y)=>h&&b&&y?_r(t.value,n,h,b,y):"",is:(h,...b)=>{const y=b.length>=1?b[0]:!0;return h&&y?`${YS}${h}`:""},cssVar:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${y}`]=h[y]);return b},cssVarName:h=>`--${t.value}-${h}`,cssVarBlock:h=>{const b={};for(const y in h)h[y]&&(b[`--${t.value}-${n}-${y}`]=h[y]);return b},cssVarBlockName:h=>`--${t.value}-${n}-${h}`}},JS=il({type:Ve(Boolean),default:null}),KS=il({type:Ve(Function)}),qS=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:JS,[t]:KS};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:c,onShow:f,onHide:d})=>{const p=a.getCurrentInstance(),{emit:v}=p,m=p.props,h=a.computed(()=>Jt(m[t])),b=a.computed(()=>m[n]===null),y=F=>{o.value!==!0&&(o.value=!0,l&&(l.value=F),Jt(f)&&f(F))},g=F=>{o.value!==!1&&(o.value=!1,l&&(l.value=F),Jt(d)&&d(F))},w=F=>{if(m.disabled===!0||Jt(c)&&!c())return;const R=h.value&&Rt;R&&v(e,!0),(b.value||!R)&&y(F)},A=F=>{if(m.disabled===!0||!Rt)return;const R=h.value&&Rt;R&&v(e,!1),(b.value||!R)&&g(F)},S=F=>{Po(F)&&(m.disabled&&F?h.value&&v(e,!1):o.value!==F&&(F?y():g()))},M=()=>{o.value?A():w()};return a.watch(()=>m[n],S),u&&p.appContext.config.globalProperties.$route!==void 0&&a.watch(()=>({...p.proxy.$route}),()=>{u.value&&o.value&&A()}),a.onMounted(()=>{S(m[n])}),{hide:A,show:w,toggle:M,hasUpdateHandler:h}},useModelToggleProps:r,useModelToggleEmits:i}},Jp=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 on="top",xn="bottom",wn="right",an="left",xu="auto",Oo=[on,xn,wn,an],hs="start",No="end",QS="clippingParents",Kp="viewport",Bo="popper",e_="reference",qp=Oo.reduce(function(n,e){return n.concat([e+"-"+hs,e+"-"+No])},[]),ds=[].concat(Oo,[xu]).reduce(function(n,e){return n.concat([e,e+"-"+hs,e+"-"+No])},[]),t_="beforeRead",n_="read",i_="afterRead",r_="beforeMain",s_="main",o_="afterMain",a_="beforeWrite",l_="write",c_="afterWrite",u_=[t_,n_,i_,r_,s_,o_,a_,l_,c_];function Zn(n){return n?(n.nodeName||"").toLowerCase():null}function Cn(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function fs(n){var e=Cn(n).Element;return n instanceof e||n instanceof Element}function Mn(n){var e=Cn(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function wu(n){if(typeof ShadowRoot>"u")return!1;var e=Cn(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function h_(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];!Mn(s)||!Zn(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 d_(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},{});!Mn(r)||!Zn(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}var Qp={name:"applyStyles",enabled:!0,phase:"write",fn:h_,effect:d_,requires:["computeStyles"]};function Xn(n){return n.split("-")[0]}var Tr=Math.max,al=Math.min,ps=Math.round;function ms(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(Mn(n)&&e){var s=n.offsetHeight,o=n.offsetWidth;o>0&&(i=ps(t.width)/o||1),s>0&&(r=ps(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 Mu(n){var e=ms(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 em(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&wu(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function pi(n){return Cn(n).getComputedStyle(n)}function f_(n){return["table","td","th"].indexOf(Zn(n))>=0}function Gi(n){return((fs(n)?n.ownerDocument:n.document)||window.document).documentElement}function ll(n){return Zn(n)==="html"?n:n.assignedSlot||n.parentNode||(wu(n)?n.host:null)||Gi(n)}function tm(n){return!Mn(n)||pi(n).position==="fixed"?null:n.offsetParent}function p_(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&Mn(n)){var i=pi(n);if(i.position==="fixed")return null}var r=ll(n);for(wu(r)&&(r=r.host);Mn(r)&&["html","body"].indexOf(Zn(r))<0;){var s=pi(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 Do(n){for(var e=Cn(n),t=tm(n);t&&f_(t)&&pi(t).position==="static";)t=tm(t);return t&&(Zn(t)==="html"||Zn(t)==="body"&&pi(t).position==="static")?e:t||p_(n)||e}function Au(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Vo(n,e,t){return Tr(n,al(e,t))}function m_(n,e,t){var i=Vo(n,e,t);return i>t?t:i}function nm(){return{top:0,right:0,bottom:0,left:0}}function im(n){return Object.assign({},nm(),n)}function rm(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var g_=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,im(typeof n!="number"?n:rm(n,Oo))};function v_(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Xn(t.placement),u=Au(l),c=[an,wn].indexOf(l)>=0,f=c?"height":"width";if(!(!s||!o)){var d=g_(r.padding,t),p=Mu(s),v=u==="y"?on:an,m=u==="y"?xn:wn,h=t.rects.reference[f]+t.rects.reference[u]-o[u]-t.rects.popper[f],b=o[u]-t.rects.reference[u],y=Do(s),g=y?u==="y"?y.clientHeight||0:y.clientWidth||0:0,w=h/2-b/2,A=d[v],S=g-p[f]-d[m],M=g/2-p[f]/2+w,F=Vo(A,M,S),R=u;t.modifiersData[i]=(e={},e[R]=F,e.centerOffset=F-M,e)}}function y_(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)||!em(e.elements.popper,r)||(e.elements.arrow=r))}var b_={name:"arrow",enabled:!0,phase:"main",fn:v_,effect:y_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gs(n){return n.split("-")[1]}var x_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function w_(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:ps(e*r)/r||0,y:ps(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,d=n.isFixed,p=o.x,v=p===void 0?0:p,m=o.y,h=m===void 0?0:m,b=typeof f=="function"?f({x:v,y:h}):{x:v,y:h};v=b.x,h=b.y;var y=o.hasOwnProperty("x"),g=o.hasOwnProperty("y"),w=an,A=on,S=window;if(c){var M=Do(t),F="clientHeight",R="clientWidth";if(M===Cn(t)&&(M=Gi(t),pi(M).position!=="static"&&l==="absolute"&&(F="scrollHeight",R="scrollWidth")),M=M,r===on||(r===an||r===wn)&&s===No){A=xn;var _=d&&M===S&&S.visualViewport?S.visualViewport.height:M[F];h-=_-i.height,h*=u?1:-1}if(r===an||(r===on||r===xn)&&s===No){w=wn;var O=d&&M===S&&S.visualViewport?S.visualViewport.width:M[R];v-=O-i.width,v*=u?1:-1}}var E=Object.assign({position:l},c&&x_),T=f===!0?w_({x:v,y:h}):{x:v,y:h};if(v=T.x,h=T.y,u){var C;return Object.assign({},E,(C={},C[A]=g?"0":"",C[w]=y?"0":"",C.transform=(S.devicePixelRatio||1)<=1?"translate("+v+"px, "+h+"px)":"translate3d("+v+"px, "+h+"px, 0)",C))}return Object.assign({},E,(e={},e[A]=g?h+"px":"",e[w]=y?v+"px":"",e.transform="",e))}function M_(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:Xn(e.placement),variation:gs(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 om={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:M_,data:{}},cl={passive:!0};function A_(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=Cn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(f){f.addEventListener("scroll",t.update,cl)}),l&&u.addEventListener("resize",t.update,cl),function(){s&&c.forEach(function(f){f.removeEventListener("scroll",t.update,cl)}),l&&u.removeEventListener("resize",t.update,cl)}}var am={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:A_,data:{}},S_={left:"right",right:"left",bottom:"top",top:"bottom"};function ul(n){return n.replace(/left|right|bottom|top/g,function(e){return S_[e]})}var __={start:"end",end:"start"};function lm(n){return n.replace(/start|end/g,function(e){return __[e]})}function Su(n){var e=Cn(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function _u(n){return ms(Gi(n)).left+Su(n).scrollLeft}function T_(n){var e=Cn(n),t=Gi(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+_u(n),y:l}}function E_(n){var e,t=Gi(n),i=Su(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=Tr(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=Tr(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+_u(n),u=-i.scrollTop;return pi(r||t).direction==="rtl"&&(l+=Tr(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function Tu(n){var e=pi(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(Zn(n))>=0?n.ownerDocument.body:Mn(n)&&Tu(n)?n:cm(ll(n))}function ko(n,e){var t;e===void 0&&(e=[]);var i=cm(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=Cn(i),o=r?[s].concat(s.visualViewport||[],Tu(i)?i:[]):i,l=e.concat(o);return r?l:l.concat(ko(ll(o)))}function Eu(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function C_(n){var e=ms(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 um(n,e){return e===Kp?Eu(T_(n)):fs(e)?C_(e):Eu(E_(Gi(n)))}function L_(n){var e=ko(ll(n)),t=["absolute","fixed"].indexOf(pi(n).position)>=0,i=t&&Mn(n)?Do(n):n;return fs(i)?e.filter(function(r){return fs(r)&&em(r,i)&&Zn(r)!=="body"}):[]}function R_(n,e,t){var i=e==="clippingParents"?L_(n):[].concat(e),r=[].concat(i,[t]),s=r[0],o=r.reduce(function(l,u){var c=um(n,u);return l.top=Tr(c.top,l.top),l.right=al(c.right,l.right),l.bottom=al(c.bottom,l.bottom),l.left=Tr(c.left,l.left),l},um(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 hm(n){var e=n.reference,t=n.element,i=n.placement,r=i?Xn(i):null,s=i?gs(i):null,o=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,u;switch(r){case on:u={x:o,y:e.y-t.height};break;case xn:u={x:o,y:e.y+e.height};break;case wn:u={x:e.x+e.width,y:l};break;case an:u={x:e.x-t.width,y:l};break;default:u={x:e.x,y:e.y}}var c=r?Au(r):null;if(c!=null){var f=c==="y"?"height":"width";switch(s){case hs:u[c]=u[c]-(e[f]/2-t[f]/2);break;case No:u[c]=u[c]+(e[f]/2-t[f]/2);break}}return u}function zo(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?QS:s,l=t.rootBoundary,u=l===void 0?Kp:l,c=t.elementContext,f=c===void 0?Bo:c,d=t.altBoundary,p=d===void 0?!1:d,v=t.padding,m=v===void 0?0:v,h=im(typeof m!="number"?m:rm(m,Oo)),b=f===Bo?e_:Bo,y=n.rects.popper,g=n.elements[p?b:f],w=R_(fs(g)?g:g.contextElement||Gi(n.elements.popper),o,u),A=ms(n.elements.reference),S=hm({reference:A,element:y,strategy:"absolute",placement:r}),M=Eu(Object.assign({},y,S)),F=f===Bo?M:A,R={top:w.top-F.top+h.top,bottom:F.bottom-w.bottom+h.bottom,left:w.left-F.left+h.left,right:F.right-w.right+h.right},_=n.modifiersData.offset;if(f===Bo&&_){var O=_[r];Object.keys(R).forEach(function(E){var T=[wn,xn].indexOf(E)>=0?1:-1,C=[on,xn].indexOf(E)>=0?"y":"x";R[E]+=O[C]*T})}return R}function F_(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?ds:u,f=gs(i),d=f?l?qp:qp.filter(function(m){return gs(m)===f}):Oo,p=d.filter(function(m){return c.indexOf(m)>=0});p.length===0&&(p=d);var v=p.reduce(function(m,h){return m[h]=zo(n,{placement:h,boundary:r,rootBoundary:s,padding:o})[Xn(h)],m},{});return Object.keys(v).sort(function(m,h){return v[m]-v[h]})}function P_(n){if(Xn(n)===xu)return[];var e=ul(n);return[lm(n),e,lm(e)]}function I_(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,d=t.rootBoundary,p=t.altBoundary,v=t.flipVariations,m=v===void 0?!0:v,h=t.allowedAutoPlacements,b=e.options.placement,y=Xn(b),g=y===b,w=u||(g||!m?[ul(b)]:P_(b)),A=[b].concat(w).reduce(function(te,oe){return te.concat(Xn(oe)===xu?F_(e,{placement:oe,boundary:f,rootBoundary:d,padding:c,flipVariations:m,allowedAutoPlacements:h}):oe)},[]),S=e.rects.reference,M=e.rects.popper,F=new Map,R=!0,_=A[0],O=0;O=0,I=L?"width":"height",x=zo(e,{placement:E,boundary:f,rootBoundary:d,altBoundary:p,padding:c}),P=L?C?wn:an:C?xn:on;S[I]>M[I]&&(P=ul(P));var B=ul(P),D=[];if(s&&D.push(x[T]<=0),l&&D.push(x[P]<=0,x[B]<=0),D.every(function(te){return te})){_=E,R=!1;break}F.set(E,D)}if(R)for(var V=m?3:1,k=function(te){var oe=A.find(function(ie){var ae=F.get(ie);if(ae)return ae.slice(0,te).every(function(W){return W})});if(oe)return _=oe,"break"},G=V;G>0;G--){var Y=k(G);if(Y==="break")break}e.placement!==_&&(e.modifiersData[i]._skip=!0,e.placement=_,e.reset=!0)}}var O_={name:"flip",enabled:!0,phase:"main",fn:I_,requiresIfExists:["offset"],data:{_skip:!1}};function dm(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 fm(n){return[on,wn,xn,an].some(function(e){return n[e]>=0})}function N_(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=zo(e,{elementContext:"reference"}),l=zo(e,{altBoundary:!0}),u=dm(o,i),c=dm(l,r,s),f=fm(u),d=fm(c);e.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}var B_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:N_};function D_(n,e,t){var i=Xn(n),r=[an,on].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,[an,wn].indexOf(i)>=0?{x:l,y:o}:{x:o,y:l}}function V_(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,o=ds.reduce(function(f,d){return f[d]=D_(d,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 k_={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:V_};function z_(n){var e=n.state,t=n.name;e.modifiersData[t]=hm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var pm={name:"popperOffsets",enabled:!0,phase:"read",fn:z_,data:{}};function U_(n){return n==="x"?"y":"x"}function G_(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,d=t.padding,p=t.tether,v=p===void 0?!0:p,m=t.tetherOffset,h=m===void 0?0:m,b=zo(e,{boundary:u,rootBoundary:c,padding:d,altBoundary:f}),y=Xn(e.placement),g=gs(e.placement),w=!g,A=Au(y),S=U_(A),M=e.modifiersData.popperOffsets,F=e.rects.reference,R=e.rects.popper,_=typeof h=="function"?h(Object.assign({},e.rects,{placement:e.placement})):h,O=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),E=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,T={x:0,y:0};if(M){if(s){var C,L=A==="y"?on:an,I=A==="y"?xn:wn,x=A==="y"?"height":"width",P=M[A],B=P+b[L],D=P-b[I],V=v?-R[x]/2:0,k=g===hs?F[x]:R[x],G=g===hs?-R[x]:-F[x],Y=e.elements.arrow,te=v&&Y?Mu(Y):{width:0,height:0},oe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:nm(),ie=oe[L],ae=oe[I],W=Vo(0,F[x],te[x]),$=w?F[x]/2-V-W-ie-O.mainAxis:k-W-ie-O.mainAxis,j=w?-F[x]/2+V+W+ae+O.mainAxis:G+W+ae+O.mainAxis,re=e.elements.arrow&&Do(e.elements.arrow),z=re?A==="y"?re.clientTop||0:re.clientLeft||0:0,H=(C=E==null?void 0:E[A])!=null?C:0,K=P+$-H-z,le=P+j-H,se=Vo(v?al(B,K):B,P,v?Tr(D,le):D);M[A]=se,T[A]=se-P}if(l){var U,N=A==="x"?on:an,Z=A==="x"?xn:wn,X=M[S],ee=S==="y"?"height":"width",ue=X+b[N],me=X-b[Z],be=[on,an].indexOf(y)!==-1,ce=(U=E==null?void 0:E[S])!=null?U:0,ge=be?ue:X-F[ee]-R[ee]-ce+O.altAxis,ne=be?X+F[ee]+R[ee]-ce-O.altAxis:me,de=v&&be?m_(ge,X,ne):Vo(v?ge:ue,X,v?ne:me);M[S]=de,T[S]=de-X}e.modifiersData[i]=T}}var H_={name:"preventOverflow",enabled:!0,phase:"main",fn:G_,requiresIfExists:["offset"]};function W_(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function j_(n){return n===Cn(n)||!Mn(n)?Su(n):W_(n)}function $_(n){var e=n.getBoundingClientRect(),t=ps(e.width)/n.offsetWidth||1,i=ps(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Z_(n,e,t){t===void 0&&(t=!1);var i=Mn(e),r=Mn(e)&&$_(e),s=Gi(e),o=ms(n,r),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!t)&&((Zn(e)!=="body"||Tu(s))&&(l=j_(e)),Mn(e)?(u=ms(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=_u(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function X_(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 Y_(n){var e=X_(n);return u_.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function J_(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function K_(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 mm={placement:"bottom",modifiers:[],strategy:"absolute"};function gm(){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=nT(u);Object.assign(o.value,c)},requires:["computeStyles"]},r=a.computed(()=>{const{onFirstUpdate:u,placement:c,strategy:f,modifiers:d}=a.unref(t);return{onFirstUpdate:u,placement:c||"bottom",strategy:f||"absolute",modifiers:[...d||[],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=eT(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 nT(n){const e=Object.keys(n.elements),t=qa(e.map(r=>[r,n.styles[r]||{}])),i=qa(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}function vm(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Ha(()=>t()),{registerTimeout:e,cancelTimeout:t}}const Lu={prefix:Math.floor(Math.random()*1e4),current:0},iT=Symbol("elIdInjection"),Ru=()=>a.getCurrentInstance()?a.inject(iT,Lu):Lu,Uo=n=>{const e=Ru();!Rt&&e===Lu&>("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=bu();return a.computed(()=>a.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)};let vs=[];const ym=n=>{const e=n;e.key===$n.esc&&vs.forEach(t=>t(e))},rT=n=>{a.onMounted(()=>{vs.length===0&&document.addEventListener("keydown",ym),Rt&&vs.push(n)}),a.onBeforeUnmount(()=>{vs=vs.filter(e=>e!==n),vs.length===0&&Rt&&document.removeEventListener("keydown",ym)})};let bm;const xm=()=>{const n=bu(),e=Ru(),t=a.computed(()=>`${n.value}-popper-container-${e.prefix}`),i=a.computed(()=>`#${t.value}`);return{id:t,selector:i}},sT=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},oT=()=>{const{id:n,selector:e}=xm();return a.onBeforeMount(()=>{Rt&&(process.env.NODE_ENV==="test"||!bm||!document.body.querySelector(e.value))&&(bm=sT(n.value))}),{id:n,selector:e}},aT=$e({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),lT=({showAfter:n,hideAfter:e,autoClose:t,open:i,close:r})=>{const{registerTimeout:s}=vm(),{registerTimeout:o,cancelTimeout:l}=vm();return{onOpen:f=>{s(()=>{i(f);const d=a.unref(t);tt(d)&&d>0&&o(()=>{r(f)},d)},a.unref(n))},onClose:f=>{l(),s(()=>{r(f)},a.unref(e))}}},wm=Symbol("elForwardRef"),cT=n=>{const e=t=>{n.value=t};a.provide(wm,{setForwardRef:e})},uT=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),Mm={current:0},Am=a.ref(0),Sm=2e3,_m=Symbol("elZIndexContextKey"),Tm=Symbol("zIndexContextKey"),Em=n=>{const e=a.getCurrentInstance()?a.inject(_m,Mm):Mm,t=n||(a.getCurrentInstance()?a.inject(Tm,void 0):void 0),i=a.computed(()=>{const o=a.unref(t);return tt(o)?o:Sm}),r=a.computed(()=>i.value+Am.value),s=()=>(e.current++,Am.value=e.current,r.value);return!Rt&&!a.inject(_m)&>("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 hT(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 dT=(n,e,t)=>rl(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),fT=(n,e)=>{const t={},i=a.shallowRef([]);return{children:i,addChild:o=>{t[o.uid]=o,i.value=dT(n,e,t)},removeChild:o=>{delete t[o],i.value=i.value.filter(l=>l.uid!==o)}}},Hi=il({type:String,values:$p,required:!1}),Cm=Symbol("size"),pT=()=>{const n=a.inject(Cm,{});return a.computed(()=>a.unref(n.size)||"")};function Lm(n,{beforeFocus:e,afterFocus:t,beforeBlur:i,afterBlur:r}={}){const s=a.getCurrentInstance(),{emit:o}=s,l=a.shallowRef(),u=a.ref(!1),c=p=>{Jt(e)&&e(p)||u.value||(u.value=!0,o("focus",p),t==null||t())},f=p=>{var v;Jt(i)&&i(p)||p.relatedTarget&&((v=l.value)!=null&&v.contains(p.relatedTarget))||(u.value=!1,o("blur",p),r==null||r())},d=()=>{var p,v;(p=l.value)!=null&&p.contains(document.activeElement)&&l.value!==document.activeElement||(v=n.value)==null||v.focus()};return a.watch(l,p=>{p&&p.setAttribute("tabindex","-1")}),kt(l,"focus",c,!0),kt(l,"blur",f,!0),kt(l,"click",d,!0),process.env.NODE_ENV==="test"&&a.onMounted(()=>{const p=Ar(n.value)?n.value:document.querySelector("input,textarea");p&&(kt(p,"focus",c,!0),kt(p,"blur",f,!0))}),{isFocused:u,wrapperRef:l,handleFocus:c,handleBlur:f}}function Rm({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=!US(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 Fm=Symbol("emptyValuesContextKey"),mT="use-empty-values",gT=["",void 0,null],vT=void 0,yT=$e({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:n=>Jt(n)?!n():!n}}),bT=(n,e)=>{const t=a.getCurrentInstance()?a.inject(Fm,a.ref({})):a.ref({}),i=a.computed(()=>n.emptyValues||t.value.emptyValues||gT),r=a.computed(()=>Jt(n.valueOnClear)?n.valueOnClear():n.valueOnClear!==void 0?n.valueOnClear:Jt(t.value.valueOnClear)?t.value.valueOnClear():t.value.valueOnClear!==void 0?t.value.valueOnClear:vT),s=o=>i.value.includes(o);return i.value.includes(r.value)||gt(mT,"value-on-clear should be a value of empty-values"),{emptyValues:i,valueOnClear:r,isEmptyValue:s}},xT=$e({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Wi=n=>mS(xT,n),Pm=Symbol(),hl=a.ref();function Fu(n,e=void 0){const t=a.getCurrentInstance()?a.inject(Pm,hl):hl;return n?a.computed(()=>{var i,r;return(r=(i=t.value)==null?void 0:i[n])!=null?r:e}):t}function wT(n,e){const t=Fu(),i=Ge(n,a.computed(()=>{var l;return((l=t.value)==null?void 0:l.namespace)||ol})),r=sl(a.computed(()=>{var l;return(l=t.value)==null?void 0:l.locale})),s=Em(a.computed(()=>{var l;return((l=t.value)==null?void 0:l.zIndex)||Sm})),o=a.computed(()=>{var l;return a.unref(e)||((l=t.value)==null?void 0:l.size)||""});return MT(a.computed(()=>a.unref(t)||{})),{ns:i,locale:r,zIndex:s,size:o}}const MT=(n,e,t=!1)=>{var i;const r=!!a.getCurrentInstance(),s=r?Fu():void 0,o=(i=void 0)!=null?i:r?a.provide:void 0;if(!o){gt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=a.computed(()=>{const u=a.unref(n);return s!=null&&s.value?AT(s.value,u):u});return o(Pm,l),o(Xp,a.computed(()=>l.value.locale)),o(Yp,a.computed(()=>l.value.namespace)),o(Tm,a.computed(()=>l.value.zIndex)),o(Cm,{size:a.computed(()=>l.value.size||"")}),o(Fm,a.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(t||!hl.value)&&(hl.value=l.value),l},AT=(n,e)=>{const t=[...new Set([...Vp(n),...Vp(e)])],i={};for(const r of t)i[r]=e[r]!==void 0?e[r]:n[r];return i};var We=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t};const ST=$e({size:{type:Ve([Number,String])},color:{type:String}}),_T=a.defineComponent({name:"ElIcon",inheritAttrs:!1}),TT=a.defineComponent({..._T,props:ST,setup(n){const e=n,t=Ge("icon"),i=a.computed(()=>{const{size:r,color:s}=e;return!r&&!s?{}:{fontSize:Tn(r)?void 0:el(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 ET=We(TT,[["__file","icon.vue"]]);const dt=Nt(ET),Pu=Symbol("formContextKey"),dl=Symbol("formItemContextKey"),Er=(n,e={})=>{const t=a.ref(void 0),i=e.prop?t:Jp("size"),r=e.global?t:pT(),s=e.form?{size:void 0}:a.inject(Pu,void 0),o=e.formItem?{size:void 0}:a.inject(dl,void 0);return a.computed(()=>i.value||a.unref(n)||(o==null?void 0:o.size)||(s==null?void 0:s.size)||r.value||"")},Go=n=>{const e=Jp("disabled"),t=a.inject(Pu,void 0);return a.computed(()=>e.value||a.unref(n)||(t==null?void 0:t.disabled)||!1)},ys=()=>{const n=a.inject(Pu,void 0),e=a.inject(dl,void 0);return{form:n,formItem:e}},fl=(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:Uo().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 Ln;const CT=` height:0 !important; visibility:hidden !important; ${gw()?"":"overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `,LT=["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 RT(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:LT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Im(n,e=1,t){var i;Ln||(Ln=document.createElement("textarea"),document.body.appendChild(Ln));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=RT(n);Ln.setAttribute("style",`${l};${CT}`),Ln.value=n.value||n.placeholder||"";let u=Ln.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Ln.value="";const f=Ln.scrollHeight-r;if(tt(e)){let d=f*e;o==="border-box"&&(d=d+r+s),u=Math.max(d,u),c.minHeight=`${d}px`}if(tt(t)){let d=f*t;o==="border-box"&&(d=d+r+s),u=Math.min(d,u)}return c.height=`${u}px`,(i=Ln.parentNode)==null||i.removeChild(Ln),Ln=void 0,c}const FT=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:Ve([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:Ve([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:Ui},prefixIcon:{type:Ui},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>fi({})},autofocus:Boolean,rows:{type:Number,default:2},...Wi(["ariaLabel"])}),PT={[ot]:n=>Ht(n),input:n=>Ht(n),change:n=>Ht(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},IT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),OT=a.defineComponent({...IT,props:FT,emits:PT,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ce={};return i.containerRole==="combobox"&&(ce["aria-haspopup"]=r["aria-haspopup"],ce["aria-owns"]=r["aria-owns"],ce["aria-expanded"]=r["aria-expanded"]),ce}),l=a.computed(()=>[i.type==="textarea"?b.b():h.b(),h.m(v.value),h.is("disabled",m.value),h.is("exceed",Y.value),{[h.b("group")]:s.prepend||s.append,[h.m("prefix")]:s.prefix||i.prefixIcon,[h.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[h.bm("suffix","password-clear")]:D.value&&V.value,[h.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[h.e("wrapper"),h.is("focus",_.value)]),c=WS({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:d}=ys(),{inputId:p}=fl(i,{formItemContext:d}),v=Er(),m=Go(),h=Ge("input"),b=Ge("textarea"),y=a.shallowRef(),g=a.shallowRef(),w=a.ref(!1),A=a.ref(!1),S=a.ref(),M=a.shallowRef(i.inputStyle),F=a.computed(()=>y.value||g.value),{wrapperRef:R,isFocused:_,handleFocus:O,handleBlur:E}=Lm(F,{beforeFocus(){return m.value},afterBlur(){var ce;i.validateEvent&&((ce=d==null?void 0:d.validate)==null||ce.call(d,"blur").catch(ge=>gt(ge)))}}),T=a.computed(()=>{var ce;return(ce=f==null?void 0:f.statusIcon)!=null?ce:!1}),C=a.computed(()=>(d==null?void 0:d.validateState)||""),L=a.computed(()=>C.value&&jp[C.value]),I=a.computed(()=>A.value?DS:FS),x=a.computed(()=>[r.style]),P=a.computed(()=>[i.inputStyle,M.value,{resize:i.resize}]),B=a.computed(()=>jn(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(_.value||w.value)),V=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||_.value)),k=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),Y=a.computed(()=>!!k.value&&G.value>Number(i.maxlength)),te=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||k.value||!!C.value&&T.value),[oe,ie]=hT(y);bn(g,ce=>{if($(),!k.value||i.resize!=="both")return;const ge=ce[0],{width:ne}=ge.contentRect;S.value={right:`calc(100% - ${ne+15+6}px)`}});const ae=()=>{const{type:ce,autosize:ge}=i;if(!(!Rt||ce!=="textarea"||!g.value))if(ge){const ne=en(ge)?ge.minRows:void 0,de=en(ge)?ge.maxRows:void 0,ve=Im(g.value,ne,de);M.value={overflowY:"hidden",...ve},a.nextTick(()=>{g.value.offsetHeight,M.value=ve})}else M.value={minHeight:Im(g.value).minHeight}},$=(ce=>{let ge=!1;return()=>{var ne;if(ge||!i.autosize)return;((ne=g.value)==null?void 0:ne.offsetParent)===null||(ce(),ge=!0)}})(ae),j=()=>{const ce=F.value,ge=i.formatter?i.formatter(B.value):B.value;!ce||ce.value===ge||(ce.value=ge)},re=async ce=>{oe();let{value:ge}=ce.target;if(i.formatter&&(ge=i.parser?i.parser(ge):ge),!H.value){if(ge===B.value){j();return}t(ot,ge),t("input",ge),await a.nextTick(),j(),ie()}},z=ce=>{t("change",ce.target.value)},{isComposing:H,handleCompositionStart:K,handleCompositionUpdate:le,handleCompositionEnd:se}=Rm({emit:t,afterComposition:re}),U=()=>{A.value=!A.value,N()},N=async()=>{var ce;await a.nextTick(),(ce=F.value)==null||ce.focus()},Z=()=>{var ce;return(ce=F.value)==null?void 0:ce.blur()},X=ce=>{w.value=!1,t("mouseleave",ce)},ee=ce=>{w.value=!0,t("mouseenter",ce)},ue=ce=>{t("keydown",ce)},me=()=>{var ce;(ce=F.value)==null||ce.select()},be=()=>{t(ot,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ce;a.nextTick(()=>ae()),i.validateEvent&&((ce=d==null?void 0:d.validate)==null||ce.call(d,"change").catch(ge=>gt(ge)))}),a.watch(B,()=>j()),a.watch(()=>i.type,async()=>{await a.nextTick(),j(),ae()}),a.onMounted(()=>{!i.formatter&&i.parser&>("ElInput","If you set the parser, you also need to set the formatter."),j(),a.nextTick(ae)}),e({input:y,textarea:g,ref:F,textareaStyle:P,autosize:a.toRef(i,"autosize"),isComposing:H,focus:N,blur:Z,select:me,clear:be,resizeTextarea:ae}),(ce,ge)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(h).bm("group","append")]:ce.$slots.append,[a.unref(h).bm("group","prepend")]:ce.$slots.prepend}],style:a.unref(x),role:ce.containerRole,onMouseenter:ee,onMouseleave:X}),[a.createCommentVNode(" input "),ce.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ce.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(h).be("group","prepend"))},[a.renderSlot(ce.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:R,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ce.$slots.prefix||ce.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(h).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("prefix-inner"))},[a.renderSlot(ce.$slots,"prefix"),ce.prefixIcon?(a.openBlock(),a.createBlock(a.unref(dt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:y,class:a.unref(h).e("inner")},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,type:ce.showPassword?A.value?"text":"password":ce.type,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,tabindex:ce.tabindex,"aria-label":ce.ariaLabel,placeholder:ce.placeholder,style:ce.inputStyle,form:ce.form,autofocus:ce.autofocus,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(te)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(h).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("suffix-inner"))},[!a.unref(D)||!a.unref(V)||!a.unref(k)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ce.$slots,"suffix"),ce.suffixIcon?(a.openBlock(),a.createBlock(a.unref(dt),{key:0,class:a.normalizeClass(a.unref(h).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(dt),{key:1,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("clear")]),onMousedown:a.withModifiers(a.unref(To),["prevent"]),onClick:be},{default:a.withCtx(()=>[a.createVNode(a.unref(vu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createBlock(a.unref(dt),{key:2,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("password")]),onClick:U},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(I))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(h).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(h).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(C)&&a.unref(L)&&a.unref(T)?(a.openBlock(),a.createBlock(a.unref(dt),{key:4,class:a.normalizeClass([a.unref(h).e("icon"),a.unref(h).e("validateIcon"),a.unref(h).is("loading",a.unref(C)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ce.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(h).be("group","append"))},[a.renderSlot(ce.$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(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(h).is("focus",a.unref(_))]},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,tabindex:ce.tabindex,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,style:a.unref(P),"aria-label":ce.ariaLabel,placeholder:ce.placeholder,form:ce.form,autofocus:ce.autofocus,rows:ce.rows,onCompositionstart:a.unref(K),onCompositionupdate:a.unref(le),onCompositionend:a.unref(se),onInput:re,onFocus:a.unref(O),onBlur:a.unref(E),onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(k)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(S.value),class:a.normalizeClass(a.unref(h).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var NT=We(OT,[["__file","input.vue"]]);const BT=Nt(NT),bs=4,DT={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"}},VT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Iu=Symbol("scrollbarContextKey"),kT=$e({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),zT="Thumb";var Om=We(a.defineComponent({__name:"thumb",props:kT,setup(n){const e=n,t=a.inject(Iu),i=Ge("scrollbar");t||us(zT,"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=Rt?document.onselectstart:null;const d=a.computed(()=>DT[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>VT({size:e.size,move:e.move,bar:d.value})),v=a.computed(()=>r.value[d.value.offset]**2/t.wrapElement[d.value.scrollSize]/e.ratio/s.value[d.value.offset]),m=M=>{var F;if(M.stopPropagation(),M.ctrlKey||[1,2].includes(M.button))return;(F=window.getSelection())==null||F.removeAllRanges(),b(M);const R=M.currentTarget;R&&(o.value[d.value.axis]=R[d.value.offset]-(M[d.value.client]-R.getBoundingClientRect()[d.value.direction]))},h=M=>{if(!s.value||!r.value||!t.wrapElement)return;const F=Math.abs(M.target.getBoundingClientRect()[d.value.direction]-M[d.value.client]),R=s.value[d.value.offset]/2,_=(F-R)*100*v.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=_*t.wrapElement[d.value.scrollSize]/100},b=M=>{M.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},y=M=>{if(!r.value||!s.value||u===!1)return;const F=o.value[d.value.axis];if(!F)return;const R=(r.value.getBoundingClientRect()[d.value.direction]-M[d.value.client])*-1,_=s.value[d.value.offset]-F,O=(R-_)*100*v.value/r.value[d.value.offset];t.wrapElement[d.value.scroll]=O*t.wrapElement[d.value.scrollSize]/100},g=()=>{u=!1,o.value[d.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",g),S(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},A=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",g)});const S=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return kt(a.toRef(t,"scrollbarElement"),"mousemove",w),kt(a.toRef(t,"scrollbarElement"),"mouseleave",A),(M,F)=>(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(d).key)]),onMousedown:h},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,M.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const UT=$e({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var GT=We(a.defineComponent({__name:"bar",props:UT,setup(n,{expose:e}){const t=n,i=a.inject(Iu),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:p=>{if(p){const v=p.offsetHeight-bs,m=p.offsetWidth-bs;s.value=p.scrollTop*100/v*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const v=p.offsetHeight-bs,m=p.offsetWidth-bs,h=v**2/p.scrollHeight,b=m**2/p.scrollWidth,y=Math.max(h,t.minSize),g=Math.max(b,t.minSize);u.value=h/(v-h)/(y/(v-y)),c.value=b/(m-b)/(g/(m-g)),l.value=y+bs(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Om,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Om,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const HT=$e({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([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,...Wi(["ariaLabel","ariaOrientation"])}),WT={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(tt)},Ou="ElScrollbar",jT=a.defineComponent({name:Ou}),$T=a.defineComponent({...jT,props:HT,emits:WT,setup(n,{expose:e,emit:t}){const i=n,r=Ge("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),d=a.ref(),p=a.ref(),v=a.computed(()=>{const S={};return i.height&&(S.height=el(i.height)),i.maxHeight&&(S.maxHeight=el(i.maxHeight)),[i.wrapStyle,S]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),h=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var S;f.value&&((S=p.value)==null||S.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function y(S,M){en(S)?f.value.scrollTo(S):tt(S)&&tt(M)&&f.value.scrollTo(S,M)}const g=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollTop=S},w=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollLeft=S},A=()=>{var S;(S=p.value)==null||S.update()};return a.watch(()=>i.noresize,S=>{S?(s==null||s(),o==null||o()):({stop:s}=bn(d,A),o=kt("resize",A))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var S;A(),f.value&&((S=p.value)==null||S.handleScroll(f.value))})}),a.provide(Iu,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()})}),a.onUpdated(()=>A()),e({wrapRef:f,update:A,scrollTo:y,setScrollTop:g,setScrollLeft:w,handleScroll:b}),(S,M)=>(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(m)),style:a.normalizeStyle(a.unref(v)),tabindex:S.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:d,class:a.normalizeClass(a.unref(h)),style:a.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(GT,{key:0,ref_key:"barRef",ref:p,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var ZT=We($T,[["__file","scrollbar.vue"]]);const XT=Nt(ZT),Nu=Symbol("popper"),Nm=Symbol("popperContent"),Bm=$e({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),YT=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),JT=a.defineComponent({...YT,props:Bm,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(Nu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var KT=We(JT,[["__file","popper.vue"]]);const Dm=$e({arrowOffset:{type:Number,default:5}}),qT=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),QT=a.defineComponent({...qT,props:Dm,setup(n,{expose:e}){const t=n,i=Ge("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Nm,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 eE=We(QT,[["__file","arrow.vue"]]);const Bu="ElOnlyChild",tE=a.defineComponent({name:Bu,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(wm),s=uT((i=r==null?void 0:r.setForwardRef)!=null?i:To);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return gt(Bu,"requires exact only one valid child."),null;const u=Vm(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(gt(Bu,"no valid child node found"),null)}}});function Vm(n){if(!n)return null;const e=n;for(const t of e){if(en(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return km(t);case a.Fragment:return Vm(t.children);default:return t}return km(t)}return null}function km(n){const e=Ge("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const zm=$e({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),nE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),iE=a.defineComponent({...nE,props:zm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Nu,void 0);cT(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,d=>{d&&(r.value=ai(d))},{immediate:!0}),a.watch(r,(d,p)=>{c==null||c(),c=void 0,Ar(d)&&(f.forEach(v=>{var m;const h=t[v];h&&(d.addEventListener(v.slice(2).toLowerCase(),h),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,v.slice(2).toLowerCase(),h))}),c=a.watch([s,o,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,h)=>{jn(v[h])?d.removeAttribute(m):d.setAttribute(m,v[h])})},{immediate:!0})),Ar(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Ar(r.value)){const d=r.value;f.forEach(p=>{const v=t[p];v&&d.removeEventListener(p.slice(2).toLowerCase(),v)}),r.value=void 0}}),e({triggerRef:r}),(d,p)=>d.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(tE),a.mergeProps({key:0},d.$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(d.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var rE=We(iE,[["__file","trigger.vue"]]);const Du="focus-trap.focus-after-trapped",Vu="focus-trap.focus-after-released",sE="focus-trap.focusout-prevented",Um={cancelable:!0,bubbles:!1},oE={cancelable:!0,bubbles:!1},Gm="focusAfterTrapped",Hm="focusAfterReleased",aE=Symbol("elFocusTrap"),ku=a.ref(),pl=a.ref(0),zu=a.ref(0);let ml=0;const Wm=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},jm=(n,e)=>{for(const t of n)if(!lE(t,e))return t},lE=(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},cE=n=>{const e=Wm(n),t=jm(e,n),i=jm(e.reverse(),n);return[t,i]},uE=n=>n instanceof HTMLInputElement&&"select"in n,ji=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),zu.value=window.performance.now(),n!==t&&uE(n)&&e&&n.select()}};function $m(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const hE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=$m(n,i),n.unshift(i)},remove:i=>{var r,s;n=$m(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},dE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(ji(i,e),document.activeElement!==t)return},Zm=hE(),fE=()=>pl.value>zu.value,gl=()=>{ku.value="pointer",pl.value=window.performance.now()},Xm=()=>{ku.value="keyboard",pl.value=window.performance.now()},pE=()=>(a.onMounted(()=>{ml===0&&(document.addEventListener("mousedown",gl),document.addEventListener("touchstart",gl),document.addEventListener("keydown",Xm)),ml++}),a.onBeforeUnmount(()=>{ml--,ml<=0&&(document.removeEventListener("mousedown",gl),document.removeEventListener("touchstart",gl),document.removeEventListener("keydown",Xm))}),{focusReason:ku,lastUserFocusTimestamp:pl,lastAutomatedFocusTimestamp:zu}),vl=n=>new CustomEvent(sE,{...oE,detail:n}),mE=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Gm,Hm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=pE();rT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:h,altKey:b,ctrlKey:y,metaKey:g,currentTarget:w,shiftKey:A}=m,{loop:S}=n,M=h===$n.tab&&!b&&!y&&!g,F=document.activeElement;if(M&&F){const R=w,[_,O]=cE(R);if(_&&O){if(!A&&F===O){const T=vl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),S&&ji(_,!0))}else if(A&&[_,R].includes(F)){const T=vl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||(m.preventDefault(),S&&ji(O,!0))}}else if(F===R){const T=vl({focusReason:s.value});e("focusout-prevented",T),T.defaultPrevented||m.preventDefault()}}};a.provide(aE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[h])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",d)),h&&(h.removeEventListener("keydown",l),h.removeEventListener("focusin",f),h.removeEventListener("focusout",d))});const u=m=>{e(Gm,m)},c=m=>e(Hm,m),f=m=>{const h=a.unref(t);if(!h)return;const b=m.target,y=m.relatedTarget,g=b&&h.contains(b);n.trapped||y&&h.contains(y)||(i=y),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:ji(r,!0))},d=m=>{const h=a.unref(t);if(!(o.paused||!h))if(n.trapped){const b=m.relatedTarget;!jn(b)&&!h.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const y=vl({focusReason:s.value});e("focusout-prevented",y),y.defaultPrevented||ji(r,!0)}},0)}else{const b=m.target;b&&h.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){Zm.push(o);const h=m.contains(document.activeElement)?i:document.activeElement;if(i=h,!m.contains(h)){const y=new Event(Du,Um);m.addEventListener(Du,u),m.dispatchEvent(y),y.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;Ht(g)||(ji(g),document.activeElement!==g&&(g="first")),g==="first"&&dE(Wm(m),!0),(document.activeElement===h||g==="container")&&ji(m)})}}}function v(){const m=a.unref(t);if(m){m.removeEventListener(Du,u);const h=new CustomEvent(Vu,{...Um,detail:{focusReason:s.value}});m.addEventListener(Vu,c),m.dispatchEvent(h),!h.defaultPrevented&&(s.value=="keyboard"||!fE()||m.contains(document.activeElement))&&ji(i??document.body),m.removeEventListener(Vu,c),Zm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():v()})}),a.onBeforeUnmount(()=>{n.trapped&&v(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",d),t.value=void 0)}),{onKeydown:l}}});function gE(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var vE=We(mE,[["render",gE],["__file","focus-trap.vue"]]);const yE=["fixed","absolute"],bE=$e({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:ds,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:yE,default:"absolute"}}),Ym=$e({...bE,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Wi(["ariaLabel"])}),xE={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},wE=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...AE(n),...e]};return SE(s,r==null?void 0:r.modifiers),s},ME=n=>{if(Rt)return ai(n)};function AE(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 SE(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const _E=0,TE=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Nu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var y;const g=a.unref(s),w=(y=a.unref(o))!=null?y:_E;return{name:"arrow",enabled:!hS(g),options:{element:g,padding:w}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...wE(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>ME(n.referenceEl)||a.unref(i)),{attributes:d,state:p,styles:v,update:m,forceUpdate:h,instanceRef:b}=tT(f,t,c);return a.watch(b,y=>e.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(f))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:d,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:v,role:r,forceUpdate:h,update:m}},EE=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Em(),s=Ge("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(tt(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),d=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:d,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=tt(n.zIndex)?n.zIndex:r()}}},CE=(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")}}},LE=a.defineComponent({name:"ElPopperContent"}),RE=a.defineComponent({...LE,props:Ym,emits:xE,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=CE(i,t),{attributes:d,arrowRef:p,contentRef:v,styles:m,instanceRef:h,role:b,update:y}=TE(i),{ariaModal:g,arrowStyle:w,contentAttrs:A,contentClass:S,contentStyle:M,updateZIndex:F}=EE(i,{styles:m,attributes:d,role:b}),R=a.inject(dl,void 0),_=a.ref();a.provide(Nm,{arrowStyle:w,arrowRef:p,arrowOffset:_}),R&&a.provide(dl,{...R,addInputId:To,removeInputId:To});let O;const E=(C=!0)=>{y(),C&&F()},T=()=>{E(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(C,L)=>{O==null||O(),O=void 0;const I=a.unref(C||v.value),x=a.unref(L||v.value);Ar(I)&&(O=a.watch([b,()=>i.ariaLabel,g,()=>i.id],P=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{jn(P[D])?I.removeAttribute(B):I.setAttribute(B,P[D])})},{immediate:!0})),x!==I&&Ar(x)&&["role","aria-label","aria-modal","id"].forEach(P=>{x.removeAttribute(P)})},{immediate:!0}),a.watch(()=>i.visible,T,{immediate:!0})}),a.onBeforeUnmount(()=>{O==null||O(),O=void 0}),e({popperContentRef:v,popperInstanceRef:h,updatePopper:E,contentStyle:M}),(C,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:v},a.unref(A),{style:a.unref(M),class:a.unref(S),tabindex:"-1",onMouseenter:I=>C.$emit("mouseenter",I),onMouseleave:I=>C.$emit("mouseleave",I)}),[a.createVNode(a.unref(vE),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(v),"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(C.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var FE=We(RE,[["__file","content.vue"]]);const PE=Nt(KT),Uu=Symbol("elTooltip"),un=$e({...aT,...Ym,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Wi(["ariaLabel"])}),Ho=$e({...zm,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[$n.enter,$n.space]}}),{useModelToggleProps:IE,useModelToggleEmits:OE,useModelToggle:NE}=qS("visible"),BE=$e({...Bm,...IE,...un,...Ho,...Dm,showArrow:{type:Boolean,default:!0}}),DE=[...OE,"before-show","before-hide","show","hide","open","close"],VE=(n,e)=>sn(n)?n.includes(e):n===e,xs=(n,e,t)=>i=>{VE(a.unref(n),e)&&t(i)},kE=a.defineComponent({name:"ElTooltipTrigger"}),zE=a.defineComponent({...kE,props:Ho,setup(n,{expose:e}){const t=n,i=Ge("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(Uu,void 0),f=a.ref(null),d=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),v=oi(d,xs(p,"hover",l)),m=oi(d,xs(p,"hover",u)),h=oi(d,xs(p,"click",A=>{A.button===0&&c(A)})),b=oi(d,xs(p,"focus",l)),y=oi(d,xs(p,"focus",u)),g=oi(d,xs(p,"contextmenu",A=>{A.preventDefault(),c(A)})),w=oi(d,A=>{const{code:S}=A;t.triggerKeys.includes(S)&&(A.preventDefault(),c(A))});return e({triggerRef:f}),(A,S)=>(a.openBlock(),a.createBlock(a.unref(rE),{id:a.unref(s),"virtual-ref":A.virtualRef,open:a.unref(o),"virtual-triggering":A.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(y),onClick:a.unref(h),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(v),onMouseleave:a.unref(m),onKeydown:a.unref(w)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var UE=We(zE,[["__file","trigger.vue"]]);const GE=$e({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var HE=We(a.defineComponent({__name:"teleport",props:GE,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 WE=Nt(HE),jE=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),$E=a.defineComponent({...jE,props:un,setup(n,{expose:e}){const t=n,{selector:i}=xm(),r=Ge("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:d,onOpen:p,onShow:v,onHide:m,onBeforeShow:h,onBeforeHide:b}=a.inject(Uu,void 0),y=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 w=a.computed(()=>a.unref(g)?!0:a.unref(c)),A=a.computed(()=>t.disabled?!1:a.unref(c)),S=a.computed(()=>t.appendTo||i.value),M=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),F=a.ref(!0),R=()=>{m(),F.value=!0},_=()=>{if(a.unref(l))return!0},O=oi(_,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),E=oi(_,()=>{a.unref(f)==="hover"&&d()}),T=()=>{var x,P;(P=(x=s.value)==null?void 0:x.updatePopper)==null||P.call(x),h==null||h()},C=()=>{b==null||b()},L=()=>{v(),o=nw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&d()})},I=()=>{t.virtualTriggering||d()};return a.watch(()=>a.unref(c),x=>{x?F.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,P;(P=(x=s.value)==null?void 0:x.updatePopper)==null||P.call(x)}),e({contentRef:s}),(x,P)=>(a.openBlock(),a.createBlock(a.unref(WE),{disabled:!x.teleported,to:a.unref(S)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:R,onBeforeEnter:T,onAfterEnter:L,onBeforeLeave:C},{default:a.withCtx(()=>[a.unref(w)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(FE),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":F.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(M)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(A),"z-index":x.zIndex,onMouseenter:a.unref(O),onMouseleave:a.unref(E),onBlur:I,onClose:a.unref(d)}),{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)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var ZE=We($E,[["__file","content.vue"]]);const XE=a.defineComponent({name:"ElTooltip"}),YE=a.defineComponent({...XE,props:BE,emits:DE,setup(n,{expose:e,emit:t}){const i=n;oT();const r=Uo(),s=a.ref(),o=a.ref(),l=()=>{var y;const g=a.unref(s);g&&((y=g.popperInstanceRef)==null||y.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:d,hasUpdateHandler:p}=NE({indicator:u,toggleReason:c}),{onOpen:v,onClose:m}=lT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:d}),h=a.computed(()=>Po(i.visible)&&!p.value);a.provide(Uu,{controlled:h,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:y=>{v(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(u)?m(y):v(y)},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,y=>{y&&u.value&&(u.value=!1)});const b=y=>{var g,w;const A=(w=(g=o.value)==null?void 0:g.contentRef)==null?void 0:w.popperContentRef,S=(y==null?void 0:y.relatedTarget)||document.activeElement;return A&&A.contains(S)};return a.onDeactivated(()=>u.value&&d()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:v,onClose:m,hide:d}),(y,g)=>(a.openBlock(),a.createBlock(a.unref(PE),{ref_key:"popperRef",ref:s,role:y.role},{default:a.withCtx(()=>[a.createVNode(UE,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(ZE,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(eE),{key:0,"arrow-offset":y.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 JE=We(YE,[["__file","tooltip.vue"]]);const Gu=Nt(JE),Jm=Symbol("buttonGroupContextKey"),KE=(n,e)=>{Zp({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(Jm,void 0),i=Fu("button"),{form:r}=ys(),s=Er(a.computed(()=>t==null?void 0:t.size)),o=Go(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,h,b;return(b=(h=n.autoInsertSpace)!=null?h:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),d=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const h=(m=u.default)==null?void 0:m.call(u);if(f.value&&(h==null?void 0:h.length)===1){const b=h[0];if((b==null?void 0:b.type)===a.Text){const y=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:d,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},Hu=$e({size:Hi,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ui},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ui,default:()=>Gp},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:Ve([String,Object]),default:"button"}}),qE={click:n=>n instanceof MouseEvent};function Wt(n,e){QE(n)&&(n="100%");var t=eC(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 yl(n){return Math.min(1,Math.max(0,n))}function QE(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function eC(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Km(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function bl(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Cr(n){return n.length===1?"0"+n:String(n)}function tC(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(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 nC(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(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=Wu(l,o,n+1/3),r=Wu(l,o,n),s=Wu(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function Qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(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 ju={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 aC(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=uC(n)),typeof n=="object"&&(mi(n.r)&&mi(n.g)&&mi(n.b)?(e=tC(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):mi(n.h)&&mi(n.s)&&mi(n.v)?(i=bl(n.s),r=bl(n.v),e=iC(n.h,i,r),o=!0,l="hsv"):mi(n.h)&&mi(n.s)&&mi(n.l)&&(i=bl(n.s),s=bl(n.l),e=nC(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Km(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 lC="[-\\+]?\\d+%?",cC="[-\\+]?\\d*\\.\\d+%?",$i="(?:".concat(cC,")|(?:").concat(lC,")"),$u="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Zu="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Rn={CSS_UNIT:new RegExp($i),rgb:new RegExp("rgb"+$u),rgba:new RegExp("rgba"+Zu),hsl:new RegExp("hsl"+$u),hsla:new RegExp("hsla"+Zu),hsv:new RegExp("hsv"+$u),hsva:new RegExp("hsva"+Zu),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 uC(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(ju[n])n=ju[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Rn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Rn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rn.hex8.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),a:tg(t[4]),format:e?"name":"hex8"}:(t=Rn.hex6.exec(n),t?{r:hn(t[1]),g:hn(t[2]),b:hn(t[3]),format:e?"name":"hex"}:(t=Rn.hex4.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),a:tg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rn.hex3.exec(n),t?{r:hn(t[1]+t[1]),g:hn(t[2]+t[2]),b:hn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function mi(n){return!!Rn.CSS_UNIT.exec(String(n))}var hC=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=oC(e)),this.originalInput=e;var r=aC(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=Km(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=Qm(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=Qm(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=qm(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=qm(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),eg(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),rC(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(Wt(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(Wt(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="#"+eg(this.r,this.g,this.b,!1),t=0,i=Object.entries(ju);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=yl(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=yl(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=yl(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=yl(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 hC(r),l=n.dark?o.tint(20).toString():Zi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Zi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Zi(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?Zi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Zi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Zi(o,80):o.tint(80).toString());else{const u=n.dark?Zi(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?Zi(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 fC=a.defineComponent({name:"ElButton"}),pC=a.defineComponent({...fC,props:Hu,emits:qE,setup(n,{expose:e,emit:t}){const i=n,r=dC(i),s=Ge("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:d,handleClick:p}=KE(i,t),v=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:d}),(m,h)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(v),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(dt),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(dt),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(d)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var mC=We(pC,[["__file","button.vue"]]);const gC={size:Hu.size,type:Hu.type},vC=a.defineComponent({name:"ElButtonGroup"}),yC=a.defineComponent({...vC,props:gC,setup(n){const e=n;a.provide(Jm,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ge("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var ng=We(yC,[["__file","button-group.vue"]]);const ws=Nt(mC,{ButtonGroup:ng});En(ng);var Xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function xl(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 Yi=new Map;if(Rt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Yi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function ig(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),d=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),v=s&&(s.contains(o)||s.contains(l));u||c||f||d||p||v||e.value(i,r)}}const xC={beforeMount(n,e){Yi.has(n)||Yi.set(n,[]),Yi.get(n).push({documentHandler:ig(n,e),bindingFn:e.value})},updated(n,e){Yi.has(n)||Yi.set(n,[]);const t=Yi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:ig(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Yi.delete(n)}},wC=100,MC=600,rg={beforeMount(n,e){const t=e.value,{interval:i=wC,delay:r=MC}=Jt(t)?{}:t;let s,o;const l=()=>Jt(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))})}},sg=$e({modelValue:{type:[String,Number,Boolean],default:void 0},size:Hi,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),AC=$e({...sg,border:Boolean}),og={[ot]:n=>Ht(n)||tt(n)||Po(n),[di]:n=>Ht(n)||tt(n)||Po(n)},ag=Symbol("radioGroupKey"),lg=(n,e)=>{const t=a.ref(),i=a.inject(ag,void 0),r=a.computed(()=>!!i),s=a.computed(()=>Dp(n.value)?n.label:n.value),o=a.computed({get(){return r.value?i.modelValue:n.modelValue},set(d){r.value?i.changeEvent(d):e&&e(ot,d),t.value.checked=n.modelValue===s.value}}),l=Er(a.computed(()=>i==null?void 0:i.size)),u=Go(a.computed(()=>i==null?void 0:i.disabled)),c=a.ref(!1),f=a.computed(()=>u.value||r.value&&o.value!==s.value?-1:0);return Zp({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},a.computed(()=>r.value&&Dp(n.value))),{radioRef:t,isGroup:r,radioGroup:i,focus:c,size:l,disabled:u,tabIndex:f,modelValue:o,actualValue:s}},SC=a.defineComponent({name:"ElRadio"}),_C=a.defineComponent({...SC,props:AC,emits:og,setup(n,{emit:e}){const t=n,i=Ge("radio"),{radioRef:r,radioGroup:s,focus:o,size:l,disabled:u,modelValue:c,actualValue:f}=lg(t,e);function d(){a.nextTick(()=>e("change",c.value))}return(p,v)=>{var m;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("focus",a.unref(o)),a.unref(i).is("bordered",p.border),a.unref(i).is("checked",a.unref(c)===a.unref(f)),a.unref(i).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(i).e("input"),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("checked",a.unref(c)===a.unref(f))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":h=>a.isRef(c)?c.value=h:null,class:a.normalizeClass(a.unref(i).e("original")),value:a.unref(f),name:p.name||((m=a.unref(s))==null?void 0:m.name),disabled:a.unref(u),checked:a.unref(c)===a.unref(f),type:"radio",onFocus:h=>o.value=!0,onBlur:h=>o.value=!1,onChange:d,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(c)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("label")),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var TC=We(_C,[["__file","radio.vue"]]);const EC=$e({...sg}),CC=a.defineComponent({name:"ElRadioButton"}),LC=a.defineComponent({...CC,props:EC,setup(n){const e=n,t=Ge("radio"),{radioRef:i,focus:r,size:s,disabled:o,modelValue:l,radioGroup:u,actualValue:c}=lg(e),f=a.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(d,p)=>{var v;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(t).b("button"),a.unref(t).is("active",a.unref(l)===a.unref(c)),a.unref(t).is("disabled",a.unref(o)),a.unref(t).is("focus",a.unref(r)),a.unref(t).bm("button",a.unref(s))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":m=>a.isRef(l)?l.value=m:null,class:a.normalizeClass(a.unref(t).be("button","original-radio")),value:a.unref(c),type:"radio",name:d.name||((v=a.unref(u))==null?void 0:v.name),disabled:a.unref(o),onFocus:m=>r.value=!0,onBlur:m=>r.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(t).be("button","inner")),style:a.normalizeStyle(a.unref(l)===a.unref(c)?a.unref(f):{}),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(d.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(d.label),1)])],46,["onKeydown"])],2)}}});var cg=We(LC,[["__file","radio-button.vue"]]);const RC=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),FC=og,PC=a.defineComponent({name:"ElRadioGroup"}),IC=a.defineComponent({...PC,props:RC,emits:FC,setup(n,{emit:e}){const t=n,i=Ge("radio"),r=Uo(),s=a.ref(),{formItem:o}=ys(),{inputId:l,isLabeledByFormItem:u}=fl(t,{formItemContext:o}),c=d=>{e(ot,d),a.nextTick(()=>e("change",d))};a.onMounted(()=>{const d=s.value.querySelectorAll("[type=radio]"),p=d[0];!Array.from(d).some(v=>v.checked)&&p&&(p.tabIndex=0)});const f=a.computed(()=>t.name||r.value);return a.provide(ag,a.reactive({...a.toRefs(t),changeEvent:c,name:f})),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(o==null||o.validate("change").catch(d=>gt(d)))}),(d,p)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:s,class:a.normalizeClass(a.unref(i).b("group")),role:"radiogroup","aria-label":a.unref(u)?void 0:d.ariaLabel||"radio-group","aria-labelledby":a.unref(u)?a.unref(o).labelId:void 0},[a.renderSlot(d.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var ug=We(IC,[["__file","radio-group.vue"]]);const hg=Nt(TC,{RadioButton:cg,RadioGroup:ug}),dg=En(ug);En(cg);const Xu=$e({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:$p},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),OC={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},NC=a.defineComponent({name:"ElTag"}),BC=a.defineComponent({...NC,props:Xu,emits:OC,setup(n,{emit:e}){const t=n,i=Er(),r=Ge("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:d,closable:p,round:v}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(d),r.is("hit",f),r.is("round",v)]}),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(dt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_: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(dt),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var DC=We(BC,[["__file","tag.vue"]]);const VC=Nt(DC),fg=Symbol("rowContextKey"),kC=$e({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"]}}),zC=a.defineComponent({name:"ElRow"}),UC=a.defineComponent({...zC,props:kC,setup(n){const e=n,t=Ge("row"),i=a.computed(()=>e.gutter);a.provide(fg,{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 GC=We(UC,[["__file","row.vue"]]);const Yn=Nt(GC),HC=$e({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:Ve([Number,Object]),default:()=>fi({})},sm:{type:Ve([Number,Object]),default:()=>fi({})},md:{type:Ve([Number,Object]),default:()=>fi({})},lg:{type:Ve([Number,Object]),default:()=>fi({})},xl:{type:Ve([Number,Object]),default:()=>fi({})}}),WC=a.defineComponent({name:"ElCol"}),jC=a.defineComponent({...WC,props:HC,setup(n){const e=n,{gutter:t}=a.inject(fg,{gutter:a.computed(()=>0)}),i=Ge("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];tt(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=>{tt(e[c])?o.push(i.b(`${c}-${e[c]}`)):en(e[c])&&Object.entries(e[c]).forEach(([f,d])=>{o.push(f!=="span"?i.b(`${c}-${f}-${d}`):i.b(`${c}-${d}`))})}),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 $C=We(jC,[["__file","col.vue"]]);const Fn=Nt($C),pg=n=>tt(n)||Ht(n)||sn(n),ZC=$e({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>fi([])}}),XC={[ot]:pg,[di]:pg},mg=Symbol("collapseContextKey"),YC=(n,e)=>{const t=a.ref(Wn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(ot,o),e(di,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=Wn(n.modelValue),{deep:!0}),a.provide(mg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},JC=()=>{const n=Ge("collapse");return{rootKls:a.computed(()=>n.b())}},KC=a.defineComponent({name:"ElCollapse"}),qC=a.defineComponent({...KC,props:ZC,emits:XC,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=YC(i,t),{rootKls:o}=JC();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 QC=We(qC,[["__file","collapse.vue"]]);const e2=a.defineComponent({name:"ElCollapseTransition"}),t2=a.defineComponent({...e2,setup(n){const e=Ge("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 n2=We(t2,[["__file","collapse-transition.vue"]]);const i2=Nt(n2),r2=$e({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:Ui,default:zi},disabled:Boolean}),s2=n=>{const e=a.inject(mg),{namespace:t}=Ge("collapse"),i=a.ref(!1),r=a.ref(!1),s=Ru(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${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))}}},o2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ge("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)}`)),d=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:d}},a2=a.defineComponent({name:"ElCollapseItem"}),l2=a.defineComponent({...a2,props:r2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=s2(t),{arrowKls:c,headKls:f,rootKls:d,itemWrapperKls:p,itemContentKls:v,scopedContentId:m,scopedHeadId:h}=o2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,y)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(d))},[a.createElementVNode("button",{id:a.unref(h),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),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(dt),{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(i2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(h)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(v))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var gg=We(l2,[["__file","collapse-item.vue"]]);const vg=Nt(QC,{CollapseItem:gg}),yg=En(gg),c2=a.defineComponent({name:"ElContainer"}),u2=a.defineComponent({...c2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ge("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 h2=We(u2,[["__file","container.vue"]]);const d2=a.defineComponent({name:"ElAside"}),f2=a.defineComponent({...d2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ge("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 bg=We(f2,[["__file","aside.vue"]]);const p2=a.defineComponent({name:"ElFooter"}),m2=a.defineComponent({...p2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("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 xg=We(m2,[["__file","footer.vue"]]);const g2=a.defineComponent({name:"ElHeader"}),v2=a.defineComponent({...g2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("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 wg=We(v2,[["__file","header.vue"]]);const y2=a.defineComponent({name:"ElMain"}),b2=a.defineComponent({...y2,setup(n){const e=Ge("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Mg=We(b2,[["__file","main.vue"]]);const Jn=Nt(h2,{Aside:bg,Footer:xg,Header:wg,Main:Mg});En(bg);const Ag=En(xg),x2=En(wg),gi=En(Mg),w2=a.defineComponent({inheritAttrs:!1});function M2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var A2=We(w2,[["render",M2],["__file","collection.vue"]]);const S2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function _2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var T2=We(S2,[["render",_2],["__file","collection-item.vue"]]);const E2="data-el-collection-item",C2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...A2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const d=Array.from(f.querySelectorAll(`[${E2}]`));return[...u.values()].sort((v,m)=>d.indexOf(v.ref)-d.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...T2,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 d=a.unref(c);d&&f.itemMap.set(d,{ref:d,...u})}),a.onBeforeUnmount(()=>{const d=a.unref(c);f.itemMap.delete(d)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Yu=$e({trigger:Ho.trigger,effect:{...un.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(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:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:un.teleported});$e({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Ui}}),$e({onKeydown:{type:Ve(Function)}}),C2("Dropdown");const L2=$e({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:Hi,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||tt(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},...Wi(["ariaLabel"])}),R2={[di]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Sr]:n=>tt(n)||jn(n),[ot]:n=>tt(n)||jn(n)},F2=a.defineComponent({name:"ElInputNumber"}),P2=a.defineComponent({...F2,props:L2,emits:R2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=sl(),s=Ge("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=ys(),c=a.computed(()=>tt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>tt(i.modelValue)&&i.modelValue>=i.max),d=a.computed(()=>{const I=y(i.step);return Tn(i.precision)?Math.max(y(i.modelValue),I):(I>i.precision&>("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),v=Er(),m=Go(),h=a.computed(()=>{if(l.userInput!==null)return l.userInput;let I=l.currentValue;if(jn(I))return"";if(tt(I)){if(Number.isNaN(I))return"";Tn(i.precision)||(I=I.toFixed(i.precision))}return I}),b=(I,x)=>{if(Tn(x)&&(x=d.value),x===0)return Math.round(I);let P=String(I);const B=P.indexOf(".");if(B===-1||!P.replace(".","").split("")[B+x])return I;const k=P.length;return P.charAt(k-1)==="5"&&(P=`${P.slice(0,Math.max(0,k-1))}6`),Number.parseFloat(Number(P).toFixed(x))},y=I=>{if(jn(I))return 0;const x=I.toString(),P=x.indexOf(".");let B=0;return P!==-1&&(B=x.length-P-1),B},g=(I,x=1)=>tt(I)?b(I+i.step*x):l.currentValue,w=()=>{if(i.readonly||m.value||f.value)return;const I=Number(h.value)||0,x=g(I);M(x),t(Sr,l.currentValue),C()},A=()=>{if(i.readonly||m.value||c.value)return;const I=Number(h.value)||0,x=g(I,-1);M(x),t(Sr,l.currentValue),C()},S=(I,x)=>{const{max:P,min:B,step:D,precision:V,stepStrictly:k,valueOnClear:G}=i;PP||YP?P:B,x&&t(ot,Y)),Y},M=(I,x=!0)=>{var P;const B=l.currentValue,D=S(I);if(!x){t(ot,D);return}B===D&&I||(l.userInput=null,t(ot,D),B!==D&&t(di,D,B),i.validateEvent&&((P=u==null?void 0:u.validate)==null||P.call(u,"change").catch(V=>gt(V))),l.currentValue=D)},F=I=>{l.userInput=I;const x=I===""?null:Number(I);t(Sr,x),M(x,!1)},R=I=>{const x=I!==""?Number(I):"";(tt(x)&&!Number.isNaN(x)||I==="")&&M(x),C(),l.userInput=null},_=()=>{var I,x;(x=(I=o.value)==null?void 0:I.focus)==null||x.call(I)},O=()=>{var I,x;(x=(I=o.value)==null?void 0:I.blur)==null||x.call(I)},E=I=>{t("focus",I)},T=I=>{var x;l.userInput=null,t("blur",I),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(P=>gt(P)))},C=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=I=>{document.activeElement===I.target&&I.preventDefault()};return a.watch(()=>i.modelValue,(I,x)=>{const P=S(I,!0);l.userInput===null&&P!==x&&(l.currentValue=P)},{immediate:!0}),a.onMounted(()=>{var I;const{min:x,max:P,modelValue:B}=i,D=(I=o.value)==null?void 0:I.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(P)?D.setAttribute("aria-valuemax",String(P)):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(m.value)),!tt(B)&&B!=null){let V=Number(B);Number.isNaN(V)&&(V=null),t(ot,V)}D.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var I,x;const P=(I=o.value)==null?void 0:I.input;P==null||P.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:_,blur:O}),(I,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(v)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!I.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[I.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(A,["enter"])},[a.renderSlot(I.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(dt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(gu),{key:0})):(a.openBlock(),a.createBlock(a.unref(OS),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),A]]):a.createCommentVNode("v-if",!0),I.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(w,["enter"])},[a.renderSlot(I.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(dt),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(SS),{key:0})):(a.openBlock(),a.createBlock(a.unref(nl),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),w]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(BT),{id:I.id,ref_key:"input",ref:o,type:"number",step:I.step,"model-value":a.unref(h),placeholder:I.placeholder,readonly:I.readonly,disabled:a.unref(m),size:a.unref(v),max:I.max,min:I.min,name:I.name,"aria-label":I.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(w,["prevent"]),["up"]),a.withKeys(a.withModifiers(A,["prevent"]),["down"])],onBlur:T,onFocus:E,onInput:F,onChange:R},a.createSlots({_:2},[I.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"prefix")])}:void 0,I.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var I2=We(P2,[["__file","input-number.vue"]]);const vi=Nt(I2),Sg=Symbol("ElSelectGroup"),wl=Symbol("ElSelect");function O2(n,e){const t=a.inject(wl),i=a.inject(Sg,{disabled:!1}),r=a.computed(()=>f(Wn(t.props.modelValue),n.value)),s=a.computed(()=>{var v;if(t.props.multiple){const m=Wn((v=t.props.modelValue)!=null?v:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(en(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(v=[],m)=>{if(en(n.value)){const h=t.props.valueKey;return v&&v.some(b=>a.toRaw(ui(b,h))===ui(m,h))}else return v&&v.includes(m)},d=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=v=>{const m=new RegExp(vS(v),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(v,m)=>{const{remote:h,valueKey:b}=t.props;if(v!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!h){if(b&&en(v)&&en(m)&&v[b]===m[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:d,updateOption:p}}const N2=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=Ge("select"),t=Uo(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=O2(n,r),{visible:d,hover:p}=a.toRefs(r),v=a.getCurrentInstance().proxy;u.onOptionCreate(v),a.onBeforeUnmount(()=>{const h=v.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(w=>w.value===v.value);a.nextTick(()=>{u.states.cachedOptions.get(h)===v&&!g&&u.states.cachedOptions.delete(h)}),u.onOptionDestroy(h,v)});function m(){l.value||u.handleOptionSelect(v)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:d,hover:p,selectOptionClick:m,states:r}}});function B2(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 Ju=We(N2,[["render",B2],["__file","option.vue"]]);const D2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(wl),e=Ge("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(),bn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function V2(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 k2=We(D2,[["render",V2],["__file","select-dropdown.vue"]]);const z2=11,U2=(n,e)=>{const{t}=sl(),i=Uo(),r=Ge("select"),s=Ge("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),d=a.ref(null),p=a.ref(null),v=a.ref(null),m=a.ref(null),h=a.ref(null),b=a.ref(null),y=a.ref(null),g=a.ref(null),{isComposing:w,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M}=Rm({afterComposition:fe=>ne(fe)}),{wrapperRef:F,isFocused:R}=Lm(d,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!_.value&&(_.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(fe){var xe,Se;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(fe))||((Se=f.value)==null?void 0:Se.isFocusInsideContent(fe))},afterBlur(){_.value=!1,o.menuVisibleOnFocus=!1}}),_=a.ref(!1),O=a.ref(),{form:E,formItem:T}=ys(),{inputId:C}=fl(n,{formItemContext:T}),{valueOnClear:L,isEmptyValue:I}=bT(n),x=a.computed(()=>n.disabled||(E==null?void 0:E.disabled)),P=a.computed(()=>sn(n.modelValue)?n.modelValue.length>0:!I(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&P.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),V=a.computed(()=>r.is("reverse",D.value&&_.value)),k=a.computed(()=>(T==null?void 0:T.validateState)||""),G=a.computed(()=>jp[k.value]),Y=a.computed(()=>n.remote?300:0),te=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&&oe.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),oe=a.computed(()=>ie.value.filter(fe=>fe.visible).length),ie=a.computed(()=>{const fe=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(Se=>{const Fe=fe.findIndex(Ie=>Ie.value===Se);Fe>-1&&xe.push(fe[Fe])}),xe.length>=fe.length?xe:fe}),ae=a.computed(()=>Array.from(o.cachedOptions.values())),W=a.computed(()=>{const fe=ie.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!fe}),$=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||ie.value.forEach(fe=>{var xe;(xe=fe.updateOption)==null||xe.call(fe,o.inputValue)})},j=Er(),re=a.computed(()=>["small"].includes(j.value)?"small":"default"),z=a.computed({get(){return _.value&&te.value!==!1},set(fe){_.value=fe}}),H=a.computed(()=>{if(n.multiple&&!Tn(n.modelValue))return Wn(n.modelValue).length===0&&!o.inputValue;const fe=sn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||Tn(fe)?!o.inputValue:!0}),K=a.computed(()=>{var fe;const xe=(fe=n.placeholder)!=null?fe:t("el.select.placeholder");return n.multiple||!P.value?xe:o.selectedLabel}),le=a.computed(()=>Yc?null:"mouseenter");a.watch(()=>n.modelValue,(fe,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",se("")),N(),!mu(fe,xe)&&n.validateEvent&&(T==null||T.validate("change").catch(Se=>gt(Se)))},{flush:"post",deep:!0}),a.watch(()=>_.value,fe=>{fe?se(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",fe)}),a.watch(()=>o.options.entries(),()=>{var fe;if(!Rt)return;const xe=((fe=l.value)==null?void 0:fe.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!Tn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&N(),n.defaultFirstOption&&(n.filterable||n.remote)&&oe.value&&U()},{flush:"post"}),a.watch(()=>o.hoveringIndex,fe=>{tt(fe)&&fe>-1?O.value=ie.value[fe]||{}:O.value={},ie.value.forEach(xe=>{xe.hover=O.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||$()});const se=fe=>{o.previousQuery===fe||w.value||(o.previousQuery=fe,n.filterable&&Jt(n.filterMethod)?n.filterMethod(fe):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(fe),n.defaultFirstOption&&(n.filterable||n.remote)&&oe.value?a.nextTick(U):a.nextTick(X))},U=()=>{const fe=ie.value.filter(Fe=>Fe.visible&&!Fe.disabled&&!Fe.states.groupDisabled),xe=fe.find(Fe=>Fe.created),Se=fe[0];o.hoveringIndex=st(ie.value,xe||Se)},N=()=>{if(n.multiple)o.selectedLabel="";else{const xe=sn(n.modelValue)?n.modelValue[0]:n.modelValue,Se=Z(xe);o.selectedLabel=Se.currentLabel,o.selected=[Se];return}const fe=[];Tn(n.modelValue)||Wn(n.modelValue).forEach(xe=>{fe.push(Z(xe))}),o.selected=fe},Z=fe=>{let xe;const Se=Jc(fe).toLowerCase()==="object",Fe=Jc(fe).toLowerCase()==="null",Ie=Jc(fe).toLowerCase()==="undefined";for(let Qe=o.cachedOptions.size-1;Qe>=0;Qe--){const Lt=ae.value[Qe];if(Se?ui(Lt.value,n.valueKey)===ui(fe,n.valueKey):Lt.value===fe){xe={value:fe,currentLabel:Lt.currentLabel,get isDisabled(){return Lt.isDisabled}};break}}if(xe)return xe;const Ue=Se?fe.label:!Fe&&!Ie?fe:"";return{value:fe,currentLabel:Ue}},X=()=>{o.hoveringIndex=ie.value.findIndex(fe=>o.selected.some(xe=>we(xe)===we(fe)))},ee=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ue=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},me=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},be=()=>{var fe,xe;(xe=(fe=c.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ce=()=>{var fe,xe;(xe=(fe=f.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ge=()=>{o.inputValue.length>0&&!_.value&&(_.value=!0),se(o.inputValue)},ne=fe=>{if(o.inputValue=fe.target.value,n.remote)de();else return ge()},de=pu(()=>{ge()},Y.value),ve=fe=>{mu(n.modelValue,fe)||e(di,fe)},Ee=fe=>uS(fe,xe=>!o.disabledOptions.has(xe)),_e=fe=>{if(n.multiple&&fe.code!==$n.delete&&fe.target.value.length<=0){const xe=Wn(n.modelValue).slice(),Se=Ee(xe);if(Se<0)return;const Fe=xe[Se];xe.splice(Se,1),e(ot,xe),ve(xe),e("remove-tag",Fe)}},Ne=(fe,xe)=>{const Se=o.selected.indexOf(xe);if(Se>-1&&!x.value){const Fe=Wn(n.modelValue).slice();Fe.splice(Se,1),e(ot,Fe),ve(Fe),e("remove-tag",xe.value)}fe.stopPropagation(),mt()},Je=fe=>{fe.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const Se of o.selected)Se.isDisabled&&xe.push(Se.value);e(ot,xe),ve(xe),o.hoveringIndex=-1,_.value=!1,e("clear"),mt()},ze=fe=>{var xe;if(n.multiple){const Se=Wn((xe=n.modelValue)!=null?xe:[]).slice(),Fe=st(Se,fe.value);Fe>-1?Se.splice(Fe,1):(n.multipleLimit<=0||Se.length{Ce(fe)})},st=(fe=[],xe)=>{if(!en(xe))return fe.indexOf(xe);const Se=n.valueKey;let Fe=-1;return fe.some((Ie,Ue)=>a.toRaw(ui(Ie,Se))===ui(xe,Se)?(Fe=Ue,!0):!1),Fe},Ce=fe=>{var xe,Se,Fe,Ie,Ue;const De=sn(fe)?fe[0]:fe;let Qe=null;if(De!=null&&De.value){const Lt=ie.value.filter(Gt=>Gt.value===De.value);Lt.length>0&&(Qe=Lt[0].$el)}if(c.value&&Qe){const Lt=(Ie=(Fe=(Se=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:Se.contentRef)==null?void 0:Fe.querySelector)==null?void 0:Ie.call(Fe,`.${r.be("dropdown","wrap")}`);Lt&&bS(Lt,Qe)}(Ue=g.value)==null||Ue.handleScroll()},je=fe=>{o.options.set(fe.value,fe),o.cachedOptions.set(fe.value,fe),fe.disabled&&o.disabledOptions.set(fe.value,fe)},He=(fe,xe)=>{o.options.get(fe)===xe&&o.options.delete(fe)},Pt=a.computed(()=>{var fe,xe;return(xe=(fe=c.value)==null?void 0:fe.popperRef)==null?void 0:xe.contentRef}),It=()=>{o.isBeforeHide=!1,a.nextTick(()=>Ce(o.selected))},mt=()=>{var fe;(fe=d.value)==null||fe.focus()},bt=()=>{var fe;(fe=d.value)==null||fe.blur()},Oi=fe=>{Je(fe)},Ni=()=>{_.value=!1,R.value&&bt()},Un=()=>{o.inputValue.length>0?o.inputValue="":_.value=!1},ss=()=>{x.value||(Yc&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:_.value=!_.value)},Q=()=>{_.value?ie.value[o.hoveringIndex]&&ze(ie.value[o.hoveringIndex]):ss()},we=fe=>en(fe.value)?ui(fe.value,n.valueKey):fe.value,Te=a.computed(()=>ie.value.filter(fe=>fe.visible).every(fe=>fe.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),qe=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),J=fe=>{if(!_.value){_.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Te.value){fe==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):fe==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=ie.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&J(fe),a.nextTick(()=>Ce(O.value))}},pe=()=>{if(!u.value)return 0;const fe=window.getComputedStyle(u.value);return Number.parseFloat(fe.gap||"6px")},he=a.computed(()=>{const fe=pe();return{maxWidth:`${y.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-fe:o.selectionWidth}px`}}),ye=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,z2)}px`}));return bn(u,ee),bn(p,ue),bn(h,be),bn(F,be),bn(b,ce),bn(y,me),a.onMounted(()=>{N()}),{inputId:C,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:R,expanded:_,optionsArray:ie,hoverOption:O,selectSize:j,filteredOptionsCount:oe,resetCalculatorWidth:ue,updateTooltip:be,updateTagTooltip:ce,debouncedOnInputChange:de,onInput:ne,deletePrevTag:_e,deleteTag:Ne,deleteSelected:Je,handleOptionSelect:ze,scrollToOption:Ce,hasModelValue:P,shouldShowPlaceholder:H,currentPlaceholder:K,mouseEnterEventName:le,showClose:B,iconComponent:D,iconReverse:V,validateState:k,validateIcon:G,showNewOption:W,updateOptions:$,collapseTagSize:re,setSelected:N,selectDisabled:x,emptyText:te,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M,onOptionCreate:je,onOptionDestroy:He,handleMenuEnter:It,focus:mt,blur:bt,handleClearClick:Oi,handleClickOutside:Ni,handleEsc:Un,toggleMenu:ss,selectOption:Q,getValueKey:we,navigateOptions:J,dropdownMenuVisible:z,showTagList:Be,collapseTagList:qe,tagStyle:he,collapseTagStyle:ye,inputStyle:Me,popperRef:Pt,inputRef:d,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:v,suffixRef:m,selectRef:l,wrapperRef:F,selectionRef:u,scrollbarRef:g,menuRef:h,tagMenuRef:b,collapseItemRef:y}};var G2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(wl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){sn(c)&&c.forEach(f=>{var d,p,v,m;const h=(d=(f==null?void 0:f.type)||{})==null?void 0:d.name;h==="ElOptionGroup"?u(!Ht(f.children)&&!sn(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(v=f.children)==null?void 0:v.default():f.children):h==="ElOption"?l.push((m=f.props)==null?void 0:m.value):sn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),mu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const H2=$e({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Hi,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(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:un.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Ui,default:vu},fitInputWidth:Boolean,suffixIcon:{type:Ui,default:gu},tagType:{...Xu.type,default:"info"},tagEffect:{...Xu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:ds,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...yT,...Wi(["ariaLabel"])}),_g="ElSelect",W2=a.defineComponent({name:_g,componentName:_g,components:{ElSelectMenu:k2,ElOption:Ju,ElOptions:G2,ElTag:VC,ElScrollbar:XT,ElTooltip:Gu,ElIcon:dt},directives:{ClickOutside:xC},props:H2,emits:[ot,di,"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 sn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=U2(i,e);return a.provide(wl,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 j2(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"),d=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),v=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)]:m=>n.states.inputHovering=!0,onMouseleave:m=>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:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;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,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.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,h=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(h),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!h.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,h)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:h.currentLabel,value:h.value},()=>[a.createTextVNode(a.toDisplayString(h.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":h=>n.states.inputValue=h,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":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(h=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(h=>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(p,{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(d,{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"])),[[v,n.handleClickOutside,n.popperRef]])}var $2=We(W2,[["render",j2],["__file","select.vue"]]);const Z2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ge("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Sg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,d;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((d=c.component)!=null&&d.proxy)},l=c=>{const f=Wn(c),d=[];return f.forEach(p=>{var v,m;o(p)?d.push(p.component.proxy):(v=p.children)!=null&&v.length?d.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&d.push(...l(p.component.subTree))}),d},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),uw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function X2(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 Tg=We(Z2,[["render",X2],["__file","option-group.vue"]]);const Ms=Nt($2,{Option:Ju,OptionGroup:Tg}),As=En(Ju);En(Tg);const Y2=$e({trigger:Ho.trigger,placement:Yu.placement,disabled:Ho.disabled,visible:un.visible,transition:un.transition,popperOptions:Yu.popperOptions,tabindex:Yu.tabindex,content:un.content,popperStyle:un.popperStyle,popperClass:un.popperClass,enterable:{...un.enterable,default:!0},effect:{...un.effect,default:"light"},teleported:un.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}}),J2={"update:visible":n=>Po(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},K2="onUpdate:visible",q2=a.defineComponent({name:"ElPopover"}),Q2=a.defineComponent({...q2,props:Y2,emits:J2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[K2]),s=Ge("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:el(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`),d=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},v=()=>{t("before-leave")},m=()=>{t("after-enter")},h=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:d}),(b,y)=>(a.openBlock(),a.createBlock(a.unref(Gu),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:p,onBeforeHide:v,onShow:m,onHide:h}),{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 eL=We(Q2,[["__file","popover.vue"]]);const Eg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var tL={mounted(n,e){Eg(n,e)},updated(n,e){Eg(n,e)}};const nL=zS(tL,"popover"),Ml=Nt(eL,{directive:nL}),Cg=Symbol("sliderContextKey"),iL=$e({modelValue:{type:Ve([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:Hi,inputSize:Hi,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(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:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:ds,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),Ku=n=>tt(n)||sn(n)&&n.every(tt),rL={[ot]:Ku,[Sr]:Ku,[di]:Ku},sL=(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),kt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},oL=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]})):[]),aL=(n,e,t)=>{const{form:i,formItem:r}=ys(),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)),d=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(d.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),v=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),h=a.computed(()=>n.vertical?{height:p.value,bottom:v.value}:{width:p.value,left:v.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},y=T=>{const C=n.min+T*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-C)e.secondValue?"firstButton":"secondButton",u[L]},g=T=>{const C=y(T);return C.value.setPosition(T),C},w=T=>{e.firstValue=T??n.min,S(n.range?[f.value,d.value]:T??n.min)},A=T=>{e.secondValue=T,n.range&&S([f.value,d.value])},S=T=>{t(ot,T),t(Sr,T)},M=async()=>{await a.nextTick(),t(di,n.range?[f.value,d.value]:n.modelValue)},F=T=>{var C,L,I,x,P,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const V=(I=(L=(C=T.touches)==null?void 0:C.item(0))==null?void 0:L.clientY)!=null?I:T.clientY;D=(s.value.getBoundingClientRect().bottom-V)/e.sliderSize*100}else{const V=(B=(P=(x=T.touches)==null?void 0:x.item(0))==null?void 0:P.clientX)!=null?B:T.clientX,k=s.value.getBoundingClientRect().left;D=(V-k)/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:d,runwayStyle:m,barStyle:h,resetSize:b,setPosition:g,emitChange:M,onSliderWrapperPrevent:T=>{var C,L;((C=u.firstButton.value)!=null&&C.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&T.preventDefault()},onSliderClick:T=>{F(T)&&M()},onSliderDown:async T=>{const C=F(T);C&&(await a.nextTick(),C.value.onButtonDown(T))},onSliderMarkerDown:T=>{c.value||e.dragging||g(T)},setFirstValue:w,setSecondValue:A}},{left:lL,down:cL,right:uL,up:hL,home:dL,end:fL,pageUp:pL,pageDown:mL}=$n,gL=(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=pu(()=>{t.value&&(r.value=!0)},50),u=pu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},vL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:d,resetSize:p,updateDragging:v}=a.inject(Cg),{tooltip:m,tooltipVisible:h,formatValue:b,displayTooltip:y,hideTooltip:g}=gL(n,f,l),w=a.ref(),A=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),S=a.computed(()=>n.vertical?{bottom:A.value}:{left:A.value}),M=()=>{e.hovering=!0,y()},F=()=>{e.hovering=!1,e.dragging||g()},R=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),w.value.focus())},_=G=>{i.value||(e.newPosition=Number.parseFloat(A.value)+G/(s.value-r.value)*100,k(e.newPosition),d())},O=()=>{_(-o.value)},E=()=>{_(o.value)},T=()=>{_(-o.value*4)},C=()=>{_(o.value*4)},L=()=>{i.value||(k(0),d())},I=()=>{i.value||(k(100),d())},x=G=>{let Y=!0;[lL,cL].includes(G.key)?O():[uL,hL].includes(G.key)?E():G.key===dL?L():G.key===fL?I():G.key===mL?T():G.key===pL?C():Y=!1,Y&&G.preventDefault()},P=G=>{let Y,te;return G.type.startsWith("touch")?(te=G.touches[0].clientY,Y=G.touches[0].clientX):(te=G.clientY,Y=G.clientX),{clientX:Y,clientY:te}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:Y,clientY:te}=P(G);n.vertical?e.startY=te:e.startX=Y,e.startPosition=Number.parseFloat(A.value),e.newPosition=e.startPosition},D=G=>{if(e.dragging){e.isClick=!1,y(),p();let Y;const{clientX:te,clientY:oe}=P(G);n.vertical?(e.currentY=oe,Y=(e.startY-e.currentY)/c.value*100):(e.currentX=te,Y=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+Y,k(e.newPosition)}},V=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||k(e.newPosition),d()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",V),window.removeEventListener("touchend",V),window.removeEventListener("contextmenu",V))},k=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const Y=100/((s.value-r.value)/o.value);let oe=Math.round(G/Y)*Y*(s.value-r.value)*.01+r.value;oe=Number.parseFloat(oe.toFixed(u.value)),oe!==n.modelValue&&t(ot,oe),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&y(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{v(G)}),kt(w,"touchstart",R,{passive:!1}),{disabled:i,button:w,tooltip:m,tooltipVisible:h,showTooltip:l,wrapperStyle:S,formatValue:b,handleMouseEnter:M,handleMouseLeave:F,onButtonDown:R,onKeyDown:x,setPosition:k}},yL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return gt("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}%`}}),bL=(n,e,t,i,r,s)=>{const o=c=>{r(ot,c),r(Sr,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&&us("Slider","min should not be greater than max.");const d=n.modelValue;n.range&&Array.isArray(d)?d[1]n.max?o([n.max,n.max]):d[0]n.max?o([d[0],n.max]):(e.firstValue=d[0],e.secondValue=d[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>gt(p))),e.oldValue=d.slice())):!n.range&&typeof d=="number"&&!Number.isNaN(d)&&(dn.max?o(n.max):(e.firstValue=d,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>gt(p))),e.oldValue=d)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((d,p)=>d===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},xL=$e({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:ds,default:"top"}}),wL={[ot]:n=>tt(n)},ML=a.defineComponent({name:"ElSliderButton"}),AL=a.defineComponent({...ML,props:xL,emits:wL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("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:d,formatValue:p,handleMouseEnter:v,handleMouseLeave:m,onButtonDown:h,onKeyDown:b,setPosition:y}=vL(i,s,t),{hovering:g,dragging:w}=a.toRefs(s);return e({onButtonDown:h,onKeyDown:b,setPosition:y,hovering:g,dragging:w}),(A,S)=>(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(w)}]),style:a.normalizeStyle(a.unref(d)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(v),onMouseleave:a.unref(m),onMousedown:a.unref(h),onFocus:a.unref(v),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Gu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:A.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":A.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Lg=We(AL,[["__file","button.vue"]]);const SL=$e({mark:{type:Ve([String,Object]),default:void 0}});var _L=a.defineComponent({name:"ElSliderMarker",props:SL,setup(n){const e=Ge("slider"),t=a.computed(()=>Ht(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Ht(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const TL=a.defineComponent({name:"ElSlider"}),EL=a.defineComponent({...TL,props:iL,emits:rL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),{t:s}=sl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:d,minValue:p,maxValue:v,runwayStyle:m,barStyle:h,resetSize:b,emitChange:y,onSliderWrapperPrevent:g,onSliderClick:w,onSliderDown:A,onSliderMarkerDown:S,setFirstValue:M,setSecondValue:F}=aL(i,o,t),{stops:R,getStopStyle:_}=yL(i,o,p,v),{inputId:O,isLabeledByFormItem:E}=fl(i,{formItemContext:l}),T=Er(),C=a.computed(()=>i.inputSize||T.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),I=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(Y.value):`${Y.value}`),P=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(te.value):`${te.value}`),D=a.computed(()=>[r.b(),r.m(T.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),V=oL(i);bL(i,o,p,v,t,l);const k=a.computed(()=>{const ae=[i.min,i.max,i.step].map(W=>{const $=`${W}`.split(".")[1];return $?$.length:0});return Math.max.apply(null,ae)}),{sliderWrapper:G}=sL(i,o,b),{firstValue:Y,secondValue:te,sliderSize:oe}=a.toRefs(o),ie=ae=>{o.dragging=ae};return kt(G,"touchstart",g,{passive:!1}),kt(G,"touchmove",g,{passive:!1}),a.provide(Cg,{...a.toRefs(i),sliderSize:oe,disabled:d,precision:k,emitChange:y,resetSize:b,updateDragging:ie}),e({onSliderClick:w}),(ae,W)=>{var $,j;return a.openBlock(),a.createElementBlock("div",{id:ae.range?a.unref(O):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(D)),role:ae.range?"group":void 0,"aria-label":ae.range&&!a.unref(E)?a.unref(L):void 0,"aria-labelledby":ae.range&&a.unref(E)?($=a.unref(l))==null?void 0:$.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":ae.showInput&&!ae.range},a.unref(r).is("disabled",a.unref(d))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(A),onTouchstartPassive:a.unref(A)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(h))},null,6),a.createVNode(Lg,{id:ae.range?void 0:a.unref(O),ref_key:"firstButton",ref:c,"model-value":a.unref(Y),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":ae.range||!a.unref(E)?a.unref(I):void 0,"aria-labelledby":!ae.range&&a.unref(E)?(j=a.unref(l))==null?void 0:j.labelId:void 0,"aria-valuemin":ae.min,"aria-valuemax":ae.range?a.unref(te):ae.max,"aria-valuenow":a.unref(Y),"aria-valuetext":a.unref(x),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(M)},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"]),ae.range?(a.openBlock(),a.createBlock(Lg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(te),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":a.unref(P),"aria-valuemin":a.unref(Y),"aria-valuemax":ae.max,"aria-valuenow":a.unref(te),"aria-valuetext":a.unref(B),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(d),"onUpdate:modelValue":a.unref(F)},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),ae.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(R),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(_)(re))},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),(re,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,style:a.normalizeStyle(a.unref(_)(re.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),(re,z)=>(a.openBlock(),a.createBlock(a.unref(_L),{key:z,mark:re.mark,style:a.normalizeStyle(a.unref(_)(re.position)),onMousedown:a.withModifiers(H=>a.unref(S)(re.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),ae.showInput&&!ae.range?(a.openBlock(),a.createBlock(a.unref(vi),{key:0,ref:"input","model-value":a.unref(Y),class:a.normalizeClass(a.unref(r).e("input")),step:ae.step,disabled:a.unref(d),controls:ae.showInputControls,min:ae.min,max:ae.max,precision:a.unref(k),debounce:ae.debounce,size:a.unref(C),"onUpdate:modelValue":a.unref(M),onChange:a.unref(y)},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 CL=We(EL,[["__file","slider.vue"]]);const An=Nt(CL),Al=Symbol("tabsRootContextKey"),LL=$e({tabs:{type:Ve(Array),default:()=>fi([])}}),Rg="ElTabBar",RL=a.defineComponent({name:Rg}),FL=a.defineComponent({...RL,props:LL,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Al);r||us(Rg,"");const s=Ge("tabs"),o=a.ref(),l=a.ref(),u=()=>{let v=0,m=0;const h=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=h==="width"?"x":"y",y=b==="x"?"left":"top";return t.tabs.every(g=>{var w,A;const S=(A=(w=i.parent)==null?void 0:w.refs)==null?void 0:A[`tab-${g.uid}`];if(!S)return!1;if(!g.active)return!0;v=S[`offset${Vi(y)}`],m=S[`client${Vi(h)}`];const M=window.getComputedStyle(S);return h==="width"&&(m-=Number.parseFloat(M.paddingLeft)+Number.parseFloat(M.paddingRight),v+=Number.parseFloat(M.paddingLeft)),!1}),{[h]:`${m}px`,transform:`translate${Vi(b)}(${v}px)`}},c=()=>l.value=u(),f=[],d=()=>{var v;f.forEach(h=>h.stop()),f.length=0;const m=(v=i.parent)==null?void 0:v.refs;if(m){for(const h in m)if(h.startsWith("tab-")){const b=m[h];b&&f.push(bn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),d()},{immediate:!0});const p=bn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(v=>v.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(v,m)=>(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 PL=We(FL,[["__file","tab-bar.vue"]]);const IL=$e({panes:{type:Ve(Array),default:()=>fi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),OL={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Fg="ElTabNav",NL=a.defineComponent({name:Fg,props:IL,emits:OL,setup(n,{expose:e,emit:t}){const i=a.inject(Al);i||us(Fg,"");const r=Ge("tabs"),s=iw(),o=mw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),d=a.ref(!1),p=a.ref(0),v=a.ref(!1),m=a.ref(!0),h=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${h.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!l.value)return;const R=l.value[`offset${Vi(h.value)}`],_=p.value;if(!_)return;const O=_>R?_-R:0;p.value=O},g=()=>{if(!l.value||!u.value)return;const R=u.value[`offset${Vi(h.value)}`],_=l.value[`offset${Vi(h.value)}`],O=p.value;if(R-O<=_)return;const E=R-O>_*2?O+_:R-_;p.value=E},w=async()=>{const R=u.value;if(!d.value||!c.value||!l.value||!R)return;await a.nextTick();const _=c.value.querySelector(".is-active");if(!_)return;const O=l.value,E=["top","bottom"].includes(i.props.tabPosition),T=_.getBoundingClientRect(),C=O.getBoundingClientRect(),L=E?R.offsetWidth-C.width:R.offsetHeight-C.height,I=p.value;let x=I;E?(T.leftC.right&&(x=I+T.right-C.right)):(T.topC.bottom&&(x=I+(T.bottom-C.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},A=()=>{var R;if(!u.value||!l.value)return;n.stretch&&((R=f.value)==null||R.update());const _=u.value[`offset${Vi(h.value)}`],O=l.value[`offset${Vi(h.value)}`],E=p.value;O<_?(d.value=d.value||{},d.value.prev=E,d.value.next=E+O<_,_-E0&&(p.value=0))},S=R=>{const _=R.code,{up:O,down:E,left:T,right:C}=$n;if(![O,E,T,C].includes(_))return;const L=Array.from(R.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),I=L.indexOf(R.target);let x;_===T||_===O?I===0?x=L.length-1:x=I-1:I{m.value&&(v.value=!0)},F=()=>v.value=!1;return a.watch(s,R=>{R==="hidden"?m.value=!1:R==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,R=>{R?setTimeout(()=>m.value=!0,50):m.value=!1}),bn(c,A),a.onMounted(()=>setTimeout(()=>w(),0)),a.onUpdated(()=>A()),e({scrollToActiveTab:w,removeFocus:F}),()=>{const R=d.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!d.value.prev)],onClick:y},[a.createVNode(dt,null,{default:()=>[a.createVNode(ki,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!d.value.next)],onClick:g},[a.createVNode(dt,null,{default:()=>[a.createVNode(zi,null,null)]})])]:null,_=n.panes.map((O,E)=>{var T,C,L,I;const x=O.uid,P=O.props.disabled,B=(C=(T=O.props.name)!=null?T:O.index)!=null?C:`${E}`,D=!P&&(O.isClosable||n.editable);O.index=`${E}`;const V=D?a.createVNode(dt,{class:"is-icon-close",onClick:Y=>t("tabRemove",O,Y)},{default:()=>[a.createVNode(yu,null,null)]}):null,k=((I=(L=O.slots).label)==null?void 0:I.call(L))||O.props.label,G=!P&&O.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",O.active),r.is("disabled",P),r.is("closable",D),r.is("focus",v.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":O.active,tabindex:G,onFocus:()=>M(),onBlur:()=>F(),onClick:Y=>{F(),t("tabClick",O,B,Y)},onKeydown:Y=>{D&&(Y.code===$n.delete||Y.code===$n.backspace)&&t("tabRemove",O,Y)}},[k,V])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!d.value),r.is(i.props.tabPosition)]},[R,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:S},[n.type?null:a.createVNode(PL,{ref:f,tabs:[...n.panes]},null),_])])])}}}),BL=$e({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:Ve(Function),default:()=>!0},stretch:Boolean}),qu=n=>Ht(n)||tt(n),DL={[ot]:n=>qu(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>qu(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>qu(n),tabAdd:()=>!0},VL=a.defineComponent({name:"ElTabs",props:BL,emits:DL,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ge("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=fT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),d=a.ref((r=n.modelValue)!=null?r:"0"),p=async(y,g=!1)=>{var w,A,S;if(!(d.value===y||Tn(y)))try{await((w=n.beforeLeave)==null?void 0:w.call(n,y,d.value))!==!1&&(d.value=y,g&&(e(ot,y),e("tabChange",y)),(S=(A=f.value)==null?void 0:A.removeFocus)==null||S.call(A))}catch{}},v=(y,g,w)=>{y.props.disabled||(p(g,!0),e("tabClick",y,w))},m=(y,g)=>{y.props.disabled||Tn(y.props.name)||(g.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},h=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,y=>p(y)),a.watch(d,async()=>{var y;await a.nextTick(),(y=f.value)==null||y.scrollToActiveTab()}),a.provide(Al,{props:n,currentName:d,registerPane:y=>{l.value.push(y)},sortPane:u,unregisterPane:c}),i({currentName:d});const b=({render:y})=>y();return()=>{const y=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:h,onKeydown:S=>{S.code===$n.enter&&h()}},[y?a.renderSlot(t,"add-icon"):a.createVNode(dt,{class:s.is("icon-plus")},{default:()=>[a.createVNode(nl,null,null)]})]):null,w=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const S=l.value.some(M=>M.slots.label);return a.createVNode(NL,{ref:f,currentName:d.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:v,onTabRemove:m},{$stable:!S})}},null),g]),A=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"}]},[A,w])}}}),kL=$e({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Pg="ElTabPane",zL=a.defineComponent({name:Pg}),UL=a.defineComponent({...zL,props:kL,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Al);r||us(Pg,"usage: ");const s=Ge("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Df(()=>{var v;return r.currentName.value===((v=e.name)!=null?v:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var v;return(v=e.name)!=null?v:o.value}),d=Df(()=>!e.lazy||c.value||u.value);a.watch(u,v=>{v&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(v,m)=>a.unref(d)?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(v.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Ig=We(UL,[["__file","tab-pane.vue"]]);const Og=Nt(VL,{TabPane:Ig}),Ng=En(Ig);function GL(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,v=d.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(Qa(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Qa(p,v.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,v;(v=(p=d.$el)==null?void 0:p.parentNode)==null||v.removeChild(d.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:m,zIndex:h}=wT("loading");return v({ns:m,zIndex:h}),()=>{const b=i.spinner||i.svg,y=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:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),d=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:d,get $el(){return d.$el}}}let Sl;const Qu=function(n={}){if(!Rt)return;const e=HL(n);if(e.fullscreen&&Sl)return Sl;const t=GL({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Sl=void 0)}});WL(e,e.parent,t),Bg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Bg(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&&(Sl=t),t},HL=n=>{var e,t,i,r;let s;return Ht(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}},WL=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Io(document.body,"position"),t.originalOverflow.value=Io(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Io(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(Io(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Io(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Bg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Qa(e,i.bm("parent","relative")):Up(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Up(e,i.bm("parent","hidden")):Qa(e,i.bm("parent","hidden"))},_l=Symbol("ElLoading"),Dg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>en(e.value)?e.value[p]:void 0,u=p=>{const v=Ht(p)&&(o==null?void 0:o[p])||p;return v&&a.ref(v)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Aw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,d={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[_l]={options:d,instance:Qu(d)}},jL=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},eh={mounted(n,e){e.value&&Dg(n,e)},updated(n,e){const t=n[_l];e.oldValue!==e.value&&(e.value&&!e.oldValue?Dg(n,e):e.value&&e.oldValue?en(e.value)&&jL(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[_l])==null||e.instance.close(),n[_l]=null}},$L={install(n){n.directive("loading",eh),n.config.globalProperties.$loading=Qu},directive:eh,service:Qu};var Vg={exports:{}},kg={},zg;function ZL(){return zg||(zg=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var d=c.shift();return{done:d===void 0,value:d}}};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(d){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof d;if(p!=="undefined")if(p==="string")d!==""&&this._fromString(d);else if(d instanceof c){var v=this;d.forEach(function(y,g){v.append(g,y)})}else if(d!==null&&p==="object")if(Object.prototype.toString.call(d)==="[object Array]")for(var m=0;mv[0]?1:0}),c._entries&&(c._entries={});for(var d=0;d1?s(v[1]):"")}})}(typeof Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi),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,d;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),d=f.createElement("base"),d.href=c,f.head.appendChild(d);try{if(d.href.indexOf(c)!==0)throw new Error(d.href)}catch(w){throw new Error("URL unable to set base "+c+" due to "+w)}}var p=f.createElement("a");p.href=u,d&&(f.body.appendChild(p),p.href=p.href);var v=f.createElement("input");if(v.type="url",v.value=u,p.protocol===":"||!/:/.test(p.href)||!v.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),h=!0,b=!0,y=this;["append","delete","set"].forEach(function(w){var A=m[w];m[w]=function(){A.apply(m,arguments),h&&(b=!1,y.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,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&&(h=!1,this.searchParams._fromString(this.search),h=!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 Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi)),kg}/** * @license * Copyright 2010-2021 Three.js Authors * SPDX-License-Identifier: MIT */const th="130",XL={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},YL={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ug=0,nh=1,Gg=2,JL=3,KL=0,ih=1,Hg=2,Ss=3,Ji=0,xt=1,Ki=2,rh=1,qL=2,yi=0,_s=1,sh=2,oh=3,ah=4,Wg=5,Lr=100,jg=101,$g=102,lh=103,ch=104,Zg=200,Xg=201,Yg=202,Jg=203,uh=204,hh=205,Kg=206,qg=207,Qg=208,e0=209,t0=210,n0=0,i0=1,r0=2,Tl=3,s0=4,o0=5,a0=6,l0=7,Wo=0,c0=1,u0=2,qi=0,h0=1,d0=2,f0=3,p0=4,m0=5,El=300,jo=301,$o=302,Cl=303,Ll=304,Ts=306,Zo=307,Qi=1e3,zt=1001,Es=1002,wt=1003,Xo=1004,QL=1004,Yo=1005,eR=1005,vt=1006,Rl=1007,tR=1007,bi=1008,nR=1008,Rr=1009,g0=1010,v0=1011,Jo=1012,y0=1013,Ko=1014,xi=1015,Fr=1016,b0=1017,x0=1018,w0=1019,Cs=1020,M0=1021,wi=1022,dn=1023,A0=1024,S0=1025,_0=dn,Pr=1026,Ls=1027,T0=1028,E0=1029,C0=1030,L0=1031,R0=1032,F0=1033,dh=33776,fh=33777,ph=33778,mh=33779,gh=35840,vh=35841,yh=35842,bh=35843,P0=36196,xh=37492,wh=37496,I0=37808,O0=37809,N0=37810,B0=37811,D0=37812,V0=37813,k0=37814,z0=37815,U0=37816,G0=37817,H0=37818,W0=37819,j0=37820,$0=37821,Z0=36492,X0=37840,Y0=37841,J0=37842,K0=37843,q0=37844,Q0=37845,ev=37846,tv=37847,nv=37848,iv=37849,rv=37850,sv=37851,ov=37852,av=37853,lv=2200,cv=2201,uv=2202,Rs=2300,Ir=2301,Fl=2302,Or=2400,Nr=2401,qo=2402,Pl=2500,Mh=2501,hv=0,dv=1,Ah=2,tn=3e3,Br=3001,Il=3007,Ol=3002,fv=3003,Sh=3004,_h=3005,Th=3006,pv=3200,mv=3201,er=0,gv=1,iR=0,Nl=7680,rR=7681,sR=7682,oR=7683,aR=34055,lR=34056,cR=5386,uR=512,hR=513,dR=514,fR=515,pR=516,mR=517,gR=518,vv=519,Fs=35044,Ps=35048,vR=35040,yR=35045,bR=35049,xR=35041,wR=35046,MR=35050,AR=35042,SR="100",Eh="300 es";class tr{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]+jt[n>>16&255]+jt[n>>24&255]+"-"+jt[e&255]+jt[e>>8&255]+"-"+jt[e>>16&15|64]+jt[e>>24&255]+"-"+jt[t&63|128]+jt[t>>8&255]+"-"+jt[t>>16&255]+jt[t>>24&255]+jt[i&255]+jt[i>>8&255]+jt[i>>16&255]+jt[i>>24&255]).toUpperCase()}function $t(n,e,t){return Math.max(e,Math.min(t,n))}function Ch(n,e){return(n%e+e)%e}function _R(n,e,t,i,r){return i+(n-e)*(r-i)/(t-e)}function TR(n,e,t){return n!==e?(t-n)/(e-n):0}function ea(n,e,t){return(1-t)*n+t*e}function ER(n,e,t,i){return ea(n,e,1-Math.exp(-t*i))}function CR(n,e=1){return e-Math.abs(Ch(n,e*2)-e)}function LR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*(3-2*n))}function RR(n,e,t){return n<=e?0:n>=t?1:(n=(n-e)/(t-e),n*n*n*(n*(n*6-15)+10))}function FR(n,e){return n+Math.floor(Math.random()*(e-n+1))}function PR(n,e){return n+Math.random()*(e-n)}function IR(n){return n*(.5-Math.random())}function OR(n){return n!==void 0&&(Bl=n%2147483647),Bl=Bl*16807%2147483647,(Bl-1)/2147483646}function NR(n){return n*Dr}function BR(n){return n*Qo}function Lh(n){return(n&n-1)===0&&n!==0}function yv(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function bv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function DR(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),d=s((e-i)/2),p=o((e-i)/2),v=s((i-e)/2),m=o((i-e)/2);switch(r){case"XYX":n.set(l*f,u*d,u*p,l*c);break;case"YZY":n.set(u*p,l*f,u*d,l*c);break;case"ZXZ":n.set(u*d,u*p,l*f,l*c);break;case"XZX":n.set(l*f,u*m,u*v,l*c);break;case"YXY":n.set(u*v,l*f,u*m,l*c);break;case"ZYZ":n.set(u*m,u*v,l*f,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}var Rh=Object.freeze({__proto__:null,DEG2RAD:Dr,RAD2DEG:Qo,generateUUID:fn,clamp:$t,euclideanModulo:Ch,mapLinear:_R,inverseLerp:TR,lerp:ea,damp:ER,pingpong:CR,smoothstep:LR,smootherstep:RR,randInt:FR,randFloat:PR,randFloatSpread:IR,seededRandom:OR,degToRad:NR,radToDeg:BR,isPowerOfTwo:Lh,ceilPowerOfTwo:yv,floorPowerOfTwo:bv,setQuaternionFromProperEuler:DR});class Ae{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}}Ae.prototype.isVector2=!0;class Bt{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],d=i[7],p=i[2],v=i[5],m=i[8],h=r[0],b=r[3],y=r[6],g=r[1],w=r[4],A=r[7],S=r[2],M=r[5],F=r[8];return s[0]=o*h+l*g+u*S,s[3]=o*b+l*w+u*M,s[6]=o*y+l*A+u*F,s[1]=c*h+f*g+d*S,s[4]=c*b+f*w+d*M,s[7]=c*y+f*A+d*F,s[2]=p*h+v*g+m*S,s[5]=p*b+v*w+m*M,s[8]=p*y+v*A+m*F,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],d=f*o-l*c,p=l*u-f*s,v=c*s-o*u,m=t*d+i*p+r*v;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const h=1/m;return e[0]=d*h,e[1]=(r*c-f*i)*h,e[2]=(l*i-r*o)*h,e[3]=p*h,e[4]=(f*t-r*u)*h,e[5]=(r*s-l*t)*h,e[6]=v*h,e[7]=(i*u-c*t)*h,e[8]=(o*t-i*s)*h,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)}}Bt.prototype.isMatrix3=!0;let Is;class Vr{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Is===void 0&&(Is=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Is.width=e.width,Is.height=e.height;const i=Is.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Is}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 VR=0;class Mt extends tr{constructor(e=Mt.DEFAULT_IMAGE,t=Mt.DEFAULT_MAPPING,i=zt,r=zt,s=vt,o=bi,l=dn,u=Rr,c=1,f=tn){super(),Object.defineProperty(this,"id",{value:VR++}),this.uuid=fn(),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 Ae(0,0),this.repeat=new Ae(1,1),this.center=new Ae(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Bt,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=fn()),!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 Qi:e.x=e.x-Math.floor(e.x);break;case zt:e.x=e.x<0?0:1;break;case Es: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 Qi:e.y=e.y-Math.floor(e.y);break;case zt:e.y=e.y<0?0:1;break;case Es: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++}}Mt.DEFAULT_IMAGE=void 0,Mt.DEFAULT_MAPPING=El,Mt.prototype.isTexture=!0;function Fh(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Vr.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 it{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],d=u[8],p=u[1],v=u[5],m=u[9],h=u[2],b=u[6],y=u[10];if(Math.abs(f-p)<.01&&Math.abs(d-h)<.01&&Math.abs(m-b)<.01){if(Math.abs(f+p)<.1&&Math.abs(d+h)<.1&&Math.abs(m+b)<.1&&Math.abs(c+v+y-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,A=(v+1)/2,S=(y+1)/2,M=(f+p)/4,F=(d+h)/4,R=(m+b)/4;return w>A&&w>S?w<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(w),r=M/i,s=F/i):A>S?A<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(A),i=M/r,s=R/r):S<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(S),i=F/s,r=R/s),this.set(i,r,s,t),this}let g=Math.sqrt((b-m)*(b-m)+(d-h)*(d-h)+(p-f)*(p-f));return Math.abs(g)<.001&&(g=1),this.x=(b-m)/g,this.y=(d-h)/g,this.z=(p-f)/g,this.w=Math.acos((c+v+y-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}}it.prototype.isVector4=!0;class Pn extends tr{constructor(e,t,i={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new it(0,0,e,t),this.scissorTest=!1,this.viewport=new it(0,0,e,t),this.texture=new Mt(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:vt,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"})}}Pn.prototype.isWebGLRenderTarget=!0;class xv extends Pn{constructor(e,t,i){super(e,t);const r=this.texture;this.texture=[];for(let s=0;s=0?1:-1,w=1-y*y;if(w>Number.EPSILON){const S=Math.sqrt(w),M=Math.atan2(S,y*g);b=Math.sin(b*M)/S,l=Math.sin(l*M)/S}const A=l*g;if(u=u*b+p*A,c=c*b+v*A,f=f*b+m*A,d=d*b+h*A,b===1-l){const S=1/Math.sqrt(u*u+c*c+f*f+d*d);u*=S,c*=S,f*=S,d*=S}}e[t]=u,e[t+1]=c,e[t+2]=f,e[t+3]=d}static multiplyQuaternionsFlat(e,t,i,r,s,o){const l=i[r],u=i[r+1],c=i[r+2],f=i[r+3],d=s[o],p=s[o+1],v=s[o+2],m=s[o+3];return e[t]=l*m+f*d+u*v-c*p,e[t+1]=u*m+f*p+c*d-l*v,e[t+2]=c*m+f*v+l*p-u*d,e[t+3]=f*m-l*d-u*p-c*v,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),d=l(s/2),p=u(i/2),v=u(r/2),m=u(s/2);switch(o){case"XYZ":this._x=p*f*d+c*v*m,this._y=c*v*d-p*f*m,this._z=c*f*m+p*v*d,this._w=c*f*d-p*v*m;break;case"YXZ":this._x=p*f*d+c*v*m,this._y=c*v*d-p*f*m,this._z=c*f*m-p*v*d,this._w=c*f*d+p*v*m;break;case"ZXY":this._x=p*f*d-c*v*m,this._y=c*v*d+p*f*m,this._z=c*f*m+p*v*d,this._w=c*f*d-p*v*m;break;case"ZYX":this._x=p*f*d-c*v*m,this._y=c*v*d+p*f*m,this._z=c*f*m-p*v*d,this._w=c*f*d+p*v*m;break;case"YZX":this._x=p*f*d+c*v*m,this._y=c*v*d+p*f*m,this._z=c*f*m-p*v*d,this._w=c*f*d-p*v*m;break;case"XZY":this._x=p*f*d-c*v*m,this._y=c*v*d-p*f*m,this._z=c*f*m+p*v*d,this._w=c*f*d+p*v*m;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],d=t[10],p=i+l+d;if(p>0){const v=.5/Math.sqrt(p+1);this._w=.25/v,this._x=(f-u)*v,this._y=(s-c)*v,this._z=(o-r)*v}else if(i>l&&i>d){const v=2*Math.sqrt(1+i-l-d);this._w=(f-u)/v,this._x=.25*v,this._y=(r+o)/v,this._z=(s+c)/v}else if(l>d){const v=2*Math.sqrt(1+l-i-d);this._w=(s-c)/v,this._x=(r+o)/v,this._y=.25*v,this._z=(u+f)/v}else{const v=2*Math.sqrt(1+d-i-l);this._w=(o-r)/v,this._x=(s+c)/v,this._y=(u+f)/v,this._z=.25*v}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($t(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 v=1-t;return this._w=v*o+t*this._w,this._x=v*i+t*this._x,this._y=v*r+t*this._y,this._z=v*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(u),f=Math.atan2(c,l),d=Math.sin((1-t)*f)/c,p=Math.sin(t*f)/c;return this._w=o*d+this._w*p,this._x=i*d+this._x*p,this._y=r*d+this._y*p,this._z=s*d+this._z*p,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(){}}Zt.prototype.isQuaternion=!0;class q{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(wv.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wv.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,d=u*r+s*i-o*t,p=-s*t-o*i-l*r;return this.x=c*u+p*-s+f*-l-d*-o,this.y=f*u+p*-o+d*-s-c*-l,this.z=d*u+p*-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 Ih.copy(this).projectOnVector(e),this.sub(Ih)}reflect(e){return this.sub(Ih.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($t(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}}q.prototype.isVector3=!0;const Ih=new q,wv=new Zt;class ln{constructor(e=new q(1/0,1/0,1/0),t=new q(-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),d>o&&(o=d),p>l&&(l=p)}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),d>o&&(o=d),p>l&&(l=p)}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,ta),ta.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(na),Dl.subVectors(this.max,na),Os.subVectors(e.a,na),Ns.subVectors(e.b,na),Bs.subVectors(e.c,na),nr.subVectors(Ns,Os),ir.subVectors(Bs,Ns),kr.subVectors(Os,Bs);let t=[0,-nr.z,nr.y,0,-ir.z,ir.y,0,-kr.z,kr.y,nr.z,0,-nr.x,ir.z,0,-ir.x,kr.z,0,-kr.x,-nr.y,nr.x,0,-ir.y,ir.x,0,-kr.y,kr.x,0];return!Nh(t,Os,Ns,Bs,Dl)||(t=[1,0,0,0,1,0,0,0,1],!Nh(t,Os,Ns,Bs,Dl))?!1:(Vl.crossVectors(nr,ir),t=[Vl.x,Vl.y,Vl.z],Nh(t,Os,Ns,Bs,Dl))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return ta.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=this.getSize(ta).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:(Mi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Mi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Mi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Mi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Mi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Mi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Mi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Mi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Mi),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)}}ln.prototype.isBox3=!0;const Mi=[new q,new q,new q,new q,new q,new q,new q,new q],ta=new q,Oh=new ln,Os=new q,Ns=new q,Bs=new q,nr=new q,ir=new q,kr=new q,na=new q,Dl=new q,Vl=new q,zr=new q;function Nh(n,e,t,i,r){for(let s=0,o=n.length-3;s<=o;s+=3){zr.fromArray(n,s);const l=r.x*Math.abs(zr.x)+r.y*Math.abs(zr.y)+r.z*Math.abs(zr.z),u=e.dot(zr),c=t.dot(zr),f=i.dot(zr);if(Math.max(-Math.max(u,c,f),Math.min(u,c,f))>l)return!1}return!0}const kR=new ln,Mv=new q,Bh=new q,Dh=new q;class Ai{constructor(e=new q,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):kR.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){Dh.subVectors(e,this.center);const t=Dh.lengthSq();if(t>this.radius*this.radius){const i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.add(Dh.multiplyScalar(r/i)),this.radius+=r}return this}union(e){return Bh.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(Mv.copy(e.center).add(Bh)),this.expandByPoint(Mv.copy(e.center).sub(Bh)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Si=new q,Vh=new q,kl=new q,rr=new q,kh=new q,zl=new q,zh=new q;class sr{constructor(e=new q,t=new q(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,Si)),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=Si.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Si.copy(this.direction).multiplyScalar(t).add(this.origin),Si.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){Vh.copy(e).add(t).multiplyScalar(.5),kl.copy(t).sub(e).normalize(),rr.copy(this.origin).sub(Vh);const s=e.distanceTo(t)*.5,o=-this.direction.dot(kl),l=rr.dot(this.direction),u=-rr.dot(kl),c=rr.lengthSq(),f=Math.abs(1-o*o);let d,p,v,m;if(f>0)if(d=o*u-l,p=o*l-u,m=s*f,d>=0)if(p>=-m)if(p<=m){const h=1/f;d*=h,p*=h,v=d*(d+o*p+2*l)+p*(o*d+p+2*u)+c}else p=s,d=Math.max(0,-(o*p+l)),v=-d*d+p*(p+2*u)+c;else p=-s,d=Math.max(0,-(o*p+l)),v=-d*d+p*(p+2*u)+c;else p<=-m?(d=Math.max(0,-(-o*s+l)),p=d>0?-s:Math.min(Math.max(-s,-u),s),v=-d*d+p*(p+2*u)+c):p<=m?(d=0,p=Math.min(Math.max(-s,-u),s),v=p*(p+2*u)+c):(d=Math.max(0,-(o*s+l)),p=d>0?s:Math.min(Math.max(-s,-u),s),v=-d*d+p*(p+2*u)+c);else p=o>0?-s:s,d=Math.max(0,-(o*p+l)),v=-d*d+p*(p+2*u)+c;return i&&i.copy(this.direction).multiplyScalar(d).add(this.origin),r&&r.copy(kl).multiplyScalar(p).add(Vh),v}intersectSphere(e,t){Si.subVectors(e.center,this.origin);const i=Si.dot(this.direction),r=Si.dot(Si)-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,d=1/this.direction.z,p=this.origin;return c>=0?(i=(e.min.x-p.x)*c,r=(e.max.x-p.x)*c):(i=(e.max.x-p.x)*c,r=(e.min.x-p.x)*c),f>=0?(s=(e.min.y-p.y)*f,o=(e.max.y-p.y)*f):(s=(e.max.y-p.y)*f,o=(e.min.y-p.y)*f),i>o||s>r||((s>i||i!==i)&&(i=s),(o=0?(l=(e.min.z-p.z)*d,u=(e.max.z-p.z)*d):(l=(e.max.z-p.z)*d,u=(e.min.z-p.z)*d),i>u||l>r)||((l>i||i!==i)&&(i=l),(u=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Si)!==null}intersectTriangle(e,t,i,r,s){kh.subVectors(t,e),zl.subVectors(i,e),zh.crossVectors(kh,zl);let o=this.direction.dot(zh),l;if(o>0){if(r)return null;l=1}else if(o<0)l=-1,o=-o;else return null;rr.subVectors(this.origin,e);const u=l*this.direction.dot(zl.crossVectors(rr,zl));if(u<0)return null;const c=l*this.direction.dot(kh.cross(rr));if(c<0||u+c>o)return null;const f=-l*rr.dot(zh);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 Oe{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,d,p,v,m,h,b){const y=this.elements;return y[0]=e,y[4]=t,y[8]=i,y[12]=r,y[1]=s,y[5]=o,y[9]=l,y[13]=u,y[2]=c,y[6]=f,y[10]=d,y[14]=p,y[3]=v,y[7]=m,y[11]=h,y[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 Oe().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/Ds.setFromMatrixColumn(e,0).length(),s=1/Ds.setFromMatrixColumn(e,1).length(),o=1/Ds.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),d=Math.sin(s);if(e.order==="XYZ"){const p=o*f,v=o*d,m=l*f,h=l*d;t[0]=u*f,t[4]=-u*d,t[8]=c,t[1]=v+m*c,t[5]=p-h*c,t[9]=-l*u,t[2]=h-p*c,t[6]=m+v*c,t[10]=o*u}else if(e.order==="YXZ"){const p=u*f,v=u*d,m=c*f,h=c*d;t[0]=p+h*l,t[4]=m*l-v,t[8]=o*c,t[1]=o*d,t[5]=o*f,t[9]=-l,t[2]=v*l-m,t[6]=h+p*l,t[10]=o*u}else if(e.order==="ZXY"){const p=u*f,v=u*d,m=c*f,h=c*d;t[0]=p-h*l,t[4]=-o*d,t[8]=m+v*l,t[1]=v+m*l,t[5]=o*f,t[9]=h-p*l,t[2]=-o*c,t[6]=l,t[10]=o*u}else if(e.order==="ZYX"){const p=o*f,v=o*d,m=l*f,h=l*d;t[0]=u*f,t[4]=m*c-v,t[8]=p*c+h,t[1]=u*d,t[5]=h*c+p,t[9]=v*c-m,t[2]=-c,t[6]=l*u,t[10]=o*u}else if(e.order==="YZX"){const p=o*u,v=o*c,m=l*u,h=l*c;t[0]=u*f,t[4]=h-p*d,t[8]=m*d+v,t[1]=d,t[5]=o*f,t[9]=-l*f,t[2]=-c*f,t[6]=v*d+m,t[10]=p-h*d}else if(e.order==="XZY"){const p=o*u,v=o*c,m=l*u,h=l*c;t[0]=u*f,t[4]=-d,t[8]=c*f,t[1]=p*d+h,t[5]=o*f,t[9]=v*d-m,t[2]=m*d-v,t[6]=l*f,t[10]=h*d+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(zR,e,UR)}lookAt(e,t,i){const r=this.elements;return pn.subVectors(e,t),pn.lengthSq()===0&&(pn.z=1),pn.normalize(),or.crossVectors(i,pn),or.lengthSq()===0&&(Math.abs(i.z)===1?pn.x+=1e-4:pn.z+=1e-4,pn.normalize(),or.crossVectors(i,pn)),or.normalize(),Ul.crossVectors(pn,or),r[0]=or.x,r[4]=Ul.x,r[8]=pn.x,r[1]=or.y,r[5]=Ul.y,r[9]=pn.y,r[2]=or.z,r[6]=Ul.z,r[10]=pn.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],d=i[5],p=i[9],v=i[13],m=i[2],h=i[6],b=i[10],y=i[14],g=i[3],w=i[7],A=i[11],S=i[15],M=r[0],F=r[4],R=r[8],_=r[12],O=r[1],E=r[5],T=r[9],C=r[13],L=r[2],I=r[6],x=r[10],P=r[14],B=r[3],D=r[7],V=r[11],k=r[15];return s[0]=o*M+l*O+u*L+c*B,s[4]=o*F+l*E+u*I+c*D,s[8]=o*R+l*T+u*x+c*V,s[12]=o*_+l*C+u*P+c*k,s[1]=f*M+d*O+p*L+v*B,s[5]=f*F+d*E+p*I+v*D,s[9]=f*R+d*T+p*x+v*V,s[13]=f*_+d*C+p*P+v*k,s[2]=m*M+h*O+b*L+y*B,s[6]=m*F+h*E+b*I+y*D,s[10]=m*R+h*T+b*x+y*V,s[14]=m*_+h*C+b*P+y*k,s[3]=g*M+w*O+A*L+S*B,s[7]=g*F+w*E+A*I+S*D,s[11]=g*R+w*T+A*x+S*V,s[15]=g*_+w*C+A*P+S*k,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],d=e[6],p=e[10],v=e[14],m=e[3],h=e[7],b=e[11],y=e[15];return m*(+s*u*d-r*c*d-s*l*p+i*c*p+r*l*v-i*u*v)+h*(+t*u*v-t*c*p+s*o*p-r*o*v+r*c*f-s*u*f)+b*(+t*c*d-t*l*v-s*o*d+i*o*v+s*l*f-i*c*f)+y*(-r*l*f-t*u*d+t*l*p+r*o*d-i*o*p+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],d=e[9],p=e[10],v=e[11],m=e[12],h=e[13],b=e[14],y=e[15],g=d*b*c-h*p*c+h*u*v-l*b*v-d*u*y+l*p*y,w=m*p*c-f*b*c-m*u*v+o*b*v+f*u*y-o*p*y,A=f*h*c-m*d*c+m*l*v-o*h*v-f*l*y+o*d*y,S=m*d*u-f*h*u-m*l*p+o*h*p+f*l*b-o*d*b,M=t*g+i*w+r*A+s*S;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const F=1/M;return e[0]=g*F,e[1]=(h*p*s-d*b*s-h*r*v+i*b*v+d*r*y-i*p*y)*F,e[2]=(l*b*s-h*u*s+h*r*c-i*b*c-l*r*y+i*u*y)*F,e[3]=(d*u*s-l*p*s-d*r*c+i*p*c+l*r*v-i*u*v)*F,e[4]=w*F,e[5]=(f*b*s-m*p*s+m*r*v-t*b*v-f*r*y+t*p*y)*F,e[6]=(m*u*s-o*b*s-m*r*c+t*b*c+o*r*y-t*u*y)*F,e[7]=(o*p*s-f*u*s+f*r*c-t*p*c-o*r*v+t*u*v)*F,e[8]=A*F,e[9]=(m*d*s-f*h*s-m*i*v+t*h*v+f*i*y-t*d*y)*F,e[10]=(o*h*s-m*l*s+m*i*c-t*h*c-o*i*y+t*l*y)*F,e[11]=(f*l*s-o*d*s-f*i*c+t*d*c+o*i*v-t*l*v)*F,e[12]=S*F,e[13]=(f*h*r-m*d*r+m*i*p-t*h*p-f*i*b+t*d*b)*F,e[14]=(m*l*r-o*h*r-m*i*u+t*h*u+o*i*b-t*l*b)*F,e[15]=(o*d*r-f*l*r+f*i*u-t*d*u-o*i*p+t*l*p)*F,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,d=l+l,p=s*c,v=s*f,m=s*d,h=o*f,b=o*d,y=l*d,g=u*c,w=u*f,A=u*d,S=i.x,M=i.y,F=i.z;return r[0]=(1-(h+y))*S,r[1]=(v+A)*S,r[2]=(m-w)*S,r[3]=0,r[4]=(v-A)*M,r[5]=(1-(p+y))*M,r[6]=(b+g)*M,r[7]=0,r[8]=(m+w)*F,r[9]=(b-g)*F,r[10]=(1-(p+h))*F,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=Ds.set(r[0],r[1],r[2]).length();const o=Ds.set(r[4],r[5],r[6]).length(),l=Ds.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],In.copy(this);const c=1/s,f=1/o,d=1/l;return In.elements[0]*=c,In.elements[1]*=c,In.elements[2]*=c,In.elements[4]*=f,In.elements[5]*=f,In.elements[6]*=f,In.elements[8]*=d,In.elements[9]*=d,In.elements[10]*=d,t.setFromRotationMatrix(In),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),d=(i+r)/(i-r),p=-(o+s)/(o-s),v=-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]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=v,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),d=(t+e)*u,p=(i+r)*c,v=(o+s)*f;return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-p,l[2]=0,l[6]=0,l[10]=-2*f,l[14]=-v,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}}Oe.prototype.isMatrix4=!0;const Ds=new q,In=new Oe,zR=new q(0,0,0),UR=new q(1,1,1),or=new q,Ul=new q,pn=new q,Av=new Oe,Sv=new Zt;class Ur{constructor(e=0,t=0,i=0,r=Ur.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],d=r[2],p=r[6],v=r[10];switch(t){case"XYZ":this._y=Math.asin($t(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-f,v),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$t(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(l,v),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin($t(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,v),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(u,s));break;case"ZYX":this._y=Math.asin(-$t(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,v),this._z=Math.atan2(u,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin($t(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-f,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(l,v));break;case"XZY":this._z=Math.asin(-$t(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-f,v),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 Av.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Av,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Sv.setFromEuler(this),this.setFromQuaternion(Sv,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 q(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Ur.prototype.isEuler=!0,Ur.DefaultOrder="XYZ",Ur.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Uh{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),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),v.length>0&&(i.animations=v)}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){On.subVectors(r,t),Ti.subVectors(i,t),Gh.subVectors(e,t);const o=On.dot(On),l=On.dot(Ti),u=On.dot(Gh),c=Ti.dot(Ti),f=Ti.dot(Gh),d=o*c-l*l;if(d===0)return s.set(-2,-1,-1);const p=1/d,v=(c*u-l*f)*p,m=(o*f-l*u)*p;return s.set(1-v-m,m,v)}static containsPoint(e,t,i,r){return this.getBarycoord(e,t,i,r,Ei),Ei.x>=0&&Ei.y>=0&&Ei.x+Ei.y<=1}static getUV(e,t,i,r,s,o,l,u){return this.getBarycoord(e,t,i,r,Ei),u.set(0,0),u.addScaledVector(s,Ei.x),u.addScaledVector(o,Ei.y),u.addScaledVector(l,Ei.z),u}static isFrontFacing(e,t,i,r){return On.subVectors(i,t),Ti.subVectors(e,t),On.cross(Ti).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 On.subVectors(this.c,this.b),Ti.subVectors(this.a,this.b),On.cross(Ti).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return At.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return At.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,i,r,s){return At.getUV(e,this.a,this.b,this.c,t,i,r,s)}containsPoint(e){return At.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return At.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;ks.subVectors(r,i),zs.subVectors(s,i),Hh.subVectors(e,i);const u=ks.dot(Hh),c=zs.dot(Hh);if(u<=0&&c<=0)return t.copy(i);Wh.subVectors(e,r);const f=ks.dot(Wh),d=zs.dot(Wh);if(f>=0&&d<=f)return t.copy(r);const p=u*d-f*c;if(p<=0&&u>=0&&f<=0)return o=u/(u-f),t.copy(i).addScaledVector(ks,o);jh.subVectors(e,s);const v=ks.dot(jh),m=zs.dot(jh);if(m>=0&&v<=m)return t.copy(s);const h=v*c-u*m;if(h<=0&&c>=0&&m<=0)return l=c/(c-m),t.copy(i).addScaledVector(zs,l);const b=f*m-v*d;if(b<=0&&d-f>=0&&v-m>=0)return Rv.subVectors(s,r),l=(d-f)/(d-f+(v-m)),t.copy(r).addScaledVector(Rv,l);const y=1/(b+h+p);return o=h*y,l=p*y,t.copy(i).addScaledVector(ks,o).addScaledVector(zs,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let $R=0;class Ft extends tr{constructor(){super(),Object.defineProperty(this,"id",{value:$R++}),this.uuid=fn(),this.name="",this.type="Material",this.fog=!0,this.blending=_s,this.side=Ji,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=uh,this.blendDst=hh,this.blendEquation=Lr,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Tl,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vv,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Nl,this.stencilZFail=Nl,this.stencilZPass=Nl,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===rh;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!==_s&&(i.blending=this.blending),this.side!==Ji&&(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++}}Ft.prototype.isMaterial=!0;const Fv={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},Nn={h:0,s:0,l:0},Hl={h:0,s:0,l:0};function $h(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 Zh(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Xh(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}class Le{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=Ch(e,1),t=$t(t,0,1),i=$t(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=$h(s,r,e+1/3),this.g=$h(s,r,e),this.b=$h(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=Fv[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=Zh(e.r),this.g=Zh(e.g),this.b=Zh(e.b),this}copyLinearToSRGB(e){return this.r=Xh(e.r),this.g=Xh(e.g),this.b=Xh(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 ZR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Us(n,e){return new ZR[n](e)}let XR=0;const Sn=new Oe,Yh=new Xe,Gs=new q,mn=new ln,ra=new ln,Ut=new q;class ke extends tr{constructor(){super(),Object.defineProperty(this,"id",{value:XR++}),this.uuid=fn(),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(kv(e)>65535?$l:jl)(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 Bt().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 Sn.makeRotationFromQuaternion(e),this.applyMatrix4(Sn),this}rotateX(e){return Sn.makeRotationX(e),this.applyMatrix4(Sn),this}rotateY(e){return Sn.makeRotationY(e),this.applyMatrix4(Sn),this}rotateZ(e){return Sn.makeRotationZ(e),this.applyMatrix4(Sn),this}translate(e,t,i){return Sn.makeTranslation(e,t,i),this.applyMatrix4(Sn),this}scale(e,t,i){return Sn.makeScale(e,t,i),this.applyMatrix4(Sn),this}lookAt(e){return Yh.lookAt(e),Yh.updateMatrix(),this.applyMatrix4(Yh.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gs).negate(),this.translate(Gs.x,Gs.y,Gs.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 d=0,p=c.length;d0&&(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 ke().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=[],d=s[c];for(let p=0,v=d.length;p0){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(),Jh.copy(i.boundingSphere),Jh.applyMatrix4(s),e.ray.intersectsSphere(Jh)===!1)||(zv.copy(s).invert(),Hs.copy(e.ray).applyMatrix4(zv),i.boundingBox!==null&&Hs.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,d=i.attributes.uv,p=i.attributes.uv2,v=i.groups,m=i.drawRange;if(l!==null)if(Array.isArray(r))for(let h=0,b=v.length;ht.far?null:{distance:c,point:Ql.clone(),object:n}}function ec(n,e,t,i,r,s,o,l,u,c,f,d){ar.fromBufferAttribute(r,c),lr.fromBufferAttribute(r,f),cr.fromBufferAttribute(r,d);const p=n.morphTargetInfluences;if(e.morphTargets&&s&&p){Zl.set(0,0,0),Xl.set(0,0,0),Yl.set(0,0,0);for(let m=0,h=s.length;m0?1:-1,f.push(D.x,D.y,D.z),d.push(G/F),d.push(1-V/R),P+=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}}Li.prototype.isShaderMaterial=!0;class sa extends Xe{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe}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)}}sa.prototype.isCamera=!0;class Dt extends sa{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=Qo*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Dr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Qo*2*Math.atan(Math.tan(Dr*.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(Dr*.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}}Dt.prototype.isPerspectiveCamera=!0;const js=90,$s=1;class tc extends Xe{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 Dt(js,$s,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new q(1,0,0)),this.add(r);const s=new Dt(js,$s,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new q(-1,0,0)),this.add(s);const o=new Dt(js,$s,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new q(0,1,0)),this.add(o);const l=new Dt(js,$s,e,t);l.layers=this.layers,l.up.set(0,0,-1),l.lookAt(new q(0,-1,0)),this.add(l);const u=new Dt(js,$s,e,t);u.layers=this.layers,u.up.set(0,-1,0),u.lookAt(new q(0,0,1)),this.add(u);const c=new Dt(js,$s,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new q(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,d=e.getRenderTarget();e.xr.enabled=!1;const p=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=p,e.setRenderTarget(i,5),e.render(t,c),e.setRenderTarget(d),e.xr.enabled=f}}class Zs extends Mt{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:wi,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}}Zs.prototype.isCubeTexture=!0;class nc extends Pn{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 Zs(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:vt,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=dn,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 Ci(5,5,5),s=new Li({name:"CubemapFromEquirect",uniforms:Ws(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:xt,blending:yi});s.uniforms.tEquirect.value=t;const o=new St(r,s),l=t.minFilter;return t.minFilter===bi&&(t.minFilter=vt),new tc(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)}}nc.prototype.isWebGLCubeRenderTarget=!0;const td=new q,qR=new q,QR=new Bt;class Kn{constructor(e=new q(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=td.subVectors(i,t).cross(qR.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(td),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||QR.getNormalMatrix(e),r=this.coplanarPoint(td).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)}}Kn.prototype.isPlane=!0;const Xs=new Ai,ic=new q;class oa{constructor(e=new Kn,t=new Kn,i=new Kn,r=new Kn,s=new Kn,o=new Kn){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],d=i[7],p=i[8],v=i[9],m=i[10],h=i[11],b=i[12],y=i[13],g=i[14],w=i[15];return t[0].setComponents(l-r,d-u,h-p,w-b).normalize(),t[1].setComponents(l+r,d+u,h+p,w+b).normalize(),t[2].setComponents(l+s,d+c,h+v,w+y).normalize(),t[3].setComponents(l-s,d-c,h-v,w-y).normalize(),t[4].setComponents(l-o,d-f,h-m,w-g).normalize(),t[5].setComponents(l+o,d+f,h+m,w+g).normalize(),this}intersectsObject(e){const t=e.geometry;return t.boundingSphere===null&&t.computeBoundingSphere(),Xs.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Xs)}intersectsSprite(e){return Xs.center.set(0,0,0),Xs.radius=.7071067811865476,Xs.applyMatrix4(e.matrixWorld),this.intersectsSphere(Xs)}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,ic.y=r.normal.y>0?e.max.y:e.min.y,ic.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ic)<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 Gv(){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 e3(n,e){const t=e.isWebGL2,i=new WeakMap;function r(c,f){const d=c.array,p=c.usage,v=n.createBuffer();n.bindBuffer(f,v),n.bufferData(f,d,p),c.onUploadCallback();let m=5126;return d instanceof Float32Array?m=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c.isFloat16BufferAttribute?t?m=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):m=5123:d instanceof Int16Array?m=5122:d instanceof Uint32Array?m=5125:d instanceof Int32Array?m=5124:d instanceof Int8Array?m=5120:(d instanceof Uint8Array||d instanceof Uint8ClampedArray)&&(m=5121),{buffer:v,type:m,bytesPerElement:d.BYTES_PER_ELEMENT,version:c.version}}function s(c,f,d){const p=f.array,v=f.updateRange;n.bindBuffer(d,c),v.count===-1?n.bufferSubData(d,0,p):(t?n.bufferSubData(d,v.offset*p.BYTES_PER_ELEMENT,p,v.offset,v.count):n.bufferSubData(d,v.offset*p.BYTES_PER_ELEMENT,p.subarray(v.offset,v.offset+v.count)),v.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 p=i.get(c);(!p||p.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`,c3=`#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`,u3=`#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`,h3=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; #endif`,d3=`#if NUM_CLIPPING_PLANES > 0 varying vec3 vClipPosition; #endif`,f3=`#if NUM_CLIPPING_PLANES > 0 vClipPosition = - mvPosition.xyz; #endif`,p3=`#if defined( USE_COLOR_ALPHA ) diffuseColor *= vColor; #elif defined( USE_COLOR ) diffuseColor.rgb *= vColor; #endif`,m3=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) varying vec3 vColor; #endif`,g3=`#if defined( USE_COLOR_ALPHA ) varying vec4 vColor; #elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) varying vec3 vColor; #endif`,v3=`#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`,y3=`#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 ); }`,b3=`#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`,x3=`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`,w3=`#ifdef USE_DISPLACEMENTMAP uniform sampler2D displacementMap; uniform float displacementScale; uniform float displacementBias; #endif`,M3=`#ifdef USE_DISPLACEMENTMAP transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); #endif`,A3=`#ifdef USE_EMISSIVEMAP vec4 emissiveColor = texture2D( emissiveMap, vUv ); emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb; totalEmissiveRadiance *= emissiveColor.rgb; #endif`,S3=`#ifdef USE_EMISSIVEMAP uniform sampler2D emissiveMap; #endif`,_3="gl_FragColor = linearToOutputTexel( gl_FragColor );",T3=` 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 ); }`,E3=`#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`,C3=`#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`,L3=`#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`,R3=`#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`,F3=`#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`,P3=`#ifdef USE_FOG fogDepth = - mvPosition.z; #endif`,I3=`#ifdef USE_FOG varying float fogDepth; #endif`,O3=`#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`,N3=`#ifdef USE_FOG uniform vec3 fogColor; varying float fogDepth; #ifdef FOG_EXP2 uniform float fogDensity; #else uniform float fogNear; uniform float fogFar; #endif #endif`,B3=`#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 }`,D3=`#ifdef USE_LIGHTMAP vec4 lightMapTexel= texture2D( lightMap, vUv2 ); reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; #endif`,V3=`#ifdef USE_LIGHTMAP uniform sampler2D lightMap; uniform float lightMapIntensity; #endif`,k3=`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`,z3=`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`,U3=`#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`,G3=`ToonMaterial material; material.diffuseColor = diffuseColor.rgb;`,H3=`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)`,W3=`BlinnPhongMaterial material; material.diffuseColor = diffuseColor.rgb; material.specularColor = specular; material.specularShininess = shininess; material.specularStrength = specularStrength;`,j3=`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)`,$3=`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`,Z3=`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 ); }`,X3=` 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`,Y3=`#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`,J3=`#if defined( RE_IndirectDiffuse ) RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); #endif #if defined( RE_IndirectSpecular ) RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); #endif`,K3=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; #endif`,q3=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) uniform float logDepthBufFC; varying float vFragDepth; varying float vIsPerspective; #endif`,Q3=`#ifdef USE_LOGDEPTHBUF #ifdef USE_LOGDEPTHBUF_EXT varying float vFragDepth; varying float vIsPerspective; #else uniform float logDepthBufFC; #endif #endif`,eF=`#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`,tF=`#ifdef USE_MAP vec4 texelColor = texture2D( map, vUv ); texelColor = mapTexelToLinear( texelColor ); diffuseColor *= texelColor; #endif`,nF=`#ifdef USE_MAP uniform sampler2D map; #endif`,iF=`#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`,rF=`#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`,sF=`float metalnessFactor = metalness; #ifdef USE_METALNESSMAP vec4 texelMetalness = texture2D( metalnessMap, vUv ); metalnessFactor *= texelMetalness.b; #endif`,oF=`#ifdef USE_METALNESSMAP uniform sampler2D metalnessMap; #endif`,aF=`#ifdef USE_MORPHNORMALS objectNormal *= morphTargetBaseInfluence; objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; #endif`,lF=`#ifdef USE_MORPHTARGETS uniform float morphTargetBaseInfluence; #ifndef USE_MORPHNORMALS uniform float morphTargetInfluences[ 8 ]; #else uniform float morphTargetInfluences[ 4 ]; #endif #endif`,cF=`#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`,uF=`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;`,hF=`#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`,dF=`#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`,fF=`#ifdef CLEARCOAT vec3 clearcoatNormal = geometryNormal; #endif`,pF=`#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`,mF=`#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`,gF=`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 ); }`,vF=`#ifdef PREMULTIPLIED_ALPHA gl_FragColor.rgb *= gl_FragColor.a; #endif`,yF=`vec4 mvPosition = vec4( transformed, 1.0 ); #ifdef USE_INSTANCING mvPosition = instanceMatrix * mvPosition; #endif mvPosition = modelViewMatrix * mvPosition; gl_Position = projectionMatrix * mvPosition;`,bF=`#ifdef DITHERING gl_FragColor.rgb = dithering( gl_FragColor.rgb ); #endif`,xF=`#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`,wF=`float roughnessFactor = roughness; #ifdef USE_ROUGHNESSMAP vec4 texelRoughness = texture2D( roughnessMap, vUv ); roughnessFactor *= texelRoughness.g; #endif`,MF=`#ifdef USE_ROUGHNESSMAP uniform sampler2D roughnessMap; #endif`,AF=`#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`,SF=`#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`,_F=`#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`,TF=`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; }`,EF=`#ifdef USE_SKINNING mat4 boneMatX = getBoneMatrix( skinIndex.x ); mat4 boneMatY = getBoneMatrix( skinIndex.y ); mat4 boneMatZ = getBoneMatrix( skinIndex.z ); mat4 boneMatW = getBoneMatrix( skinIndex.w ); #endif`,CF=`#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`,LF=`#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`,RF=`#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`,FF=`float specularStrength; #ifdef USE_SPECULARMAP vec4 texelSpecular = texture2D( specularMap, vUv ); specularStrength = texelSpecular.r; #else specularStrength = 1.0; #endif`,PF=`#ifdef USE_SPECULARMAP uniform sampler2D specularMap; #endif`,IF=`#if defined( TONE_MAPPING ) gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); #endif`,OF=`#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; }`,NF=`#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`,BF=`#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`,DF=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) varying vec2 vUv; #endif`,VF=`#ifdef USE_UV #ifdef UVS_VERTEX_ONLY vec2 vUv; #else varying vec2 vUv; #endif uniform mat3 uvTransform; #endif`,kF=`#ifdef USE_UV vUv = ( uvTransform * vec3( uv, 1 ) ).xy; #endif`,zF=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) varying vec2 vUv2; #endif`,UF=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) attribute vec2 uv2; varying vec2 vUv2; uniform mat3 uv2Transform; #endif`,GF=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; #endif`,HF=`#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`,WF=`uniform sampler2D t2D; varying vec2 vUv; void main() { vec4 texColor = texture2D( t2D, vUv ); gl_FragColor = mapTexelToLinear( texColor ); #include #include }`,jF=`varying vec2 vUv; uniform mat3 uvTransform; void main() { vUv = ( uvTransform * vec3( uv, 1 ) ).xy; gl_Position = vec4( position.xy, 1.0, 1.0 ); }`,$F=`#include uniform float opacity; varying vec3 vWorldDirection; #include void main() { vec3 vReflect = vWorldDirection; #include gl_FragColor = envColor; gl_FragColor.a *= opacity; #include #include }`,ZF=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include gl_Position.z = gl_Position.w; }`,XF=`#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 }`,YF=`#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; }`,JF=`#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 ); }`,KF=`#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; }`,qF=`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 }`,QF=`varying vec3 vWorldDirection; #include void main() { vWorldDirection = transformDirection( position, modelMatrix ); #include #include }`,eP=`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 }`,tP=`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 }`,nP=`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 }`,iP=`#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 }`,rP=`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 }`,sP=`#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 }`,oP=`#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 }`,aP=`#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; }`,lP=`#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 }`,cP=`#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 }`,uP=`#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 }`,hP=`#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 }`,dP=`#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 }`,fP=`#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 }`,pP=`#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 ); }`,mP=`#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 }`,gP=`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 }`,vP=`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 }`,yP=`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 }`,bP=`#include #include #include void main() { #include #include #include #include #include #include #include #include #include #include }`,xP=`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 }`,wP=`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 Ke={alphamap_fragment:t3,alphamap_pars_fragment:n3,alphatest_fragment:i3,aomap_fragment:r3,aomap_pars_fragment:s3,begin_vertex:o3,beginnormal_vertex:a3,bsdfs:l3,bumpmap_pars_fragment:c3,clipping_planes_fragment:u3,clipping_planes_pars_fragment:h3,clipping_planes_pars_vertex:d3,clipping_planes_vertex:f3,color_fragment:p3,color_pars_fragment:m3,color_pars_vertex:g3,color_vertex:v3,common:y3,cube_uv_reflection_fragment:b3,defaultnormal_vertex:x3,displacementmap_pars_vertex:w3,displacementmap_vertex:M3,emissivemap_fragment:A3,emissivemap_pars_fragment:S3,encodings_fragment:_3,encodings_pars_fragment:T3,envmap_fragment:E3,envmap_common_pars_fragment:C3,envmap_pars_fragment:L3,envmap_pars_vertex:R3,envmap_physical_pars_fragment:U3,envmap_vertex:F3,fog_vertex:P3,fog_pars_vertex:I3,fog_fragment:O3,fog_pars_fragment:N3,gradientmap_pars_fragment:B3,lightmap_fragment:D3,lightmap_pars_fragment:V3,lights_lambert_vertex:k3,lights_pars_begin:z3,lights_toon_fragment:G3,lights_toon_pars_fragment:H3,lights_phong_fragment:W3,lights_phong_pars_fragment:j3,lights_physical_fragment:$3,lights_physical_pars_fragment:Z3,lights_fragment_begin:X3,lights_fragment_maps:Y3,lights_fragment_end:J3,logdepthbuf_fragment:K3,logdepthbuf_pars_fragment:q3,logdepthbuf_pars_vertex:Q3,logdepthbuf_vertex:eF,map_fragment:tF,map_pars_fragment:nF,map_particle_fragment:iF,map_particle_pars_fragment:rF,metalnessmap_fragment:sF,metalnessmap_pars_fragment:oF,morphnormal_vertex:aF,morphtarget_pars_vertex:lF,morphtarget_vertex:cF,normal_fragment_begin:uF,normal_fragment_maps:hF,normalmap_pars_fragment:dF,clearcoat_normal_fragment_begin:fF,clearcoat_normal_fragment_maps:pF,clearcoat_pars_fragment:mF,packing:gF,premultiplied_alpha_fragment:vF,project_vertex:yF,dithering_fragment:bF,dithering_pars_fragment:xF,roughnessmap_fragment:wF,roughnessmap_pars_fragment:MF,shadowmap_pars_fragment:AF,shadowmap_pars_vertex:SF,shadowmap_vertex:_F,shadowmask_pars_fragment:TF,skinbase_vertex:EF,skinning_pars_vertex:CF,skinning_vertex:LF,skinnormal_vertex:RF,specularmap_fragment:FF,specularmap_pars_fragment:PF,tonemapping_fragment:IF,tonemapping_pars_fragment:OF,transmission_fragment:NF,transmission_pars_fragment:BF,uv_pars_fragment:DF,uv_pars_vertex:VF,uv_vertex:kF,uv2_pars_fragment:zF,uv2_pars_vertex:UF,uv2_vertex:GF,worldpos_vertex:HF,background_frag:WF,background_vert:jF,cube_frag:$F,cube_vert:ZF,depth_frag:XF,depth_vert:YF,distanceRGBA_frag:JF,distanceRGBA_vert:KF,equirect_frag:qF,equirect_vert:QF,linedashed_frag:eP,linedashed_vert:tP,meshbasic_frag:nP,meshbasic_vert:iP,meshlambert_frag:rP,meshlambert_vert:sP,meshmatcap_frag:oP,meshmatcap_vert:aP,meshtoon_frag:lP,meshtoon_vert:cP,meshphong_frag:uP,meshphong_vert:hP,meshphysical_frag:dP,meshphysical_vert:fP,normal_frag:pP,normal_vert:mP,points_frag:gP,points_vert:vP,shadow_frag:yP,shadow_vert:bP,sprite_frag:xP,sprite_vert:wP},Re={common:{diffuse:{value:new Le(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Bt},uv2Transform:{value:new Bt},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 Ae(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 Le(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 Le(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bt}},sprite:{diffuse:{value:new Le(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bt}}},Bn={basic:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.fog]),vertexShader:Ke.meshbasic_vert,fragmentShader:Ke.meshbasic_frag},lambert:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.fog,Re.lights,{emissive:{value:new Le(0)}}]),vertexShader:Ke.meshlambert_vert,fragmentShader:Ke.meshlambert_frag},phong:{uniforms:Kt([Re.common,Re.specularmap,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,Re.lights,{emissive:{value:new Le(0)},specular:{value:new Le(1118481)},shininess:{value:30}}]),vertexShader:Ke.meshphong_vert,fragmentShader:Ke.meshphong_frag},standard:{uniforms:Kt([Re.common,Re.envmap,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.roughnessmap,Re.metalnessmap,Re.fog,Re.lights,{emissive:{value:new Le(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag},toon:{uniforms:Kt([Re.common,Re.aomap,Re.lightmap,Re.emissivemap,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.gradientmap,Re.fog,Re.lights,{emissive:{value:new Le(0)}}]),vertexShader:Ke.meshtoon_vert,fragmentShader:Ke.meshtoon_frag},matcap:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,Re.fog,{matcap:{value:null}}]),vertexShader:Ke.meshmatcap_vert,fragmentShader:Ke.meshmatcap_frag},points:{uniforms:Kt([Re.points,Re.fog]),vertexShader:Ke.points_vert,fragmentShader:Ke.points_frag},dashed:{uniforms:Kt([Re.common,Re.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ke.linedashed_vert,fragmentShader:Ke.linedashed_frag},depth:{uniforms:Kt([Re.common,Re.displacementmap]),vertexShader:Ke.depth_vert,fragmentShader:Ke.depth_frag},normal:{uniforms:Kt([Re.common,Re.bumpmap,Re.normalmap,Re.displacementmap,{opacity:{value:1}}]),vertexShader:Ke.normal_vert,fragmentShader:Ke.normal_frag},sprite:{uniforms:Kt([Re.sprite,Re.fog]),vertexShader:Ke.sprite_vert,fragmentShader:Ke.sprite_frag},background:{uniforms:{uvTransform:{value:new Bt},t2D:{value:null}},vertexShader:Ke.background_vert,fragmentShader:Ke.background_frag},cube:{uniforms:Kt([Re.envmap,{opacity:{value:1}}]),vertexShader:Ke.cube_vert,fragmentShader:Ke.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ke.equirect_vert,fragmentShader:Ke.equirect_frag},distanceRGBA:{uniforms:Kt([Re.common,Re.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ke.distanceRGBA_vert,fragmentShader:Ke.distanceRGBA_frag},shadow:{uniforms:Kt([Re.lights,Re.fog,{color:{value:new Le(0)},opacity:{value:1}}]),vertexShader:Ke.shadow_vert,fragmentShader:Ke.shadow_frag}};Bn.physical={uniforms:Kt([Bn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Le(0)},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Le(0)}}]),vertexShader:Ke.meshphysical_vert,fragmentShader:Ke.meshphysical_frag};function MP(n,e,t,i,r){const s=new Le(0);let o=0,l,u,c=null,f=0,d=null;function p(m,h){let b=!1,y=h.isScene===!0?h.background:null;y&&y.isTexture&&(y=e.get(y));const g=n.xr,w=g.getSession&&g.getSession();w&&w.environmentBlendMode==="additive"&&(y=null),y===null?v(s,o):y&&y.isColor&&(v(y,1),b=!0),(n.autoClear||b)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),y&&(y.isCubeTexture||y.mapping===Ts)?(u===void 0&&(u=new St(new Ci(1,1,1),new Li({name:"BackgroundCubeMaterial",uniforms:Ws(Bn.cube.uniforms),vertexShader:Bn.cube.vertexShader,fragmentShader:Bn.cube.fragmentShader,side:xt,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(A,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y._needsFlipEnvMap?-1:1,(c!==y||f!==y.version||d!==n.toneMapping)&&(u.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new St(new Gr(2,2),new Li({name:"BackgroundMaterial",uniforms:Ws(Bn.background.uniforms),vertexShader:Bn.background.vertexShader,fragmentShader:Bn.background.fragmentShader,side:Ji,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=y,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(c!==y||f!==y.version||d!==n.toneMapping)&&(l.material.needsUpdate=!0,c=y,f=y.version,d=n.toneMapping),m.unshift(l,l.geometry,l.material,0,0,null))}function v(m,h){t.buffers.color.setClear(m.r,m.g,m.b,h,r)}return{getClearColor:function(){return s},setClearColor:function(m,h=1){s.set(m),o=h,v(s,o)},getClearAlpha:function(){return o},setClearAlpha:function(m){o=m,v(s,o)},render:p}}function AP(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=h(null);let c=u;function f(C,L,I,x,P){let B=!1;if(o){const D=m(x,I,L);c!==D&&(c=D,p(c.object)),B=b(x,P),B&&y(x,P)}else{const D=L.wireframe===!0;(c.geometry!==x.id||c.program!==I.id||c.wireframe!==D)&&(c.geometry=x.id,c.program=I.id,c.wireframe=D,B=!0)}C.isInstancedMesh===!0&&(B=!0),P!==null&&t.update(P,34963),B&&(F(C,L,I,x),P!==null&&n.bindBuffer(34963,t.get(P).buffer))}function d(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function p(C){return i.isWebGL2?n.bindVertexArray(C):s.bindVertexArrayOES(C)}function v(C){return i.isWebGL2?n.deleteVertexArray(C):s.deleteVertexArrayOES(C)}function m(C,L,I){const x=I.wireframe===!0;let P=l[C.id];P===void 0&&(P={},l[C.id]=P);let B=P[L.id];B===void 0&&(B={},P[L.id]=B);let D=B[x];return D===void 0&&(D=h(d()),B[x]=D),D}function h(C){const L=[],I=[],x=[];for(let P=0;P=0){const G=P[V];if(G!==void 0){const Y=G.normalized,te=G.itemSize,oe=t.get(G);if(oe===void 0)continue;const ie=oe.buffer,ae=oe.type,W=oe.bytesPerElement;if(G.isInterleavedBufferAttribute){const $=G.data,j=$.stride,re=G.offset;$&&$.isInstancedInterleavedBuffer?(A(k,$.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=$.meshPerAttribute*$.count)):w(k),n.bindBuffer(34962,ie),M(k,te,ae,Y,j*W,re*W)}else G.isInstancedBufferAttribute?(A(k,G.meshPerAttribute),x._maxInstanceCount===void 0&&(x._maxInstanceCount=G.meshPerAttribute*G.count)):w(k),n.bindBuffer(34962,ie),M(k,te,ae,Y,0,0)}else if(V==="instanceMatrix"){const Y=t.get(C.instanceMatrix);if(Y===void 0)continue;const te=Y.buffer,oe=Y.type;A(k+0,1),A(k+1,1),A(k+2,1),A(k+3,1),n.bindBuffer(34962,te),n.vertexAttribPointer(k+0,4,oe,!1,64,0),n.vertexAttribPointer(k+1,4,oe,!1,64,16),n.vertexAttribPointer(k+2,4,oe,!1,64,32),n.vertexAttribPointer(k+3,4,oe,!1,64,48)}else if(V==="instanceColor"){const Y=t.get(C.instanceColor);if(Y===void 0)continue;const te=Y.buffer,oe=Y.type;A(k,1),n.bindBuffer(34962,te),n.vertexAttribPointer(k,3,oe,!1,12,0)}else if(D!==void 0){const Y=D[V];if(Y!==void 0)switch(Y.length){case 2:n.vertexAttrib2fv(k,Y);break;case 3:n.vertexAttrib3fv(k,Y);break;case 4:n.vertexAttrib4fv(k,Y);break;default:n.vertexAttrib1fv(k,Y)}}}}S()}function R(){E();for(const C in l){const L=l[C];for(const I in L){const x=L[I];for(const P in x)v(x[P].object),delete x[P];delete L[I]}delete l[C]}}function _(C){if(l[C.id]===void 0)return;const L=l[C.id];for(const I in L){const x=L[I];for(const P in x)v(x[P].object),delete x[P];delete L[I]}delete l[C.id]}function O(C){for(const L in l){const I=l[L];if(I[C.id]===void 0)continue;const x=I[C.id];for(const P in x)v(x[P].object),delete x[P];delete I[C.id]}}function E(){T(),c!==u&&(c=u,p(c.object))}function T(){u.geometry=null,u.program=null,u.wireframe=!1}return{setup:f,reset:E,resetDefaultState:T,dispose:R,releaseStatesOfGeometry:_,releaseStatesOfProgram:O,initAttributes:g,enableAttribute:w,disableUnusedAttributes:S}}function SP(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,d){if(d===0)return;let p,v;if(r)p=n,v="drawArraysInstanced";else if(p=e.get("ANGLE_instanced_arrays"),v="drawArraysInstancedANGLE",p===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}p[v](s,c,f,d),t.update(f,s,d)}this.setMode=o,this.render=l,this.renderInstances=u}function _P(n,e,t){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");i=n.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function s(F){if(F==="highp"){if(n.getShaderPrecisionFormat(35633,36338).precision>0&&n.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";F="mediump"}return F==="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,d=n.getParameter(34930),p=n.getParameter(35660),v=n.getParameter(3379),m=n.getParameter(34076),h=n.getParameter(34921),b=n.getParameter(36347),y=n.getParameter(36348),g=n.getParameter(36349),w=p>0,A=o||e.has("OES_texture_float"),S=w&&A,M=o?n.getParameter(36183):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:r,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:p,maxTextureSize:v,maxCubemapSize:m,maxAttributes:h,maxVertexUniforms:b,maxVaryings:y,maxFragmentUniforms:g,vertexTextures:w,floatFragmentTextures:A,floatVertexTextures:S,maxSamples:M}}function TP(n){const e=this;let t=null,i=0,r=!1,s=!1;const o=new Kn,l=new Bt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p,v){const m=d.length!==0||p||i!==0||r;return r=p,t=f(d,v,0),i=d.length,m},this.beginShadows=function(){s=!0,f(null)},this.endShadows=function(){s=!1,c()},this.setState=function(d,p,v){const m=d.clippingPlanes,h=d.clipIntersection,b=d.clipShadows,y=n.get(d);if(!r||m===null||m.length===0||s&&!b)s?f(null):c();else{const g=s?0:i,w=g*4;let A=y.clippingState||null;u.value=A,A=f(m,p,w,v);for(let S=0;S!==w;++S)A[S]=t[S];y.clippingState=A,this.numIntersection=h?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(d,p,v,m){const h=d!==null?d.length:0;let b=null;if(h!==0){if(b=u.value,m!==!0||b===null){const y=v+h*4,g=p.matrixWorldInverse;l.getNormalMatrix(g),(b===null||b.length0){const c=n.getRenderTarget(),f=new nc(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 CP(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 LP(n,e,t,i){const r={},s=new WeakMap;function o(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const m in p.attributes)e.remove(p.attributes[m]);p.removeEventListener("dispose",o),delete r[p.id];const v=s.get(p);v&&(e.remove(v),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(d,p){return r[p.id]===!0||(p.addEventListener("dispose",o),r[p.id]=!0,t.memory.geometries++),p}function u(d){const p=d.attributes;for(const m in p)e.update(p[m],34962);const v=d.morphAttributes;for(const m in v){const h=v[m];for(let b=0,y=h.length;b65535?$l:jl)(p,1);b.version=h;const y=s.get(d);y&&e.remove(y),s.set(d,b)}function f(d){const p=s.get(d);if(p){const v=d.index;v!==null&&p.version0)return n;const r=e*t;let s=jv[r];if(s===void 0&&(s=new Float32Array(r),jv[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 nn(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(la).join(` `)}function LI(n){const e=[];for(const t in n){const i=n[t];i!==!1&&e.push("#define "+t+" "+i)}return e.join(` `)}function RI(n,e){const t={},i=n.getProgramParameter(e,35721);for(let r=0;r/gm;function sd(n){return n.replace(FI,PI)}function PI(n,e){const t=Ke[e];if(t===void 0)throw new Error("Can not resolve #include <"+e+">");return sd(t)}const II=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,OI=/#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 sy(n){return n.replace(OI,oy).replace(II,NI)}function NI(n,e,t,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),oy(n,e,t,i)}function oy(n,e,t,i){let r="";for(let s=parseInt(e);s0?n.gammaFactor:1,v=t.isWebGL2?"":CI(t),m=LI(s),h=r.createProgram();let b,y,g=t.glslVersion?"#version "+t.glslVersion+` `:"";t.isRawShaderMaterial?(b=[m].filter(la).join(` `),b.length>0&&(b+=` `),y=[v,m].filter(la).join(` `),y.length>0&&(y+=` `)):(b=[ay(t),"#define SHADER_NAME "+t.shaderName,m,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#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(la).join(` `),y=[v,ay(t),"#define SHADER_NAME "+t.shaderName,m,t.alphaTest?"#define ALPHATEST "+t.alphaTest+(t.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,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 "+d:"",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!==qi?"#define TONE_MAPPING":"",t.toneMapping!==qi?Ke.tonemapping_pars_fragment:"",t.toneMapping!==qi?EI("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",Ke.encodings_pars_fragment,t.map?aa("mapTexelToLinear",t.mapEncoding):"",t.matcap?aa("matcapTexelToLinear",t.matcapEncoding):"",t.envMap?aa("envMapTexelToLinear",t.envMapEncoding):"",t.emissiveMap?aa("emissiveMapTexelToLinear",t.emissiveMapEncoding):"",t.lightMap?aa("lightMapTexelToLinear",t.lightMapEncoding):"",TI("linearToOutputTexel",t.outputEncoding),t.depthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` `].filter(la).join(` `)),o=sd(o),o=iy(o,t),o=ry(o,t),l=sd(l),l=iy(l,t),l=ry(l,t),o=sy(o),l=sy(l),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(g=`#version 300 es `,b=["#define attribute in","#define varying out","#define texture2D texture"].join(` `)+` `+b,y=["#define varying in",t.glslVersion===Eh?"":"out highp vec4 pc_fragColor;",t.glslVersion===Eh?"":"#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(` `)+` `+y);const w=g+b+o,A=g+y+l,S=ey(r,35633,w),M=ey(r,35632,A);if(r.attachShader(h,S),r.attachShader(h,M),t.index0AttributeName!==void 0?r.bindAttribLocation(h,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(h,0,"position"),r.linkProgram(h),n.debug.checkShaderErrors){const _=r.getProgramInfoLog(h).trim(),O=r.getShaderInfoLog(S).trim(),E=r.getShaderInfoLog(M).trim();let T=!0,C=!0;if(r.getProgramParameter(h,35714)===!1){T=!1;const L=ny(r,S,"vertex"),I=ny(r,M,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(h,35715),"gl.getProgramInfoLog",_,L,I)}else _!==""?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",_):(O===""||E==="")&&(C=!1);C&&(this.diagnostics={runnable:T,programLog:_,vertexShader:{log:O,prefix:b},fragmentShader:{log:E,prefix:y}})}r.deleteShader(S),r.deleteShader(M);let F;this.getUniforms=function(){return F===void 0&&(F=new ur(r,h)),F};let R;return this.getAttributes=function(){return R===void 0&&(R=RI(r,h)),R},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(h),this.program=void 0},this.name=t.shaderName,this.id=SI++,this.cacheKey=e,this.usedTimes=1,this.program=h,this.vertexShader=S,this.fragmentShader=M,this}function UI(n,e,t,i,r,s){const o=[],l=i.isWebGL2,u=i.logarithmicDepthBuffer,c=i.floatVertexTextures,f=i.maxVertexUniforms,d=i.vertexTextures;let p=i.precision;const v={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"},m=["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 h(M){const R=M.skeleton.bones;if(c)return 1024;{const O=Math.floor((f-20)/4),E=Math.min(O,R.length);return E0,maxBones:I,useVertexTexture:c,morphTargets:M.morphTargets,morphNormals:M.morphNormals,numDirLights:F.directional.length,numPointLights:F.point.length,numSpotLights:F.spot.length,numRectAreaLights:F.rectArea.length,numHemiLights:F.hemi.length,numDirLightShadows:F.directionalShadowMap.length,numPointLightShadows:F.pointShadowMap.length,numSpotLightShadows:F.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:M.dithering,shadowMapEnabled:n.shadowMap.enabled&&R.length>0,shadowMapType:n.shadowMap.type,toneMapping:M.toneMapped?n.toneMapping:qi,physicallyCorrectLights:n.physicallyCorrectLights,premultipliedAlpha:M.premultipliedAlpha,alphaTest:M.alphaTest,doubleSided:M.side===Ki,flipSided:M.side===xt,depthPacking:M.depthPacking!==void 0?M.depthPacking:!1,index0AttributeName:M.index0AttributeName,extensionDerivatives:M.extensions&&M.extensions.derivatives,extensionFragDepth:M.extensions&&M.extensions.fragDepth,extensionDrawBuffers:M.extensions&&M.extensions.drawBuffers,extensionShaderTextureLOD:M.extensions&&M.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:M.customProgramCacheKey()}}function g(M){const F=[];if(M.shaderID?F.push(M.shaderID):(F.push(M.fragmentShader),F.push(M.vertexShader)),M.defines!==void 0)for(const R in M.defines)F.push(R),F.push(M.defines[R]);if(M.isRawShaderMaterial===!1){for(let R=0;R0?r.push(w):h.transparent===!0?s.push(w):i.push(w)}function f(v,m,h,b,y,g){const w=u(v,m,h,b,y,g);h.transmission>0?r.unshift(w):h.transparent===!0?s.unshift(w):i.unshift(w)}function d(v,m){i.length>1&&i.sort(v||HI),r.length>1&&r.sort(m||ly),s.length>1&&s.sort(m||ly)}function p(){for(let v=t,m=e.length;v=e.get(r).length?(o=new cy(n),e.get(r).push(o)):o=e.get(r)[s],o}function i(){e=new WeakMap}return{get:t,dispose:i}}function jI(){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 q,color:new Le};break;case"SpotLight":t={position:new q,direction:new q,color:new Le,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new q,color:new Le,distance:0,decay:0};break;case"HemisphereLight":t={direction:new q,skyColor:new Le,groundColor:new Le};break;case"RectAreaLight":t={color:new Le,position:new q,halfWidth:new q,halfHeight:new q};break}return n[e.id]=t,t}}}function $I(){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 Ae};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[e.id]=t,t}}}let ZI=0;function XI(n,e){return(e.castShadow?1:0)-(n.castShadow?1:0)}function YI(n,e){const t=new jI,i=$I(),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 q);const s=new q,o=new Oe,l=new Oe;function u(f){let d=0,p=0,v=0;for(let F=0;F<9;F++)r.probe[F].set(0,0,0);let m=0,h=0,b=0,y=0,g=0,w=0,A=0,S=0;f.sort(XI);for(let F=0,R=f.length;F0&&(e.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Re.LTC_FLOAT_1,r.rectAreaLTC2=Re.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Re.LTC_HALF_1,r.rectAreaLTC2=Re.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=d,r.ambient[1]=p,r.ambient[2]=v;const M=r.hash;(M.directionalLength!==m||M.pointLength!==h||M.spotLength!==b||M.rectAreaLength!==y||M.hemiLength!==g||M.numDirectionalShadows!==w||M.numPointShadows!==A||M.numSpotShadows!==S)&&(r.directional.length=m,r.spot.length=b,r.rectArea.length=y,r.point.length=h,r.hemi.length=g,r.directionalShadow.length=w,r.directionalShadowMap.length=w,r.pointShadow.length=A,r.pointShadowMap.length=A,r.spotShadow.length=S,r.spotShadowMap.length=S,r.directionalShadowMatrix.length=w,r.pointShadowMatrix.length=A,r.spotShadowMatrix.length=S,M.directionalLength=m,M.pointLength=h,M.spotLength=b,M.rectAreaLength=y,M.hemiLength=g,M.numDirectionalShadows=w,M.numPointShadows=A,M.numSpotShadows=S,r.version=ZI++)}function c(f,d){let p=0,v=0,m=0,h=0,b=0;const y=d.matrixWorldInverse;for(let g=0,w=f.length;g=t.get(s).length?(l=new uy(n,e),t.get(s).push(l)):l=t.get(s)[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}class rc extends Ft{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=pv,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}}rc.prototype.isMeshDepthMaterial=!0;class sc extends Ft{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new q,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}}sc.prototype.isMeshDistanceMaterial=!0;var KI=`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 ) ); }`,qI=`void main() { gl_Position = vec4( position, 1.0 ); }`;function hy(n,e,t){let i=new oa;const r=new Ae,s=new Ae,o=new it,l=[],u=[],c={},f=t.maxTextureSize,d={0:xt,1:Ji,2:Ki},p=new Li({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:qI,fragmentShader:KI}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const h=new St(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ih,this.render=function(M,F,R){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||M.length===0)return;const _=n.getRenderTarget(),O=n.getActiveCubeFace(),E=n.getActiveMipmapLevel(),T=n.state;T.setBlending(yi),T.buffers.color.setClear(1,1,1,1),T.buffers.depth.setTest(!0),T.setScissorTest(!1);for(let C=0,L=M.length;Cf||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/P.x),r.x=s.x*P.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/P.y),r.y=s.y*P.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ss){const D={minFilter:vt,magFilter:vt,format:dn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.mapPass=new Pn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:wt,magFilter:wt,format:dn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D0),C=L(x)}else C=I;if(n.localClippingEnabled&&R.clipShadows===!0&&R.clippingPlanes.length!==0){const x=C.uuid,P=R.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[P];D===void 0&&(D=C.clone(),B[P]=D),C=D}return C.visible=R.visible,C.wireframe=R.wireframe,T===Ss?C.side=R.shadowSide!==null?R.shadowSide:R.side:C.side=R.shadowSide!==null?R.shadowSide:d[R.side],C.clipShadows=R.clipShadows,C.clippingPlanes=R.clippingPlanes,C.clipIntersection=R.clipIntersection,C.wireframeLinewidth=R.wireframeLinewidth,C.linewidth=R.linewidth,_.isPointLight===!0&&C.isMeshDistanceMaterial===!0&&(C.referencePosition.setFromMatrixPosition(_.matrixWorld),C.nearDistance=O,C.farDistance=E),C}function S(M,F,R,_,O){if(M.visible===!1)return;if(M.layers.test(F.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&O===Ss)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,M.matrixWorld);const C=e.update(M),L=M.material;if(Array.isArray(L)){const I=C.groups;for(let x=0,P=I.length;x=1):I.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),C=L>=2);let x=null,P={};const B=n.getParameter(3088),D=n.getParameter(2978),V=new it().fromArray(B),k=new it().fromArray(D);function G(ne,de,ve){const Ee=new Uint8Array(4),_e=n.createTexture();n.bindTexture(ne,_e),n.texParameteri(ne,10241,9728),n.texParameteri(ne,10240,9728);for(let Ne=0;NeX||U.height>X)&&(ee=X/Math.max(U.width,U.height)),ee<1||N===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ue=N?bv:Math.floor,me=ue(ee*U.width),be=ue(ee*U.height);v===void 0&&(v=h(me,be));const ce=Z?h(me,be):v;return ce.width=me,ce.height=be,ce.getContext("2d").drawImage(U,0,0,me,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+me+"x"+be+")."),ce}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function y(U){return Lh(U.width)&&Lh(U.height)}function g(U){return l?!1:U.wrapS!==zt||U.wrapT!==zt||U.minFilter!==wt&&U.minFilter!==vt}function w(U,N){return U.generateMipmaps&&N&&U.minFilter!==wt&&U.minFilter!==vt}function A(U,N,Z,X,ee=1){n.generateMipmap(U);const ue=i.get(N);ue.__maxMipLevel=Math.log2(Math.max(Z,X,ee))}function S(U,N,Z){if(l===!1)return N;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let X=N;return N===6403&&(Z===5126&&(X=33326),Z===5131&&(X=33325),Z===5121&&(X=33321)),N===6407&&(Z===5126&&(X=34837),Z===5131&&(X=34843),Z===5121&&(X=32849)),N===6408&&(Z===5126&&(X=34836),Z===5131&&(X=34842),Z===5121&&(X=32856)),(X===33325||X===33326||X===34842||X===34836)&&e.get("EXT_color_buffer_float"),X}function M(U){return U===wt||U===Xo||U===Yo?9728:9729}function F(U){const N=U.target;N.removeEventListener("dispose",F),_(N),N.isVideoTexture&&p.delete(N),o.memory.textures--}function R(U){const N=U.target;N.removeEventListener("dispose",R),O(N)}function _(U){const N=i.get(U);N.__webglInit!==void 0&&(n.deleteTexture(N.__webglTexture),i.remove(U))}function O(U){const N=U.texture,Z=i.get(U),X=i.get(N);if(U){if(X.__webglTexture!==void 0&&(n.deleteTexture(X.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ee=0;ee<6;ee++)n.deleteFramebuffer(Z.__webglFramebuffer[ee]),Z.__webglDepthbuffer&&n.deleteRenderbuffer(Z.__webglDepthbuffer[ee]);else n.deleteFramebuffer(Z.__webglFramebuffer),Z.__webglDepthbuffer&&n.deleteRenderbuffer(Z.__webglDepthbuffer),Z.__webglMultisampledFramebuffer&&n.deleteFramebuffer(Z.__webglMultisampledFramebuffer),Z.__webglColorRenderbuffer&&n.deleteRenderbuffer(Z.__webglColorRenderbuffer),Z.__webglDepthRenderbuffer&&n.deleteRenderbuffer(Z.__webglDepthRenderbuffer);if(U.isWebGLMultipleRenderTargets)for(let ee=0,ue=N.length;ee=u&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+u),E+=1,U}function L(U,N){const Z=i.get(U);if(U.isVideoTexture&&z(U),U.version>0&&Z.__version!==U.version){const X=U.image;if(X===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(X.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(Z,U,N);return}}t.activeTexture(33984+N),t.bindTexture(3553,Z.__webglTexture)}function I(U,N){const Z=i.get(U);if(U.version>0&&Z.__version!==U.version){G(Z,U,N);return}t.activeTexture(33984+N),t.bindTexture(35866,Z.__webglTexture)}function x(U,N){const Z=i.get(U);if(U.version>0&&Z.__version!==U.version){G(Z,U,N);return}t.activeTexture(33984+N),t.bindTexture(32879,Z.__webglTexture)}function P(U,N){const Z=i.get(U);if(U.version>0&&Z.__version!==U.version){Y(Z,U,N);return}t.activeTexture(33984+N),t.bindTexture(34067,Z.__webglTexture)}const B={[Qi]:10497,[zt]:33071,[Es]:33648},D={[wt]:9728,[Xo]:9984,[Yo]:9986,[vt]:9729,[Rl]:9985,[bi]:9987};function V(U,N,Z){if(Z?(n.texParameteri(U,10242,B[N.wrapS]),n.texParameteri(U,10243,B[N.wrapT]),(U===32879||U===35866)&&n.texParameteri(U,32882,B[N.wrapR]),n.texParameteri(U,10240,D[N.magFilter]),n.texParameteri(U,10241,D[N.minFilter])):(n.texParameteri(U,10242,33071),n.texParameteri(U,10243,33071),(U===32879||U===35866)&&n.texParameteri(U,32882,33071),(N.wrapS!==zt||N.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,10240,M(N.magFilter)),n.texParameteri(U,10241,M(N.minFilter)),N.minFilter!==wt&&N.minFilter!==vt&&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 X=e.get("EXT_texture_filter_anisotropic");if(N.type===xi&&e.has("OES_texture_float_linear")===!1||l===!1&&N.type===Fr&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(U,X.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function k(U,N){U.__webglInit===void 0&&(U.__webglInit=!0,N.addEventListener("dispose",F),U.__webglTexture=n.createTexture(),o.memory.textures++)}function G(U,N,Z){let X=3553;N.isDataTexture2DArray&&(X=35866),N.isDataTexture3D&&(X=32879),k(U,N),t.activeTexture(33984+Z),t.bindTexture(X,U.__webglTexture),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const ee=g(N)&&y(N.image)===!1,ue=b(N.image,ee,!1,f),me=y(ue)||l,be=s.convert(N.format);let ce=s.convert(N.type),ge=S(N.internalFormat,be,ce);V(X,N,me);let ne;const de=N.mipmaps;if(N.isDepthTexture)ge=6402,l?N.type===xi?ge=36012:N.type===Ko?ge=33190:N.type===Cs?ge=35056:ge=33189:N.type===xi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===Pr&&ge===6402&&N.type!==Jo&&N.type!==Ko&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=Jo,ce=s.convert(N.type)),N.format===Ls&&ge===6402&&(ge=34041,N.type!==Cs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=Cs,ce=s.convert(N.type))),t.texImage2D(3553,0,ge,ue.width,ue.height,0,be,ce,null);else if(N.isDataTexture)if(de.length>0&&me){for(let ve=0,Ee=de.length;ve0&&me){for(let ve=0,Ee=de.length;vev+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=v-m&&(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 nO extends tr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,d=null,p=null;const v=[],m=new Map,h=new Dt;h.layers.enable(1),h.viewport=new it;const b=new Dt;b.layers.enable(2),b.viewport=new it;const y=[h,b],g=new od;g.layers.enable(1),g.layers.enable(2);let w=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let x=v[I];return x===void 0&&(x=new ad,v[I]=x),x.getTargetRaySpace()},this.getControllerGrip=function(I){let x=v[I];return x===void 0&&(x=new ad,v[I]=x),x.getGripSpace()},this.getHand=function(I){let x=v[I];return x===void 0&&(x=new ad,v[I]=x),x.getHandSpace()};function S(I){const x=m.get(I.inputSource);x&&x.dispatchEvent({type:I.type,data:I.inputSource})}function M(){m.forEach(function(I,x){I.disconnect(x)}),m.clear(),w=null,A=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){o=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){u=I,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(I){if(s=I,s!==null){s.addEventListener("select",S),s.addEventListener("selectstart",S),s.addEventListener("selectend",S),s.addEventListener("squeeze",S),s.addEventListener("squeezestart",S),s.addEventListener("squeezeend",S),s.addEventListener("end",M),s.addEventListener("inputsourceschange",F);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const P={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,P);s.updateRenderState({baseLayer:B})}else{let P=0;x.depth&&(P=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:P,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),d=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function F(I){const x=s.inputSources;for(let P=0;P0&&(y.transmissionSamplerMap.value=w.texture,y.transmissionSamplerSize.value.set(w.width,w.height)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)}function v(y,g){g.matcap&&(y.matcap.value=g.matcap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function m(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function h(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),y.referencePosition.value.copy(g.referencePosition),y.nearDistance.value=g.nearDistance,y.farDistance.value=g.farDistance}function b(y,g){g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function rO(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:rO(),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 d=null,p=null;const v=[],m=[];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=tn,this.physicallyCorrectLights=!1,this.toneMapping=qi,this.toneMappingExposure=1;const h=this;let b=!1,y=0,g=0,w=null,A=-1,S=null;const M=new it,F=new it;let R=null,_=e.width,O=e.height,E=1,T=null,C=null;const L=new it(0,0,_,O),I=new it(0,0,_,O);let x=!1;const P=[],B=new oa;let D=!1,V=!1,k=null;const G=new Oe,Y=new q,te={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function oe(){return w===null?E:1}let ie=t;function ae(J,pe){for(let he=0;he0&&Un(ye,J,pe),Me.length>0&&Ni(ye,Me,J,pe),fe.length>0&&Un(fe,J,pe),w!==null&&(H.updateMultisampleRenderTarget(w),H.updateRenderTargetMipmap(w)),J.isScene===!0&&J.onAfterRender(h,J,pe),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),ve.resetDefaultState(),A=-1,S=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,v.pop(),v.length>0?d=v[v.length-1]:d=null};function Oi(J,pe,he,ye){if(J.visible===!1)return;if(J.layers.test(pe.layers)){if(J.isGroup)he=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(pe);else if(J.isLight)p.pushLight(J),J.castShadow&&p.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||B.intersectsSprite(J)){ye&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=U.update(J),Se=J.material;Se.visible&&d.push(J,xe,Se,he,Y.z,null)}}else if(J.isImmediateRenderObject)ye&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G),d.push(J,null,J.material,he,Y.z,null);else if((J.isMesh||J.isLine||J.isPoints)&&(J.isSkinnedMesh&&J.skeleton.frame!==re.render.frame&&(J.skeleton.update(),J.skeleton.frame=re.render.frame),!J.frustumCulled||B.intersectsObject(J))){ye&&Y.setFromMatrixPosition(J.matrixWorld).applyMatrix4(G);const xe=U.update(J),Se=J.material;if(Array.isArray(Se)){const Fe=xe.groups;for(let Ie=0,Ue=Fe.length;Ie=0&&pe<=J.width-ye&&he>=0&&he<=J.height-Me&&ie.readPixels(pe,he,ye,Me,de.convert(Ie),de.convert(Ue),fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Fe=w!==null?z.get(w).__webglFramebuffer:null;j.bindFramebuffer(36160,Fe)}}},this.copyFramebufferToTexture=function(J,pe,he=0){const ye=Math.pow(2,-he),Me=Math.floor(pe.image.width*ye),fe=Math.floor(pe.image.height*ye);let xe=de.convert(pe.format);$.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),H.setTexture2D(pe,0),ie.copyTexImage2D(3553,he,xe,J.x,J.y,Me,fe,0),j.unbindTexture()},this.copyTextureToTexture=function(J,pe,he,ye=0){const Me=pe.image.width,fe=pe.image.height,xe=de.convert(he.format),Se=de.convert(he.type);H.setTexture2D(he,0),ie.pixelStorei(37440,he.flipY),ie.pixelStorei(37441,he.premultiplyAlpha),ie.pixelStorei(3317,he.unpackAlignment),pe.isDataTexture?ie.texSubImage2D(3553,ye,J.x,J.y,Me,fe,xe,Se,pe.image.data):pe.isCompressedTexture?ie.compressedTexSubImage2D(3553,ye,J.x,J.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):ie.texSubImage2D(3553,ye,J.x,J.y,xe,Se,pe.image),ye===0&&he.generateMipmaps&&ie.generateMipmap(3553),j.unbindTexture()},this.copyTextureToTexture3D=function(J,pe,he,ye,Me=0){if(h.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const fe=J.max.x-J.min.x+1,xe=J.max.y-J.min.y+1,Se=J.max.z-J.min.z+1,Fe=de.convert(ye.format),Ie=de.convert(ye.type);let Ue;if(ye.isDataTexture3D)H.setTexture3D(ye,0),Ue=32879;else if(ye.isDataTexture2DArray)H.setTexture2DArray(ye,0),Ue=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ie.pixelStorei(37440,ye.flipY),ie.pixelStorei(37441,ye.premultiplyAlpha),ie.pixelStorei(3317,ye.unpackAlignment);const De=ie.getParameter(3314),Qe=ie.getParameter(32878),Lt=ie.getParameter(3316),Gt=ie.getParameter(3315),os=ie.getParameter(32877),ht=he.isCompressedTexture?he.mipmaps[0]:he.image;ie.pixelStorei(3314,ht.width),ie.pixelStorei(32878,ht.height),ie.pixelStorei(3316,J.min.x),ie.pixelStorei(3315,J.min.y),ie.pixelStorei(32877,J.min.z),he.isDataTexture||he.isDataTexture3D?ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,ht.data):he.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ie.compressedTexSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,ht.data)):ie.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,ht),ie.pixelStorei(3314,De),ie.pixelStorei(32878,Qe),ie.pixelStorei(3316,Lt),ie.pixelStorei(3315,Gt),ie.pixelStorei(32877,os),Me===0&&ye.generateMipmaps&&ie.generateMipmap(Ue),j.unbindTexture()},this.initTexture=function(J){H.setTexture2D(J,0),j.unbindTexture()},this.resetState=function(){y=0,g=0,w=null,j.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class fy extends rt{}fy.prototype.isWebGL1Renderer=!0;class ca{constructor(e,t=25e-5){this.name="",this.color=new Le(e),this.density=t}clone(){return new ca(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ca.prototype.isFogExp2=!0;class ua{constructor(e,t=1,i=1e3){this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new ua(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ua.prototype.isFog=!0;class oc extends Xe{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}}oc.prototype.isScene=!0;class hr{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=fn()}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:da.clone(),uv:At.getUV(da,ac,pa,lc,my,ld,gy,new Ae),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}ma.prototype.isSprite=!0;function cc(n,e,t,i,r,s){Qs.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(fa.x=s*Qs.x-r*Qs.y,fa.y=r*Qs.x+s*Qs.y):fa.copy(Qs),n.copy(e),n.x+=fa.x,n.y+=fa.y,n.applyMatrix4(py)}const uc=new q,vy=new q;class yy extends Xe{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){uc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(uc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){uc.setFromMatrixPosition(e.matrixWorld),vy.setFromMatrixPosition(this.matrixWorld);const i=uc.distanceTo(vy)/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;p.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(p);Re.far||t.push({distance:R,point:d.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let w=y,A=g-1;wu)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);Me.far||t.push({distance:M,point:d.clone().applyMatrix4(this.matrixWorld),index:w,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.")}}}Qn.prototype.isLine=!0;const Ly=new q,Ry=new q;class rn extends Qn{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.")}}}eo.prototype.isPoints=!0;function Py(n,e,t,i,r,s,o){const l=hd.distanceSqToPoint(n);if(lr.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Iy extends Mt{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:wi,this.minFilter=o!==void 0?o:vt,this.magFilter=s!==void 0?s:vt,this.generateMipmaps=!1;const f=this;function d(){f.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}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)}}Iy.prototype.isVideoTexture=!0;class dd extends Mt{constructor(e,t,i,r,s,o,l,u,c,f,d,p){super(null,o,l,u,c,f,r,s,d,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}dd.prototype.isCompressedTexture=!0;class Oy extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Oy.prototype.isCanvasTexture=!0;class Ny extends Mt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Pr,f!==Pr&&f!==Ls)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Pr&&(i=Jo),i===void 0&&f===Ls&&(i=Cs),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:wt,this.minFilter=u!==void 0?u:wt,this.flipY=!1,this.generateMipmaps=!1}}Ny.prototype.isDepthTexture=!0;class to extends ke{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 q,f=new Ae;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let d=0,p=3;d<=t;d++,p+=3){const v=i+d/t*r;c.x=e*Math.cos(v),c.y=e*Math.sin(v),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let d=1;d<=t;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(u,2))}static fromJSON(e){return new to(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class fr extends ke{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=[],d=[],p=[],v=[];let m=0;const h=[],b=i/2;let y=0;g(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(f),this.setAttribute("position",new Pe(d,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(v,2));function g(){const A=new q,S=new q;let M=0;const F=(t-e)/i;for(let R=0;R<=s;R++){const _=[],O=R/s,E=O*(t-e)+e;for(let T=0;T<=r;T++){const C=T/r,L=C*u+l,I=Math.sin(L),x=Math.cos(L);S.x=E*I,S.y=-O*i+b,S.z=E*x,d.push(S.x,S.y,S.z),A.set(I,F,x).normalize(),p.push(A.x,A.y,A.z),v.push(C,1-O),_.push(m++)}h.push(_)}for(let R=0;R.9&&F<.1&&(w<.2&&(o[g+0]+=1),A<.2&&(o[g+2]+=1),S<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function v(g,w){const A=g*3;w.x=e[A+0],w.y=e[A+1],w.z=e[A+2]}function m(){const g=new q,w=new q,A=new q,S=new q,M=new Ae,F=new Ae,R=new Ae;for(let _=0,O=0;_0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,v=(o-f)/p;return(r+v)/(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 Ae:new q);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 q,r=[],s=[],o=[],l=new q,u=new Oe;for(let v=0;v<=e;v++){const m=v/e;r[v]=this.getTangentAt(m,new q),r[v].normalize()}s[0]=new q,o[0]=new q;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),d=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),d<=c&&(c=d,i.set(0,1,0)),p<=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 v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),l.crossVectors(r[v-1],r[v]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(u.makeRotationAxis(l,m))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos($t(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(v=-v);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],v*m)),o[m].crossVectors(r[m],s[m])}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 xa extends gn{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 Ae,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]:(bc.subVectors(r[0],r[1]).add(r[0]),c=bc);const d=r[l%s],p=r[(l+1)%s];if(this.closed||l+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return i.set(By(l,u.x,c.x,f.x,d.x),By(l,u.y,c.y,f.y,d.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 m=t;mc&&(c=d),p>f&&(f=p);v=Math.max(c-l,f-u),v=v!==0?1/v:0}return Sa(s,o,t,l,u,v),o}};function Vy(n,e,t,i,r){let s,o;if(r===RO(n,e,t,i)>0)for(s=e;s=e;s-=i)o=Uy(s,n[s],n[s+1],o);return o&&Ac(o,o.next)&&(Ta(o),o=o.next),o}function pr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ac(t,t.next)||ft(t.prev,t,t.next)===0)){if(Ta(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Sa(n,e,t,i,r,s,o){if(!n)return;!o&&s&&SO(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?gO(n,i,r,s):mO(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ta(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=vO(pr(n),e,t),Sa(n,e,t,i,r,s,2)):o===2&&yO(n,e,t,i,r,s):Sa(pr(n),e,t,i,r,s,1);break}}}function mO(n){const e=n.prev,t=n,i=n.next;if(ft(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(ro(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ft(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function gO(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ft(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,d=Sd(l,u,e,t,i),p=Sd(c,f,e,t,i);let v=n.prevZ,m=n.nextZ;for(;v&&v.z>=d&&m&&m.z<=p;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0||(v=v.prevZ,m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;v&&v.z>=d;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function vO(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ac(r,s)&&ky(r,i,i.next,s)&&_a(r,s)&&_a(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ta(i),Ta(i.next),i=n=s),i=i.next}while(i!==n);return pr(i)}function yO(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&EO(o,l)){let u=zy(o,l);o=pr(o,o.next),u=pr(u,u.next),Sa(o,e,t,i,r,s),Sa(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function bO(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 p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===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&&ro(ro.x||t.x===o.x&&AO(o,t)))&&(o=t,f=d)),t=t.next;while(t!==l);return o}function AO(n,e){return ft(n.prev,n,e.prev)<0&&ft(e.next,n,n.next)<0}function SO(n,e,t,i){let r=n;do r.z===null&&(r.z=Sd(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,_O(r)}function _O(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 Sd(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 TO(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 EO(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!CO(n,e)&&(_a(n,e)&&_a(e,n)&&LO(n,e)&&(ft(n.prev,n,e.prev)||ft(n,e.prev,e))||Ac(n,e)&&ft(n.prev,n,n.next)>0&&ft(e.prev,e,e.next)>0)}function ft(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ac(n,e){return n.x===e.x&&n.y===e.y}function ky(n,e,t,i){const r=_c(ft(n,e,t)),s=_c(ft(n,e,i)),o=_c(ft(t,i,n)),l=_c(ft(t,i,e));return!!(r!==s&&o!==l||r===0&&Sc(n,t,e)||s===0&&Sc(n,i,e)||o===0&&Sc(t,n,i)||l===0&&Sc(t,e,i))}function Sc(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 _c(n){return n>0?1:n<0?-1:0}function CO(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&&ky(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function _a(n,e){return ft(n.prev,n,n.next)<0?ft(n,e,n.next)>=0&&ft(n,n.prev,e)>=0:ft(n,e,n.prev)<0||ft(n,n.next,e)<0}function LO(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 zy(n,e){const t=new _d(n.i,n.x,n.y),i=new _d(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 Uy(n,e,t,i){const r=new _d(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 Ta(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 _d(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 RO(n,e,t,i){let r=0;for(let s=e,o=t-i;s2&&n[e-1].equals(n[0])&&n.pop()}function Hy(n,e){for(let t=0;tNumber.EPSILON){const be=Math.sqrt(ue),ce=Math.sqrt(X*X+ee*ee),ge=H.x-Z/be,ne=H.y+N/be,de=K.x-ee/ce,ve=K.y+X/ce,Ee=((de-ge)*ee-(ve-ne)*X)/(N*ee-Z*X);le=ge+N*Ee-z.x,se=ne+Z*Ee-z.y;const _e=le*le+se*se;if(_e<=2)return new Ae(le,se);U=Math.sqrt(_e/2)}else{let be=!1;N>Number.EPSILON?X>Number.EPSILON&&(be=!0):N<-Number.EPSILON?X<-Number.EPSILON&&(be=!0):Math.sign(Z)===Math.sign(ee)&&(be=!0),be?(le=-Z,se=N,U=Math.sqrt(ue)):(le=N,se=Z,U=Math.sqrt(ue/2))}return new Ae(le/U,se/U)}const D=[];for(let z=0,H=L.length,K=H-1,le=z+1;z=0;z--){const H=z/b,K=v*Math.cos(H*Math.PI/2),le=m*Math.sin(H*Math.PI/2)+h;for(let se=0,U=L.length;se=0;){const le=K;let se=K-1;se<0&&(se=z.length-1);for(let U=0,N=f+b*2;U=0?(e(g-u,b,d),p.subVectors(f,d)):(e(g+u,b,d),p.subVectors(d,f)),b-u>=0?(e(g,b-u,d),v.subVectors(f,d)):(e(g,b+u,d),v.subVectors(d,f)),c.crossVectors(p,v).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let h=0;h0)&&v.push(w,A,M),(y!==i-1||u=i)){d.push(c.times[v]);for(let h=0;hs.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u=l.times[m]){const y=m*d+f,g=y+d-f;h=ut.arraySlice(l.values,y,g)}else{const y=l.createInterpolant(),g=f,w=d-f;y.evaluate(s),h=ut.arraySlice(y.resultBuffer,g,w)}u==="quaternion"&&new Zt().fromArray(h).normalize().conjugate().toArray(h);const b=c.times.length;for(let y=0;y=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=ut.arraySlice(i,s,o),this.values=ut.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&&ut.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=ut.arraySlice(this.times),t=ut.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Fl,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=ut.arraySlice(e,0,o),this.values=ut.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ut.arraySlice(this.times,0),t=ut.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Vn.prototype.TimeBufferType=Float32Array,Vn.prototype.ValueBufferType=Float32Array,Vn.prototype.DefaultInterpolation=Ir;class Xr extends Vn{}Xr.prototype.ValueTypeName="bool",Xr.prototype.ValueBufferType=Array,Xr.prototype.DefaultInterpolation=Rs,Xr.prototype.InterpolantFactoryMethodLinear=void 0,Xr.prototype.InterpolantFactoryMethodSmooth=void 0;class Nd extends Vn{}Nd.prototype.ValueTypeName="color";class po extends Vn{}po.prototype.ValueTypeName="number";class Zy extends ni{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)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Yr extends Vn{InterpolantFactoryMethodLinear(e){return new Zy(this.times,this.values,this.getValueSize(),e)}}Yr.prototype.ValueTypeName="quaternion",Yr.prototype.DefaultInterpolation=Ir,Yr.prototype.InterpolantFactoryMethodSmooth=void 0;class Jr extends Vn{}Jr.prototype.ValueTypeName="string",Jr.prototype.ValueBufferType=Array,Jr.prototype.DefaultInterpolation=Rs,Jr.prototype.InterpolantFactoryMethodLinear=void 0,Jr.prototype.InterpolantFactoryMethodSmooth=void 0;class mo extends Vn{}mo.prototype.ValueTypeName="vector";class go{constructor(e,t=-1,i,r=Pl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=fn(),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(BO(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(Vn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l1){const d=f[1];let p=r[d];p||(r[d]=p=[]),p.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(d,p,v,m,h){if(v.length!==0){const b=[],y=[];ut.flattenJSON(v,b,y,m),b.length!==0&&h.push(new d(p,b,y))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let d=0;d0||e.search(/^data\:image\/jpeg/)===0;s.format=u?wi:dn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class Ky extends gn{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 d=c.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.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 mr extends La{constructor(e){super(e),this.uuid=fn(),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 Le().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new q().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Bt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Oe().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 Ae().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 Ae().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 Bd(t);s=new Ca(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c0){r=new Ca(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=Kr.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){Kr.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)}}$d.prototype.isImageBitmapLoader=!0;class cb{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new La,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 w=[];for(let A=0,S=g.length;ANumber.EPSILON){if(E<0&&(R=w[F],O=-O,_=w[M],E=-E),g.y_.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const T=E*(g.x-R.x)-O*(g.y-R.y);if(T===0)return!0;if(T<0)continue;S=!S}}else{if(g.y!==R.y)continue;if(_.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=_.x)return!0}}return S}const s=ti.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 mr,c.curves=u.curves,f.push(c),f;let d=!s(o[0].getPoints());d=e?!d:d;const p=[],v=[];let m=[],h=0,b;v[h]=void 0,m[h]=[];for(let g=0,w=o.length;g1){let g=!1;const w=[];for(let A=0,S=v.length;A0&&(g||(m=p))}let y;for(let g=0,w=v.length;g"u"?Date:performance).now()}const qr=new q,vb=new Zt,jO=new q,Qr=new q;class $O extends Xe{constructor(){super(),this.type="AudioListener",this.context=Xd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new mb}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(qr,vb,jO),Qr.set(0,0,-1).applyQuaternion(vb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(qr.x,r),t.positionY.linearRampToValueAtTime(qr.y,r),t.positionZ.linearRampToValueAtTime(qr.z,r),t.forwardX.linearRampToValueAtTime(Qr.x,r),t.forwardY.linearRampToValueAtTime(Qr.y,r),t.forwardZ.linearRampToValueAtTime(Qr.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(qr.x,qr.y,qr.z),t.setOrientation(Qr.x,Qr.y,Qr.z,i.x,i.y,i.z)}}class Yd extends Xe{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){Zt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Zt.multiplyQuaternionsFlat(e,o,e,t,e,i),Zt.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 Jd="\\[\\]\\.:\\/",YO=new RegExp("["+Jd+"]","g"),Kd="[^"+Jd+"]",JO="[^"+Jd.replace("\\.","")+"]",KO=/((?:WC+[\/:])*)/.source.replace("WC",Kd),qO=/(WCOD+)?/.source.replace("WCOD",JO),QO=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kd),eN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kd),tN=new RegExp("^"+KO+qO+QO+eN+"$"),nN=["material","materials","bones"];class iN{constructor(e,t,i){const r=i||et.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 et{constructor(e,t,i){this.path=t,this.parsedPath=i||et.parseTrackName(t),this.node=et.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 et.Composite(e,t,i):new et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(YO,"")}static parseTrackName(e){const t=tN.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);nN.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 d=s++,p=e[d];t[p.uuid]=f,e[f]=p,t[c]=d,e[d]=u;for(let v=0,m=r;v!==m;++v){const h=i[v],b=h[d],y=h[f];h[f]=b,h[d]=y}}}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,d=t[f];if(d!==void 0)if(delete t[f],d0&&(t[v.uuid]=d),e[d]=v,e.pop();for(let m=0,h=r;m!==h;++m){const b=i[m];b[d]=b[p],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_,d=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(d);for(let p=f,v=u.length;p!==v;++p){const m=u[p];d[p]=new et(m,e,t)}return d}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()}}}wb.prototype.isAnimationObjectGroup=!0;class rN{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:Or,endingEnd:Or};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=cv,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 Mh:for(let f=0,d=u.length;f!==d;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Pl:default:for(let f=0,d=u.length;f!==d;++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===uv;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===lv){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=Nr,r.endingEnd=Nr):(e?r.endingStart=this.zeroSlopeAtStart?Nr:Or:r.endingStart=qo,t?r.endingEnd=this.zeroSlopeAtEnd?Nr:Or:r.endingEnd=qo)}_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 Mb extends tr{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 d=0;d!==s;++d){const p=r[d],v=p.name;let m=f[v];if(m!==void 0)o[d]=m;else{if(m=o[d],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,u,v));continue}const h=t&&t._propertyBindings[d].binding.parsedPath;m=new xb(et.create(i,v,h),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,u,v),o[d]=m}l[d].resultBuffer=m.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 Tb.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)}}yo.prototype.isBox2=!0;const Eb=new q,Ic=new q;class Cb{constructor(e=new q,t=new q){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){Eb.subVectors(e,this.start),Ic.subVectors(this.end,this.start);const i=Ic.dot(Ic);let s=Ic.dot(Eb)/i;return t&&(s=$t(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 Lb extends Xe{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}}Lb.prototype.isImmediateRenderObject=!0;const Rb=new q;class lN extends Xe{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new ke,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{kb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(kb,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 zb extends rn{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 ke;r.setAttribute("position",new Pe(t,3)),r.setAttribute("color",new Pe(i,3));const s=new Vt({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Le,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 Ub=new Float32Array(1),yN=new Int32Array(Ub.buffer);class bN{static toHalfFloat(e){Ub[0]=e;const t=yN[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 bo=4,vr=8,ii=Math.pow(2,vr),Gb=[.125,.215,.35,.446,.526,.582],Hb=vr-bo+1+Gb.length,xo=20,ri={[tn]:0,[Br]:1,[Ol]:2,[Sh]:3,[_h]:4,[Th]:5,[Il]:6},ns=new cn({side:xt,depthWrite:!1,depthTest:!1}),xN=new St(new Ci,ns),tf=new vo,{_lodPlanes:Pa,_sizeLods:Wb,_sigmas:kc}=AN(),jb=new Le;let nf=null;const is=(1+Math.sqrt(5))/2,wo=1/is,$b=[new q(1,1,1),new q(-1,1,1),new q(1,1,-1),new q(-1,1,-1),new q(0,is,wo),new q(0,is,-wo),new q(wo,0,is),new q(-wo,0,is),new q(is,wo,0),new q(-is,wo,0)];function Zb(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 wN{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=SN(xo),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){nf=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=Jb(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=Yb(),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?ii:0,ii,ii),f.setRenderTarget(r),m&&f.render(xN,l),f.render(e,l)}f.toneMapping=v,f.outputEncoding=p,f.autoClear=d}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Jb()):this._equirectShader==null&&(this._equirectShader=Yb());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new St(Pa[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=ri[e.encoding],o.outputEncoding.value=ri[t.texture.encoding],zc(t,0,0,3*ii,2*ii),i.setRenderTarget(t),i.render(s,tf)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;rxo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${xo}`);const y=[];let g=0;for(let M=0;Mvr-bo?r-vr+bo:0);zc(t,A,S,3*w,2*w),u.setRenderTarget(t),u.render(d,tf)}}function MN(n){return n===void 0||n.type!==Rr?!1:n.encoding===tn||n.encoding===Br||n.encoding===Il}function AN(){const n=[],e=[],t=[];let i=vr;for(let r=0;rvr-bo?o=Gb[r-vr+bo-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],d=6,p=6,v=3,m=2,h=1,b=new Float32Array(v*p*d),y=new Float32Array(m*p*d),g=new Float32Array(h*p*d);for(let A=0;A2?0:-1,F=[S,M,0,S+2/3,M,0,S+2/3,M+1,0,S,M,0,S+2/3,M+1,0,S,M+1,0];b.set(F,v*p*A),y.set(f,m*p*A);const R=[A,A,A,A,A,A];g.set(R,h*p*A)}const w=new ke;w.setAttribute("position",new Ze(b,v)),w.setAttribute("uv",new Ze(y,m)),w.setAttribute("faceIndex",new Ze(g,h)),n.push(w),i>bo&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function Xb(n){const e=new Pn(3*ii,3*ii,n);return e.texture.mapping=Ts,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function zc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function SN(n){const e=new Float32Array(n),t=new q(0,1,0);return new fo({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:ri[tn]},outputEncoding:{value:ri[tn]}},vertexShader:rf(),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; ${sf()} #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:yi,depthTest:!1,depthWrite:!1})}function Yb(){const n=new Ae(1,1);return new fo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:n},inputEncoding:{value:ri[tn]},outputEncoding:{value:ri[tn]}},vertexShader:rf(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform sampler2D envMap; uniform vec2 texelSize; ${sf()} #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:yi,depthTest:!1,depthWrite:!1})}function Jb(){return new fo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ri[tn]},outputEncoding:{value:ri[tn]}},vertexShader:rf(),fragmentShader:` precision mediump float; precision mediump int; varying vec3 vOutputDirection; uniform samplerCube envMap; ${sf()} 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:yi,depthTest:!1,depthWrite:!1})}function rf(){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 sf(){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 _N=0,TN=1,EN=0,CN=1,LN=2;function RN(n){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),n}function FN(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 PN(n,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new eo(n,e)}function IN(n){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new ma(n)}function ON(n,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new eo(n,e)}function NN(n){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new dr(n)}function BN(n){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new dr(n)}function DN(n){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new dr(n)}function VN(n,e,t){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new q(n,e,t)}function kN(n,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Ze(n,e).setUsage(Ps)}function zN(n,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Pv(n,e)}function UN(n,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Iv(n,e)}function GN(n,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Ov(n,e)}function HN(n,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Nv(n,e)}function WN(n,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new jl(n,e)}function jN(n,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Bv(n,e)}function $N(n,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new $l(n,e)}function ZN(n,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Pe(n,e)}function XN(n,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Vv(n,e)}gn.create=function(n,e){return console.log("THREE.Curve.create() has been deprecated"),n.prototype=Object.create(gn.prototype),n.prototype.constructor=n,n.prototype.getPoint=e,n},La.prototype.fromPoints=function(n){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(n)};function YN(n){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new zb(n)}function JN(n,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Vb(n,e)}function KN(n,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new rn(new pd(n.geometry),new Vt({color:e!==void 0?e:16777215}))}Nb.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Fb.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};function qN(n,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new rn(new Td(n.geometry),new Vt({color:e!==void 0?e:16777215}))}Xt.prototype.extractUrlBase=function(n){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Fi.extractUrlBase(n)},Xt.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 QN(n){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new vn(n)}function eB(n){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Jy(n)}yo.prototype.center=function(n){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(n)},yo.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},yo.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},yo.prototype.size=function(n){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(n)},ln.prototype.center=function(n){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(n)},ln.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},ln.prototype.isIntersectionBox=function(n){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},ln.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},ln.prototype.size=function(n){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(n)},Ai.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},oa.prototype.setFromMatrix=function(n){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(n)},Cb.prototype.center=function(n){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(n)},Bt.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)},Bt.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},Bt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},Bt.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),n.applyMatrix3(this)},Bt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},Bt.prototype.getInverse=function(n){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()},Oe.prototype.extractPosition=function(n){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(n)},Oe.prototype.flattenToArrayOffset=function(n,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(n,e)},Oe.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),new q().setFromMatrixColumn(this,3)},Oe.prototype.setRotationFromQuaternion=function(n){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(n)},Oe.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Oe.prototype.multiplyVector3=function(n){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},Oe.prototype.multiplyVector4=function(n){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},Oe.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Oe.prototype.rotateAxis=function(n){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),n.transformDirection(this)},Oe.prototype.crossVector=function(n){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},Oe.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Oe.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Oe.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Oe.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Oe.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Oe.prototype.applyToBufferAttribute=function(n){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),n.applyMatrix4(this)},Oe.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Oe.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)},Oe.prototype.getInverse=function(n){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(n).invert()},Kn.prototype.isIntersectionLine=function(n){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(n)},Zt.prototype.multiplyVector3=function(n){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),n.applyQuaternion(this)},Zt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},sr.prototype.isIntersectionBox=function(n){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(n)},sr.prototype.isIntersectionPlane=function(n){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(n)},sr.prototype.isIntersectionSphere=function(n){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(n)},At.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},At.prototype.barycoordFromPoint=function(n,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(n,e)},At.prototype.midpoint=function(n){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(n)},At.prototypenormal=function(n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(n)},At.prototype.plane=function(n){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(n)},At.barycoordFromPoint=function(n,e,t,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),At.getBarycoord(n,e,t,i,r)},At.normal=function(n,e,t,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),At.getNormal(n,e,t,i)},mr.prototype.extractAllPoints=function(n){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(n)},mr.prototype.extrude=function(n){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Dn(this,n)},mr.prototype.makeGeometry=function(n){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new jr(this,n)},Ae.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},Ae.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},Ae.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},q.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},q.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},q.prototype.getPositionFromMatrix=function(n){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(n)},q.prototype.getScaleFromMatrix=function(n){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(n)},q.prototype.getColumnFromMatrix=function(n,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,n)},q.prototype.applyProjection=function(n){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(n)},q.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},q.prototype.distanceToManhattan=function(n){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(n)},q.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},it.prototype.fromAttribute=function(n,e,t){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(n,e,t)},it.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Xe.prototype.getChildByName=function(n){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(n)},Xe.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Xe.prototype.translate=function(n,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,n)},Xe.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Xe.prototype.applyMatrix=function(n){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)},Object.defineProperties(Xe.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.")}}}),St.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(St.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),hv},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.")}}}),ga.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Dt.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(zn.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(Ze.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===Ps},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Ps)}}}),Ze.prototype.setDynamic=function(n){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Ps:Fs),this},Ze.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ze.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},ke.prototype.addIndex=function(n){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(n)},ke.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 Ze(arguments[1],arguments[2]))):n==="index"?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(n,e)},ke.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)},ke.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},ke.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},ke.prototype.removeAttribute=function(n){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(n)},ke.prototype.applyMatrix=function(n){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(n)},Object.defineProperties(ke.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}}}),hr.prototype.setDynamic=function(n){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(n===!0?Ps:Fs),this},hr.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},Dn.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},Dn.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},Dn.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},oc.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Pc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Ft.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 Le}},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===rh}},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(Li.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}}}),rt.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)},rt.prototype.animate=function(n){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(n)},rt.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},rt.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},rt.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},rt.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},rt.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},rt.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},rt.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},rt.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},rt.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},rt.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},rt.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},rt.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},rt.prototype.enableScissorTest=function(n){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(n)},rt.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},rt.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},rt.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},rt.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},rt.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},rt.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},rt.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},rt.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},rt.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},rt.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(rt.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?Br:tn}},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(hy.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 tB(n,e,t){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new nc(n,t)}Object.defineProperties(Pn.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}}}),Yd.prototype.load=function(n){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return new ub().load(n,function(i){e.setBuffer(i)}),this},bb.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},tc.prototype.updateCubeMap=function(n,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(n,e)},tc.prototype.clear=function(n,e,t,i){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(n,e,t,i)},Vr.crossOrigin=void 0,Vr.loadTexture=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Dd;r.setCrossOrigin(this.crossOrigin);const s=r.load(n,t,void 0,i);return e&&(s.mapping=e),s},Vr.loadTextureCube=function(n,e,t,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new Yy;r.setCrossOrigin(this.crossOrigin);const s=r.load(n,t,void 0,i);return e&&(s.mapping=e),s},Vr.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Vr.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function nB(){console.error("THREE.CanvasRenderer has been removed")}function iB(){console.error("THREE.JSONLoader has been removed.")}const rB={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 sB(){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:th}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=th);const oB=xl(Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:p0,AddEquation:Lr,AddOperation:u0,AdditiveAnimationBlendMode:Mh,AdditiveBlending:sh,AlphaFormat:M0,AlwaysDepth:i0,AlwaysStencilFunc:vv,AmbientLight:Ud,AmbientLightProbe:db,AnimationClip:go,AnimationLoader:DO,AnimationMixer:Mb,AnimationObjectGroup:wb,AnimationUtils:ut,ArcCurve:md,ArrayCamera:od,ArrowHelper:vN,Audio:Yd,AudioAnalyser:bb,AudioContext:Xd,AudioListener:$O,AudioLoader:ub,AxesHelper:zb,AxisHelper:YN,BackSide:xt,BasicDepthPacking:pv,BasicShadowMap:KL,BinaryTextureLoader:eB,Bone:va,BooleanKeyframeTrack:Xr,BoundingBoxHelper:JN,Box2:yo,Box3:ln,Box3Helper:mN,BoxBufferGeometry:Ci,BoxGeometry:Ci,BoxHelper:Vb,BufferAttribute:Ze,BufferGeometry:ke,BufferGeometryLoader:ob,ByteType:g0,Cache:Kr,Camera:sa,CameraHelper:pN,CanvasRenderer:nB,CanvasTexture:Oy,CatmullRomCurve3:xd,CineonToneMapping:f0,CircleBufferGeometry:to,CircleGeometry:to,ClampToEdgeWrapping:zt,Clock:mb,Color:Le,ColorKeyframeTrack:Nd,CompressedTexture:dd,CompressedTextureLoader:VO,ConeBufferGeometry:no,ConeGeometry:no,CubeCamera:tc,CubeReflectionMapping:jo,CubeRefractionMapping:$o,CubeTexture:Zs,CubeTextureLoader:Yy,CubeUVReflectionMapping:Ts,CubeUVRefractionMapping:Zo,CubicBezierCurve:xc,CubicBezierCurve3:wd,CubicInterpolant:jy,CullFaceBack:nh,CullFaceFront:Gg,CullFaceFrontBack:JL,CullFaceNone:Ug,Curve:gn,CurvePath:Ky,CustomBlending:Wg,CustomToneMapping:m0,CylinderBufferGeometry:fr,CylinderGeometry:fr,Cylindrical:aN,DataTexture:Hr,DataTexture2DArray:nd,DataTexture3D:id,DataTextureLoader:Jy,DataUtils:bN,DecrementStencilOp:oR,DecrementWrapStencilOp:lR,DefaultLoadingManager:Xy,DepthFormat:Pr,DepthStencilFormat:Ls,DepthTexture:Ny,DirectionalLight:Rc,DirectionalLightHelper:fN,DiscreteInterpolant:$y,DodecahedronBufferGeometry:io,DodecahedronGeometry:io,DoubleSide:Ki,DstAlphaFactor:Kg,DstColorFactor:Qg,DynamicBufferAttribute:kN,DynamicCopyUsage:MR,DynamicDrawUsage:Ps,DynamicReadUsage:bR,EdgesGeometry:pd,EdgesHelper:KN,EllipseCurve:xa,EqualDepth:s0,EqualStencilFunc:dR,EquirectangularReflectionMapping:Cl,EquirectangularRefractionMapping:Ll,Euler:Ur,EventDispatcher:tr,ExtrudeBufferGeometry:Dn,ExtrudeGeometry:Dn,FaceColors:CN,FileLoader:vn,FlatShading:rh,Float16BufferAttribute:Dv,Float32Attribute:ZN,Float32BufferAttribute:Pe,Float64Attribute:XN,Float64BufferAttribute:Vv,FloatType:xi,Fog:ua,FogExp2:ca,Font:Zd,FontLoader:HO,FrontSide:Ji,Frustum:oa,GLBufferAttribute:Sb,GLSL1:SR,GLSL3:Eh,GammaEncoding:Il,GreaterDepth:a0,GreaterEqualDepth:o0,GreaterEqualStencilFunc:gR,GreaterStencilFunc:pR,GridHelper:Nb,Group:qn,HalfFloatType:Fr,HemisphereLight:Vd,HemisphereLightHelper:hN,HemisphereLightProbe:hb,IcosahedronBufferGeometry:so,IcosahedronGeometry:so,ImageBitmapLoader:$d,ImageLoader:Ca,ImageUtils:Vr,ImmediateRenderObject:Lb,IncrementStencilOp:sR,IncrementWrapStencilOp:aR,InstancedBufferAttribute:jd,InstancedBufferGeometry:Wd,InstancedInterleavedBuffer:Ab,InstancedMesh:cd,Int16Attribute:HN,Int16BufferAttribute:Nv,Int32Attribute:jN,Int32BufferAttribute:Bv,Int8Attribute:zN,Int8BufferAttribute:Pv,IntType:y0,InterleavedBuffer:hr,InterleavedBufferAttribute:Ri,Interpolant:ni,InterpolateDiscrete:Rs,InterpolateLinear:Ir,InterpolateSmooth:Fl,InvertStencilOp:cR,JSONLoader:iB,KeepStencilOp:Nl,KeyframeTrack:Vn,LOD:yy,LatheBufferGeometry:oo,LatheGeometry:oo,Layers:Uh,LensFlare:sB,LessDepth:r0,LessEqualDepth:Tl,LessEqualStencilFunc:fR,LessStencilFunc:hR,Light:zn,LightProbe:Fa,Line:Qn,Line3:Cb,LineBasicMaterial:Vt,LineCurve:Aa,LineCurve3:Dy,LineDashedMaterial:Id,LineLoop:fc,LinePieces:TN,LineSegments:rn,LineStrip:_N,LinearEncoding:tn,LinearFilter:vt,LinearInterpolant:Od,LinearMipMapLinearFilter:nR,LinearMipMapNearestFilter:tR,LinearMipmapLinearFilter:bi,LinearMipmapNearestFilter:Rl,LinearToneMapping:h0,Loader:Xt,LoaderUtils:Fi,LoadingManager:Bd,LogLuvEncoding:fv,LoopOnce:lv,LoopPingPong:uv,LoopRepeat:cv,LuminanceAlphaFormat:S0,LuminanceFormat:A0,MOUSE:XL,Material:Ft,MaterialLoader:sb,Math:Rh,MathUtils:Rh,Matrix3:Bt,Matrix4:Oe,MaxEquation:ch,Mesh:St,MeshBasicMaterial:cn,MeshDepthMaterial:rc,MeshDistanceMaterial:sc,MeshFaceMaterial:RN,MeshLambertMaterial:Fd,MeshMatcapMaterial:Pd,MeshNormalMaterial:Rd,MeshPhongMaterial:Cd,MeshPhysicalMaterial:Ea,MeshStandardMaterial:Zr,MeshToonMaterial:Ld,MinEquation:lh,MirroredRepeatWrapping:Es,MixOperation:c0,MultiMaterial:FN,MultiplyBlending:ah,MultiplyOperation:Wo,NearestFilter:wt,NearestMipMapLinearFilter:eR,NearestMipMapNearestFilter:QL,NearestMipmapLinearFilter:Yo,NearestMipmapNearestFilter:Xo,NeverDepth:n0,NeverStencilFunc:uR,NoBlending:yi,NoColors:EN,NoToneMapping:qi,NormalAnimationBlendMode:Pl,NormalBlending:_s,NotEqualDepth:l0,NotEqualStencilFunc:mR,NumberKeyframeTrack:po,Object3D:Xe,ObjectLoader:kO,ObjectSpaceNormalMap:gv,OctahedronBufferGeometry:Wr,OctahedronGeometry:Wr,OneFactor:Xg,OneMinusDstAlphaFactor:qg,OneMinusDstColorFactor:e0,OneMinusSrcAlphaFactor:hh,OneMinusSrcColorFactor:Jg,OrthographicCamera:vo,PCFShadowMap:ih,PCFSoftShadowMap:Hg,PMREMGenerator:wN,ParametricBufferGeometry:Tc,ParametricGeometry:Tc,Particle:IN,ParticleBasicMaterial:BN,ParticleSystem:ON,ParticleSystemMaterial:DN,Path:La,PerspectiveCamera:Dt,Plane:Kn,PlaneBufferGeometry:Gr,PlaneGeometry:Gr,PlaneHelper:gN,PointCloud:PN,PointCloudMaterial:NN,PointLight:Lc,PointLightHelper:cN,Points:eo,PointsMaterial:dr,PolarGridHelper:dN,PolyhedronBufferGeometry:ei,PolyhedronGeometry:ei,PositionalAudio:XO,PropertyBinding:et,PropertyMixer:xb,QuadraticBezierCurve:wc,QuadraticBezierCurve3:Md,Quaternion:Zt,QuaternionKeyframeTrack:Yr,QuaternionLinearInterpolant:Zy,REVISION:th,RGBADepthPacking:mv,RGBAFormat:dn,RGBAIntegerFormat:F0,RGBA_ASTC_10x10_Format:W0,RGBA_ASTC_10x5_Format:U0,RGBA_ASTC_10x6_Format:G0,RGBA_ASTC_10x8_Format:H0,RGBA_ASTC_12x10_Format:j0,RGBA_ASTC_12x12_Format:$0,RGBA_ASTC_4x4_Format:I0,RGBA_ASTC_5x4_Format:O0,RGBA_ASTC_5x5_Format:N0,RGBA_ASTC_6x5_Format:B0,RGBA_ASTC_6x6_Format:D0,RGBA_ASTC_8x5_Format:V0,RGBA_ASTC_8x6_Format:k0,RGBA_ASTC_8x8_Format:z0,RGBA_BPTC_Format:Z0,RGBA_ETC2_EAC_Format:wh,RGBA_PVRTC_2BPPV1_Format:bh,RGBA_PVRTC_4BPPV1_Format:yh,RGBA_S3TC_DXT1_Format:fh,RGBA_S3TC_DXT3_Format:ph,RGBA_S3TC_DXT5_Format:mh,RGBDEncoding:Th,RGBEEncoding:Ol,RGBEFormat:_0,RGBFormat:wi,RGBIntegerFormat:R0,RGBM16Encoding:_h,RGBM7Encoding:Sh,RGB_ETC1_Format:P0,RGB_ETC2_Format:xh,RGB_PVRTC_2BPPV1_Format:vh,RGB_PVRTC_4BPPV1_Format:gh,RGB_S3TC_DXT1_Format:dh,RGFormat:C0,RGIntegerFormat:L0,RawShaderMaterial:fo,Ray:sr,Raycaster:sN,RectAreaLight:Gd,RedFormat:T0,RedIntegerFormat:E0,ReinhardToneMapping:d0,RepeatWrapping:Qi,ReplaceStencilOp:rR,ReverseSubtractEquation:$g,RingBufferGeometry:ao,RingGeometry:ao,SRGB8_ALPHA8_ASTC_10x10_Format:sv,SRGB8_ALPHA8_ASTC_10x5_Format:nv,SRGB8_ALPHA8_ASTC_10x6_Format:iv,SRGB8_ALPHA8_ASTC_10x8_Format:rv,SRGB8_ALPHA8_ASTC_12x10_Format:ov,SRGB8_ALPHA8_ASTC_12x12_Format:av,SRGB8_ALPHA8_ASTC_4x4_Format:X0,SRGB8_ALPHA8_ASTC_5x4_Format:Y0,SRGB8_ALPHA8_ASTC_5x5_Format:J0,SRGB8_ALPHA8_ASTC_6x5_Format:K0,SRGB8_ALPHA8_ASTC_6x6_Format:q0,SRGB8_ALPHA8_ASTC_8x5_Format:Q0,SRGB8_ALPHA8_ASTC_8x6_Format:ev,SRGB8_ALPHA8_ASTC_8x8_Format:tv,Scene:oc,SceneUtils:rB,ShaderChunk:Ke,ShaderLib:Bn,ShaderMaterial:Li,ShadowMaterial:Ed,Shape:mr,ShapeBufferGeometry:jr,ShapeGeometry:jr,ShapePath:cb,ShapeUtils:ti,ShortType:v0,Skeleton:ya,SkeletonHelper:Fb,SkinnedMesh:ga,SmoothShading:qL,Sphere:Ai,SphereBufferGeometry:$r,SphereGeometry:$r,Spherical:oN,SphericalHarmonics3:Hd,SplineCurve:Mc,SpotLight:Cc,SpotLightHelper:lN,Sprite:ma,SpriteMaterial:ha,SrcAlphaFactor:uh,SrcAlphaSaturateFactor:t0,SrcColorFactor:Yg,StaticCopyUsage:wR,StaticDrawUsage:Fs,StaticReadUsage:yR,StereoCamera:WO,StreamCopyUsage:AR,StreamDrawUsage:vR,StreamReadUsage:xR,StringKeyframeTrack:Jr,SubtractEquation:jg,SubtractiveBlending:oh,TOUCH:YL,TangentSpaceNormalMap:er,TetrahedronBufferGeometry:lo,TetrahedronGeometry:lo,TextBufferGeometry:Ec,TextGeometry:Ec,Texture:Mt,TextureLoader:Dd,TorusBufferGeometry:co,TorusGeometry:co,TorusKnotBufferGeometry:uo,TorusKnotGeometry:uo,Triangle:At,TriangleFanDrawMode:Ah,TriangleStripDrawMode:dv,TrianglesDrawMode:hv,TubeBufferGeometry:ho,TubeGeometry:ho,UVMapping:El,Uint16Attribute:WN,Uint16BufferAttribute:jl,Uint32Attribute:$N,Uint32BufferAttribute:$l,Uint8Attribute:UN,Uint8BufferAttribute:Iv,Uint8ClampedAttribute:GN,Uint8ClampedBufferAttribute:Ov,Uniform:Pc,UniformsLib:Re,UniformsUtils:Uv,UnsignedByteType:Rr,UnsignedInt248Type:Cs,UnsignedIntType:Ko,UnsignedShort4444Type:b0,UnsignedShort5551Type:x0,UnsignedShort565Type:w0,UnsignedShortType:Jo,VSMShadowMap:Ss,Vector2:Ae,Vector3:q,Vector4:it,VectorKeyframeTrack:mo,Vertex:VN,VertexColors:LN,VideoTexture:Iy,WebGL1Renderer:fy,WebGLCubeRenderTarget:nc,WebGLMultipleRenderTargets:xv,WebGLMultisampleRenderTarget:Ph,WebGLRenderTarget:Pn,WebGLRenderTargetCube:tB,WebGLRenderer:rt,WebGLUtils:dy,WireframeGeometry:Td,WireframeHelper:qN,WrapAroundEnding:qo,XHRLoader:QN,ZeroCurvatureEnding:Or,ZeroFactor:Zg,ZeroSlopeEnding:Nr,ZeroStencilOp:iR,sRGBEncoding:Br},Symbol.toStringTag,{value:"Module"})));function aB(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function lB(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 dB(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function fB(n,e){return e&&(typeof e=="object"||typeof e=="function")?e:dB(n)}function pB(n){var e=hB();return function(){var i=Uc(n),r;if(e){var s=Uc(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return fB(this,r)}}function Kb(n,e){return gB(n)||yB(n,e)||qb(n,e)||xB()}function Gc(n){return mB(n)||vB(n)||qb(n)||bB()}function mB(n){if(Array.isArray(n))return af(n)}function gB(n){if(Array.isArray(n))return n}function vB(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function yB(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 qb(n,e){if(n){if(typeof n=="string")return af(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 af(n,e)}}function af(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 aB(this,t),i=e.call(this,new Ia.SpriteMaterial({map:new Ia.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=Ia.LinearFilter,i._genCanvas(),i}return cB(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(F){return F*r.fontSize*.1}),c=Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius],f=c.map(function(F){return F*r.fontSize*.1}),d=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],p=d.map(function(F){return F*r.fontSize*.1}),v=this.text.split(` `),m="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);o.font=m;var h=Math.max.apply(Math,Gc(v.map(function(F){return o.measureText(F).width}))),b=this.fontSize*v.length;if(s.width=h+u[0]*2+p[0]*2,s.height=b+u[1]*2+p[1]*2,this.borderWidth){if(o.strokeStyle=this.borderColor,u[0]){var y=u[0]/2;o.lineWidth=u[0],o.beginPath(),o.moveTo(y,f[0]),o.lineTo(y,s.height-f[3]),o.moveTo(s.width-y,f[1]),o.lineTo(s.width-y,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 w=Math.max.apply(Math,Gc(u)),A=w/2;o.lineWidth=w,o.beginPath(),[!!f[0]&&[f[0],A,A,f[0]],!!f[1]&&[s.width-f[1],s.width-A,A,f[1]],!!f[2]&&[s.width-f[2],s.width-A,s.height-A,s.height-f[2]],!!f[3]&&[f[3],A,s.height-A,s.height-f[3]]].filter(function(F){return F}).forEach(function(F){var R=Kb(F,4),_=R[0],O=R[1],E=R[2],T=R[3];o.moveTo(_,E),o.quadraticCurveTo(O,E,O,T)}),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(F){var R=Kb(F,6),_=R[0],O=R[1],E=R[2],T=R[3],C=R[4],L=R[5];o.quadraticCurveTo(_,T,O,C),o.lineTo(E,L)}),o.closePath(),o.fill()):o.fillRect(u[0],u[1],s.width-u[0]*2,s.height-u[1]*2)),o.translate.apply(o,Gc(u)),o.translate.apply(o,Gc(p)),o.font=m,o.fillStyle=this.color,o.textBaseline="bottom";var S=this.strokeWidth>0;S&&(o.lineWidth=this.strokeWidth*this.fontSize/10,o.strokeStyle=this.strokeColor),v.forEach(function(F,R){var _=(h-o.measureText(F).width)/2,O=(R+1)*r.fontSize;S&&o.strokeText(F,_,O),o.fillText(F,_,O)}),this._texture.image=s,this._texture.needsUpdate=!0;var M=this.textHeight*v.length+l[1]*2+d[1]*2;this.scale.set(M*s.width/s.height,M,0)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(r){return Ia.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}(Ia.Sprite);const MB=xl(Object.freeze(Object.defineProperty({__proto__:null,default:wB},Symbol.toStringTag,{value:"Module"})));var lf={exports:{}},Qb;function AB(){return Qb||(Qb=1,function(n,e){(function(t,i){n.exports=i()})(typeof window<"u"?window:Xi,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,d){var p=Object.prototype.toString.call(f),v=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&f instanceof jQuery||typeof Elements<"u"&&f instanceof Elements,m=0,h=f.length;if(v)for(;m=2.0 are supported."));return}const c=new HB(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[d]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+d+'".')}}c.setExtensions(o),c.setPlugins(l),c.parse(i,r)}}function _B(){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 TB{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 FB{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 PB{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,d=r.byteStride,p=new ArrayBuffer(f*d),v=new Uint8Array(l[0],u,c);return o.decodeGltfBuffer(new Uint8Array(p),f,d,v,r.mode,r.filter),p})}else return null}}const ex="glTF",Oa=12,tx={JSON:1313821514,BIN:5130562};class IB{constructor(e){this.name=nt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Oa);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!==ex)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-Oa,r=new DataView(e,Oa);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 BB{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 cf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Le(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 Le(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Le(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 cf(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=er,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 DB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Mo extends ni{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}}Mo.prototype.beforeStart_=Mo.prototype.copySampleValue_,Mo.prototype.afterEnd_=Mo.prototype.copySampleValue_,Mo.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,d=f*f,p=d*f,v=n*u,m=v-u,h=-2*p+3*d,b=p-d,y=1-h,g=b-d+f;for(let w=0;w!==o;w++){const A=s[m+w+o],S=s[m+w+l]*c,M=s[v+w+o],F=s[v+w]*c;r[w]=y*A+g*S+h*M+b*F}return r};const Pi={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},Na={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},nx={9728:wt,9729:vt,9984:Xo,9985:Rl,9986:Yo,9987:bi},ix={33071:zt,33648:Es,10497:Qi},rx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uf={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},yr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},VB={CUBICSPLINE:void 0,LINEAR:Ir,STEP:Rs},hf={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function sx(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 kB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Zr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ji})),n.DefaultMaterial}function Ba(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 rs(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 zB(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l=2&&b.setY(_,M[F*u+1]),u>=3&&b.setZ(_,M[F*u+2]),u>=4&&b.setW(_,M[F*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||"",d=!1,p=!0;const v=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||v)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(h){if(t.mimeType==="image/png"){const y=new DataView(h,25,1).getUint8(0,!1);p=y===6||y===4||y===3}d=!0;const b=new Blob([h],{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 m=Promise.resolve(f).then(function(h){return new Promise(function(b,y){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const A=new Mt(w);A.needsUpdate=!0,b(A)}),i.load(sx(h,o.path),g,void 0,y)})}).then(function(h){d===!0&&c.revokeObjectURL(f),h.flipY=!1,l.name&&(h.name=l.name),p||(h.format=wi);const y=(s.samplers||{})[l.sampler]||{};return h.magFilter=nx[y.magFilter]||vt,h.minFilter=nx[y.minFilter]||bi,h.wrapS=ix[y.wrapS]||Qi,h.wrapT=ix[y.wrapT]||Qi,r.associations.set(h,{type:"textures",index:e}),h}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}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 dr,Ft.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 Vt,Ft.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 Zr}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 d=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const d=r[nt.KHR_MATERIALS_UNLIT];o=d.getMaterialType(),c.push(d.extendParams(l,s,t))}else{const d=s.pbrMetallicRoughness||{};if(l.color=new Le(1,1,1),l.opacity=1,Array.isArray(d.baseColorFactor)){const p=d.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}d.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",d.baseColorTexture)),l.metalness=d.metallicFactor!==void 0?d.metallicFactor:1,l.roughness=d.roughnessFactor!==void 0?d.roughnessFactor:1,d.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",d.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",d.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=Ki);const f=s.alphaMode||hf.OPAQUE;return f===hf.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===hf.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ae(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==cn&&(l.emissive=new Le().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==cn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let d;return o===cf?d=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):d=new o(l),s.name&&(d.name=s.name),d.map&&(d.map.encoding=Br),d.emissiveMap&&(d.emissiveMap.encoding=Br),rs(d,s),t.associations.set(d,{type:"materials",index:e}),s.extensions&&Ba(r,d,s),d})}createUniqueName(e){const t=et.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 lx(u,l,t)})}const o=[];for(let l=0,u=e.length;l0&&UB(y,s),y.name=t.createUniqueName(s.name||"mesh_"+e),rs(y,s),b.extensions&&Ba(r,y,b),t.assignFinalMaterial(y),d.push(y)}if(d.length===1)return d[0];const p=new qn;for(let v=0,m=d.length;v1?u=new qn:l.length===1?u=l[0]:u=new Xe,u!==l[0])for(let c=0,f=l.length;c0},!1)}function u(c,f){for(var d={main:[f]},p={main:[]},v={main:{}};l(d);)for(var m=Object.keys(d),h=0;h(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,d=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(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new d},o=>{o.exports=ZL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.15.1","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,d=(v,m,h)=>{var b=f(v,h),y=!1;1>h.opacity&&(y=!0);var g;if(b._video===void 0){var w=h.localTimeEnabled||h.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=h.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,transparent:y,opacity:h.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:h.colour,morphTargets:w,morphNormals:h.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:h.opacity,side:c.DoubleSide}),h.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:h.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:h.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(v,m,h)=>{if(!(this.morph&&this.morph.geometry&&v!=null)){var b=d(v,m,h);this.setMesh(b,h.localTimeEnabled,h.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var v=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,h=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(v.x-m.x,v.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y{this.morph.material.wireframe=v},this.editVertices=function(v,m){if(v&&v.length){var h=this.getMorph(),b=h.geometry.getAttribute("position");if(!h||0>m)return;var y=3*m;v.forEach(g=>{b.array[y++]=g[0],b.array[y++]=g[1],b.array[y++]=g[2]}),b.needsUpdate=!0,h.geometry.computeBoundingBox(),h.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=oB},(o,l,u)=>{function c(_){throw new TypeError('"'+_+'" is read-only')}var f=u(4),d=u(6).Geometry,p=u(7).default;function v(_){var O=_,E=u(0).modelPrefix;return E&&(E[E.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(_)||(O=E+_)),O}function m(_,O){var E=(C,L)=>{try{var I=new URL(C,L).href;if(C&&2>C.split("?").length){var x=L.split("?");x.length===2&&(I=I+"?"+x[1])}return I}catch{console.error("There is an issue creating the url link with: ".concat(C,"."))}};if(!Array.isArray(_))return E(_,O);var T=[];return _.forEach(C=>{T.push(E(C,O))}),T}function h(_,O,E,T,C){var L=_.morphTargetInfluences,I=void 0;_.geometry&&(I=_.geometry.morphAttributes);var x=!1;if(L&&I&&I.position){T.set(0,0,0),C.set(0,0,0);for(var P=0;P{C.readyState==4&&(C.status==200?E(C.responseText,O):T(_))},C.send(null)}function y(_,O,E){function T(P,B){I[B]=P,L++,L==C&&O(I)}for(var C=_.length,L=0,I=[],x=0;x{var E=Math.floor(O/3),T=O%3,C=0;T==0?C=_[E].r:T==1?C=_[E].g:T==2&&(C=_[E].b);var L=new f.Color(C);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(_,O){if(O&&_&&_.morphAttributes&&_.morphAttributes.color){var E=_.morphAttributes.color,T=O.morphTargetInfluences,C=T.length;_.deleteAttribute("morphColor0"),_.deleteAttribute("morphColor1");for(var L=0,I=[],x=0;1>L||x{var E;return _ instanceof d?(O.localTimeEnabled&&!_.morphNormalsReady&&(_.morphNormals==null||_.morphNormals.length==0)&&_.computeMorphNormals(),E=_.toIndexedBufferGeometry(),O.localMorphColour&&g(_,E)):_ instanceof f.BufferGeometry&&(E=_.clone()),E.colorsNeedUpdate=!0,E.computeBoundingBox(),E.computeBoundingSphere(),_._video&&(E._video=_._video),E},l.copyMorphColorsToBufferGeometry=(_,O)=>{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],T=_.morphColors,C=u(5).getColorsRGB,L=0,I=T.length;L{if(_&&_.morphColors&&0<_.morphColors.length){for(var E=[],T=_.morphColors,C=u(5).getColorsRGB,L=0,I=T.length;L[]))}for(var te=Math.log10(1/O),oe=Math.pow(10,te),k=0;k=Math.pow(2,8)&&(ee=Uint16Array),me.length>=Math.pow(2,16)&&(ee=Uint32Array);var ue=new ee(me),me=null;return C===null?me=new f.BufferAttribute(ue,1):(me=_.getIndex().clone(),me.setArray(ue)),U.setIndex(me),U};function A(_){if(_.isMeshPhongMaterial){var O=new f.MeshToonMaterial({color:_.color.clone(),morphTargets:_.morphTargets,morphNormals:_.morphNormals,vertexColors:_.vertexColors,transparent:_.transparent,opacity:_.opacity,side:_.side});return _.map&&(O.map=_.map),O}return _}function S(_,O){if(O&&_>=O.length){var E=new f.BufferGeometry,T=new Float32Array(3*_),C=0;return O.forEach(L=>{T[C++]=L[0],T[C++]=L[1],T[C++]=L[2]}),E.setAttribute("position",new f.BufferAttribute(T,3)),E.setDrawRange(0,O.length),E}}function M(){var _=new Image;_.src=u(8);var O=new f.Texture;return O.image=_,O.needsUpdate=!0,O}function F(_,O,E,T,C,L){var I=new p(_,O,E,T,C,L);return I.fontFace=T,I.fontSize=C,I.fontWeight=L,I.material.map.generateMipmaps=!1,I.material.map.anisotropy=4,I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}function R(_,O,E){if(E){var T=_||"",C=O||"",L=E.lastIndexOf("/");if(-1{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,d=new c.Object3D,p=new c.Vector3,v=new c.Vector3;function m(){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}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,A=new c.Matrix3().getNormalMatrix(g),S=0,M=this.vertices.length;Sx;x++)if(I[x]===I[(x+1)%3]){T.push(C);break}}for(var P,B=T.length-1;0<=B;B--){P=T[B],this.faces.splice(P,1);for(var D=0,V=this.faceVertexUvs.length;D{o.exports=MB},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,d=u(5).resolveURL,p=0,v=function(){return"pr"+p++},m=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=v(),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,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};m.prototype.setDuration=function(h){this.duration=h,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(h){this.region=h},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var h=this._lod.getCurrentMorph();return h||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(h){this.morph=h,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(h,b),this._lod.setMaterial(h.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(h,b,y){this.animationGroup=new c.AnimationObjectGroup(h),this.mixer=new c.AnimationMixer(this.animationGroup);var g=h.geometry;if(this.geometry=h.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,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=y,h.userData=this,h.matrixAutoUpdate=!1,this.setMorph(h),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setIsPickable=function(h){this.isPickable!==h&&(this.isPickable=h,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAnatomicalId=function(h){this.anatomicalId=h},m.prototype.setName=function(h){this.groupName=h,this._lod.setName(h)},m.prototype.getCurrentTime=function(){if(this.clipAction){var h=this.clipAction.time/this.clipAction._clip.duration;return this.duration*h}return this.inbuildTime},m.prototype.setMorphTime=function(h){var b=!1;if(this.clipAction){var y=h/this.duration,g=this.clipAction._clip.duration,w=y*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var A=h;A=h>this.duration?this.duration:0>h?0:h,A!=this.inbuildTime&&(this.inbuildTime=A,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(h){h!==this.visible&&(this.visible=h,this.group.visible=h,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(h){var b=this._lod._material,y=!1;1>h&&(y=!0),b.opacity=h,b.transparent=y,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(h){this._lod.setFrustumCulled(h)},m.prototype.setVertexColors=function(h){this._lod.setVertexColors(h)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(h){this._lod.setColour(h)},m.prototype.setGreyScale=function(h){if(h){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(h){this._lod._material.color.setHex(h),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(h)},m.prototype.setEmissiveRGB=function(h){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...h),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...h)},m.prototype.setMaterial=function(h){this._lod.setMaterial(h)},m.prototype.getClosestVertexIndex=function(){var h=-1,b=this.getMorph();if(b&&b.geoemtry){var y=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(y),this._b1.getCenter(this._v1),y)for(var g=-1,w=0,A=0;Aw&&(g=w,h=A)}return h},m.prototype.getClosestVertex=function(h){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var y=this.getMorph();if(y&&y.geometry&&0<=this.closestVertexIndex){var g=y.morphTargetInfluences,w=y.geometry.morphAttributes;if(g&&w&&w.position){for(var A=!1,S=0;Sy.x||1y.y)&&(b=!1),h.getZincCameraControls().getRelativeCoordsFromNDC(y.x,y.y,y),{position:y,inView:b}}},m.prototype.setMarkerMode=function(h,b){h!==this.markerMode&&(this.markerMode=h==="on"||h==="off"?h:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(h,b,y,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(y,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(h);else{var w=this.inbuildTime+h;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&h!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(h,b,y,g,w){this._lod.addLevelFromURL(h,b,y,g,w)},m.prototype.addVertices=function(h){var b=this.getMorph(),y=void 0;if(!b)y=f(500,h),this.drawRange=h.length;else if(-1{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),y=b.geoemtry,this.boundingBoxUpdateRequired=!0}return y},m.prototype.setPosition=function(h,b,y){var g=this.getGroup();g&&(g.position.set(h,b,y),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(h){h.load(d(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(h){var b=this.getGroup();b&&(b.scale.set(h,h,h),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,d=u(5).toBufferGeometry,p=function(v){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=v,this.addLevel=(h,b)=>{if(h){var y,g=Math.abs(b);for(y=0;y{if(h){for(var y=Math.abs(b),g=0;g{this._loader=h;var A,S=this.calculateDistance(b);for(A=0;A{var b=this.levels[h];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(h){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return h==="far"?y=4.5*b:h==="medium"?y=2.5*b:h=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1{var h=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,!h.secondaryMesh&&(h.secondaryMesh=new c.Mesh(h.morph.geometry,this._secondaryMaterial),h.secondaryMesh.renderOrder=h.morph.renderOrder+1,h.secondaryMesh.userData=h.morph.userData,h.secondaryMesh.name=h.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!h.secondaryMesh.parent&&(h.morph.add(h.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(h.secondaryMesh))):(h.secondaryMesh&&(h.morph.remove(h.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(h.secondaryMesh),this._parent.animationGroup.remove(h.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&h.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var h=this.levels[this._currentLevel];return h&&h.morph?h.morph:this._parent.morph},this.lodLoader=function(h){return b=>{var y=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=d(b,g),A=void 0;this._parent.isGeometry?A=new c.Mesh(w,y):this._parent.isLines&&(A=new(u(12)).LineSegments(w,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,h)}},this.updateMorphColorAttribute=h=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(h){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=h=>{this._material.color=h,this._secondaryMaterial&&(this._secondaryMaterial.color=h),m()},this.setFrustumCulled=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=h),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=h)})},this.setMaterial=h=>{h&&(!this._material||this._material.id!==h.id)&&(this._material=h,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=h.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=h=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=h),b.secondaryMesh&&(b.secondaryMesh.name=h)})},this.setRenderOrder=h=>{this._renderOrder=h,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=h),b.secondaryMesh&&(b.secondaryMesh.renderOrder=h)})},this.setVertexColors=h=>{this._material.vertexColors=h,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=h)},this.update=(h,b)=>{var y=this.levels;if(1=y[g].distance;g++)y[g].morph?(-1{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(h):y.morph.remove(h))})};var m=()=>{this.levels.forEach(h=>{h.morph&&h.morph.geometry&&(h.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>v});var c=u(13),f=u(4),d=new f.Vector3,p=new f.Vector3;class v extends c.Line{constructor(h,b){super(h,b),this.type="LineSegments"}computeLineDistances(){var h=this.geometry;if(!h.isBufferGeometry)h.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(h.index===null){for(var b=h.attributes.position,y=[],g=0,w=b.count;g{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,d=new c.Vector3,p=new c.Matrix4,v=new c.Ray,m=new c.Sphere,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0L)){B.applyMatrix4(this.matrixWorld);var $=M.ray.origin.distanceTo(B);$M.far||F.push({distance:$,point:P.clone().applyMatrix4(this.matrixWorld),index:oe,face:null,faceIndex:null,object:this})}}else for(var j=Math.max(0,E.start),re=Math.min(G.count,E.start+E.count),z=j;zL)){B.applyMatrix4(this.matrixWorld);var K=M.ray.origin.distanceTo(B);KM.far||F.push({distance:K,point:P.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else R.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var F=M.morphAttributes,R=Object.keys(F);if(0{var c=u(4),f=new Image(128,128);f.src=u(15);var d=new c.Texture;d.image=f,d.needsUpdate=!0;var p=[.02,.03,1],v=new c.SpriteMaterial({map:d,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,h=function(b){u(10).ZincObject.call(this),this.texture=d;var y=void 0,g=void 0,w=void 0,A=void 0,S=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var F=!1;this.ndc=new c.Vector3;var R=void 0,_=void 0,O=()=>{y=new c.Sprite(v),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(E,T)=>{var C=1,L=0;E!==T&&(L=1-(this.ndc.z-E)/(T-E),C=.6+.4*L),this.setSpriteSize(C)},this.updateNDC=E=>(this.ndc.copy(this.morph.position),this.ndc.project(E),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(E,T,C)=>{this.morph.position.set(E,T,C)},this.setSpriteSize=E=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(E)},this.setUserSprite=()=>{A&&(this.morph.add(A),M&&(this.morph.remove(y),_&&this.morph.remove(_),M=!1))},this.setImageForUserSprite=(E,T)=>{A&&(this.morph.remove(A),A=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=E,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),T||(T=[.05,.05,1]),A=new c.Sprite(w),A.center.set(.5,0),A.scale.set(T[0],T[1],T[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(y),A&&this.morph.remove(A),_&&this.morph.add(_))},this.loadUserSprite=(E,T)=>{if(E)if(E!==S){S=E;var C=new Image(128,128);C.crossOrigin="anonymous",C.onload=()=>{this.setImageForUserSprite(C,T)},C.src=E}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),_&&(_.material.map.dispose(),_.material.dispose(),_=void 0)},this.isEnabled=()=>F,this.setNumber=E=>{(!E||R!=E)&&_&&(this.morph.remove(_),_.material.map.dispose(),_.material.dispose(),_=void 0),!_&&E&&(_=m(E,.012,"black","Asap",120,700),this.morph.add(_)),R=E},this.getNumber=()=>R||1,this.setVisibility=function(E){E!==this.visible&&(this.visible=E,this.group.visible=E,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{F=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{F=!1,this.morph.visible=!1,this.visible=!1},O()};h.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=h},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(d,p,v,m){u(10).ZincObject.call(this);var h;p&&(h=p.clone(),h.vertexColors=c.FaceColors),this.id=v;var b=void 0,y=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),d&&h&&this.fromMesh(new c.Mesh(d,h)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(y=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(w,A,S,M)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=S[0],this.morph.matrix.elements[5]=S[1],this.morph.matrix.elements[6]=S[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(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,d){var p=f,v=void 0;v=d?new c(p,.015,d.getStyle()):new c(p,.015),v.fontFace="Asap",v.fontWeight=700,v.material.map.generateMipmaps=!1,v.material.sizeAttenuation=!1,v.center.x=-.05,v.center.y=0,this.getPosition=()=>v?[v.position.x,v.position.y,v.position.z]:[0,0,0],this.setPosition=(m,h,b)=>{v&&v.position.set(m,h,b)},this.setColour=m=>{v.color=m.getStyle()},this.setScale=m=>{v&&0{},this.getSprite=()=>v,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,d=function(){u(10).ZincObject.call(this);var p=[],v=void 0,m=void 0,h=void 0,b=void 0,y=void 0,g=void 0,w=void 0,A=0,S=0,M=[0,0,0],F=[0,0,0],R=[0,0,0],_="NONE";this.ready=!1;var O=!1,E=!1;this.isGlyphset=!0;var T=new c.Matrix4,C=new c.Color,L=new c.Color,I=new c.Box3,x=new c.Box3,P=new c.Box3,B=[],D=[],V=[],k=[],G=[],Y=[],te=[];this.globalScale=1;for(var oe=0;8>oe;oe++)new c.Vector3;this.load=(z,H,K,le,se)=>{v=z.axis1,m=z.axis2,h=z.axis3,b=z.positions,y=z.scale,g=z.colors,w=z.label,O=z.metadata.MorphColours,E=z.metadata.MorphVertices,A=z.metadata.number_of_time_steps,_=z.metadata.repeat_mode,S=z.metadata.number_of_vertices,_=="AXES_2D"||_=="MIRROR"?S*=2:_=="AXES_3D"&&(S*=3),M=z.metadata.base_size,F=z.metadata.offset,R=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var N=new c.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(N),le){var Z=U.parse(H);re(K,se)(Z.geometry,Z.materials),Z.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(H,re(K,se))};var ie=(z,H,K,le,se,U)=>{if(_=="NONE"||_=="MIRROR"){for(var N,Z=[0,0,0],X=[0,0,0],ee=[0,0,0],ue=[0,0,0],me=[0,0,0],be=[0,0,0],ce=[0,0,0],ge=[0,0,0],ne=[0,0,0],de=0;3>de;de++)N=0>se[de]?-1:1,Z[de]=(N*M[de]+se[de]*R[de])*this.globalScale;for(var de=0;3>de;de++)X[de]=H[de]*Z[0],ee[de]=K[de]*Z[1],ue[de]=le[de]*Z[2],me[de]=z[de]+F[0]*X[de]+F[1]*ee[de]+F[2]*ue[de],_=="MIRROR"&&(be[de]=-X[de],ce[de]=-ee[de],ge[de]=-ue[de],ne[de]=me[de],0>se[0]&&(me[de]-=X[de],ne[de]-=be[de]));0>ue[0]*(X[1]*ee[2]-X[2]*ee[1])+ue[1]*(X[2]*ee[0]-X[0]*ee[2])+ue[2]*(X[0]*ee[1]-X[1]*ee[0])&&(ue[0]=-ue[0],ue[1]=-ue[1],ue[2]=-ue[2]),U[0]=[me,X,ee,ue],_=="MIRROR"&&(0>ge[0]*(be[1]*ce[2]-be[2]*ce[1])+ge[1]*(be[2]*ce[0]-be[0]*ce[2])+ge[2]*(be[0]*ce[1]-be[1]*ce[0])&&(ge[0]=-ge[0],ge[1]=-ge[1],ge[2]=-ge[2]),U[1]=[ne,be,ce,ge])}else if(_=="AXES_2D"||_=="AXES_3D"){for(var N,ve=[0,0,0],Ee=[0,0,0],de=0;3>de;de++)N=0>se[de]?-1:1,ve[de]=(N*M[0]+se[de]*R[0])*this.globalScale;for(var de=0;3>de;de++)Ee[de]=z[de]+F[0]*ve[0]*H[de]+F[1]*ve[1]*K[de]+F[2]*ve[2]*le[de];for(var _e=glyph_repeat_mode=="AXES_2D"?2:3,Ne=0;Ne<_e;Ne++){var Je=void 0,ze=void 0,st=se[Ne],Ce=[0,0,0],je=[0,0,0],He=[0,0,0];Ne==0?(Je=H,ze=K):Ne==1?(Je=K,ze=glyph_repeat_mode=="AXES_2D"?H:le):(Je=le,ze=H);var Pt=(M[0]+st*R[0])*this.globalScale;Ce[0]=Je[0]*Pt,Ce[1]=Je[1]*Pt,Ce[2]=Je[2]*Pt,He[0]=Ce[1]*ze[2]-ze[1]*Ce[2],He[1]=Ce[2]*ze[0]-ze[2]*Ce[0],He[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var It=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]);if(0{var U=1;_=="AXES_2D"||_=="MIRROR"?U=2:_=="AXES_3D"&&(U=3);var N=z.length/3,Z=0;te.length=U;for(var X=0;X{var H=1;_=="AXES_2D"||_=="MIRROR"?H=2:_=="AXES_3D"&&(H=3);for(var K,le=z.length,se=0,U=0;U{var z=B,H=D,K=V,le=k,se=G,U=Y,N=this.inbuildTime/this.duration*(A-1),Z=Math.floor(N),X=1-(N-Z),ee=Math.ceil(N);if(E){var ue=b[Z.toString()],me=b[ee.toString()],be=v[Z.toString()],ce=v[ee.toString()],ge=m[Z.toString()],ne=m[ee.toString()],de=h[Z.toString()],ve=h[ee.toString()],Ee=y[Z.toString()],_e=y[ee.toString()];B.length=ue.length,D.length=ue.length,V.length=ue.length,k.length=ue.length,G.length=ue.length;for(var Ne=0;Ne{for(var z=0;z{for(var z=0;z{for(var H=0;H{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,H)=>{if(z.isMesh){var K=new(u(16)).Glyph(void 0,void 0,H,this);return K.fromMesh(z),p.push(K),this.morph.add(K.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,K}},this.forEachGlyph=z=>{for(var H=0;H(K,le)=>{var se=K.toBufferGeometry();this.geometry.copy(se),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),se.dispose(),le&&le[0]&&(this.morph.material=le[0]),j(H),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),K.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var H,K=b[0],le=K.length/3,se=-1,U=0,N=0;NU)&&(se=U,z=N)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,T),z.setFromMatrixPosition(T),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){I.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(O||E)&&($(),E&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,$()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),v=void 0,m=void 0,h=void 0,b=void 0,y=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,H,K)=>{if(H==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(O||E)&&$()}this.updateMarker(H,K)}};d.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=d},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,d=c.LoaderUtils,p=c.AnimationClip,v=c.Vector3,m=c.Vector4,h=c.Color,b=c.Vector2,y=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,A=c.DefaultLoadingManager,S=u(21).VideoHandler;function M(F){typeof F=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),F=void 0),this.manager=F===void 0?A:F,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(R,_,O,E){var T=this,C=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:d.extractUrlBase(R),L=new w(this.manager);R.split("?"),this.paramsString=R.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(R,function(I){var x;try{x=JSON.parse(I)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),E)return void E({responseURL:R})}var P=x.metadata;if(P!==void 0){var B=P.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+R+" should be loaded with THREE.ObjectLoader instead.")}if(T&&T.parse)try{var D=T.parse(x,C);_(D.geometry,D.materials)}catch(V){if(console.error("The loader has encountered aon loading the geometry"),console.error(V),E)return void E({responseURL:R})}},O,E)},setTexturePath:function(R){this.texturePath=R},parse:function(){function F(E,T){function C(de,ve){return de&1<I;I++)k=ee[P++],Z=U[2*k],X=U[2*k+1],N=new b(Z,X),I!==2&&T.faceVertexUvs[L][x].push(N),I!==0&&T.faceVertexUvs[L][x+1].push(N);if(ae&&(V=3*ee[P++],H.normal.set(me[V++],me[V++],me[V]),K.normal.copy(H.normal)),W)for(L=0;4>L;L++)V=3*ee[P++],se=new v(me[V++],me[V++],me[V]),L!==2&&H.vertexNormals.push(se),L!==0&&K.vertexNormals.push(se);if($&&(D=ee[P++],le=be[D],H.color.setHex(le),K.color.setHex(le)),j)for(L=0;4>L;L++)D=ee[P++],le=be[D],L!==2&&H.vertexColors.push(new h(le)),L!==0&&K.vertexColors.push(new h(le));T.faces.push(H),T.faces.push(K)}else{if(z=new y,z.a=ee[P++],z.b=ee[P++],z.c=ee[P++],oe&&(G=ee[P++],z.materialIndex=G),x=T.faces.length,ie)for(L=0;LI;I++)k=ee[P++],Z=U[2*k],X=U[2*k+1],N=new b(Z,X),T.faceVertexUvs[L][x].push(N);if(ae&&(V=3*ee[P++],z.normal.set(me[V++],me[V++],me[V])),W)for(L=0;3>L;L++)V=3*ee[P++],se=new v(me[V++],me[V++],me[V]),z.vertexNormals.push(se);if($&&(D=ee[P++],z.color.setHex(be[D])),j)for(L=0;3>L;L++)D=ee[P++],z.vertexColors.push(new h(be[D]));T.faces.push(z)}}function R(E,T){var C=E.influencesPerVertex===void 0?2:E.influencesPerVertex;if(E.skinWeights)for(var L=0,I=E.skinWeights.length;L{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,v){this.handlers.push(p,v)},get:function(p){for(var v=this.handlers,m=0,h=v.length;mA.opacity&&(A.transparent=!0),m.setTextures(w),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var d=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,v){var m=p/v*d.video.duration;d.video.currentTime=m},this.getVideoDuration=function(){return d.video.duration},this.createCanvasVideoTexture=function(){return d.videoTexture=new c.VideoTexture(d.video),d.videoTexture.minFilter=c.LinearFilter,d.videoTexture.magFilter=c.LinearFilter,d.videoTexture.format=c.RGBFormat,d.video.currentTime=0,d.videoTexture},this.getCurrentTime=function(p){return d.video?p*(d.video.currentTime/d.video.duration):0},this.isReadyToPlay=function(){return!!(d.video&&3<=d.video.readyState)},function(){document&&(d.video=document.createElement("video"),d.video.crossOrigin="anonymous",d.video.src=f,d.video.load(),d.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,d=u(5).toBufferGeometry,p=u(5).getCircularTexture,v=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var h=[];this.createMesh=(y,g,w)=>{if(y&&g){var A=d(y,w),S=p();g.map=S;var M=new f(A,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(y,g,w,A)=>{if(w){var S=new c.Color(A),M=new v(w,S);M.setPosition(g[0],g[1],g[2]);var F=M.getSprite();F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,this.group.add(F),h[y]=M}};this.addPoints=(y,g,w)=>{if(y&&0{this.morph&&this.morph.material&&(this.morph.material.size=y,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=y=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=y,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(y){if(0<=y&&this.drawRange>y){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(y),g.getY(y),g.getZ(y)]}},this.editVertices=function(y,g){if(y&&y.length){var w=this.getMorph(),A=g+y.length-1;if(!w||0>g||A>=this.drawRange)return;var S=w.geometry.getAttribute("position"),M=g;y.forEach(F=>{var R=h[M];R&&R.setPosition(F[0],F[1],F[2]),S.setXYZ(M++,F[0],F[1],F[2])}),S.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(y,g,w,A)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,y,g,w,A)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,d=new c.Ray,p=new c.Sphere,v=new c.Vector3,m=new c.Vector3,h=new c.Vector3;class b extends c.Object3D{constructor(){var A=0F.far)return;R.push({distance:T,distanceToRay:Math.sqrt(O),point:E,index:A,face:null,object:_})}}function g(w,A,S,M){v.fromBufferAttribute(A,M);var F=w.morphTargetInfluences;if(w.material.morphTargets&&S&&F){m.set(0,0,0);for(var R=0,_=S.length;R<_;R++){var O=F[R],E=S[R];O!==0&&(h.fromBufferAttribute(E,M),m.addScaledVector(h.sub(v),O))}v.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,d=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,v,m)=>{if(p&&v){var h=f(p,m);m.localMorphColour&&h.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(h,v);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,v)=>{if(p&&0{function c(v,m,h,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void h(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,h=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,h);g(void 0)})}}var d=u(4),p=function(){var v=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(h){var b=1,y=1,g=0;if(h&&h.length){v.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var A,S=document.createElement("canvas"),M=0,F=Array(h.length),R=0;R{_.set(O,M),M+=O.length}),v.impl=new d.DataTexture2DArray(_,b,y,g),v.size={width:b,height:y,depth:g},v.isLoading=!1,v.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var h;if(!m)h=new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=d.FrontSide;m.side&&(y=m.side),h=new d.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(h.glslVersion=m.glslVersion)}if(h)return h.needsUpdate=!0,h}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(v,m,h,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void h(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,h=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,h);g(void 0)})}}var d=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(v,m){return new Promise((h,b)=>{v.onload=()=>h(v),v.onerror=b,v.src=m})},p.prototype.imageToUint8Array=function(){var v=f(function*(m,h,b,y){yield m.loadImage(h,b),y.width=h.width,y.height=h.height;var g=y.getContext("2d");return g.drawImage(h,0,0),{array:new Uint8Array(g.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return v.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var v=f(function*(){});return function(){return v.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new d.MeshBasicMaterial({color:new d.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:d.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);g&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),w.push.apply(w,A)}return w}function f(y){for(var g,w=1;w{R.forEach(_=>this.createSlide(_))};var M=(R,_)=>{var O=R.material,E=O.uniforms;switch(R.rotation.x=0,R.rotation.y=0,R.rotation.z=0,R.position.x=0,R.position.y=0,R.position.z=0,_.direction){case"x":var T=-Math.PI/2;R.rotation.y=T,E.direction.value=1,E.slide.value.set(_.value,0,0),R.position.x=_.value;break;case"y":R.rotation.x=Math.PI/2,E.direction.value=2,E.slide.value.set(0,_.value,0),R.position.y=_.value;break;case"z":E.direction.value=3,E.slide.value.set(0,0,_.value),R.position.z=_.value;break}O.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=R=>{R&&R.id&&R.id in w&&w[R.id]&&M(w[R.id],R)},this.createSlide=R=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&R&&R.direction&&R.value!==void 0){var _=new m.PlaneGeometry(1,1);_.translate(.5,.5,0);var O=h.getUniforms();O.diffuse.value=this.texture.impl,O.depth.value=this.texture.size.depth,O.flipY.value=S;var E={fs:h.fs,vs:h.vs,uniforms:O,glslVersion:h.glslVersion,side:m.DoubleSide,transparent:!1},T=this.texture.getMaterial(E);T.needsUpdate=!0;var C=new m.Mesh(_,T);C.name=this.groupName,C.userData=this;var L={value:R.value,direction:R.direction,id:C.id};return g.push(L),M(C,L),w[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,L}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=R=>{for(var _=0;_this.morph?[...this.morph.children]:[],this.removeSlide=R=>{R&&this.removeSlideWithId(R.id)},this.removeSlideWithId=R=>{if(this.morph&&R in w&&w[R]){if(this.morph.getObjectById(R)){var _=w[R];this.morph.remove(_),_.clear(),_.geometry&&_.geometry.dispose(),_.material&&_.material.dispose(),this.boundingBoxUpdateRequired=!0}var O=g.findIndex(E=>E.id===R);-1{this.morph.children.forEach(R=>{R.geometry&&R.geometry.dispose(),R.material&&R.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var F=(R,_,O)=>{if(_)switch(_.direction.value){case 1:O.copy(_.slide.value),R.expandByPoint(O),O.setY(1),O.setZ(1),R.expandByPoint(O);break;case 2:O.copy(_.slide.value),R.expandByPoint(O),O.setX(1),O.setZ(1),R.expandByPoint(O);break;case 3:O.copy(_.slide.value),R.expandByPoint(O),O.setX(1),O.setY(1),R.expandByPoint(O);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var R=new m.Vector3(0,0,0);this.morph.children.forEach(_=>{F(this.cachedBoundingBox,_.material.uniforms,R)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(R,_,O)=>{var E=new m.Matrix4;E.set(R[0],R[1],R[2],0,R[3],R[4],R[5],0,R[6],R[7],R[8],0,0,0,0,0);var T=new m.Quaternion().setFromRotationMatrix(E);this.morph.position.set(..._),this.morph.quaternion.copy(T),this.morph.scale.set(...O),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=R=>{this.morph.renderOrder=R},this.initialise=(R,_)=>{if(R){var O=R.locations;O&&0{if(A)A.material.color=R;else{var _=new m.BoxGeometry(1,1,1);_.translate(.5,.5,.5);var O=new m.EdgesGeometry(_);A=new m.LineSegments(O,new m.LineBasicMaterial({color:R})),this.group.add(A)}A.visible=!0},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,d=` precision highp float; precision highp int; precision highp sampler2DArray; uniform sampler2DArray diffuse; uniform bool discardAlpha; in vec3 vUw; out vec4 outColor; void main() { vec4 color = texture( diffuse, vUw ); // lighten a bit if (discardAlpha && color.a == 0.0) discard; outColor = vec4( color.rgba ); } `,p=` 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); } `,v=function(){return{diffuse:{value:void 0},depth:{value:1},slide:{value:new c.Vector3(0,0,1)},direction:{value:1},flipY:{value:!0},discardAlpha:{value:!0}}};l.fs=d,l.vs=p,l.glslVersion=f,l.getUniforms=v},(o,l,u)=>{u(4);var c=u(5).resolveURL,f=function(d){u(10).ZincObject.call(this),this.isTexturePrimitive=!0,this.texture=d,this.load=(p,v)=>{if(p&&p.images&&p.images.source){var m=new(u(25)).TextureArray,h=[];p.images.source.forEach(y=>{h.push(c(y))});var b=this;m.loadFromImages(h).then(()=>{b.texture=m,b.initialise(p,v)})}},this.initialise=(p,v)=>{v!=null&&typeof v=="function"&&v(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(d){var p=d,v=void 0,m=void 0,h=new c.Clock(!1);this.playAnimation=!0;var b=1e3,y=[],g=0,w=[],A=0,S=void 0,M=void 0,F=void 0,R=void 0,_=[],O=[],E=new c.Group,T=void 0,C=void 0,L=!1;this.getDrawingWidth=()=>p?p.clientWidth:T?typeof T.clientWidth>"u"?Math.round(T.width):Math.round(T.clientWidth):0,this.getDrawingHeight=()=>p?p.clientHeight:T?typeof T.clientHeight>"u"?Math.round(T.height):Math.round(T.clientHeight):0,this.onWindowResize=()=>{m.onWindowResize();var P=this.getDrawingWidth(),B=this.getDrawingHeight();if(v!=null){var D;p?(D=p.getBoundingClientRect(),v.setSize(P,B)):T&&(typeof T.getBoundingClientRect>"u"||(D=T.getBoundingClientRect(),T.width=P,T.height=B),v.setSize(P,B,!1)),D&&(D.left,D.top);var V=new c.Vector2;v.getSize(V),V.x,V.y}},this.initialiseVisualisation=P=>{if(P=P||{},P.antialias===void 0){var B=!1;try{/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(B=!0)}catch{B=!1}P.antialias=!B}P.canvas&&(p=void 0,T=P.canvas),v=new c.WebGLRenderer(P),p!==void 0&&p.appendChild(v.domElement),v.setClearColor(16777215,1),T&&T.style&&(T.style.height="100%",T.style.width="100%"),v.autoClear=!1;var D=this.createScene("default");this.setCurrentScene(D)},this.getCurrentScene=()=>m,this.setCurrentScene=P=>{if(P){this.removeActiveScene(P);var B=m;m=P,B&&B.setInteractiveControlEnable(!1),m.setInteractiveControlEnable(!0),m.setAdditionalScenesGroup(E),this.onWindowResize()}},this.getSceneByName=P=>_[P],this.createScene=P=>{if(_[P]==null){var B;return B=T?new(u(32)).Scene(T,v):new(u(32)).Scene(p,v),_[P]=B,B.sceneName=P,B}},this.resetView=()=>{m.resetView()},this.viewAll=()=>{if(m){var P=m.getBoundingBox();if(P){for(var B,D=0;D{m.loadModelsURL(P,B,D,V,k,G)},this.loadViewURL=P=>{m.loadViewURL(P)},this.loadFromViewURL=(P,B)=>{m.loadFromViewURL(P,B)},this.updateDirectionalLight=()=>{m.updateDirectionalLight()};var I=()=>{L?(S=requestAnimationFrame(I),this.render()):(cancelAnimationFrame(S),S=void 0)};this.stopAnimate=()=>{L&&(h.stop(),L=!1)},this.animate=()=>{L||(h.start(),L=!0,I())},this.addPreRenderCallbackFunction=P=>(++g,y[g]=P,g),this.removePreRenderCallbackFunction=P=>{P in y&&delete y[P]},this.addPostRenderCallbackFunction=P=>(++A,w[A]=P,A),this.removePostRenderCallbackFunction=P=>{P in w&&delete w[P]},this.getPlayRate=()=>b,this.setPlayRate=P=>{b=P},this.getCurrentTime=()=>m.getCurrentTime(),this.setMorphsTime=P=>{m.setMorphsTime(P)},this.getZincGeometryByID=P=>m.getZincGeometryByID(P),this.addToScene=P=>{m.addObject(P)},this.addToOrthoScene=P=>{if(F==null&&(F=new c.Scene),M==null){var B=this.getDrawingWidth(),D=this.getDrawingHeight();M=new c.OrthographicCamera(-B/2,B/2,D/2,-D/2,1,10),M.position.z=10}F.add(P)};var x=P=>B=>{B.needsUpdate=!0;var D=new c.SpriteMaterial({map:B}),V=D.map.image.width,k=D.map.image.height;P.material=D,P.scale.set(V,k,1);var G=this.getDrawingWidth(),Y=this.getDrawingHeight();P.position.set((G-V)/2,(-Y+k)/2,1),this.addToOrthoScene(P)};this.addLogo=()=>{R=new c.Sprite,c.ImageUtils.loadTexture("images/abi_big_logo_transparent_small.png",void 0,x(R))},this.render=()=>{C||(p?0v,this.isSceneActive=P=>{if(m===P)return!0;for(var B,D=0;D{this.isSceneActive(P)||(O.push(P),E.add(P.getThreeJSScene()))},this.removeActiveScene=P=>{for(var B,D=0;D{for(var P=0;P{for(var P in L&&cancelAnimationFrame(S),_)_.hasOwnProperty(P)&&_[P].clearAll();_=[],O=[],E=new c.Group,this.stopAnimate(),y=[],g=0,M=void 0,F=void 0,R=void 0;var B=this.createScene("default");this.setCurrentScene(B),C=void 0},this.transitionScene=(P,B)=>{if(m){var D=m.getZincCameraControls(),V=P.getBoundingBox();if(V){var k=V.min.distanceTo(V.max)/2,G=(V.min.x+V.max.x)/2,Y=(V.min.y+V.max.y)/2,te=(V.min.z+V.max.z)/2,oe=D.getViewportFromCentreAndRadius(G,Y,te,k,40,k*4),ie=D.getCurrentViewport();D.cameraTransition(ie,oe,B),D.enableCameraTransition()}}},this.isWebGL2=()=>!!v&&v.capabilities.isWebGL2}},o=>{o.exports=AB()},(o,l,u)=>{var c=u(4),f=u(33).MarkerCluster,d=u(35).SceneLoader,p=u(42).SceneExporter,v=u(44).Viewport,m=u(5).createBufferGeometry,h=u(5).getCircularTexture,b=u(5).createNewSpriteText,y=0,g=function(){return"sc"+y++},w=function(){return{Duration:"6 secs",OriginalDuration:"-",TimeStamps:{}}},A=6e3;l.Scene=function(S,M){var F=this,R=S,_=void 0,O=new d(this),E=void 0,T={},C=0,L={},I=0,x=new c.Scene,P=new c.Scene,B=new(u(45)).Region(void 0,this);x.add(B.getGroup());var D=new c.Group;x.add(D),this.directionalLight=void 0,this.ambient=void 0,this.camera=void 0;var V=6e3,k=void 0;this.sceneName=void 0;var G=!1,Y=void 0;this.autoClearFlag=!0,this.displayMarkers=!1,this.displayMinimap=!1,this.displayMiniAxes=!1,this.minimapScissor={x_offset:16,y_offset:16,width:128,height:128,align:"top-right",updateRequired:!0};var te={x:0,y:0},oe=w(),ie=new c.Vector2,ae=[];this.forcePickableObjectsUpdate=!1,this.uuid=g();var W=new f(this);W.disable(),x.add(W.group);var $={main:[],mini:[]},j=new c.Vector3(0,0,0),re=()=>R?typeof R.clientWidth>"u"?R.width:R.clientWidth:0,z=()=>R?typeof R.clientHeight>"u"?R.height:R.clientHeight:0;this.getDownloadProgress=()=>O.getDownloadProgress(),this.onWindowResize=()=>{var N=z();this.camera.aspect=re()/N,this.camera.updateProjectionMatrix(),this.minimapScissor.updateRequired=!0,k.onResize(),k.calculateHeightPerPixelAtZeroDepth(N)},this.resetView=()=>{this.onWindowResize(),k.resetView()},this.changeZoomByScrollRateUnit=N=>{k.changeZoomByScrollRateUnit(N)};var H=()=>{this.camera=new c.PerspectiveCamera(40,re()/z(),0,10),this.ambient=new c.AmbientLight(16777215,.2),x.add(this.ambient),this.directionalLight=new c.DirectionalLight(16777215,.8),x.add(this.directionalLight),k=new(u(44)).CameraControls(this.camera,M.domElement,M,this),k.setDirectionalLight(this.directionalLight),k.resetView(),E=new(u(50)).Minimap(this)};H(),this.loadView=N=>{var Z=new v;return Z.setFromObject(N),k.setCurrentCameraSettings(Z),!0},this.setupMultipleViews=(N,Z)=>{for(var[X,ee]of Object.entries(Z)){var ue=new v;ue.setFromObject(ee),k.addViewport(X,ue)}k.setDefaultViewport(N)},this.getBoundingBox=()=>B.getBoundingBox(!0),this.viewAllWithBoundingBox=N=>{if(N){var Z=k.getViewportFromBoundingBox(N,1);k.setCurrentCameraSettings(Z),k.calculateHeightPerPixelAtZeroDepth(z()),W.markerUpdateRequired=!0}},this.viewAll=()=>{var N=this.getBoundingBox();this.viewAllWithBoundingBox(N),W.markerUpdateRequired=!0},this.forEachGeometry=N=>{B.forEachGeometry(N,!0)},this.forEachGlyphset=N=>{B.forEachGlyphset(N,!0)},this.forEachPointset=N=>{B.forEachPointset(N,!0)},this.forEachLine=N=>{B.forEachLine(N,!0)},this.findGeometriesWithGroupName=N=>B.findGeometriesWithGroupName(N,!0),this.findPointsetsWithGroupName=N=>B.findPointsetsWithGroupName(N,!0),this.findGlyphsetsWithGroupName=N=>B.findGlyphsetsWithGroupName(N,!0),this.findLinesWithGroupName=N=>B.findLinesWithGroupName(N,!0),this.findObjectsWithGroupName=N=>B.findObjectsWithGroupName(N,!0),this.findObjectsWithAnatomicalId=N=>B.findObjectsWithAnatomicalId(N,!0),this.getBoundingBoxOfZincObjects=N=>{for(var Z,X=void 0,ee=0;ee{N.project(this.camera);var Z=re(),X=z(),ee=Z/2,ue=X/2;return N.x=N.x*ee+ee,N.y=-(N.y*ue)+ue,N},this.getObjectsScreenXY=N=>{if(N&&0{var Z=this.findObjectsWithGroupName(N);return this.getObjectsScreenXY(Z)},this.addZincObject=N=>{N&&(B.addZincObject(N),k&&k.calculateMaxAllowedDistance(this))},this.loadGlyphsetURL=(N,Z,X,ee)=>{O.loadGlyphsetURL(B,N,Z,X,ee)},this.loadPointsetURL=(N,Z,X,ee,ue)=>{O.loadPointsetURL(B,N,Z,X,ee,ue)},this.loadLinesURL=(N,Z,X,ee,ue)=>{O.loadLinesURL(B,N,Z,X,ee,ue)},this.loadSTL=(N,Z,X)=>{O.loadSTL(B,N,Z,X)},this.loadOBJ=(N,Z,X)=>{O.loadOBJ(B,N,Z,X)},this.loadMetadataURL=(N,Z,X,ee)=>{O.loadMetadataURL(B,N,Z,X,ee)},this.loadModelsURL=(N,Z,X,ee,ue,me)=>{O.loadModelsURL(B.urls,Z,X,ee,ue,me)},this.loadViewURL=N=>{O.loadViewURL(N)},this.loadFromViewURL=(N,Z)=>{O.loadFromViewURL(N,Z)},this.loadGLTF=(N,Z,X,ee)=>{O.loadGLTF(B,N,Z,X,ee)},this.updateDirectionalLight=()=>{k.updateDirectionalLight()},this.addObject=N=>{x.add(N)},this.removeObject=N=>{x.remove(N)},this.getCurrentTime=()=>{if(_!=null)return _.getCurrentTime(V);var N=B.getCurrentTime();return N===-1?0:N},this.setMorphsTime=N=>{_!=null&&_.setMorphTime(N,V),B.setMorphTime(N,!0)},this.isTimeVarying=()=>!!(_&&_.video&&!_.video.error)||B.isTimeVarying(),this.renderGeometries=(N,Z,X)=>{var ee={};if(ee.camera=k,ee.displayMarkers=this.displayMarkers,ee.markerCluster=W,ee.markersList=W.markers,ee.ndcToBeUpdated=!1,X&&(ee.markerCluster.markerUpdateRequired=!0),!_)O.toBeDownloaded==0?(ee.ndcToBeUpdated=k.update(Z),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.renderGeometries(N,Z,X,k,ee,!0)):k.update(0);else if(_.isReadyToPlay()){X?_.video.play():_.video.pause();var ue=_.video.currentTime/_.getVideoDuration()*V;O.toBeDownloaded==0?(k.setTime(ue),ee.ndcToBeUpdated=k.update(0),ee.ndcToBeUpdated&&k.calculateHeightPerPixelAtZeroDepth(z()),B.setMorphTime(ue,!0),B.renderGeometries(0,0,X,k,ee,!0)):k.update(0)}else myPlayRate=0},this.getThreeJSScene=()=>x,this.setVideoHandler=N=>{_||(_=N)},this.setAdditionalScenesGroup=N=>{x.add(N)};var K=(N,Z,X,ee,ue,me,be)=>{var ce=0,ge=0;return ge=N.includes("top")?be-ue-X:N.includes("bottom")?X:Math.floor((be-ue)/2),ce=N.includes("left")?Z:N.includes("right")?me-Z-ee:Math.floor((me-ee)/2),{x:ce,y:ge}},le=N=>{(this.displayMinimap||this.displayMiniAxes)&&(N.setScissorTest(!0),N.getSize(ie),this.minimapScissor.updateRequired&&(te=K(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),N.setScissor(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),N.setViewport(te.x,te.y,this.minimapScissor.width,this.minimapScissor.height),E.updateCamera(),this.displayMiniAxes?N.render(P,E.camera):(x.add(E.mask),N.render(x,E.camera),x.remove(E.mask)),N.setScissorTest(!1),N.setViewport(0,0,ie.x,ie.y))};this.render=N=>{this.autoClearFlag&&N.clear(),G&&Y?Y.render(x,this.camera):(N.render(x,this.camera),le(N))},this.setInteractiveControlEnable=N=>{N==!0?k.enable():k.disable()},this.getZincCameraControls=()=>k,this.getThreeJSScene=()=>x,this.setDuration=N=>{B.setDuration(N),V=N,k.setPathDuration(N),O.duration=N},this.getDuration=()=>V,this.setStereoEffectEnable=N=>{N!=!0||Y||(Y=new u(44).StereoEffect(M)),M.setSize(re(),z()),this.camera.updateProjectionMatrix(),G=N},this.objectIsInScene=N=>B.objectIsInRegion(N,!0),this.alignBoundingBoxToCameraView=(N,Z)=>{if(N){N.getCenter(j);var X=this.getZincCameraControls().getCurrentViewport(),ee=new c.Vector3(X.targetPosition[0],X.targetPosition[1],X.targetPosition[2]),ue=new c.Vector3(X.eyePosition[0],X.eyePosition[1],X.eyePosition[2]),me=new c.Vector3,be=new c.Vector3;me.subVectors(ee,ue).normalize(),be.subVectors(ee,j).normalize();var ce=new c.Vector3;ce.crossVectors(me,be);var ge=me.angleTo(be);0{if(N){var ee=this.getZincCameraControls().getCurrentViewport(),ue=this.getZincCameraControls().getViewportFromBoundingBox(N,Z);0{if(this.objectIsInScene(N)){var X=N.getBoundingBox();this.alignBoundingBoxToCameraView(X,Z)}},this.setCameraTargetToObject=N=>{if(this.objectIsInScene(N)){var Z=N.getBoundingBox(),X=this.getZincCameraControls().getCurrentViewport();Z.getCenter(j);var ee=new c.Vector3(X.targetPosition[0],X.targetPosition[1],X.targetPosition[2]),ue=new c.Vector3(X.eyePosition[0],X.eyePosition[1],X.eyePosition[2]),me=new c.Vector3,be=new c.Vector3;me.subVectors(ue,ee),be.addVectors(j,me),X.eyePosition[0]=be.x,X.eyePosition[1]=be.y,X.eyePosition[2]=be.z,X.targetPosition[0]=j.x,X.targetPosition[1]=j.y,X.targetPosition[2]=j.z,this.getZincCameraControls().setCurrentCameraSettings(X),W.markerUpdateRequired=!0}},this.isStereoEffectEnable=()=>G,this.removeZincObject=N=>{B.removeZincObject(N),k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.updatePickableThreeJSObjects=()=>{ae.length=0,W.isEnabled&&ae.push(W.group),B.getPickableThreeJSObjects(ae,!0),this.forcePickableObjectsUpdate=!1},this.getPickableThreeJSObjects=()=>((this.forcePickableObjectsUpdate||B.checkPickableUpdateRequred(!0))&&this.updatePickableThreeJSObjects(),ae),this.getNormalisedMinimapCoordinates=(N,Z)=>{if(this.displayMinimap){var X=new c.Vector2;N.getSize(X);var ee=X.y-Z.clientY;if(te.x+this.minimapScissor.width>Z.clientX&&Z.clientX>te.x&&te.y+this.minimapScissor.height>ee&&ee>te.y){var ue=2*((Z.clientX-te.x)/this.minimapScissor.width)-1,me=2*((ee-te.y)/this.minimapScissor.height)-1;return{x:ue,y:me}}}},this.getMinimapDiffFromNormalised=(N,Z)=>E?E.getDiffFromNormalised(N,Z):void 0,this.isWebGL2=()=>M.isWebGL2(),this.clearAll=()=>{W.clear(),B.clear(!0),this.clearZincObjectAddedCallbacks(),this.clearZincObjectRemovedCallbacks(),O.toBeDwonloaded=0,k&&k.calculateMaxAllowedDistance(this),W.markerUpdateRequired=!0},this.addMetadataTimeStamp=(N,Z)=>{oe.TimeStamps[N]=U(Z)},this.getMetadataTag=N=>oe[N],this.getMetadata=()=>oe,this.setMetadataTag=(N,Z)=>{oe[N]=Z},this.removeMetadataTag=N=>{delete oe[N]},this.resetMetadata=()=>{oe=w()},this.resetDuration=()=>{this.setDuration(A)};var se=N=>[...N.years?["".concat(N.years,"years")]:[],...N.months?["".concat(N.months,"months")]:[],...N.weeks?["".concat(N.weeks,"weeks")]:[],...N.days?["".concat(N.days,"days")]:[],...N.hours?["".concat(N.hours,"hours")]:[],...N.mins?["".concat(N.mins,"mins")]:[],...N.secs?["".concat(N.secs,"secs")]:[]].join(" "),U=N=>N.years?31536e6*N.years:0+N.months?2592e6*N.months:0+N.weeks?6048e5*N.weeks:0+N.days?864e5*N.days:0+N.hours?36e5*N.hours:0+N.mins?6e4*N.mins:0+N.secs?1e3*N.secs:0;this.setDurationFromObject=N=>{var Z=se(N),X=U(N);this.setMetadataTag("Duration",Z),this.setDuration(X)},this.setOriginalDurationFromObject=N=>{var Z=se(N);this.setMetadataTag("OriginalDuration",Z)},this.exportGLTF=N=>{var Z=new p(this);return Z.exportGLTF(N)},this.getRootRegion=()=>B,this.createLines=(N,Z,X,ee)=>{var ue=B.findChildFromPath(N);return ue===void 0&&(ue=B.createChildFromPath(N)),ue.createLines(Z,X,ee)},this.createPoints=(N,Z,X,ee,ue)=>{var me=B.findChildFromPath(N);return me===void 0&&(me=B.createChildFromPath(N)),me.createPoints(Z,X,ee,ue)},this.addZincObjectAddedCallbacks=N=>(++C,T[C]=N,C),this.addZincObjectRemovedCallbacks=N=>(++I,L[I]=N,I),this.removeZincObjectAddedCallbacks=N=>{N in C&&delete T[N]},this.removeZincObjectRemovedCallbacks=N=>{N in I&&delete L[N]},this.clearZincObjectAddedCallbacks=()=>{T={},C=0},this.clearZincObjectRemovedCallbacks=()=>{L={},I=0},this.triggerObjectAddedCallback=N=>{for(var Z in T)T.hasOwnProperty(Z)&&T[Z](N)},this.triggerObjectRemovedCallback=N=>{for(var Z in L)L.hasOwnProperty(Z)&&L[Z](N)},this.addTemporaryPoints=(N,Z)=>{var X=m(N.length,N),ee=new c.PointsMaterial({alphaTest:.5,size:15,color:Z,sizeAttenuation:!1}),ue=h();ee.map=ue;var me=new(u(23)).Points(X,ee);return D.add(me),me},this.addTemporaryLines=(N,Z)=>{var X=m(N.length,N),ee=new c.LineBasicMaterial({color:Z}),ue=new(u(12)).LineSegments(X,ee);return D.add(ue),ue},this.removeTemporaryPrimitive=N=>{D.remove(N),N.geometry.dispose(),N.material.dispose()},this.clearTemporaryPrimitives=()=>{var N=0,Z=D.children;return Z.forEach(X=>{X.geometry.dispose(),X.material.dispose(),N++}),D.clear(),N},this.addBoundingBoxPrimitive=function(N,Z,X,ee,ue){var me=5{var Ee;switch(ve){case"x":Ee=new c.PlaneGeometry(ge.z,ge.y),Ee.rotateY(Math.PI/2);break;case"y":Ee=new c.PlaneGeometry(ge.x,ge.z),Ee.rotateX(Math.PI/2);break;case"z":Ee=new c.PlaneGeometry(ge.x,ge.y);break}var _e=be.createGeometryFromThreeJSGeometry(Z[de],Ee,X[de],ee,ue,10001);ne.push(_e),de++}),ge.addVectors(ce.min,ce.max).multiplyScalar(.5),ne.forEach(ve=>{ve.setPosition(ge.x,ge.y,ge.z)}),ne}},this.enableMarkerCluster=N=>{N?(W.markerUpdateRequired=!0,W.enable()):(W.markerUpdateRequired=!1,W.disable()),this.forcePickableObjectsUpdate=!0},this.destroyAxisDisplay=()=>{this.displayMiniAxes=!1,$.main&&(this.enableAxisDisplay(!1,!1),$.main.forEach(N=>{N.dispose&&N.dispose()})),$.mini&&(this.enableAxisDisplay(!1,!0),$.mini.forEach(N=>{N.dispose&&N.dispose()})),$={main:[],mini:[]}},this.createAxisDisplay=function(){var N=0{var be=new c.ArrowHelper(me.dir,ue,ee,me.hex);$.main.push(be);var ce=new c.ArrowHelper(me.dir,X.getCenter(j),ee/2,me.hex);$.mini.push(ce);var ge=b(me.name,.036,me.colour,"Asap",120,700),ne=me.dir.clone().multiplyScalar(ee).add(ue);ge.position.set(ne.x,ne.y,ne.z),$.main.push(ge)})},this.enableAxisDisplay=function(N){var Z,X=1{N?P.add(ee):P.remove(ee)})):!X&&$.main&&$.main.forEach(ee=>{N?x.add(ee):x.remove(ee)})}}},(o,l,u)=>{function c(S,M){var F=Object.keys(S);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(S);M&&(R=R.filter(function(_){return Object.getOwnPropertyDescriptor(S,_).enumerable})),F.push.apply(F,R)}return F}function f(S){for(var M,F=1;F{M.scale.set(.015,.02,1),M.scale.multiplyScalar(x)},this.clear=()=>{this.group.clear(),this.markers={}},this.dispose=()=>{this.clear(),this.morph&&this.morph.clear()};var T=x=>{var P=new m.Group,B=new m.Sprite(g);return B.clusterIndex=x,B.center.set(.5,0),B.position.set(0,0,0),B.renderOrder=1e4,B.scale.set(y[0],y[1],y[2]),B.userData=this,P.add(B),this.group.add(P),{group:P,marker:B,label:void 0,number:0,min:[0,0,0],max:[1,1,1]}},C=(x,P,B)=>{x.group.visible=!0,x.group.position.set(P.coords[0],P.coords[1],P.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=w(B,.012,"black","Asap",120,700),x.number=B,x.group.add(x.label)),x.min=P.min,x.max=P.max},L=x=>{var P=0;for(x.forEach(B=>{var D=B.members.length,V=0;D===1?B.members[0].setVisibility(!0):(B.members.forEach(k=>{V+=k.getNumber(),k.setVisibility(!1)}),!R[P]&&R.push(T(P)),C(R[P],B,V),P++)}),P;P{var B=!0,D={members:[],coords:[0,0,0],min:[0,0,0],max:[1,1,1]},V=0;for(var k in x)B?(_.set(x[k].ndc.x,x[k].ndc.y),this._b1.setFromPoints([x[k].morph.position]),B=!1,D.members.push(x[k]),D.coords=[x[k].morph.position.x,x[k].morph.position.y,x[k].morph.position.z],P.push(D),delete x[k]):(O.set(x[k].ndc.x,x[k].ndc.y),V=_.distanceTo(O),.1>V&&(D.members.push(x[k]),this._b1.expandByPoint(x[k].morph.position),delete x[k]));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&&I(x,P)};this.calculate=()=>{if(F){var x=Date.now();if(500F,this.enable=()=>{F=!0,this.morph.visible=!0},this.disable=()=>{for(var x in F=!1,this.morph.visible=!1,this.markers){var P;(P=this.markers[x])!==null&&P!==void 0&&P.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,d=u(5).createNewURL,p=u(5).isRegionGroup,v=u(36).STLLoader,m=u(37).OBJLoader,h=u(38).PrimitivesLoader;l.SceneLoader=function(b){var y=b;this.toBeDownloaded=0,this.progressMap={};var g=!1,w=!1,A=new h;this.getDownloadProgress=()=>{var W=0,$=0,j=!1;for(var re in this.progressMap){var z=this.progressMap[re];W+=z[1],$+=z[0],z[1]==0&&(j=!0)}return j&&(W=0),[W,$,w]},this.onProgress=W=>$=>{this.progressMap[W]=[$.loaded,$.total]},this.onError=W=>$=>{--this.toBeDownloaded,w=!0,console.error("There is an issue with external resource ".concat($!=null&&$.responseURL?": "+($==null?void 0:$.responseURL):"",".")),W&&W({type:"Error",xhr:$})};var S=(W,$)=>{var j=$.Default;if($.Inline)y.setupMultipleViews(j,$.Entries);else{var re=[],z=function(se){W&&(newURL=d(K,W),re.push(new Promise((U,N)=>{fetch(newURL).then(Z=>Z.json()).then(Z=>U({key:se,data:Z})).catch(Z=>N(Z))})))};for(var[H,K]of Object.entries($.Entries))z(H);Promise.all(re).then(le=>{var se={};le.forEach(N=>{se[N.key]=N.data}),y.setupMultipleViews(j,se);var U=y.getZincCameraControls();U&&U.setCurrentViewport(j),g=!0})}};this.loadViewURL=(W,$)=>{this.toBeDownloaded+=1;var j=new XMLHttpRequest;j.onreadystatechange=()=>{if(j.readyState==4)if(j.status==200){var z=JSON.parse(j.responseText);y.setupMultipleViews("default",{default:z}),y.resetView(),g=!0,--this.toBeDownloaded,$!=null&&typeof $=="function"&&$()}else this.onError($)({responseURL:W})};var re=f(W);j.open("GET",re,!0),j.send()},this.loadModelsURL=(W,$,j,re,z,H,K)=>{var le=$.length;this.toBeDownloaded+=le;for(var se=0;se{var re=new XMLHttpRequest;re.onreadystatechange=()=>{if(re.readyState==4&&re.status==200){var H=JSON.parse(re.responseText);y.loadView(H);for(var K,le=[],se=$+"_",U=0;U(U,N)=>{var Z=le?new(u(39)).TubeLines:new(u(24)).Lines,X=void 0;N&&N[0]&&(X=new c.LineBasicMaterial({color:N[0].color.clone()}),1>N[0].opacity&&(X.transparent=!0),X.opacity=N[0].opacity,X.morphTargets=$,X.vertexColors=N[0].vertexColors);var ee={localTimeEnabled:$,localMorphColour:j};if(Z&&(Z.createLineSegment(U,X,ee),Z.setName(re),Z.setAnatomicalId(z),Z.setRenderOrder(H),W.addZincObject(Z),Z.setDuration(y.getDuration()),K&&K.levels))for(var[ue,me]of Object.entries(K.levels))Z.addLOD(A,ue,me.URL,me.Index,K.preload);--this.toBeDownloaded,U.dispose(),se!=null&&typeof se=="function"&&se(Z)};this.loadLinesURL=(W,$,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1;var se=!!(K!=null&&K.isInline)&&K.isInline,U=K!=null&&K.anatomicalId?K.anatomicalId:void 0,N=K!=null&&K.renderOrder?K.renderOrder:void 0;j!=null&&(le=!!j);var Z=0;re!=null&&(Z=!!re);var X=K.tubeLines&&!le&&!Z;if(se){var ee=A.parse($);M(W,le,Z,z,U,N,K.lod,X,H)(ee.geometry,ee.materials)}else A.load($,M(W,le,Z,z,U,N,K.lod,X,H),this.onProgress($),this.onError(H),K.loaderOptions)};var F=(W,$,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.displayLabels?H.displayLabels:void 0,U=H&&H.renderOrder?H.renderOrder:void 0,N=new(u(18)).Glyphset;N.setDuration(y.getDuration()),N.groupName=re;var Z=()=>{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(N)};++this.toBeDownloaded,K?N.load($,j,Z,K,se):N.load($,f(j),Z,K,se),N.setAnatomicalId(le),N.setRenderOrder(U),W.addZincObject(N)},R=(W,$,j,re,z,H)=>()=>{if($.readyState==4&&$.status==200){var K=JSON.parse($.responseText);F(W,K,j,re,z,H)}},_=(W,$,j,re,z,H,K)=>(le,se)=>{var U=new(u(22)).Pointset,N=new c.PointsMaterial({alphaTest:.5,size:10,sizeAttenuation:!1});se&&se[0]&&(1>se[0].opacity&&(N.transparent=!0),N.opacity=se[0].opacity,N.color=se[0].color,N.morphTargets=$,N.vertexColors=se[0].vertexColors);var Z={};Z.localTimeEnabled=$,Z.localMorphColour=j,U&&(U.createMesh(le,N,Z),U.setName(re),U.setAnatomicalId(z),W.addZincObject(U),U.setDuration(y.getDuration()),U.setRenderOrder(H)),le.dispose(),--this.toBeDownloaded,K!=null&&typeof K=="function"&&K(U)};this.loadSTL=(W,$,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new v;K.crossOrigin="Anonymous",K.load(f($),I(W,z,H,!1,!1,j,void 0,void 0,void 0,re))},this.loadOBJ=(W,$,j,re)=>{this.toBeDownloaded+=1;var z=u(0).defaultMaterialColor,H=u(0).defaultOpacity,K=new m;K.crossOrigin="Anonymous",K.load(f($),I(W,z,H,!1,!1,j,void 0,void 0,void 0,re))};var O=(W,$,j,re,z,H,K)=>{this.toBeDownloaded+=1;var le=u(0).defaultMaterialColor,se=u(0).defaultOpacity,U=0,N=!!(K&&K.isInline)&&K.isInline,Z=K&&K.fileFormat?K.fileFormat:void 0,X=K&&K.anatomicalId?K.anatomicalId:void 0,ee=K&&K.renderOrder?K.renderOrder:void 0;j!=null&&(U=!!j);var ue=0;re!=null&&(ue=!!re);var me=A;if(Z!==void 0){if(Z=="STL")me=new v;else if(Z=="OBJ")return me=new m,me.crossOrigin="Anonymous",void me.load($,objloader(W,le,se,U,ue,z,X,H),this.onProgress($),this.onError,K.loaderOptions)}if(N){var be=A.parse($);I(W,le,se,U,ue,z,X,ee,K,H)(be.geometry,be.materials)}else me.crossOrigin="Anonymous",A.load($,I(W,le,se,U,ue,z,X,ee,K,H),this.onProgress($),this.onError(H),K.loaderOptions)},E=function($,j,re){var z=0;return H=>{if(++z,H&&j!=null&&typeof j=="function"&&j(H),z==$&&(g==!1&&y.viewAll(),re!=null&&typeof re=="function")){re();var K=y.getZincCameraControls();K&&K.calculateMaxAllowedDistance(y)}}};this.loadPointsetURL=(W,$,j,re,z,H,K)=>{var le=0;this.toBeDownloaded+=1,j!=null&&(le=!!j);var se=0;re!=null&&(se=!!re);var U=!!(K&&K.isInline)&&K.isInline,N=K&&K.anatomicalId?K.anatomicalId:void 0,Z=K&&K.renderOrder?K.renderOrder:void 0;if(U){var X=A.parse($);_(W,le,se,z,N,Z,H)(X.geometry,X.materials)}else A.load($,_(W,le,se,z,N,Z,H),this.onProgress($),this.onError(H),K.loaderOptions)};var T=(W,$,j,re,z,H)=>{var K=H&&H.isInline?H.isInline:void 0,le=H&&H.anatomicalId?H.anatomicalId:void 0,se=H&&H.renderOrder?H.renderOrder:void 0,U=void 0;if(j){if($&&j.images&&j.images.source)for(var N,Z=j.images.source,X=0;X{--this.toBeDownloaded,z!=null&&typeof z=="function"&&z(U)};++this.toBeDownloaded,U.load(j,ee,K),U.setAnatomicalId(le),U.setRenderOrder(se),W.addZincObject(U)}}},C=(W,$,j,re,z)=>()=>{if($.readyState==4&&$.status==200){var H=JSON.parse($.responseText);T(W,$.responseURL,H,j,re,z)}};this.loadTextureURL=(W,$,j,re,z)=>{var H=!!(z&&z.isInline)&&z.isInline;if(H)T(W,void 0,$,j,re,z);else{var K=new XMLHttpRequest;K.onreadystatechange=C(W,K,j,re,z),K.open("GET",f($),!0),K.send()}},this.loadGlyphsetURL=(W,$,j,re,z,H)=>{var K=!!(H&&H.isInline)&&H.isInline;if(K)F(W,$,j,re,z,H);else{var le=new XMLHttpRequest;le.onreadystatechange=R(W,le,j,re,z,H),le.open("GET",f($),!0),le.send()}};var L=(W,$,j,re,z,H,K,le,se,U,N)=>{var Z={colour:j,opacity:re,localTimeEnabled:z,localMorphColour:H},X=new(u(3)).Geometry;return X.createMesh($,le,Z),X.getMorph()?(X.setName(se),X.setRenderOrder(U),X.setAnatomicalId(N),W&&W.addZincObject(X),X.setDuration(y.getDuration()),X.videoHandler&&y.setVideoHandler(X.videoHandler),X):void 0},I=(W,$,j,re,z,H,K,le,se,U)=>(N,Z)=>{var X;Z&&Z[0]&&(X=Z[0]);var ee=L(W,N,$,j,re,z,void 0,X,H,le,K);if(se.lod&&se.lod.levels)for(var[ue,me]of Object.entries(se.lod.levels))ee.addLOD(A,ue,me.URL,me.Index,se.lod.preload);--this.toBeDownloaded,N.dispose(),U!=null&&typeof U=="function"&&U(ee)},x=W=>{var $=/P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,[,j,re,z,H,K,le,se]=W.match($);return{years:j,months:re,weeks:z,days:H,hours:K,mins:le,secs:se}};this.loadSettings=W=>{if(W){if(W.Duration){var $=x(W.Duration);y.setDurationFromObject($)}if(W.OriginalDuration){var j=x(W.OriginalDuration);y.setOriginalDurationFromObject(j)}if(W.TimeStamps)for(var re in W.TimeStamps){var z=x(W.TimeStamps[re]);y.addMetadataTimeStamp(re,z)}}};var P=(W,$,j,re,z)=>{if(j){var H=void 0,K=!1;j.URL?(H=j.URL,$&&(H=d(H,$))):j.Inline&&(H=j.Inline.URL,K=!0);var le={};if(j.LOD&&j.LOD.Levels){le.preload=!!j.LOD.Preload,le.levels={};for(var[se,U]of Object.entries(j.LOD.Levels))le.levels[se]={},le.levels[se].URL=d(U.URL,$),le.levels[se].Index=U.Index}var N=j.GroupName;(N===void 0||N==="")&&(N="_Unnamed");var Z={loaderOptions:{index:j.Index},isInline:K,fileFormat:j.FileFormat,anatomicalId:j.AnatomicalId,compression:j.compression,tubeLines:j.tubeLines,lod:le,renderOrder:re};switch(j.Type){case"Surfaces":O(W,H,j.MorphVertices,j.MorphColours,N,z,Z);break;case"Glyph":var X;K?X=j.Inline.GlyphGeometriesURL:(X=j.GlyphGeometriesURL,X=d(j.GlyphGeometriesURL,$)),j.DisplayLabels&&(Z.displayLabels=!0),this.loadGlyphsetURL(W,H,X,N,z,Z);break;case"Points":this.loadPointsetURL(W,H,j.MorphVertices,j.MorphColours,N,z,Z);break;case"Lines":this.loadLinesURL(W,H,j.MorphVertices,j.MorphColours,N,z,Z);break;case"Texture":this.loadTextureURL(W,H,N,z,Z);break}}},B=(W,$,j)=>{if($){var re=void 0,z=!1;switch($.URL?(re=$.URL,W&&(re=d($.URL,W))):$.Inline&&(re=$.Inline.URL,z=!0),$.Type){case"View":z?(y.setupMultipleViews("default",{default:re}),g=!0,j!=null&&typeof j=="function"&&j()):this.loadViewURL(re,j);break;case"Settings":this.loadSettings($);break}}};this.loadGLTF=(W,$,j,re,z)=>{var H=new(u(40)).GLTFToZincJSLoader;H.load(y,W,$,j,re,z)};var D=(W,$,j,re)=>{if(j.Primitives&&j.Primitives.forEach(le=>{var se=1;le.Order&&(se=le.Order),P(W,$,le,se,re)}),j.Transformation&&W.setTransformation(j.Transformation),j.Children)for(var[z,H]of Object.entries(j.Children)){var K=W.findOrCreateChildFromPath(z);K&&D(K,$,H,re)}},V=(W,$)=>{var j,re,z=W,H=$==null||(j=$.enabled)===null||j===void 0?void 0:j.include,K=$==null||(re=$.enabled)===null||re===void 0?void 0:re.exclude,le=$==null?void 0:$.tubeLines;return(H!=null&&H.length||K!=null&&K.length)&&(H&&(z=W.filter(se=>{if(se.Type==="View")return!0;for(var U=0;U{if(se.Type==="View")return!0;for(var U=0;U{se.Type==="Lines"&&(se.tubeLines=!0)}),z},k=(W,$)=>Array.isArray(W)?V(W,$):W,G=(W,$)=>{if(Array.isArray(W)){for(var j=0,re=0;re{var $=W.Primitives?G(W.Primitives,!1):0;return W.Children&&Object.values(W.Children).forEach(j=>{$+=Y(j)}),$},te=W=>Array.isArray(W)?G(W,!0):typeof W=="object"&&W!==null&&W.Version==="2.0"?Y(W.Regions):void 0,oe=(W,$,j,re,z)=>{var H=W;j.RegionPath&&j.RegionPath!==""&&(H=W.findOrCreateChildFromPath(j.RegionPath)),P(H,$,j,2*re,z)},ie=(W,$,j,re,z,H)=>{for(var K=k($,H),le=te(K),se=new E(le,re,z),U=0;U<$.length;U++)B(j,K[U],se);for(var N=0;N<$.length;N++)oe(W,j,K[N],N,se)},ae=(W,$,j,re,z)=>{var H=te($),K=new E(H,re,z);$.Settings&&this.loadSettings($.Settings),$.Views&&S(j,$.Views),$.Regions&&D(W,j,$.Regions,K)};this.loadMetadataURL=(W,$,j,re,z)=>{var H=new XMLHttpRequest,K=f($);H.onreadystatechange=()=>{if(H.readyState==4&&H.status==200){y.resetMetadata(),y.resetDuration(),g=!1;var le=H.responseURL;le===void 0&&(le=new URL(K).href);var se=JSON.parse(H.responseText);Array.isArray(se)?ie(W,se,le,j,re,z):typeof se=="object"&&se!==null&&se.Version=="2.0"&&ae(W,se,le,j,re)}},H.open("GET",K,!0),H.send()}}},(o,l,u)=>{u.r(l),u.d(l,{STLLoader:()=>f});var c=u(4);class f extends c.Loader{constructor(p){super(p)}load(p,v,m,h){var b=this,y=new c.FileLoader(this.manager);y.setPath(this.path),y.setResponseType("arraybuffer"),y.setRequestHeader(this.requestHeader),y.setWithCredentials(this.withCredentials),y.load(p,function(g){try{v(b.parse(g))}catch(w){h?h(w):console.error(w),b.manager.itemError(p)}},m,h)}parse(p){function v(h,b,y){for(var g=0,w=h.length;gw;w++)if(v(g,b,w))return!1;return!0}(m)?function(h){for(var b,y,g,w,A,S,M,F,R=new DataView(h),_=R.getUint32(80,!0),O=!1,E=0;E<70;E++)R.getUint32(E,!1)==1129270351&&R.getUint8(E+4)==82&&R.getUint8(E+5)==61&&(O=!0,w=new Float32Array(3*(3*_)),A=R.getUint8(E+6)/255,S=R.getUint8(E+7)/255,M=R.getUint8(E+8)/255,F=R.getUint8(E+9)/255);for(var T=new c.BufferGeometry,C=new Float32Array(3*(3*_)),L=new Float32Array(3*(3*_)),I=0;I<_;I++){var x=84+I*50,P=R.getFloat32(x,!0),B=R.getFloat32(x+4,!0),D=R.getFloat32(x+8,!0);if(O){var V=R.getUint16(x+48,!0);32768&V?(b=A,y=S,g=M):(b=(31&V)/31,y=(31&V>>5)/31,g=(31&V>>10)/31)}for(var k=1;3>=k;k++){var G=x+12*k,Y=3*(3*I)+3*(k-1);C[Y]=R.getFloat32(G,!0),C[Y+1]=R.getFloat32(G+4,!0),C[Y+2]=R.getFloat32(G+8,!0),L[Y]=P,L[Y+1]=B,L[Y+2]=D,O&&(w[Y]=b,w[Y+1]=y,w[Y+2]=g)}}return T.setAttribute("position",new c.BufferAttribute(C,3)),T.setAttribute("normal",new c.BufferAttribute(L,3)),O&&(T.setAttribute("color",new c.BufferAttribute(w,3)),T.hasColors=!0,T.alpha=F),T}(m):function(h){for(var b,y=new c.BufferGeometry,g=/solid([\s\S]*?)endsolid/g,w=/facet([\s\S]*?)endfacet/g,A=0,S=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,M=new RegExp("vertex"+S+S+S,"g"),F=new RegExp("normal"+S+S+S,"g"),R=[],_=[],O=new c.Vector3,E=0,T=0,C=0;(b=g.exec(h))!==null;){T=C;for(var L=b[0];(b=w.exec(L))!==null;){for(var I=0,x=0,P=b[0];(b=F.exec(P))!==null;)O.x=parseFloat(b[1]),O.y=parseFloat(b[2]),O.z=parseFloat(b[3]),x++;for(;(b=M.exec(P))!==null;)R.push(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])),_.push(O.x,O.y,O.z),I++,C++;x!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+A),I!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+A),A++}var B=T,D=C-T;y.addGroup(B,D,E),E++}return y.setAttribute("position",new c.Float32BufferAttribute(R,3)),y.setAttribute("normal",new c.Float32BufferAttribute(_,3)),y}(function(h){return typeof h=="string"?h:c.LoaderUtils.decodeText(new Uint8Array(h))}(p))}}},(o,l,u)=>{u.r(l),u.d(l,{OBJLoader:()=>A});var c=u(4),f=/^[og]\s*(.+)?/,d=/^mtllib /,p=/^usemtl /,v=/^usemap /,m=new c.Vector3,h=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;function w(){var S={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(F,R){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=F,void(this.object.fromDeclaration=R!==!1);var _=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:F||"",fromDeclaration:R!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(T,C){var L=this._finalize(!1);L&&(L.inherited||0>=L.groupCount)&&this.materials.splice(L.index,1);var I={index:this.materials.length,name:T||"",mtllib:Array.isArray(C)&&0=this.materials[L].groupCount&&this.materials.splice(L,1);return T&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),C}},_&&_.name&&typeof _.clone=="function"){var O=_.clone(0);O.inherited=!0,this.object.materials.push(O)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(F,R){var _=parseInt(F,10);return 3*(0<=_?_-1:_+R/3)},parseNormalIndex:function(F,R){var _=parseInt(F,10);return 3*(0<=_?_-1:_+R/3)},parseUVIndex:function(F,R){var _=parseInt(F,10);return 2*(0<=_?_-1:_+R/2)},addVertex:function(F,R,_){var O=this.vertices,E=this.object.geometry.vertices;E.push(O[F+0],O[F+1],O[F+2]),E.push(O[R+0],O[R+1],O[R+2]),E.push(O[_+0],O[_+1],O[_+2])},addVertexPoint:function(F){var R=this.vertices,_=this.object.geometry.vertices;_.push(R[F+0],R[F+1],R[F+2])},addVertexLine:function(F){var R=this.vertices,_=this.object.geometry.vertices;_.push(R[F+0],R[F+1],R[F+2])},addNormal:function(F,R,_){var O=this.normals,E=this.object.geometry.normals;E.push(O[F+0],O[F+1],O[F+2]),E.push(O[R+0],O[R+1],O[R+2]),E.push(O[_+0],O[_+1],O[_+2])},addFaceNormal:function(F,R,_){var O=this.vertices,E=this.object.geometry.normals;m.fromArray(O,F),h.fromArray(O,R),b.fromArray(O,_),g.subVectors(b,h),y.subVectors(m,h),g.cross(y),g.normalize(),E.push(g.x,g.y,g.z),E.push(g.x,g.y,g.z),E.push(g.x,g.y,g.z)},addColor:function(F,R,_){var O=this.colors,E=this.object.geometry.colors;O[F]!==void 0&&E.push(O[F+0],O[F+1],O[F+2]),O[R]!==void 0&&E.push(O[R+0],O[R+1],O[R+2]),O[_]!==void 0&&E.push(O[_+0],O[_+1],O[_+2])},addUV:function(F,R,_){var O=this.uvs,E=this.object.geometry.uvs;E.push(O[F+0],O[F+1]),E.push(O[R+0],O[R+1]),E.push(O[_+0],O[_+1])},addDefaultUV:function(){var F=this.object.geometry.uvs;F.push(0,0),F.push(0,0),F.push(0,0)},addUVLine:function(F){var R=this.uvs,_=this.object.geometry.uvs;_.push(R[F+0],R[F+1])},addFace:function(F,R,_,O,E,T,C,L,I){var x=this.vertices.length,P=this.parseVertexIndex(F,x),B=this.parseVertexIndex(R,x),D=this.parseVertexIndex(_,x);if(this.addVertex(P,B,D),this.addColor(P,B,D),C!==void 0&&C!==""){var V=this.normals.length;P=this.parseNormalIndex(C,V),B=this.parseNormalIndex(L,V),D=this.parseNormalIndex(I,V),this.addNormal(P,B,D)}else this.addFaceNormal(P,B,D);if(O!==void 0&&O!==""){var k=this.uvs.length;P=this.parseUVIndex(O,k),B=this.parseUVIndex(E,k),D=this.parseUVIndex(T,k),this.addUV(P,B,D),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(F){this.object.geometry.type="Points";for(var R,_=this.vertices.length,O=0,E=F.length;O{function c(A,S){var M=Object.keys(A);if(Object.getOwnPropertySymbols){var F=Object.getOwnPropertySymbols(A);S&&(F=F.filter(function(R){return Object.getOwnPropertyDescriptor(A,R).enumerable})),M.push.apply(M,F)}return M}function f(A){for(var S,M=1;M{var S=(F,R)=>{F.merge(R)};if(A&&0{var G=T[k.index];if(G){var Y=_.parse(G);k.onLoad(Y.geometry,Y.materials)}else B(k)},B=k=>{k.onError&&(!I&&(I={responseURL:O}),k.onError(I))};this.downloadCompleted=k=>{try{T=JSON.parse(k[0]),C=!1,L=!0,Array.isArray(T)?x.forEach(G=>P(G)):x.forEach(G=>B(G))}catch{x.forEach(Y=>B(Y))}};var D=()=>k=>{I=k,L=!0,C=!1,x.forEach(G=>{B(G)})},V=()=>k=>{x.forEach(G=>{G.onProgress&&G.onProgress(k)})};this.load=(k,G,Y,te)=>{var oe={index:k,onLoad:G,onProgress:Y,onError:te};L?T?P(oe):B(I):C?x.push(oe):(x.push(oe),C=!0,R.load(O,E,V,D))}},w=function(S,M){var F=[],R=S,_=M,O=0;this.itemDownloaded=(E,T)=>{if(F[E]=T,O++,O==R){for(var C=F[0][1],L=F.map(P=>P[0]),I=y(L),x=1;xP.dispose());_(I,C)}}};l.PrimitivesLoader=function(){var A=0,S=20;this.crossOrigin="Anonymous";var M=new m,F=[],R={},_=(C,L,I,x,P)=>{var B=C.length,D=new w(B,L),V=0;C.forEach(k=>{var G=P?f({},P):{};G.msHandler=D,G.order=V,V++,E(k,L,I,x,G)})},O=(C,L,I,x,P)=>{var B=P?f({},P):{},D=R[C];if(!D)if(S>A){var V=new T(void 0,this,B);++A,D=new g(C,this.crossOrigin,V),R[C]=D}else F.push({url:C,onLoad:L,onProgress:I,onError:x,options:P});D&&(B.isHandler=D,D.load(P.index,L,I,x))},E=(C,L,I,x,P)=>{if(P&&P.index!==void 0)O(C,L,I,x,P);else if(S>A){++A;var B=new T(L,this,P),D=new T(x,this,P);M.crossOrigin=this.crossOrigin,M.load(C,B,I,D)}else F.push({url:C,onLoad:L,onProgress:I,onError:x,options:P})};this.load=(C,L,I,x,P)=>{Array.isArray(C)?_(C,L,I,x,P):E(C,L,I,x,P)},this.loadFromWaitingList=()=>{for(;S>A;){var C=F.shift();if(C)this.load(C.url,C.onLoad,C.onProgress,C.onError,C.options);else return}},this.itemRemainingCheck=()=>{if(F.length===0&&A==0)for(var C in R)R.hasOwnProperty(C)&&delete R[C]};var T=function(L,I,x){return function(){--A;for(var P=arguments.length,B=Array(P),D=0;DM.parse(C)}},(o,l,u)=>{var c=u(4),f=u(5).mergeGeometries,d=function(){u(10).ZincObject.call(this),this.isTubeLines=!0;var p={},v={radius:1,radialSegments:8,smooth:!1};this.createLineSegment=(h,b,y)=>{if(h&&b){p={geometryIn:h,materialIn:b,options:y};var g=m(h.vertices),w=new c.MeshStandardMaterial({color:b.color}),A=new c.Mesh(g,w);this.setMesh(A,y.localTimeEnabled,y.localMorphColour)}},this.setWidth=h=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=h,this.morph.material.needsUpdate=!0)},this.setAlpha=function(h){var b=this.getMorph();b.material.opacity=h,b.material.transparent=1>h,b.material.depthWrite=.5{var b=this.getMorph();b.material.wireframe=h},this.setTubeLines=(h,b)=>{if(h&&b){var{geometryIn:y}=p,g=this.getMorph();g.geometry.dispose(),v=Object.assign(v,{radius:h,radialSegments:b}),g.geometry=m(y.vertices)}};var m=h=>{var b,{radius:y,radialSegments:g,smooth:w}=v;if(w){var A=new c.CatmullRomCurve3(h);b=new c.TubeGeometry(A,h.length,y,g,!1)}else{for(var S=[],M=0;M+1_.dispose())}return b}};d.prototype=Object.create(u(10).ZincObject.prototype),l.TubeLines=d},(o,l,u)=>{u(4);var c=u(41).GLTFLoader,f=function(){var d=this;this.parseGLTFObjects=(p,v,m,h)=>{var b=v;if(m!==0){if(p.type!=="Object3D"){var y;if(p.type==="Mesh"?y=new(u(3)).Geometry:p.type==="LineSegments"?y=new(u(24)).Lines:p.type==="Points"&&(y=new(u(22)).Pointset),y){var g=!1,w=!1;p.geometry&&p.geometry.morphAttributes&&(g=!!p.geometry.morphAttributes.position,w=!!p.geometry.morphAttributes.color),y.setMesh(p.clone(),g,w);var A=y.getMorph();y.groupName=A.name,A.matrixAutoUpdate=!0,v.addZincObject(y),h!=null&&typeof h=="function"&&h(y)}}else if(p.name!==""&&(v&&(b=v.findOrCreateChildFromPath(p.name)),b)){var S=b.getGroup();S.position.copy(p.position),S.rotation.copy(p.rotation),S.quaternion.copy(p.quaternion),S.matrixAutoUpdate=!0}}m++,p.children.forEach(M=>{d.parseGLTFObjects(M,b,m,h)})},this.setCamera=p=>{p.viewAll();var v=p.getZincCameraControls(),m=v.getCurrentViewport();v.addViewport("default",m),v.setDefaultViewport("default")},this.load=(p,v,m,h,b)=>{var y=m.substring(0,m.lastIndexOf("/")+1),g=m.substring(m.lastIndexOf("/")+1,m.length),w=new c().setPath(y);w.load(g,function(A){console.log(A),d.parseGLTFObjects(A.scene,v,0,h),d.setCamera(p),b!=null&&typeof b=="function"&&b()})}};l.GLTFToZincJSLoader=f},o=>{o.exports=jB},(o,l,u)=>{var c=u(43).GLTFExporter,f=function(d){var p=d;this.exportGLTF=v=>{var m=p.getRootRegion(),h=m.getAllObjects(!0),b=[];h.forEach(w=>{w.animationClip&&b.push({clip:w.animationClip[0],mesh:w.getMorph()})});var y=new c,g={binary:v,animations:b};return new Promise(w=>{y.parse(p.getThreeJSScene(),function(A){w(A)},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 T(x)}),this.register(function(x){return new C(x)}),this.register(function(x){return new L(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,P,B){for(var D=new E,V=[],k=0,G=this.pluginCallbacks.length;kD&&(D=0)}if(D===0)return null;var oe,ie=F(x,B,D);P!==void 0&&(oe=x===P.index?d.ELEMENT_ARRAY_BUFFER:d.ARRAY_BUFFER);var ae=this.processBufferView(x,V,B,D,oe),W={bufferView:ae.id,byteOffset:ae.byteOffset,componentType:V,count:D,max:ie.max,min:ie.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[x.itemSize]};return x.normalized===!0&&(W.normalized=!0),G.accessors||(G.accessors=[]),G.accessors.push(W)-1}processImage(x,P,B){var D=this,V=D.cache,k=D.json,G=D.options,Y=D.pending;V.images.has(x)||V.images.set(x,{});var te=V.images.get(x),oe=P===c.RGBAFormat?"image/png":"image/jpeg",ie=oe+":flipY/"+B.toString();if(te[ie]!==void 0)return te[ie];k.images||(k.images=[]);var ae={mimeType:oe};if(G.embedImages){var W=O=O||document.createElement("canvas");W.width=Math.min(x.width,G.maxTextureSize),W.height=Math.min(x.height,G.maxTextureSize);var $=W.getContext("2d");if(B===!0&&($.translate(0,W.height),$.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)$.drawImage(x,0,0,W.width,W.height);else{P!==c.RGBAFormat&&P!==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 j=new Uint8ClampedArray(4*(x.height*x.width));if(P===c.RGBAFormat)for(var re=0;reve&&de.setXYZ(ve,ce.getX(ve)-ne.getX(ve),ce.getY(ve)-ne.getY(ve),ce.getZ(ve)-ne.getZ(ve));else for(var _e=0,Ne=ce.count;_e=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),P.cameras.push(D)-1}processAnimation(x,P){var B=this.json,D=this.nodeMap;B.animations||(B.animations=[]),x=f.Utils.mergeMorphTargetTracks(x.clone(),P);for(var V=x.tracks,k=[],G=[],Y=0;Yx.times[x.times.length-1]){if(Math.abs(x.times[x.times.length-1]-P)P){k.set(x.times.slice(0,oe+1),0),k[oe+1]=P,k.set(x.times.slice(oe+1),oe+2),G.set(x.values.slice(0,(oe+1)*V),0),G.set(Y.evaluate(P),(oe+1)*V),G.set(x.values.slice((oe+1)*V),(oe+2)*V),B=oe+1;break}}return x.times=k,x.values=G,B},mergeMorphTargetTracks:function(x,P){for(var B=[],D={},V=x.tracks,k=0;k{var c=u(4),f=u(5).resolveURL,d=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 S=this;this.setFromObject=M=>{var{nearPlane:F,farPlane:R,eyePosition:_,targetPosition:O,upVector:E}=M;S.nearPlane=F,S.farPlane=R,S.eyePosition=_,S.targetPosition=O,S.upVector=E}},p=function(S,M,F,R){var _={NONE:-1,DEFAULT:0,PATH:1,SMOOTH_CAMERA_TRANSITION:2,AUTO_TUMBLE:3,ROTATE_TRANSITION:4,MINIMAP:5,SYNC_CONTROL:6},O={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM:4,TOUCH_PAN:5,SCROLL:6,KEYBOARD_ZOOM:7,KEYBOARD_ROTATE:8,KEYBOARD_PAN:9},E={NONE:-1,FREE:1,HORIZONTAL:2,VERTICAL:3},T={ARROWLEFT:37,ARROWUP:38,ARROWRIGHT:39,ARROWDOWN:40,NUMPADADD:107,NUMPADSUBTRACT:109,EQUAL:187,MINUS:189},C={};C.MAIN=O.ROTATE,C.AUXILIARY=O.ZOOM,C.SECONDARY=O.PAN,this.cameraObject=S,this.domElement=M===void 0?document:M,this.renderer=F,this.scene=R,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.zoomRate=50,this.rotateRate=50,this.panRate=100,this.pixelHeight=1;var L=6e3,I=!0,x=0,P=void 0,B=void 0,D=!1,V=500,k=void 0,G="default",Y=_.DEFAULT,te=void 0,oe=void 0,ie=void 0,ae=0,W=E.FREE;this._state=O.NONE;var $;this.targetTouchId=-1;var j=void 0,re=new c.Vector3,z=new c.Vector3,H=new c.Vector3,K=new c.Vector3,le=new c.Vector3,se=new c.Vector3,U=new c.Vector3,N=new c.Vector3,Z=new c.Sphere,X=new c.Vector3,ee=!1,ue=void 0,me=0,be={default:new d};be.default.nearPlane=.1,be.default.farPlane=2e3,be.default.eyePosition=[0,0,0],be.default.targetPosition=[0,0,-1],be.default.upVector=[0,1,0],this.cameraObject.target===void 0&&(this.cameraObject.target=new c.Vector3(...be.default.targetPosition)),this.calculateMaxAllowedDistance=Q=>{var we=Q.getBoundingBox();if(we){we.getBoundingSphere(Z),me=6*Z.radius;var Te=0;this.cameraObject&&(Te=this.cameraObject.position.distanceTo(Z.center)),me=Te>me?1.5*Te:me}else me=0},this.addViewport=(Q,we)=>{Q&&we&&(be[Q]=we)},this.setDefaultViewport=Q=>!!(Q&&Q in be)&&(G=Q,!0),this.getDefaultViewport=()=>G,this.getViewportOfName=Q=>be[Q],this.setCurrentViewport=Q=>Q in be&&(this.setCurrentCameraSettings(be[Q]),!0),this.setRotationMode=Q=>{switch(Q){case"none":W=E.NONE;break;case"horizontal":W=E.HORIZONTAL;break;case"vertical":W=E.VERTICAL;break;case"free":default:W=E.FREE}},this.onResize=()=>{j&&(j=void 0),ue&&ue.setCurrentCameraSettings(this.cameraObject,be[G])},this.getVisibleHeightAtZDepth=Q=>{var we=this.cameraObject.position.distanceTo(this.cameraObject.target);Q{var we=this.getVisibleHeightAtZDepth(0);return this.pixelHeight=we/Q,this.pixelHeight},this.getNDCFromDocumentCoords=(Q,we,Te)=>{Ce(!1);var Be=Te||new c.Vector2,qe=2*((Q-j.left)/j.width)-1,J=2*-((we-j.top)/j.height)+1;return Be.set(qe,J)},this.getRelativeCoordsFromNDC=(Q,we,Te)=>{Ce(!1);var Be=Te||new c.Vector2;return Be.x=(Q+1)*j.width/2,Be.y=(1-we)*j.height/2,Be},this.setMouseButtonAction=(Q,we)=>{C[Q]=O[we]};var ce=(Q,we)=>{Q instanceof HTMLCanvasElement&&(Q.tabIndex=we)},ge=()=>{if(0Q||this.cameraObject.position.distanceTo(Z.center)>Q}return!0},ne=Q=>{X.copy(this.cameraObject.position).add(Q),ge()&&(this.cameraObject.target.add(Q),this.cameraObject.position.add(Q),this.updateDirectionalLight())},de=Q=>{Ce(!1);var we;if(Y===_.DEFAULT&&(we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q)),!we)Q.button==0?Q.ctrlKey?this._state=C.AUXILIARY:Q.shiftKey?this._state=C.SECONDARY:this._state=C.MAIN:Q.button==1?(Q.preventDefault(),this._state=C.AUXILIARY):Q.button==2&&(this._state=C.SECONDARY),this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.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{Y=_.MINIMAP;var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);ne(Te)}},ve=Q=>{if(Ce(!1),j)if(this.pointer_x=Q.clientX-j.left,this.pointer_y=Q.clientY-j.top,Y===_.MINIMAP){var we=this.scene.getNormalisedMinimapCoordinates(this.renderer,Q);if(we){var Te=this.scene.getMinimapDiffFromNormalised(we.x,we.y);ne(Te)}}else this._state===O.NONE&&$!==void 0&&$.move(this,Q.clientX,Q.clientY,this.renderer)},Ee=Q=>{this._state=O.NONE,Y==_.MINIMAP&&(Y=_.DEFAULT),$!==void 0&&this.pointer_x_start==Q.clientX-j.left&&this.pointer_y_start==Q.clientY-j.top&&$.pick(this,Q.clientX,Q.clientY,this.renderer)},_e=Q=>{this._state=O.NONE},Ne=Q=>{Ce(!1);var we=Q.touches.length;if(we==1){var Te,Be;this._state=O.TOUCH_ROTATE,this.pointer_x=Q.touches[0].clientX-((Te=j)===null||Te===void 0?void 0:Te.left),this.pointer_y=Q.touches[0].clientY-((Be=j)===null||Be===void 0?void 0:Be.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(we==2){this._state=O.TOUCH_ZOOM;var qe=Q.touches[0].clientX-Q.touches[1].clientX,J=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=this.touchZoomDistanceStart=Math.sqrt(qe*qe+J*J)}else if(we==3){var pe,he;this._state=O.TOUCH_PAN,this.targetTouchId=Q.touches[0].identifier,this.pointer_x=Q.touches[0].clientX-((pe=j)===null||pe===void 0?void 0:pe.left),this.pointer_y=Q.touches[0].clientY-((he=j)===null||he===void 0?void 0:he.top),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y}},Je=Q=>{Q.preventDefault(),Q.stopPropagation();var we=Q.touches.length;if(we==1)this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top;else if(we==2){if(this._state===O.TOUCH_ZOOM){var Te=Q.touches[0].clientX-Q.touches[1].clientX,Be=Q.touches[0].clientY-Q.touches[1].clientY;this.touchZoomDistanceEnd=Math.sqrt(Te*Te+Be*Be)}}else if(we==3&&this._state===O.TOUCH_PAN)for(var qe=0;3>qe;qe++)Q.touches[qe].identifier==this.targetTouchId&&(this.pointer_x=Q.touches[0].clientX-j.left,this.pointer_y=Q.touches[0].clientY-j.top)},ze=Q=>{var we=Q.touches.length;this.touchZoomDistanceStart=this.touchZoomDistanceEnd=0,this.targetTouchId=-1,this._state=O.NONE,we==1&&$!==void 0&&this.pointer_x_start==Q.touches[0].clientX-j.left&&this.pointer_y_start==Q.touches[0].clientY-j.top&&$.pick(this.cameraObject,Q.touches[0].clientX,Q.touches[0].clientY,this.renderer)},st=()=>{Ce(!0)},Ce=Q=>{if(Q||j===void 0){var we=new IntersectionObserver(Te=>{for(var Be of Te)j=Be.boundingClientRect;we.disconnect()});we.observe(this.domElement)}},je=Q=>{Ce(!1),this._state=O.SCROLL;var we=0;0Q.deltaY&&(we=-1*this.zoomRate),ae+=we,Q.preventDefault(),Q.stopImmediatePropagation()},He=Q=>{Ce(!1);var we=0;if(Q.keyCode===T.EQUAL||Q.keyCode===T.MINUS||Q.keyCode===T.NUMPADADD||Q.keyCode===T.NUMPADSUBTRACT){this._state=O.KEYBOARD_ZOOM;var Te=1;Q.shiftKey&&(Te*=2),Q.keyCode===T.EQUAL||Q.keyCode===T.NUMPADADD?we=-1*(this.zoomRate*Te):(Q.keyCode===T.MINUS||Q.keyCode===T.NUMPADSUBTRACT)&&(we=this.zoomRate*Te),ae+=we}else(Q.keyCode===T.ARROWLEFT||Q.keyCode===T.ARROWUP||Q.keyCode===T.ARROWRIGHT||Q.keyCode===T.ARROWDOWN)&&(Q.shiftKey?(this._state=O.KEYBOARD_ROTATE,this.pointer_x_start=this.pointer_x,this.pointer_y_start=this.pointer_y,we=this.rotateRate):(this._state=O.KEYBOARD_PAN,we=this.panRate),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,Q.keyCode===T.ARROWLEFT?this.pointer_x-=we:Q.keyCode===T.ARROWUP?this.pointer_y-=we:Q.keyCode===T.ARROWRIGHT?this.pointer_x+=we:Q.keyCode===T.ARROWDOWN&&(this.pointer_y+=we));Object.values(T).includes(Q.keyCode)&&Q.preventDefault()},Pt=Q=>{this._state=O.NONE},It=()=>{if(typeof this.cameraObject<"u"){var Q=j.height,we=this.cameraObject.position.distanceTo(this.cameraObject.target),Te=0;this.cameraObject.far>this.cameraObject.near&&we>=this.cameraObject.near&&we<=this.cameraObject.far&&(Te=(we-this.cameraObject.near)/(this.cameraObject.far-this.cameraObject.near)),z.set(this.previous_pointer_x,Q-this.previous_pointer_y,0),H.set(this.previous_pointer_x,Q-this.previous_pointer_y,1),K.set(this.pointer_x,Q-this.pointer_y,0),le.set(this.pointer_x,Q-this.pointer_y,1),z.unproject(this.cameraObject),H.unproject(this.cameraObject),K.unproject(this.cameraObject),le.unproject(this.cameraObject);var Be=-.002;K.sub(z).multiplyScalar(1-Te),le.sub(H).multiplyScalar(Te),K.add(le).multiplyScalar(Be),ne(K)}this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y};this.getVectorsFromRotateAboutLookAtPoints=(Q,we)=>{Q.normalize(),U.copy(this.cameraObject.position).sub(this.cameraObject.target),N.copy(U),U.normalize(),.8{var Te=this.getVectorsFromRotateAboutLookAtPoints(Q,we);this.cameraObject.position.copy(Te.position),this.updateDirectionalLight(),this.cameraObject.up.copy(Te.up)};var mt=()=>{if(typeof this.cameraObject<"u"){var Q,we,Te=(Q=j)===null||Q===void 0?void 0:Q.width,Be=(we=j)===null||we===void 0?void 0:we.height;if(0{var Q=0;return this._state===O.ZOOM?Q=this.previous_pointer_y-this.pointer_y:this._state===O.SCROLL||this._state===O.KEYBOARD_ZOOM?Q=ae:(Q=-1*(this.touchZoomDistanceEnd-this.touchZoomDistanceStart),this.touchZoomDistanceStart=this.touchZoomDistanceEnd),Q};this.changeZoomByScrollRateUnit=Q=>{var we=Q*this.zoomRate;this.changeZoomByValue(we)},this.changeZoomByValue=Q=>{if(typeof this.cameraObject<"u"){var we=j.height,Te=this.cameraObject.position.clone();Te.sub(this.cameraObject.target);var Be=Te.length(),qe=1.5*Q/we;if(.01{var Q=bt();this.changeZoomByValue(Q),this._state===O.ZOOM&&(this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y),(this._state===O.SCROLL||this._state===O.KEYBOARD_ZOOM)&&(ae=0,this._state=O.NONE)};this.setDirectionalLight=Q=>{this.directionalLight=Q},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&&(ce(this.domElement,0),this.domElement.addEventListener("mousedown",de,!1),this.domElement.addEventListener("mousemove",ve,!1),this.domElement.addEventListener("mouseup",Ee,!1),this.domElement.addEventListener("mouseleave",_e,!1),this.domElement.addEventListener("touchstart",Ne,!1),this.domElement.addEventListener("touchmove",Je,!1),this.domElement.addEventListener("touchend",ze,!1),this.domElement.addEventListener("wheel",je,!1),this.domElement.addEventListener("mouseenter",st,!1),this.domElement.addEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.addEventListener("keydown",He,!1),this.domElement.addEventListener("keyup",Pt,!1))},this.disable=function(){I=!1,this.domElement&&this.domElement.removeEventListener&&(this.domElement.removeEventListener("mousedown",de,!1),this.domElement.removeEventListener("mousemove",ve,!1),this.domElement.removeEventListener("mouseup",Ee,!1),this.domElement.removeEventListener("mouseleave",_e,!1),this.domElement.removeEventListener("touchstart",Ne,!1),this.domElement.removeEventListener("touchmove",Je,!1),this.domElement.removeEventListener("touchend",ze,!1),this.domElement.removeEventListener("wheel",je,!1),this.domElement.removeEventListener("mouseenter",st,!1),this.domElement.removeEventListener("contextmenu",Q=>{Q.preventDefault()},!1),this.domElement.removeEventListener("keydown",He,!1),this.domElement.removeEventListener("keyup",Pt,!1),ce(this.domElement,-1))},this.loadPath=Q=>{P=Q.CameraPath,B=Q.NumberOfPoints},this.loadPathURL=(Q,we)=>{var Te=new XMLHttpRequest;Te.onreadystatechange=()=>{if(Te.readyState==4&&Te.status==200){var qe=JSON.parse(Te.responseText);this.loadPath(qe),we!=null&&typeof we=="function"&&we()}};var Be=f(Q);Te.open("GET",Be,!0),Te.send()},this.setPathDuration=Q=>{L=Q,te&&te.setDuration(L),oe&&oe.setDuration(L)},this.getPlayRate=()=>V,this.setPlayRate=Q=>{V=Q};var Ni=Q=>{var we=x+Q;we>L&&(we-=L),x=we};this.getTime=()=>x,this.setTime=Q=>{x=Q>L?L:0>Q?0:Q},this.getNumberOfTimeFrame=()=>B,this.getCurrentTimeFrame=()=>{if(2{2x&&(x=0),x>L&&(x=L))};var Un=Q=>{if(Y===_.PATH&&(Ni(Q),P)){for(var we=this.getCurrentTimeFrame(),Te=we[0],Be=we[1],qe=we[2],J=[P[3*Te],P[3*Te+1],P[3*Te+2]],pe=[P[3*Be],P[3*Be+1],P[3*Be+2]],he=[],ye=0;ye{Un(0)};var ss=()=>{this._state===O.ROTATE||this._state===O.TOUCH_ROTATE||this._state===O.KEYBOARD_ROTATE?mt():this._state===O.PAN||this._state===O.TOUCH_PAN||this._state===O.KEYBOARD_PAN?(It(),ue.triggerCallback()):(this._state===O.ZOOM||this._state===O.TOUCH_ZOOM||this._state===O.SCROLL||this._state===O.KEYBOARD_ZOOM)&&(ue.zoom(bt()),this.previous_pointer_x=this.pointer_x,this.previous_pointer_y=this.pointer_y,(this._state===O.SCROLL||this._state===O.KEYBOARD_ZOOM)&&(this._state=O.NONE),ae=0,ue.triggerCallback())};this.update=Q=>{var we=Q*V,Te=I,Be=!0;return Y===_.PATH?Un(we):Y===_.SMOOTH_CAMERA_TRANSITION&&te?(te.update(we),te.isTransitionCompleted()&&(Y=_.DEFAULT),Te=!1):Y===_.ROTATE_CAMERA_TRANSITION&&oe?(oe.update(we),oe.isTransitionCompleted()&&(Y=_.DEFAULT),Te=!1):Y===_.AUTO_TUMBLE&&ie?ie.update(we):Y===_.SYNC_CONTROL&&ue?(ss(),Te=!1):Be=!1,Te&&(this._state!==O.NONE&&(Be=!0),this._state===O.ROTATE||this._state===O.TOUCH_ROTATE||this._state===O.KEYBOARD_ROTATE?mt():this._state===O.PAN||this._state===O.TOUCH_PAN||this._state===O.KEYBOARD_PAN?It():(this._state===O.ZOOM||this._state===O.TOUCH_ZOOM||this._state===O.SCROLL||this._state===O.KEYBOARD_ZOOM)&&Oi(),this._state!==O.NONE&&Y===_.AUTO_TUMBLE&&ie&&ie.stopOnCameraInput,this._state===O.SCROLL&&(this._state=O.NONE)),k?(Be=!0,k.update()):this.cameraObject.lookAt(this.cameraObject.target),Be=Be||ee,ee=!1,Be},this.playPath=()=>{Y=_.PATH},this.stopPath=()=>{Y=_.DEFAULT},this.isPlayingPath=()=>Y===_.PATH,this.enableDirectionalLightUpdateWithPath=Q=>{D=Q},this.enableDeviceOrientation=()=>{k||(k=new w(this.cameraObject))},this.disableDeviceOrientation=()=>{k&&(k.dispose(),k=void 0)},this.isDeviceOrientationEnabled=()=>!!k,this.resetView=()=>{var Q=be[G];this.cameraObject.near=Q.nearPlane,this.cameraObject.far=Q.farPlane,this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight()},this.setCurrentCameraSettings=Q=>{Q.nearPlane&&(this.cameraObject.near=Q.nearPlane),Q.farPlane&&(this.cameraObject.far=Q.farPlane),Q.eyePosition&&this.cameraObject.position.set(Q.eyePosition[0],Q.eyePosition[1],Q.eyePosition[2]),Q.targetPosition&&this.cameraObject.target.set(Q.targetPosition[0],Q.targetPosition[1],Q.targetPosition[2]),Q.upVector&&this.cameraObject.up.set(Q.upVector[0],Q.upVector[1],Q.upVector[2]),this.cameraObject.updateProjectionMatrix(),this.updateDirectionalLight(),ee=!0},this.getViewportFromCentreAndRadius=(Q,we,Te,Be,qe,J)=>{var pe=this.cameraObject.position.x-this.cameraObject.target.x,he=this.cameraObject.position.y-this.cameraObject.target.y,ye=this.cameraObject.position.z-this.cameraObject.target.z,Me=1/Math.sqrt(pe*pe+he*he+ye*ye);pe*=Me,he*=Me,ye*=Me;var fe=[Q,we,Te],xe=Be/Math.tan(qe*Math.PI/360),Se=[Q+pe*xe,we+he*xe,Te+ye*xe],Fe=xe+J,Ie=0,Ue=.95;Ie=J>Ue*xe?(1-Ue)*xe:xe-J;var De=new d;return De.nearPlane=Ie,De.farPlane=Fe,De.eyePosition=Se,De.targetPosition=fe,De.upVector=[this.cameraObject.up.x,this.cameraObject.up.y,this.cameraObject.up.z],De},this.getViewportFromBoundingBox=(Q,we)=>{var Te=Q.min.distanceTo(Q.max)/2*we,Be=(Q.min.x+Q.max.x)/2,qe=(Q.min.y+Q.max.y)/2,J=(Q.min.z+Q.max.z)/2,pe=4,he=this.getViewportFromCentreAndRadius(Be,qe,J,Te,40,Te*pe);return he},this.getCurrentViewport=()=>{var Q=new d;return Q.nearPlane=this.cameraObject.near,Q.farPlane=this.cameraObject.far,Q.eyePosition[0]=this.cameraObject.position.x,Q.eyePosition[1]=this.cameraObject.position.y,Q.eyePosition[2]=this.cameraObject.position.z,Q.targetPosition[0]=this.cameraObject.target.x,Q.targetPosition[1]=this.cameraObject.target.y,Q.targetPosition[2]=this.cameraObject.target.z,Q.upVector[0]=this.cameraObject.up.x,Q.upVector[1]=this.cameraObject.up.y,Q.upVector[2]=this.cameraObject.up.z,Q},this.getDefaultEyePosition=()=>eyePosition,this.getDefaultTargetPosition=()=>targetPosition,this.cameraTransition=(Q,we,Te)=>{oe==null&&(te=new v(Q,we,this,Te))},this.rotateCameraTransition=(Q,we,Te)=>{te==null&&(oe=new m(Q,we,this,Te))},this.enableCameraTransition=()=>{te&&(Y=_.SMOOTH_CAMERA_TRANSITION),oe&&(Y=_.ROTATE_CAMERA_TRANSITION)},this.pauseCameraTransition=()=>{Y=_.DEFAULT},this.stopCameraTransition=()=>{Y=_.DEFAULT,te=void 0,oe=void 0},this.isTransitioningCamera=()=>Y===_.SMOOTH_CAMERA_TRANSITION||Y===_.ROTATE_CAMERA_TRANSITION,this.autoTumble=(Q,we,Te)=>{ie=new b(Q,we,Te,this)},this.enableAutoTumble=()=>{Y=_.AUTO_TUMBLE},this.stopAutoTumble=()=>{Y=_.DEFAULT,ie=void 0},this.updateAutoTumble=()=>{ie&&(ie.requireUpdate=!0)},this.isAutoTumble=()=>Y===_.AUTO_TUMBLE,this.enableRaycaster=(Q,we,Te)=>{$==null&&($=new h(Q,this.scene,we,Te,this.renderer))},this.disableRaycaster=()=>{$.disable(),$=void 0},this.isSyncControl=()=>currentMpde===_.SYNC_CONTROL,this.enableSyncControl=()=>(Y=_.SYNC_CONTROL,ue||(ue=new A),ue.setCurrentCameraSettings(this.cameraObject,be[G]),ue),this.disableSyncControl=()=>{Y=_.DEFAULT,this.cameraObject.zoom=1,this.cameraObject.updateProjectionMatrix()},this.enable()},v=function(M,F,R,_){var O=M.eyePosition,E=M.targetPosition,T=M.upVector,C=F.eyePosition,L=F.targetPosition,I=F.upVector,x=R,P=_,B=0,D=!1;x.near=Math.min(M.nearPlane,F.nearPlane),x.far=Math.max(M.farPlane,F.farPlane),x.cameraObject.up.set(F.upVector[0],F.upVector[1],F.upVector[2]),this.setDuration=G=>{P=G};var V=G=>{var Y=B+G;Y>P&&(Y=P),B=Y},k=()=>{var G=B/P,Y=[O[0]*(1-G)+C[0]*G,O[1]*(1-G)+C[1]*G,O[2]*(1-G)+C[2]*G],te=[E[0]*(1-G)+L[0]*G,E[1]*(1-G)+L[1]*G,E[2]*(1-G)+L[2]*G];T[0]*(1-G)+I[0]*G,T[1]*(1-G)+I[1]*G,T[2]*(1-G)+I[2]*G,x.cameraObject.position.set(Y[0],Y[1],Y[2]),x.cameraObject.target.set(te[0],te[1],te[2])};this.update=G=>{this.enabled===!1||(V(G),k(),B==P&&(D=!0))},this.isTransitionCompleted=()=>D},m=function(M,F,R,_){var O=M,E=F,T=R,C=_,L=0,I=!1;this.setDuration=P=>{C=P};var x=P=>{var B=L,D=L+P;D>C&&(D=C),L=D;var V=L-B,k=V/C,G=k*E;T.rotateAboutLookAtpoint(O,G)};this.update=P=>{this.enabled===!1||(x(P),L==C&&(I=!0))},this.isTransitionCompleted=()=>I},h=function(M,F,R,_,O){var E=M,T=F,C=O,L=R,I=_,x=new c.Raycaster;x.params.Line.threshold=.1,x.params.Points.threshold=1;var P=new c.Vector2,B=!1,D=new Date,V=!1,k=0,G=[],Y={zincCamera:void 0,x:-1,y:-1},te=void 0;this.enable=()=>{enable=!0},this.disable=()=>{enable=!1},this.getIntersectsObject=ae=>{if(T!==E){var W=E.getThreeJSScene();C.render(W,ae.cameraObject)}var $=te||E.getPickableThreeJSObjects();return G.length=0,x.intersectObjects($,!0,G)},this.setPickableObjects=ae=>{ae===void 0?te=void 0:(te=[],ae.forEach(W=>{W.getGroup()&&W.getGroup().visible&&te.push(W.getGroup())}))},this.getIntersectsObjectWithOrigin=(ae,W,$)=>(x.set(W,$),this.getIntersectsObject(ae)),this.getIntersectsObjectWithCamera=(ae,W,$)=>(ae.getNDCFromDocumentCoords(W,$,P),x.setFromCamera(P,ae.cameraObject),this.getIntersectsObject(ae)),this.pick=(ae,W,$)=>{if(C&&E&&ae&&L){this.getIntersectsObjectWithCamera(ae,W,$);for(var j,re=G.length,z=0;z{if(C&&E&&ae&&I){if(this.getIntersectsObjectWithCamera(ae,W,$),D.setTime(Date.now()),G.length===0){if(V)return;V=!0}else V=!1;I(G,W,$)}};this.move=(ae,W,$)=>{C&&E&&ae&&I&&(E.displayMarkers?oe(ae,W,$):(Y.zincCamera=ae,Y.x=W,Y.y=$,!B&&(k=D?Date.now()-D.getTime():250,250<=k?oe(ae,W,$):(B=!0,setTimeout(ie(Y),k)))))};var ie=ae=>function(){B=!1,oe(ae.zincCamera,ae.x,ae.y)}},b=function(M,F,R,_){var O=new c.Vector3,E=-F,T=_,C=M;this.stopOnCameraInput=R,this.requireUpdate=!0;var L=new c.Vector3,I=new c.Vector3,x=P=>{var B=Math.sqrt(P[0]*P[0]+P[1]*P[1]),D=4*Math.abs(P[0]),V=4*Math.abs(P[1]),k=.25*(D+V),G=-P[1]/B,Y=P[0]/B,te=G*P[0]+Y*-P[1];te>k?te=k:te<-k&&(te=-k);var oe=Math.acos(te/k)-.5*Math.PI;O.copy(T.cameraObject.position).sub(T.cameraObject.target).normalize(),L.copy(T.cameraObject.up).normalize(),I.crossVectors(L,O).normalize().multiplyScalar(G),L.multiplyScalar(Y),L.add(I).multiplyScalar(Math.cos(oe)),O.multiplyScalar(Math.sin(oe)).add(L)};this.update=P=>{this.enabled===!1||(this.requireUpdate&&(x(C),this.requireUpdate=!1),T.rotateAboutLookAtpoint(O,E*P/1e3))}},y=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(y.prototype,{update:(()=>{var S,M,F,R,_,O,E=new c.Matrix4,T=new c.Matrix4;return function(L){var I=S!==L.focus||M!==L.fov||F!==L.aspect*this.aspect||R!==L.near||_!==L.far||O!==L.zoom;if(I){S=L.focus,M=L.fov,F=L.aspect*this.aspect,R=L.near,_=L.far,O=L.zoom;var x,P,B=L.projectionMatrix.clone(),D=.064/2,V=D*R/S,k=R*Math.tan(.5*(c.Math.DEG2RAD*M))/L.zoom;T.elements[12]=-D,E.elements[12]=D,x=-k*F+V,P=k*F+V,B.elements[0]=2*R/(P-x),B.elements[8]=(P+x)/(P-x),this.cameraL.projectionMatrix.copy(B),x=-k*F-V,P=k*F-V,B.elements[0]=2*R/(P-x),B.elements[8]=(P+x)/(P-x),this.cameraR.projectionMatrix.copy(B)}this.cameraL.matrixWorld.copy(L.matrixWorld).multiply(T),this.cameraR.matrixWorld.copy(L.matrixWorld).multiply(E)}})()});var g=function(M){var F=new y;F.aspect=.5,this.setSize=(R,_)=>{M.setSize(R,_)},this.render=(R,_)=>{R.updateMatrixWorld(),_.parent===null&&_.updateMatrixWorld(),F.update(_);var O=M.getSize();M.setScissorTest(!0),M.clear(),M.setScissor(0,0,O.width/2,O.height),M.setViewport(0,0,O.width/2,O.height),M.render(R,F.cameraL),M.setScissor(O.width/2,0,O.width/2,O.height),M.setViewport(O.width/2,0,O.width/2,O.height),M.render(R,F.cameraR),M.setScissorTest(!1)}},w=function(M){var F=this;this.object=M,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0;var R=E=>{F.deviceOrientation=E},_=()=>{typeof window<"u"&&(F.screenOrientation=window.orientation||0)},O=(()=>{var E=new c.Vector3(0,0,1),T=new c.Euler,C=new c.Quaternion,L=new c.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5));return(I,x,P,B,D)=>{var V=new c.Vector3(0,0,1);V.subVectors(I.target,I.position),T.set(P,x,-B,"YXZ");var k=new c.Quaternion;k.setFromEuler(T),k.multiply(L),k.multiply(C.setFromAxisAngle(E,-D)),V.applyQuaternion(k),V.addVectors(I.position,V),I.lookAt(V)}})();this.connect=()=>{_(),typeof window<"u"&&(window.addEventListener("orientationchange",_,!1),window.addEventListener("deviceorientation",R,!1)),F.enabled=!0},this.disconnect=()=>{typeof window<"u"&&(window.removeEventListener("orientationchange",_,!1),window.removeEventListener("deviceorientation",R,!1)),F.enabled=!1},this.update=()=>{if(F.enabled!==!1){var E=F.deviceOrientation.alpha?c.Math.degToRad(F.deviceOrientation.alpha):0,T=F.deviceOrientation.beta?c.Math.degToRad(F.deviceOrientation.beta):0,C=F.deviceOrientation.gamma?c.Math.degToRad(F.deviceOrientation.gamma):0,L=F.screenOrientation?c.Math.degToRad(F.screenOrientation):0;O(F.object,E,T,C,L)}},this.dispose=function(){this.disconnect()},this.connect()},A=function(){var M=void 0,F=void 0,R=void 0,_=new c.Vector3,O=new c.Vector3,E=new c.Vector3,T=new c.Vector3,C=void 0;this.setCurrentCameraSettings=(L,I)=>{M=L.clone(),F=L,R=I,M.near=R.nearPlane,R.farPlane&&(M.far=R.farPlane),R.eyePosition&&M.position.set(R.eyePosition[0],R.eyePosition[1],R.eyePosition[2]),R.upVector&&M.up.set(R.upVector[0],R.upVector[1],R.upVector[2]),R.targetPosition&&(M.target=new c.Vector3(R.targetPosition[0],R.targetPosition[1],R.targetPosition[2]),M.lookAt(M.target)),M.updateProjectionMatrix(),_.copy(M.position).project(M),O.copy(M.target).project(M)},this.getCurrentPosition=()=>(O.copy(F.target).project(M),[O.x,O.y]),this.zoom=L=>{var I=.002*L,x=Math.max(F.zoom-I,1);F.zoom=x,F.updateProjectionMatrix()},this.zoomToBox=(L,I)=>{L.getCenter(E),E.project(M),this.setCenterZoom([E.x,E.y],I)},this.getPanZoom=()=>({target:this.getCurrentPosition(),zoom:F.zoom}),this.setCenterZoom=(L,I)=>{E.set(L[0],L[1],O.z).unproject(M),T.copy(E).sub(F.target),F.target.copy(E),F.lookAt(F.target),F.position.add(T),F.zoom=I,F.updateProjectionMatrix()},this.setEventCallback=L=>{(L===void 0||typeof L=="function")&&(C=L)},this.triggerCallback=()=>{C!==void 0&&typeof C=="function"&&C()}};l.Viewport=d,l.CameraControls=p,l.SmoothCameraTransition=v,l.RotateCameraTransition=m,l.RayCaster=h,l.CameraAutoTumble=b,l.StereoEffect=g,l.NDCCameraControl=A},(o,l,u)=>{var{Group:c,Matrix4:f}=u(4),d=u(22).Pointset;u(24).Lines;var p=u(46).Lines2,v=u(3).Geometry,m=u(4),h=0,b=function(){return"re"+h++},y=function(g,w){var A=g,S=new c;S.matrixAutoUpdate=!1,S.userData=this;var M=[],F="",R=[],_=w,O=new f,E=3e3;O.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=()=>{M.forEach(T=>T.hideAllPrimitives()),R.forEach(T=>T.setVisibility(!1))},this.showAllPrimitives=()=>{M.forEach(T=>T.showAllPrimitives()),R.forEach(T=>T.setVisibility(!0))},this.setVisibility=T=>{T!=S.visible&&(S.visible=T,this.pickableUpdateRequired=!0)},this.getVisibility=()=>S.visible,this.getGroup=()=>S,this.setTransformation=T=>{O.set(...T),S.matrix.copy(O),S.updateMatrixWorld()},this.setName=T=>{T&&T!==""&&(F=T)},this.getName=()=>F,this.getParent=()=>A,this.getFullSeparatedPath=()=>{var T=[];if(F!==""){T.push(F);for(var C,L=A;L!==void 0;)C=L.getName(),C!==""&&T.unshift(C),L=L.getParent()}return T},this.getFullPath=()=>{var T=this.getFullSeparatedPath();if(0{C=C.concat("/",L)}),C}return""},this.createChild=T=>{var C=new y(this,_);return C.setName(T),M.push(C),S.add(C.getGroup()),C},this.getChildWithName=T=>{if(T){for(var C=T.toLowerCase(),L=0;L{if(T&&0{var C=T.split("/");return this.findChildFromSeparatedPath(C)},this.createChildFromSeparatedPath=T=>{if(0{var C=T.split("/");return this.createChildFromSeparatedPath(C)},this.findOrCreateChildFromPath=T=>{var C=this.findChildFromPath(T);return C||(C=this.createChildFromPath(T)),C},this.addZincObject=T=>{T&&(T.setRegion(this),S.add(T.getGroup()),R.push(T),this.pickableUpdateRequired=!0,_&&_.triggerObjectAddedCallback(T))},this.removeZincObject=T=>{for(var C=0;C{if(this.pickableUpdateRequired)return!0;if(T){for(var C=!1,L=0;L(S.visible&&(R.forEach(L=>{if(L.isPickable&&L.getGroup()&&L.getGroup().visible){var I=L.marker;I&&I.isEnabled()&&T.push(I.getMorph()),T.push(L.getGroup())}}),C&&M.forEach(L=>{L.getPickableThreeJSObjects(T,C)}),this.pickableUpdateRequired=!1),T),this.setDuration=T=>{E=T,R.forEach(C=>C.setDuration(T)),M.forEach(C=>C.setDuration(T))},this.getDuration=()=>E,this.getBoundingBox=T=>{var C,L;return R.forEach(I=>{L=I.getBoundingBox(),L&&(C==null?C=L.clone():C.union(L))}),T&&M.forEach(I=>{L=I.getBoundingBox(T),L&&(C==null?C=L.clone():C.union(L))}),C},this.clear=T=>{T&&M.forEach(C=>C.clear(T)),R.forEach(C=>{S.remove(C.getGroup()),C.dispose()}),M=[],R=[]},this.objectIsInRegion=(T,C)=>{for(var L=0;L{R.forEach(L=>{L.isGeometry&&T(L)}),C&&M.forEach(L=>L.forEachGeometry(T,C))},this.forEachGlyphset=(T,C)=>{R.forEach(L=>{L.isGlyphset&&T(L)}),C&&M.forEach(L=>L.forEachGlyphset(T,C))},this.forEachPointset=(T,C)=>{R.forEach(L=>{L.isPointset&&T(L)}),C&&M.forEach(L=>L.forEachPointset(T,C))},this.forEachLine=(T,C)=>{R.forEach(L=>{L.isLines&&T(L)}),C&&M.forEach(L=>L.forEachLine(T,C))},this.findObjectsWithAnatomicalId=(T,C)=>{var L=[];return R.forEach(I=>{I.anatomicalId===T&&L.push(I)}),C&&M.forEach(I=>{var x=I.findObjectsWithAnatomicalId(T,C);L.push(...x)}),L},this.findObjectsWithGroupName=(T,C)=>{var L=[];return R.forEach(I=>{var x=I.groupName?I.groupName.toLowerCase():I.groupName,P=T&&T.toLowerCase();x===P&&L.push(I)}),C&&M.forEach(I=>{var x=I.findObjectsWithGroupName(T,C);L.push(...x)}),L},this.findGeometriesWithGroupName=(T,C)=>{var L=this.findObjectsWithGroupName(T,C),I=L.filter(x=>x.isGeometry);return I},this.findPointsetsWithGroupName=(T,C)=>{var L=this.findObjectsWithGroupName(T,C),I=L.filter(x=>x.isPointset);return I},this.findGlyphsetsWithGroupName=(T,C)=>{var L=this.findObjectsWithGroupName(T,C),I=L.filter(x=>x.isGlyphset);return I},this.findLinesWithGroupName=(T,C)=>{var L=this.findObjectsWithGroupName(T,C),I=L.filter(x=>x.isLines);return I},this.getAllObjects=T=>{var C=[...R];return T&&M.forEach(L=>{var I=L.getAllObjects(T);C.push(...I)}),C},this.getChildRegions=T=>{var C=[...M];return T&&M.forEach(L=>{var I=L.getChildRegions(T);C.push(...I)}),C},this.getCurrentTime=()=>{if(R[0]!=null)return R[0].getCurrentTime();for(var T,C=0;C{R.forEach(L=>{L.setMorphTime(T)}),C&&M.forEach(L=>{L.setMorphTime(T)})},this.isTimeVarying=()=>{for(var T=0;T{var B,D=this.getAllObjects(P);D.forEach(V=>{V.render(T*C,L,I,x)}),x&&L===!1&&(B=x.markerCluster)!==null&&B!==void 0&&B.markerUpdateRequired&&x.markerCluster.calculate()},this.createPoints=(T,C,L,I)=>{var x=!1,P=this.findObjectsWithGroupName(T,!1),B=P.findIndex(V=>V.isPointset),D=-1{var I=!1,x=this.findObjectsWithGroupName(T,!1),P=x.findIndex(D=>D.isLines),B=-1{var B=new v,D=new m.MeshPhongMaterial({color:L,morphTargets:!1,morphNormals:!1,transparent:!0,opacity:I,side:m.DoubleSide});return B.createMesh(C,D,{localTimeEnabled:!1,localMorphColour:!1}),B.getMorph()?(B.setVisibility(!1),B.setName(T),B.setRenderOrder(P),this.addZincObject(B),B):void 0}};l.Region=y},(o,l,u)=>{u(4),u(5).toBufferGeometry;var c=u(47).LineSegments2,f=u(49).LineMaterial,d=u(48).LineSegmentsGeometry,p=function(){u(24).Lines.call(this),this.isLines2=!0;var v=Array(300);this.createLineSegment=(m,h,b)=>{if(m&&h){var y=new d;y.setPositions(m),y.colorsNeedUpdate=!0;var g=new c(y,h);g.scale.set(1,1,1),g.computeLineDistances(),this.setMesh(g,b.localTimeEnabled,b.localMorphColour)}},this.setWidth=m=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=m,this.morph.material.needsUpdate=!0)},this.addVertices=function(m){if(m&&m.length){var h=this.getMorph();h||(this.drawRange=0);var b=3*this.drawRange;if(m.forEach(y=>{v[b++]=y[0],v[b++]=y[1],v[b++]=y[2],this.drawRange++}),!h)for(;300>b;)v[b++]=m[0][0],v[b++]=m[0][1],v[b++]=m[0][2];h&&(h.geometry.setPositions(v),h.computeLineDistances(),this.boundingBoxUpdateRequired=!0)}return v},this.getVerticesByFaceIndex=function(m){var h=3*(2*m),b=this.getMorph();if(b&&3*this.drawRange>h){var y=b.geometry.getAttribute("instanceStart");return[[y.data.array[h],y.data.array[++h],y.data.array[++h]],[y.data.array[++h],y.data.array[++h],y.data.array[++h]]]}return[]},this.editVertices=function(m,h){if(m&&m.length){var b=this.getMorph(),y=h+m.length-1;if(!b||0>h||y>=this.drawRange)return;var g=3*h;for(m.forEach(w=>{v[g++]=w[0],v[g++]=w[1],v[g++]=w[2]}),g=3*this.drawRange;300>g;)v[g++]=m[0][0],v[g++]=m[0][1],v[g++]=m[0][2];b.geometry.setPositions(v),b.computeLineDistances(),this.boundingBoxUpdateRequired=!0}return v},this.addLines=(m,h)=>{if(m&&0{var m=this.getMorph().material;m.resolution.set(window.innerWidth,window.innerHeight)}};p.prototype=Object.create(u(24).Lines.prototype),p.prototype.constructor=p,l.Lines2=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments2:()=>R});var c=u(4),f=u(48),d=u(49),p=new c.Vector3,v=new c.Vector3,m=new c.Vector4,h=new c.Vector4,b=new c.Vector4,y=new c.Vector3,g=new c.Matrix4,w=new c.Line3,A=new c.Vector3,S=new c.Box3,M=new c.Sphere,F=new c.Vector4;class R extends c.Mesh{constructor(){var O=0Y&&h.z>Y;if(!re){if(m.z>Y){var z=m.z-h.z,H=(m.z-Y)/z;m.lerp(h,H)}else if(h.z>Y){var K=h.z-m.z,le=(h.z-Y)/K;h.lerp(m,le)}m.applyMatrix4(I),h.applyMatrix4(I),m.multiplyScalar(1/m.w),h.multiplyScalar(1/h.w),m.x*=D.x/2,m.y*=D.y/2,h.x*=D.x/2,h.y*=D.y/2,w.start.copy(m),w.start.z=0,w.end.copy(h),w.end.z=0;var se=w.closestPointToPointParameter(y,!0);w.at(se,A);var U=c.MathUtils.lerp(m.z,h.z,se),N=-1<=U&&1>=U,Z=y.distanceTo(A)<.5*V;if(N&&Z){w.start.fromBufferAttribute(k,$),w.end.fromBufferAttribute(G,$),w.start.applyMatrix4(x),w.end.applyMatrix4(x);var X=new c.Vector3,ee=new c.Vector3;C.distanceSqToSegment(w.start,w.end,ee,X),E.push({point:ee,pointOnLine:X,distance:C.origin.distanceTo(ee),object:this,face:null,faceIndex:$,uv:null,uv2:null})}}}}}}}R.prototype.LineSegments2=!0},(o,l,u)=>{u.r(l),u.d(l,{LineSegmentsGeometry:()=>p});var c=u(4),f=new c.Box3,d=new c.Vector3;class p 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(m){var h=this.attributes.instanceStart,b=this.attributes.instanceEnd;return h!==void 0&&(h.applyMatrix4(m),b.applyMatrix4(m),h.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,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(m){var h;m instanceof Float32Array?h=m:Array.isArray(m)&&(h=new Float32Array(m));var b=new c.InstancedInterleavedBuffer(h,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(b,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(b,3,3)),this}fromWireframeGeometry(m){return this.setPositions(m.attributes.position.array),this}fromEdgesGeometry(m){return this.setPositions(m.attributes.position.array),this}fromMesh(m){return this.fromWireframeGeometry(new c.WireframeGeometry(m.geometry)),this}fromLineSegments(m){var h=m.geometry;return h.isGeometry?void console.error("THREE.LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead."):(h.isBufferGeometry&&this.setPositions(h.attributes.position.array),this)}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;m!==void 0&&h!==void 0&&(this.boundingBox.setFromBufferAttribute(m),f.setFromBufferAttribute(h),this.boundingBox.union(f))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();var m=this.attributes.instanceStart,h=this.attributes.instanceEnd;if(m!==void 0&&h!==void 0){var b=this.boundingSphere.center;this.boundingBox.getCenter(b);for(var y=0,g=0,w=m.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(p){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(m){this.uniforms.diffuse.value=m}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(m){this.uniforms.linewidth.value=m}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(v){!!v!="USE_DASH"in this.defines&&(this.needsUpdate=!0),v===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(m){this.uniforms.dashScale.value=m}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(m){this.uniforms.dashSize.value=m}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(m){this.uniforms.dashOffset.value=m}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(m){this.uniforms.gapSize.value=m}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(m){this.uniforms.opacity.value=m}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(m){this.uniforms.resolution.value.copy(m)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(m){!!m!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),m===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(p)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var d=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var p=new c.BufferGeometry,v=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),m=new c.BufferAttribute(v,3);p.setAttribute("position",m);var h=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(p,h);var b=new c.Box3,y=new c.Vector3;this.getDiffFromNormalised=(w,A)=>{b.setFromBufferAttribute(m).getCenter(y);var S=y.clone().project(this.camera),M=new c.Vector3(w,A,S.z).unproject(this.camera);return M.sub(y)};var g=(w,A)=>{d.camera.near&&(this.camera.near=d.camera.near),A.farPlane&&(this.camera.far=A.farPlane),A.eyePosition&&this.camera.position.set(A.eyePosition[0],A.eyePosition[1],A.eyePosition[2]),A.upVector&&this.camera.up.set(A.upVector[0],A.upVector[1],A.upVector[2]),A.targetPosition&&this.camera.lookAt(new c.Vector3(A.targetPosition[0],A.targetPosition[1],A.targetPosition[2])),this.camera.zoom=1/w,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var w=new c.Vector3().copy(d.camera.target).project(d.camera),A=new c.Vector3(-1,-1,w.z).unproject(d.camera),S=new c.Vector3(1,-1,w.z).unproject(d.camera),M=new c.Vector3(1,1,w.z).unproject(d.camera),F=new c.Vector3(-1,1,w.z).unproject(d.camera);m.copyVector3sArray([A,S,M,M,F,A]),m.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var w=d.getZincCameraControls(),A=d.getBoundingBox();if(A){var S=A.min.distanceTo(A.max),M=S/2,F=(A.min.x+A.max.x)/2,R=(A.min.y+A.max.y)/2,_=(A.min.z+A.max.z)/2,O=w.getViewportFromCentreAndRadius(F,R,_,M,40,M*4);g(S,O)}}}},(o,l,u)=>{var c=u(4),f=u(52)(c),d=u(3).Geometry,p=u(53),v=u(54).default,m=c.BufferGeometryLoader,h=function(b){var y;b&&b.isGeometry&&(y=b);var g=void 0,w=void 0,A=!1,S=void 0,M=E=>{var T=y.getMorph().material.clone();T.morphTargets=!1;var C=new d,L=new m,I=L.parse(E),x=new c.Mesh(I.geometry,T);return C.geometry=x.geometry,x.userData=C,C.setMorph(x),C},F=E=>{switch(E.data.action){case"message":console.log(E.data.message);break;case"result":var T=new h(M(E.data.object));S&&S(T),S=void 0,A=!1;break;default:throw"Cannot handle specified action."}},R=E=>{if(p!==void 0&&(w=p(55)),!w)g=new(u(56)).GeometryCSGInternal(E);else if(E&&E.isGeometry){var T=E.getMorph(),C=T.geometry.clone().applyMatrix(T.matrix).toJSON();w.addEventListener("message",function(L){F(L)}),w.postMessage({action:"initialise",object:C})}};this.getHostGeometry=()=>{var E=new f(y.getMorph());return new _(E)},this.getGeometry=()=>y;var _=E=>{var T=y.getMorph().material.clone();T.morphTargets=!1;var C=E.toMesh(T),L=new d;return L.geometry=C.geometry,C.userData=L,L.setMorph(C),L};this.setCSG=E=>{g.setCSG(E)};var O=(E,T,C,L)=>{if(A)L("On progress");else{var I=E.getMorph(),x=I.geometry.clone().applyMatrix(I.matrix).toJSON();S=C,A=!0,w.postMessage({action:T,object:x})}};this.intersect=E=>new v((T,C)=>{if(w)O(E,"intersect",T,C);else{var L=g.intersect(E),I=new h(_(L));I.setCSG(L),T(I)}}),this.subtract=E=>new v((T,C)=>{if(w)O(E,"intersect",T,C);else{var L=g.subtract(E),I=new h(_(L));I.setCSG(L),T(I)}}),this.union=E=>new v((T,C)=>{if(w)O(E,"intersect",T,C);else{var L=g.union(E),I=new h(_(L));I.setCSG(L),T(I)}}),this.terminateWorker=()=>{w&&w.terminate()},R(b)};l.GeometryCSG=h},o=>{var l=1e-5,u=0,c=1,f=2,d=3;o.exports=function(p){var v=function(m){var h,b,y,g,w,A,S,M=[];if(m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m instanceof p.Geometry)this.matrix=new p.Matrix4;else if(m.isMesh)m.updateMatrix(),this.matrix=m.matrix.clone(),m=m.geometry,m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m.mergeVertices(),m.computeVertexNormals(!1);else{if(m instanceof v.Node)return this.tree=m,this.matrix=new p.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(h=0,b=m.faces.length;h"u"?(_.vertices.push(S),g=T[S.x+","+S.y+","+S.z]=_.vertices.length-1):g=T[S.x+","+S.y+","+S.z],S=b.vertices[h-1],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof T[S.x+","+S.y+","+S.z]>"u"?(_.vertices.push(S),w=T[S.x+","+S.y+","+S.z]=_.vertices.length-1):w=T[S.x+","+S.y+","+S.z],S=b.vertices[h],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof T[S.x+","+S.y+","+S.z]>"u"?(_.vertices.push(S),A=T[S.x+","+S.y+","+S.z]=_.vertices.length-1):A=T[S.x+","+S.y+","+S.z],M=new p.Face3(g,w,A,new p.Vector3(b.normal.x,b.normal.y,b.normal.z)),_.faces.push(M),_.faceVertexUvs[0].push(F);return _},v.prototype.toBufferGeometry=function(){var m=this.toGeometry(),h=new p.BufferGeometry().fromGeometry(m);return h},v.prototype.toMesh=function(m){var h=this.toBufferGeometry(),b=new p.Mesh(h,m);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},v.Polygon=function(m){m instanceof Array||(m=[]),this.vertices=m,0l?c:u},v.Polygon.prototype.classifySide=function(m){var h,b,y,g=0,w=0,A=m.vertices.length;for(h=0;h{o.exports=$B()},o=>{o.exports=eD},(o,l,u)=>{var c=u(3).Geometry,f=u(4),d=f.BufferGeometryLoader;o.exports=function(p){var v=void 0,m=function(A){var S=new d,M=S.parse(A),F=new f.MeshPhongMaterial,R=new f.Mesh(M.geometry,F),_=new c;return _.setMorph(R),_},h=function(A){var S=m(A);v=new(u(56)).GeometryCSGInternal(S),p.postMessage({action:"message",message:"Initialised"})},b=function(A){if(v){var S=m(A),M=v.intersect(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},y=function(A){if(v){var S=m(A),M=v.subtract(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},g=function(A){if(v){var S=m(A),M=v.union(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}};p.addEventListener("message",function(w){switch(w.data.action){case"initialise":h(w.data.object);break;case"intersect":b(w.data.object);break;case"subtract":y(w.data.object);break;case"union":g(w.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(52)(c);u(3).Geometry,u(51).GeometryCSG;var d=function(p){var v;p&&p.isGeometry&&(v=p);var m;this.setGeometry=b=>{b&&b.isGeometry&&(v=b),m=void 0},this.setCSG=b=>{m=b};var h=b=>{if(v&&v.morph&&b&&b.morph){m===void 0&&(m=new f(v.morph));var y=new f(b.morph);return y}};this.intersect=b=>{var y=h(b);return m&&y?m.intersect(y):void 0},this.subtract=b=>{var y=h(b);return m&&y?m.subtract(y):void 0},this.union=b=>{var y=h(b);return m&&y?m.union(y):void 0}};l.GeometryCSGInternal=d},(o,l,u)=>{var c=u(4),f=u(52)(c);u(18).Glyphset;var d=function(p){var v;p&&p.isGlyphset&&(v=p);var m=[];this.setGlyphset=y=>{y&&y.isGlyphset&&(v=y),hostCSG=void 0},this.getGlyphset=()=>v;var h=()=>y=>{var g=y.getMesh(),w=y.getLabel();if(g){var A=new f(g.geometry.clone().applyMatrix(g.matrix)),S=[];S.csg=A,S.label=w,g.material&&(S.material=g.material.clone()),m.push(S)}},b=y=>{if(v&&y&&y.getMorph()){m.length==0&&v.forEachGlyph(h());var g=new f(y.getMorph());return g}};this.intersect=y=>{var g=b(y);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})())})(Vg);var br=Vg.exports;const Hc=bC(br),si={SELECTED_COLOUR:"#00ff00",HIGHLIGHTED_COLOUR:"#ff0000",DEFAULT_RADIUS:1,DEFAULT_RADIAL_SEGMENTS:8,ZOOM_RADIUS:5,ZOOM_RADIAL_SEGMENTS:12},mx=(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},gf=(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)},tD=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=gf(r[0],[s.x,s.y,s.z]),l=gf(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]}}}}}},nD=n=>{const e=n.zincObjects;if(e.length>0&&e[0])return e[0]},iD=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},rD=(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},Wc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return gf(t[1],t[0])}return 0},vf=(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},sD=(n,e)=>{const t=e.getBoundingBox(),i=new br.THREE.Vector3().subVectors(t.max,t.min),r=new br.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=>gx(i,e))},Ao=(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},yf=(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},oD=(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=yf(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=yf(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},aD=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[]},vx=(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=yf(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},lD=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;n.isPointset?s="MultiPoint":n.isLines2?s="MultiLineString":s="Feature";const o=s!=="Feature",l=s==="Feature"?"Feature annotation":"Drawn annotation";if(s){const u=lD(n);let c=e.slice(-1)==="/"?e:e+"/";c=c+t;const f=c,d={resource:i,item:{id:f},body:{evidence:[],comment:r},feature:{id:f,properties:{drawn:o,label:l},geometry:{coordinates:u,type:s}}};return r==="Deleted"&&(d.feature=void 0),d}},bx=(n,e,t,i,r,s,o)=>{const l=yx(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},xx=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},wx=(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)})},bf=function(n){const e=[];for(let t=0;t{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},cD={name:"LinesControls",components:{Button:ws,Col:Fn,Container:Jn,InputNumber:vi,Main:gi,Slider:An,ElIconArrowLeft:ki,ElIconArrowRight:zi},props:{createData:{type:Object},usageConfig:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,radius:si.DEFAULT_RADIUS,radialSegments:si.DEFAULT_RADIAL_SEGMENTS,currentIndex:0,ElIconArrowLeft:a.shallowRef(ki),ElIconArrowRight:a.shallowRef(zi),edited:!1,zincObject:void 0,isTubeLines:!1}},computed:{showTubeLinesControls(){return this.usageConfig.showTubeLinesControls}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=Wc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?Wc(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=vf(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=vf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=vf(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=Wc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){var e;this.currentIndex=-1,this.distance=0,n.isLines2||n.isTubeLines?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,this.isTubeLines=n.isTubeLines,n.isEditable?(this.currentIndex=0,this.distance=Wc(n,this.currentIndex)):(e=n.userData)!=null&&e.isNerves&&(this.radius=si.ZOOM_RADIUS,this.radialSegments=si.ZOOM_RADIAL_SEGMENTS)):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)},modifyTubeLines:function(){this.zincObject.setTubeLines(this.radius,this.radius*this.radialSegments)}}};function uD(n,e,t,i,r,s){const o=Fn,l=An,u=vi,c=Yn,f=ws,d=gi,p=Jn;return a.openBlock(),a.createBlock(p,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(d,{class:"slides-block"},{default:a.withCtx(()=>[n.isTubeLines&&s.showTubeLinesControls?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Radius: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radius,"onUpdate:modelValue":e[0]||(e[0]=v=>n.radius=v),class:"my-slider",step:1,min:1,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radius,"onUpdate:modelValue":e[1]||(e[1]=v=>n.radius=v),step:1,min:1,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Radial Segments: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radialSegments,"onUpdate:modelValue":e[2]||(e[2]=v=>n.radialSegments=v),class:"my-slider",step:1,min:8,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radialSegments,"onUpdate:modelValue":e[3]||(e[3]=v=>n.radialSegments=v),step:1,min:8,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):n.isTubeLines?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(c,{key:1},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" Width: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[4]||(e[4]=v=>n.width=v),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[5]||(e[5]=v=>n.width=v),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:2},[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[6]||(e[6]=v=>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[7]||(e[7]=v=>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(()=>e[18]||(e[18]=[a.createTextVNode(" Move: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[8]||(e[8]=v=>n.adjust=v),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[9]||(e[9]=v=>s.onMoveSliding()),onChange:e[10]||(e[10]=v=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Length: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[11]||(e[11]=v=>n.lengthScale=v),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[12]||(e[12]=v=>s.onLengthSliding()),onChange:e[13]||(e[13]=v=>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[14]||(e[14]=v=>n.newDistance=v),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Mx=Ii(cD,[["render",uD],["__scopeId","data-v-0deb177d"]]),hD={name:"PointsControls",components:{Col:Fn,Container:Jn,InputNumber:vi,Main:gi,Select:Ms,Slider:An,Row:Yn,Option:As,ElIconArrowLeft:ki,ElIconArrowRight:zi},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(ki),ElIconArrowRight:a.shallowRef(zi),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=rD(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 dD(n,e,t,i,r,s){const o=Fn,l=An,u=vi,c=Yn,f=As,d=Ms,p=ws,v=gi,m=Jn;return a.openBlock(),a.createBlock(m,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(v,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[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]=h=>n.size=h),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=h=>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]=h=>n.size=h),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(()=>e[16]||(e[16]=[a.createTextVNode(" Size attenuation: ")])),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(d,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=h=>s.modifyAttenuation(h,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,h=>(a.openBlock(),a.createBlock(f,{key:h.value,label:h.label,value:h.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(p,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=h=>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(p,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=h=>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(()=>e[17]||(e[17]=[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]=h=>n.translation[0]=h),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=h=>s.onMoveSliding()),onChange:e[8]||(e[8]=h=>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(()=>e[18]||(e[18]=[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]=h=>n.translation[1]=h),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=h=>s.onMoveSliding()),onChange:e[11]||(e[11]=h=>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(()=>e[19]||(e[19]=[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]=h=>n.translation[2]=h),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=h=>s.onMoveSliding()),onChange:e[14]||(e[14]=h=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Ax=Ii(hD,[["render",dD],["__scopeId","data-v-d1de9c65"]]),fD={name:"TextureSlidesControls",components:{Col:Fn,Container:Jn,Footer:Ag,Icon:dt,InputNumber:vi,Main:gi,Row:Yn,Select:Ms,Slider:An,Option:As,ElIconDelete:tl,ElIconPlus:nl},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 pD(n,e,t,i,r,s){const o=As,l=Ms,u=Fn,c=An,f=vi,d=tl,p=dt,v=Yn,m=gi,h=nl,b=Ag,y=Jn;return a.openBlock(),a.createBlock(y,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(m,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,w)=>(a.openBlock(),a.createBlock(v,{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:A=>s.modifyDirection(A,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,A=>(a.openBlock(),a.createBlock(o,{key:A.value,label:A.label,value:A.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":A=>g.value=A,class:"my-slider",step:.01,min:0,max:1,"show-tooltip":!1,onInput:A=>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":A=>g.value=A,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(p,{class:"delete-icon",onClick:A=>s.removeSlide(w,g)},{default:a.withCtx(()=>[a.createVNode(d)]),_: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(v,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>e[0]||(e[0]=[a.createTextVNode(" Add a new slide ")])),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const Sx=Ii(fD,[["render",pD],["__scopeId","data-v-12185b7f"]]),mD={name:"TransformationControls",components:{Col:Fn,Container:Jn,InputNumber:vi,Main:gi,Slider:An},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0,enableScaling:!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(),t=this.zincObject.userData.originalPos;e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.zincObject.isGlyphset?this.scale=this.zincObject.globalScale:this.scale=e.scale.x,this.enableScaling=!this.zincObject.isTextureSlides,t&&this.boundingDims&&(this.min=[t[0]-this.boundingDims.size[0],t[1]-this.boundingDims.size[1],t[2]-this.boundingDims.size[2]],this.max=[t[0]+this.boundingDims.size[0],t[1]+this.boundingDims.size[1],t[2]+this.boundingDims.size[2]]))}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject&&this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function gD(n,e,t,i,r,s){const o=Fn,l=An,u=vi,c=Yn,f=gi,d=Jn;return a.openBlock(),a.createBlock(d,{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(()=>e[16]||(e[16]=[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]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=p=>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]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=p=>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(()=>e[17]||(e[17]=[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]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=p=>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]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=p=>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(()=>e[18]||(e[18]=[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]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=p=>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]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),n.enableScaling?(a.openBlock(),a.createBlock(c,{key:0,class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[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]=p=>n.scale=p),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=p=>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]=p=>n.scale=p),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1})]),_:1})}const _x=Ii(mD,[["render",gD],["__scopeId","data-v-cd88ead8"]]),vD={name:"OpacityControls",components:{Container:Jn,Header:x2,Main:gi,Slider:An},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}}},yD={class:"block"},bD={class:"display"};function xD(n,e,t,i,r,s){const o=An,l=Jn;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",yD,[a.createElementVNode("span",bD,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 Tx=Ii(vD,[["render",xD],["__scopeId","data-v-cbfc46a5"]]),wD={name:"PrimitiveControls",components:{Collapse:vg,CollapseItem:yg,LinesControls:Mx,OpacityControls:Tx,PointsControls:Ax,TextureSlidesControls:Sx,TransformationControls:_x,ElIconArrowRight:zi},props:{createData:{type:Object},viewingMode:{type:String,default:"Exploration"},usageConfig:{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%"}},computed:{hasValidPrimitive:function(){return this.viewingMode==="Exploration"||this.viewingMode==="Annotation"?this.material!==void 0||this.isTextureSlides===!0:!1}},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,t;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||n.isTubeLines&&((t=this.usageConfig)!=null&&t.showTubeLinesControls))&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function MD(n,e,t,i,r,s){const o=Tx,l=yg,u=_x,c=Sx,f=Ax,d=Mx,p=vg,v=zi,m=dt;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(p,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=h=>n.activeName=h),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]=h=>n.$emit("primitivesUpdated",h))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(d,{class:"lines-controls",ref:"linesControls",createData:t.createData,usageConfig:t.usageConfig,onPrimitivesUpdated:e[1]||(e[1]=h=>n.$emit("primitivesUpdated",h))},null,8,["createData","usageConfig"])]),_: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]=(...h)=>s.toggleDrawer&&s.toggleDrawer(...h))},[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(v)]),_:1})],2)],2)),[[a.vShow,s.hasValidPrimitive]])}const Ex=Ii(wD,[["render",MD],["__scopeId","data-v-83d11562"]]),AD=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return ti?1:0},SD={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:ki,TreeControls:Ua.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)=>AD(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},removeRegion:function(n){if(this.treeData[0].children){for(let e=0;e{const u=r&&!n.disabled;l.setVisibility(u)})},updateActiveUI:function(n){this.active.length=0,mx(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,mx(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=Ao(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Ao(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",[])},forEachChildInNode:function(n,e,t,i,r){if(n.isRegion){if(n.children){const s=t===""||e.includes(n.id);n.children.forEach(o=>this.forEachChildInNode(o,e,n.regionPath,i&&s,r))}}else n.isPrimitives&&r(n,t,i)},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getNodeDataByRegionAndGroup:function(n,e){for(const t of this.treeDataEntry)if(t.isRegion&&t.label===n){const i=t.children;for(const r of i)if(r.isPrimitives&&r.label===e)return r}},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return Ao(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)})},updateAllNodeColours:function(){const n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],n,"",!0,(e,t,i)=>{e.isPrimitives&&(e.activeColour=this.getColour(e))})},setOutlines:function(n){const e=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],e,"",!0,(t,i,r)=>{const o=this.module.scene.getRootRegion().findChildFromPath(i).findObjectsWithGroupName(t.label);n?o.forEach(l=>{l.isLines&&(e.includes(t.id)&&r&&l.setVisibility(!0),t.disabled=!1)}):t.isPrimitives&&o.forEach(l=>{l.isLines&&(l.setVisibility(!1),t.disabled=!0)})})},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)})},setCheckedKeys:function(n,e){this.$nextTick(()=>{e&&this.$refs.treeControls.$refs.regionTree.setCheckedKeys([]),n.forEach(t=>{this.$refs.treeControls.$refs.regionTree.setChecked(t,!0,!0)})})},checkAllKeys:function(n=[]){const e=[],t=[];gx(this.treeData[0],e);const i=e.filter(r=>!n.some(s=>r.includes(s)));this.setTreeVisibilityWithFullPaths(this.treeData[0],i,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:oD(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)}}}}},_D={class:"traditional-container"};function TD(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=ki,u=dt;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",_D,[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",onMouseleave:e[0]||(e[0]=c=>s.removeHover(!0))},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[1]||(e[1]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const Cx=Ii(SD,[["render",TD],["__scopeId","data-v-5394b615"]]),xf=Ga.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),ED={name:"ScaffoldTooltip",components:{Col:Fn,CreateTooltipContent:Ua.CreateTooltipContent,ElIconDelete:tl,Icon:dt,Popover:Ml,Row:Yn,Tooltip:Ua.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{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(tl)}},computed:{...Ga.mapState(xf,["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,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}]}}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}}},CD={class:"tooltip-text"},LD={key:0,class:"tooltip-text"},RD={key:1,class:"delete-container"};function FD(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Fn,c=ws,f=Yn,d=Ml;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(d,{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",CD,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",LD,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>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,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",RD,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[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[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const Lx=Ii(ED,[["render",FD],["__scopeId","data-v-d3f76b72"]]),Va={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},PD=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},ID=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Va.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Va.ALL||s.targetEventType===l)){const f=new PD(l,u,c);r(f)}}},OD=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}},wf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},yn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};yn.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)},yn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const jc=(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)})}},ND=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{var m,h,b;if(v.isTubeLines&&((m=v.userData)!=null&&m.isNerves)&&!((h=v.userData)!=null&&h.isGreyScale)){v.setTubeLines(d,p);let y=c||((b=v.userData)==null?void 0:b.defaultColour);y=y.replace("#","0x"),v.setColourHex(y)}})}},this.resetHighlighted=function(){const u=l(n);this.setNervesStyle(n),jc(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);this.setNervesStyle(n),jc(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Mf=Hc.THREE,BD=function(){const n=document.createElement("div");let e;if(n.style.height="100%",Rx.isWebGLAvailable())e=new Hc.Renderer(n,window),Hc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=Rx.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:Hc,renderer:e,container:n}},Et=function(){yn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new ND,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Mf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};Et.prototype=Object.create(yn.prototype),Et.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},Et.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,r)}return s},Et.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)},Et.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Mf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},Et.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=bf(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Va.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},Et.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)},Et.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},Et.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},Et.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},Et.prototype.changeBackgroundColour=function(n){const e=new Mf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},Et.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},Et.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},Et.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},Et.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},Et.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},Et.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=BD();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())},Et.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),yn.prototype.destroy.call(this)};const DD=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},VD=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Fx=function(n){Et.call(this);const e=this;let t;this.sceneData=new VD;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer";let f=!1;this.isIgnorePicking=function(){return f},this.setIgnorePicking=function(E){f=E},this.getSceneData=function(){return e.sceneData},this.updateTime=function(E){let T=6e3;e.scene&&(T=e.scene.getDuration());const C=E/100*T;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(C),e.sceneData.currentTime=E};const d=function(){let E=3e3;e.scene&&(E=e.scene.getDuration());const T=e.zincRenderer.getCurrentTime();for(let C=0;C{let C=this.scene.getZincCameraControls();E?(C.resetView(),this.NDCCameraControl=C.enableSyncControl(),C.setRotationMode(T)):(C.disableSyncControl(),this.NDCCameraControl=void 0,C.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=E=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(E,2)},this.setSyncControlCallback=E=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(E)},this.setSyncControlCenterZoom=(E,T)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(E,T)};const p=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const E=new br.THREE.Vector3;E.copy(e.selectedCenter);const T=e.scene.vectorToScreenXY(E);e.selectedScreenCoordinates.x=T.x,e.selectedScreenCoordinates.y=T.y}},v=function(){return function(){d()}},m=function(){return function(){p()}};this.addTimeChangedCallback=function(E){i.push(E)},this.setTexturePos=function(E){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(E)},this.addSceneChangedCallback=function(E){r.push(E)},this.addOrganPartAddedCallback=function(E){s.push(E)},this.addOrganPartRemovedCallback=function(E){o.push(E)},this.setFinishDownloadCallback=function(E){l=E},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(E){u=E},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(E,T){const C=new br.THREE.Vector3;C.setFromMatrixPosition(obj.matrixWorld);const L=width/2,I=height/2;return C.project(T),C.x=C.x*L+L,C.y=-(C.y*I)+I,C};const h=function(E){let T,C;if(E!==void 0){let L=!1;E.object.userData&&E.object.userData.isMarker?(L=!0,C=E.object.userData.parent.getMorph()):C=E.object;try{C.userData.userData.annotation.data.lastActionOnMarker=L}finally{}if(C)if(C.name)T=C.name;else{const I=e.getAnnotationsFromObjects([C]);I&&I[0]&&(T=I[0].data.group)}}return{id:T,object:C}},b=function(){return function(E,T,C){var B;const L=e.getIntersectedObject(E),I=h(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0],intersected:L,intersects:E},P={x:T,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,I.object.userData.isGlyph?I.object.name?e.setSelectedByObjects([I.object],P,x,!0):e.setSelectedByZincObjects(I.object.userData.getGlyphset(),P,x,!0):e.setSelectedByObjects([I.object],P,x,!0);return}else{if(f)return;e.setSelectedByObjects([],P,x,!0)}}},y=function(){return function(E,T,C){var B;const L=e.getIntersectedObject(E),I=h(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0]},P={x:T,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([I.object],P,x,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],P,x,!0)}},g=function(E,T,C,L){if(L=="all"||L=="geometries"){const I=E.findGeometriesWithGroupName(T);for(let x=0;x-1){const C=E[T].PartName;if(e.scene.findGeometriesWithGroupName(C).length>0||e.scene.findGlyphsetsWithGroupName(C).length>0)e.changeOrganPartsVisibility(C,!0);else{const L=getOrganDetails(E[T].SystemName,C);L!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+L.meta)}}},this.getAvailableSpecies=function(E,T,C){const L=new Array;L.push("none");const I=Object.keys(organsFileMap);for(index in I){const x=I[index];x!=E&&organsFileMap[x].hasOwnProperty(T)&&organsFileMap[x][T].hasOwnProperty(C)&&L.push(x)}return L},this.getCentreAndSize=function(){const E=new br.THREE.Vector3,T=this.scene.getBoundingBox();T.getCenter(E);const C=[E.x,E.y,E.z];T.getSize(E);const L=[E.x,E.y,E.z];return{centre:C,size:L}};const _=function(E,T,C,L){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=E,e.sceneData.currentSystem=T,e.sceneData.currentPart=C,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let I="";E&&(I=E+"/"),T&&(I=T+"/"),C&&(I=C),e.sceneData.currentName=I};this.loadOrgansFromURL=function(E,T,C,L,I,x,P){if(e.zincRenderer&&L&&e.sceneData.metaURL!==E){_(T,C,L);const B=e.sceneData.currentName;let D=e.zincRenderer.getSceneByName(B);D?x&&D.clearAll():D=e.zincRenderer.createScene(B),e.selectObjectOnPick=!0;for(let k=0;k0&&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 Ct(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 UD="ENTRIES",Px="KEYS",Ix="VALUES",Yt="",Af=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=So(this._path),t=e.node,i=e.keys;if(So(i)===Yt)return{done:!1,value:this.result()};var r=t.get(So(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=So(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 So(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return So(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Ix:return this.value();case Px:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),So=function(n){return n[n.length-1]},GD=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}Ox(n.get(v),e,t,i,r,h,o,l+v)}}}catch(C){u={error:C}}finally{try{p&&!p.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}},Sf=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=Ct($c(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Ct(Ef(o),2),u=l[0],c=l[1];try{for(var f=Ye(u.keys()),d=f.next();!d.done;d=f.next()){var p=d.value;if(p!==Yt&&p.startsWith(c)){var v=new Map;return v.set(p.slice(c.length),u.get(p)),new n(v,e)}}}catch(m){t={error:m}}finally{try{d&&!d.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,HD(this._tree,e)},n.prototype.entries=function(){return new Af(this,UD)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ye(this),s=r.next();!s.done;s=r.next()){var o=Ct(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 GD(this._tree,e,t)},n.prototype.get=function(e){var t=_f(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=_f(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Af(this,Px)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e);return i.set(Yt,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=Tf(this._tree,e);return i.set(Yt,t(i.get(Yt))),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=Tf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Af(this,Ix)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ye(e),o=s.next();!o.done;o=s.next()){var l=Ct(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}(),$c=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ye(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),$c(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]),$c(void 0,"",t)},_f=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ye(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return _f(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}}},Tf=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 Sf,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=Ye(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=Pf,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 kD(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,d,p,v,m,h,b,y,g,w,A,S,M,F,R,_,O,E;return zD(this,function(T){switch(T.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Ff.batchSize,s=e.batchWait||Ff.batchWait,o=1,T.label=1;case 1:T.trys.push([1,7,8,9]),l=Ye(this._index),u=l.next(),T.label=2;case 2:if(u.done)return[3,6];c=Ct(u.value,2),f=c[0],d=c[1];try{for(p=(R=void 0,Ye(d)),v=p.next();!v.done;v=p.next()){m=Ct(v.value,2),h=m[0],b=m[1];try{for(y=(O=void 0,Ye(b)),g=y.next();!g.done;g=y.next())w=Ct(g.value,1),A=w[0],!this._documentIds.has(A)&&(b.size<=1?d.delete(h):b.delete(A))}catch(C){O={error:C}}finally{try{g&&!g.done&&(E=y.return)&&E.call(y)}finally{if(O)throw O.error}}}}catch(C){R={error:C}}finally{try{v&&!v.done&&(_=p.return)&&_.call(p)}finally{if(R)throw R.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(C){return setTimeout(C,s)})];case 3:T.sent(),T.label=4;case 4:o+=1,T.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return S=T.sent(),M={error:S},[3,9];case 8:try{u&&!u.done&&(F=l.return)&&F.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,T.label=10;case 10:return[4,null];case 11:return T.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||If.minDirtCount,i=i||If.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=Ye(s),u=l.next();!u.done;u=l.next()){var c=Ct(u.value,2),f=c[0],d=c[1],p=d.score,v=d.terms,m=d.match,h=v.length||1,b={id:this._documentIds.get(f),score:p*h,terms:Object.keys(m),queryTerms:v,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(y){i={error:y}}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(zx),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=lt(lt({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ye(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,d=f.score,p=f.terms,v=p.join(" "),m=l.get(v);m!=null?(m.score+=d,m.count+=1):l.set(v,{score:d,terms:p,count:1})}}catch(S){i={error:S}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var h=[];try{for(var b=Ye(l),y=b.next();!y.done;y=b.next()){var g=Ct(y.value,2),m=g[0],w=g[1],d=w.score,p=w.terms,A=w.count;h.push({suggestion:m,terms:p,score:d/A})}}catch(S){s={error:S}}finally{try{y&&!y.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return h.sort(zx),h},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(Rf.hasOwnProperty(e))return Lf(Rf,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,d=e.nextId,p=e.documentIds,v=e.fieldIds,m=e.fieldLength,h=e.averageFieldLength,b=e.storedFields,y=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=d,w._documentIds=Zc(p),w._idToShortId=new Map,w._fieldIds=v,w._fieldLength=Zc(m),w._avgFieldLength=h,w._storedFields=Zc(b),w._dirtCount=y||0,w._index=new Sf;try{for(var A=Ye(w._documentIds),S=A.next();!S.done;S=A.next()){var M=Ct(S.value,2),F=M[0],R=M[1];w._idToShortId.set(R,F)}}catch(D){i={error:D}}finally{try{S&&!S.done&&(r=A.return)&&r.call(A)}finally{if(i)throw i.error}}try{for(var _=Ye(c),O=_.next();!O.done;O=_.next()){var E=Ct(O.value,2),T=E[0],C=E[1],L=new Map;try{for(var I=(l=void 0,Ye(Object.keys(C))),x=I.next();!x.done;x=I.next()){var P=x.value,B=C[P];g===1&&(B=B.ds),L.set(parseInt(P,10),Zc(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}w._index.set(T,L)}}catch(D){s={error:D}}finally{try{O&&!O.done&&(o=_.return)&&o.call(_)}finally{if(s)throw s.error}}return w},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=lt(lt(lt({},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=lt(lt({tokenize:l,processTerm:u},c),t),d=f.tokenize,p=f.processTerm,v=d(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=v.map(YD(f)),h=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(h,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=lt(lt({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(P,B){var D;return lt(lt({},P),(D={},D[B]=Lf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,d=l.maxFuzzy,p=l.bm25,v=lt(lt({},Vx.weights),f),m=v.fuzzy,h=v.prefix,b=this._index.get(e.term),y=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var A=e.fuzzy===!0?.2:e.fuzzy,S=A<1?Math.min(d,Math.round(e.term.length*A)):A;S&&(w=this._index.fuzzyGet(e.term,S))}if(g)try{for(var M=Ye(g),F=M.next();!F.done;F=M.next()){var R=Ct(F.value,2),_=R[0],O=R[1],E=_.length-e.term.length;if(E){w==null||w.delete(_);var T=h*_.length/(_.length+.3*E);this.termResults(e.term,_,T,O,u,c,p,y)}}}catch(P){i={error:P}}finally{try{F&&!F.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var C=Ye(w.keys()),L=C.next();!L.done;L=C.next()){var _=L.value,I=Ct(w.get(_),2),x=I[0],E=I[1];if(E){var T=m*_.length/(_.length+E);this.termResults(e.term,_,T,x,u,c,p,y)}}}catch(P){s={error:P}}finally{try{L&&!L.done&&(o=C.return)&&o.call(C)}finally{if(s)throw s.error}}return y},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=lt(lt({},this._options.searchOptions),e);try{for(var o=Ye(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],d=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:d,terms:[],match:{}})}}catch(p){t={error:p}}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=Cf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce($D[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ye(this._index),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],d={};try{for(var p=(i=void 0,Ye(f)),v=p.next();!v.done;v=p.next()){var m=Ct(v.value,2),h=m[0],b=m[1];d[h]=Object.fromEntries(b)}}catch(y){i={error:y}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,d])}}catch(y){e={error:y}}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,d,p,v;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Ye(Object.keys(s)),h=m.next();!h.done;h=m.next()){var b=h.value,y=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var A=w.size,S=this._avgFieldLength[g];try{for(var M=(d=void 0,Ye(w.keys())),F=M.next();!F.done;F=M.next()){var R=F.value;if(!this._documentIds.has(R)){this.removeTerm(g,R,t),A-=1;continue}var _=o?o(this._documentIds.get(R),t,this._storedFields.get(R)):1;if(_){var O=w.get(R),E=this._fieldLength.get(R)[g],T=XD(O,A,this._documentCount,E,S,l),C=i*y*_*T,L=u.get(R);if(L){L.score+=C,KD(L.terms,e);var I=Lf(L.match,t);I?I.push(b):L.match[t]=[b]}else u.set(R,{score:C,terms:[e],match:(v={},v[t]=[b],v)})}}}catch(x){d={error:x}}finally{try{F&&!F.done&&(p=M.return)&&p.call(M)}finally{if(d)throw d.error}}}}}catch(x){c={error:x}}finally{try{h&&!h.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,Ux),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,Ux),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=Ye(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=aD(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 e4=[{id:0,nerve_id:"ILX:0793723",label:"Auriculotemporal nerve","FMA subclasses (in human nerves)":["FMA:53002","FMA:53001"],"subclass labels":["Left auriculotemporal nerve","Right auriculotemporal nerve"]},{id:1,nerve_id:"ILX:0792409",label:"gray communicating ramus of tenth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6895","FMA:6894"],"subclass labels":["Left T10 grey ramus communicans","Right T10 grey ramus communicans"]},{id:2,nerve_id:"UBERON:0011326",label:"superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53530","FMA:53536"],"subclass labels":["Right superior laryngeal nerve","Left superior laryngeal nerve"]},{id:3,nerve_id:"ILX:0793220",label:"white communicating ramus of first lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:4,nerve_id:"ILX:0787082",label:"gray communicating ramus of the first thoracic nerve","FMA subclasses (in human nerves)":["FMA:6082","FMA:6084"],"subclass labels":["Right T1 grey ramus communicans","Left T1 grey ramus communicans"]},{id:5,nerve_id:"ILX:0793809",label:"Clitoral cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:6,nerve_id:"UBERON:0011096",label:"lacrimal nerve","FMA subclasses (in human nerves)":["FMA:52630","FMA:52629"],"subclass labels":["Left lacrimal nerve","Right lacrimal nerve"]},{id:7,nerve_id:"ILX:0793215",label:"white communicating ramus of ninth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:8,nerve_id:"ILX:0795005",label:"Posterior cutaneous nerve of arm","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:9,nerve_id:"UBERON:0001649",label:"glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:50894","FMA:50892"],"subclass labels":[]},{id:10,nerve_id:"UBERON:0022302",label:"short ciliary nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:11,nerve_id:"ILX:0785932",label:"gray communicating ramus of third lumbar nerve","FMA subclasses (in human nerves)":["FMA:65920","FMA:65919"],"subclass labels":["Left L3 grey ramus communicans","Right L3 grey ramus communicans"]},{id:12,nerve_id:"ILX:0738293",label:"Ganglioglomerular nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:13,nerve_id:"ILX:0739298",label:"gray communicating ramus of twelfth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:14,nerve_id:"UBERON:0001492",label:"radial nerve","FMA subclasses (in human nerves)":["FMA:37070","FMA:37071"],"subclass labels":["Right radial nerve","Left radial nerve"]},{id:15,nerve_id:"ILX:0793214",label:"white communicating ramus of eighth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:16,nerve_id:"UBERON:0018681",label:"lesser splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6957","FMA:6958"],"subclass labels":["Right lesser splanchnic nerve","Left lesser splanchnic nerve"]},{id:17,nerve_id:"ILX:0794476",label:"abdominal branch of vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:18,nerve_id:"ILX:0791105",label:"gray communicating ramus of the second thoracic nerve","FMA subclasses (in human nerves)":["FMA:6122","FMA:6757"],"subclass labels":["Right T2 grey ramus communicans","Left T2 grey ramus communicans"]},{id:19,nerve_id:"ILX:0794853",label:"esophageal vagus trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:20,nerve_id:"ILX:0793210",label:"white communicating ramus of fourth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:21,nerve_id:"UBERON:0001759",label:"vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:22,nerve_id:"UBERON:0009675",label:"chorda tympani branch of facial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:23,nerve_id:"ILX:0794949",label:"recurrent branch of the median nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:24,nerve_id:"ILX:0789339",label:"Pharyngeal branch of glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:53495","FMA:53494"],"subclass labels":["Pharyngeal branch of left glossopharyngeal nerve","Pharyngeal branch of right glossopharyngeal nerve"]},{id:25,nerve_id:"ILX:0793712",label:"Zygomatic nerve","FMA subclasses (in human nerves)":["FMA:52968","FMA:52969"],"subclass labels":["Right zygomatic nerve","Left zygomatic nerve"]},{id:26,nerve_id:"ILX:0788536",label:"gray communicating ramus of fourth lumbar nerve","FMA subclasses (in human nerves)":["FMA:65917","FMA:65918"],"subclass labels":["Right L4 grey ramus communicans","Left L4 grey ramus communicans"]},{id:27,nerve_id:"UBERON:0018680",label:"greater splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6956","FMA:6955"],"subclass labels":["Right greater splanchnic nerve","Left greater splanchnic nerve"]},{id:28,nerve_id:"UBERON:0001322",label:"sciatic nerve","FMA subclasses (in human nerves)":["FMA:22111","FMA:22112"],"subclass labels":["Right sciatic nerve","Left sciatic nerve"]},{id:29,nerve_id:"ILX:0793209",label:"white communicating ramus of third thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:30,nerve_id:"UBERON:0011391",label:"perineal nerve","FMA subclasses (in human nerves)":["FMA:21874","FMA:21873"],"subclass labels":["Left perineal nerve","Right perineal nerve"]},{id:31,nerve_id:"ILX:0788945",label:"gray communicating ramus of the fourth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6759","FMA:6758"],"subclass labels":["Right T4 grey ramus communicans","Left T4 grey ramus communicans"]},{id:32,nerve_id:"ILX:0790497",label:"Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:33,nerve_id:"UBERON:0001323",label:"tibial nerve","FMA subclasses (in human nerves)":["FMA:22109","FMA:22110"],"subclass labels":["Right tibial nerve","Left tibial nerve"]},{id:34,nerve_id:"ILX:0794969",label:"deep branch of ulnar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:35,nerve_id:"ILX:0793227",label:"gray communicating ramus of thirteenth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:36,nerve_id:"ILX:0793228",label:"gray communicating ramus of first sacral nerve","FMA subclasses (in human nerves)":["FMA:65992","FMA:65991"],"subclass labels":["Left S1 grey ramus communicans","Right S1 grey ramus communicans"]},{id:37,nerve_id:"UBERON:0035111",label:"medial plantar nerve","FMA subclasses (in human nerves)":["FMA:45435","FMA:45434"],"subclass labels":["Left medial plantar nerve","Right medial plantar nerve"]},{id:38,nerve_id:"UBERON:0001780",label:"spinal nerve","FMA subclasses (in human nerves)":["FMA:6117","FMA:6435","FMA:6295","FMA:6422","FMA:6417","FMA:6421","FMA:6038","FMA:6292","FMA:6439","FMA:6313","FMA:6410","FMA:6412","FMA:6088","FMA:6298","FMA:6433","FMA:6411","FMA:6438","FMA:6314","FMA:6291","FMA:6420","FMA:6116","FMA:6413","FMA:6310","FMA:6432","FMA:6305","FMA:6182","FMA:6297","FMA:6436","FMA:6418","FMA:6039","FMA:6089","FMA:6301","FMA:6294","FMA:6303","FMA:6183","FMA:6434","FMA:6429","FMA:6308","FMA:6300","FMA:6430","FMA:6428","FMA:6419","FMA:6437","FMA:6307","FMA:6311","FMA:6431"],"subclass labels":["Left T3 spinal nerve","Left S4 spinal nerve","Left T5 spinal nerve","Left L5 spinal nerve","Right L3 spinal nerve","Right L5 spinal nerve","Right T1 spinal nerve","Left T4 spinal nerve","Left coccygeal spinal nerve","Right T11 spinal nerve","Right L1 spinal nerve","Right L2 spinal nerve","Right T2 spinal nerve","Left T6 spinal nerve","Left S3 spinal nerve","Left L1 spinal nerve","Right coccygeal spinal nerve","Left T11 spinal nerve","Right T4 spinal nerve","Left L4 spinal nerve","Right T3 spinal nerve","Left L2 spinal nerve","Right T10 spinal nerve","Right S3 spinal nerve","Left T8 spinal nerve","Right T12 spinal nerve","Right T6 spinal nerve","Right S5 spinal nerve","Left L3 spinal nerve","Left T1 spinal nerve","Left T2 spinal nerve","Left T7 spinal nerve","Right T5 spinal nerve","Right T8 spinal nerve","Left T12 spinal nerve","Right S4 spinal nerve","Left S1 spinal nerve","Left T9 spinal nerve","Right T7 spinal nerve","Right S2 spinal nerve","Right S1 spinal nerve","Right L4 spinal nerve","Left S5 spinal nerve","Right T9 spinal nerve","Left T10 spinal nerve","Left S2 spinal nerve"]},{id:39,nerve_id:"UBERON:0018683",label:"lumbar splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6925","FMA:6930","FMA:6927","FMA:6926"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Left first lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left second lumbar splanchnic nerve","Right second lumbar splanchnic nerve"]},{id:40,nerve_id:"UBERON:0001643",label:"oculomotor nerve","FMA subclasses (in human nerves)":["FMA:50880","FMA:50879"],"subclass labels":["Left oculomotor nerve","Right oculomotor nerve"]},{id:41,nerve_id:"ILX:0793212",label:"white communicating ramus of sixth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:42,nerve_id:"UBERON:0003724",label:"musculocutaneous nerve","FMA subclasses (in human nerves)":["FMA:37066","FMA:37065"],"subclass labels":["Left musculocutaneous nerve","Right musculocutaneous nerve"]},{id:43,nerve_id:"ILX:0738372",label:"white communicating ramus of first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:44,nerve_id:"ILX:0793563",label:"splenic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:45,nerve_id:"UBERON:0035526",label:"superficial fibular nerve","FMA subclasses (in human nerves)":["FMA:45363","FMA:45364"],"subclass labels":["Right superficial fibular nerve","Left superficial fibular nerve"]},{id:46,nerve_id:"ILX:0791560",label:"gray communicating ramus of eighth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6891","FMA:6890"],"subclass labels":["Left T8 grey ramus communicans","Right T8 grey ramus communicans"]},{id:47,nerve_id:"ILX:0793827",label:"posterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:48,nerve_id:"ILX:0794141",label:"right cervical vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:49,nerve_id:"ILX:0793714",label:"Mesenteric nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:50,nerve_id:"UBERON:0001964",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:51,nerve_id:"UBERON:0001267",label:"femoral nerve","FMA subclasses (in human nerves)":["FMA:16499","FMA:16500"],"subclass labels":["Right femoral nerve","Left femoral nerve"]},{id:52,nerve_id:"UBERON:0034984",label:"nerve to quadratus femoris","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:53,nerve_id:"UBERON:0003721",label:"lingual nerve","FMA subclasses (in human nerves)":["FMA:53219","FMA:53220"],"subclass labels":["Right lingual nerve","Left lingual nerve"]},{id:54,nerve_id:"UBERON:0036216",label:"tympanic nerve","FMA subclasses (in human nerves)":["FMA:53481","FMA:53482"],"subclass labels":["Right tympanic nerve","Left tympanic nerve"]},{id:55,nerve_id:"ILX:0793216",label:"white communicating ramus of tenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:56,nerve_id:"ILX:0793362",label:"White communicating ramus of fourth lumbar anterior ramus","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:57,nerve_id:"ILX:0793561",label:"Internal branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53539","FMA:53540"],"subclass labels":["Right internal laryngeal nerve","Left internal laryngeal nerve"]},{id:58,nerve_id:"ILX:0738312",label:"Aortic arch depressor nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:59,nerve_id:"ILX:0793218",label:"white communicating ramus of twelfth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:60,nerve_id:"ILX:0738308",label:"External branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:61,nerve_id:"ILX:0739299",label:"gray communicating ramus of sixth lumbar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:62,nerve_id:"ILX:0793559",label:"bladder nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:63,nerve_id:"ILX:0793822",label:"Superior ovarian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:64,nerve_id:"ILX:0793807",label:"Penile cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:65,nerve_id:"UBERON:0011390",label:"pudendal nerve","FMA subclasses (in human nerves)":["FMA:21863","FMA:21864"],"subclass labels":["Right pudendal nerve","Left pudendal nerve"]},{id:66,nerve_id:"UBERON:0008810",label:"nasopalatine nerve","FMA subclasses (in human nerves)":["FMA:52799","FMA:52798"],"subclass labels":["Left nasopalatine nerve","Right nasopalatine nerve"]},{id:67,nerve_id:"ILX:0793219",label:"white communicating ramus of thirteenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:68,nerve_id:"ILX:0793632",label:"lumbar colonic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:69,nerve_id:"ILX:0784439",label:"gray communicating ramus of the fifth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6760","FMA:6761"],"subclass labels":["Left T5 grey ramus communicans","Right T5 grey ramus communicans"]},{id:70,nerve_id:"ILX:0794977",label:"deep branch of radial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:71,nerve_id:"UBERON:0001884",label:"phrenic nerve","FMA subclasses (in human nerves)":["FMA:6193","FMA:6192"],"subclass labels":["Left phrenic nerve","Right phrenic nerve"]},{id:72,nerve_id:"UBERON:0035110",label:"lateral plantar nerve","FMA subclasses (in human nerves)":["FMA:45450","FMA:45451"],"subclass labels":["Right lateral plantar nerve","Left lateral plantar nerve"]},{id:73,nerve_id:"ILX:0793711",label:"Communicating branch of zygomatic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:74,nerve_id:"ILX:0793560",label:"External branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53537","FMA:53538"],"subclass labels":["Right external laryngeal nerve","Left external laryngeal nerve"]},{id:75,nerve_id:"ILX:0738309",label:"Internal branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:76,nerve_id:"UBERON:0001021",label:"nerve","FMA subclasses (in human nerves)":["FMA:6775","FMA:6894","FMA:6784","FMA:6728","FMA:65325","FMA:21873","FMA:45429","FMA:6844","FMA:53609","FMA:7116","FMA:44770","FMA:8916","FMA:52995","FMA:6071","FMA:45309","FMA:6122","FMA:6892","FMA:6767","FMA:16405","FMA:53560","FMA:6092","FMA:65343","FMA:37066","FMA:8894","FMA:8868","FMA:65341","FMA:53559","FMA:8897","FMA:82956","FMA:20633","FMA:6763","FMA:65339","FMA:8829","FMA:16493","FMA:8817","FMA:8821","FMA:11757","FMA:45456","FMA:45422","FMA:11261","FMA:65388","FMA:6192","FMA:65347","FMA:37068","FMA:65995","FMA:6764","FMA:39081","FMA:45338","FMA:53402","FMA:11210","FMA:52644","FMA:37067","FMA:65313","FMA:11153","FMA:6155","FMA:8797","FMA:53302","FMA:8883","FMA:53067","FMA:52939","FMA:53301","FMA:292889","FMA:45423","FMA:8791","FMA:45380","FMA:11759","FMA:7305","FMA:8830","FMA:78650","FMA:65389","FMA:45387","FMA:8827","FMA:8912","FMA:52941","FMA:6743","FMA:7126","FMA:53485","FMA:16492","FMA:53399","FMA:65337","FMA:11209","FMA:6772","FMA:52726","FMA:6121","FMA:52627","FMA:52974","FMA:53571","FMA:6729","FMA:8729","FMA:53606","FMA:80025","FMA:53481","FMA:53575","FMA:45451","FMA:11218","FMA:22109","FMA:6852","FMA:8909","FMA:11751","FMA:65991","FMA:8836","FMA:65350","FMA:53423","FMA:65569","FMA:65314","FMA:82957","FMA:65438","FMA:39146","FMA:8911","FMA:22111","FMA:65916","FMA:65739","FMA:65917","FMA:6779","FMA:8889","FMA:65924","FMA:65316","FMA:53002","FMA:16887","FMA:53366","FMA:6890","FMA:8790","FMA:6730","FMA:45358","FMA:52716","FMA:53494","FMA:7115","FMA:53561","FMA:78655","FMA:45366","FMA:11219","FMA:11555","FMA:7092","FMA:53220","FMA:45428","FMA:6193","FMA:20604","FMA:45433","FMA:21874","FMA:21875","FMA:53244","FMA:45432","FMA:6770","FMA:52640","FMA:11249","FMA:20630","FMA:53308","FMA:11216","FMA:65399","FMA:78649","FMA:11084","FMA:6897","FMA:53633","FMA:6085","FMA:6851","FMA:45457","FMA:6757","FMA:8732","FMA:8824","FMA:20632","FMA:6137","FMA:52730","FMA:7301","FMA:52699","FMA:53607","FMA:7300","FMA:53576","FMA:44904","FMA:65342","FMA:7127","FMA:6737","FMA:52669","FMA:21876","FMA:45425","FMA:65999","FMA:8728","FMA:21871","FMA:55172","FMA:6149","FMA:45453","FMA:44932","FMA:292832","FMA:6744","FMA:6781","FMA:44769","FMA:45326","FMA:6760","FMA:53634","FMA:53605","FMA:53530","FMA:6821","FMA:52968","FMA:53001","FMA:11552","FMA:45264","FMA:8835","FMA:6888","FMA:55160","FMA:44899","FMA:52979","FMA:45333","FMA:45310","FMA:6084","FMA:11781","FMA:82962","FMA:53280","FMA:52715","FMA:53311","FMA:16491","FMA:21880","FMA:44952","FMA:11687","FMA:11212","FMA:65335","FMA:52940","FMA:6774","FMA:8823","FMA:45388","FMA:6666","FMA:6072","FMA:16886","FMA:53312","FMA:65915","FMA:45357","FMA:11262","FMA:65921","FMA:0328826","FMA:81290","FMA:53279","FMA:11551","FMA:7293","FMA:6677","FMA:11756","FMA:53598","FMA:52732","FMA:44902","FMA:53545","FMA:6740","FMA:53502","FMA:53562","FMA:52700","FMA:7122","FMA:6118","FMA:65918","FMA:8814","FMA:16403","FMA:65346","FMA:6667","FMA:52630","FMA:52629","FMA:8871","FMA:16500","FMA:52725","FMA:6108","FMA:45363","FMA:65340","FMA:8872","FMA:11760","FMA:53604","FMA:11214","FMA:52777","FMA:21864","FMA:53503","FMA:6738","FMA:66000","FMA:6776","FMA:6777","FMA:6765","FMA:6111","FMA:8890","FMA:20607","FMA:52643","FMA:8908","FMA:65437","FMA:6762","FMA:11154","FMA:65344","FMA:52937","FMA:8919","FMA:45354","FMA:6766","FMA:53424","FMA:6145","FMA:65568","FMA:20634","FMA:6732","FMA:8893","FMA:11758","FMA:6889","FMA:11554","FMA:65922","FMA:7118","FMA:16884","FMA:45308","FMA:7290","FMA:6758","FMA:65743","FMA:11063","FMA:16885","FMA:8882","FMA:65286","FMA:291238","FMA:53482","FMA:52976","FMA:11308","FMA:53432","FMA:53540","FMA:45379","FMA:44871","FMA:6714","FMA:82955","FMA:65993","FMA:45452","FMA:52626","FMA:6083","FMA:53582","FMA:65919","FMA:52936","FMA:53506","FMA:8918","FMA:44901","FMA:6073","FMA:65315","FMA:53219","FMA:11194","FMA:6792","FMA:7119","FMA:52785","FMA:7296","FMA:53068","FMA:6845","FMA:52677","FMA:53504","FMA:53548","FMA:52698","FMA:53570","FMA:6771","FMA:7078","FMA:65997","FMA:65338","FMA:52969","FMA:16401","FMA:65416","FMA:6835","FMA:39082","FMA:8726","FMA:45254","FMA:8879","FMA:11250","FMA:53049","FMA:45382","FMA:8795","FMA:53495","FMA:45434","FMA:82963","FMA:0328827","FMA:52656","FMA:82961","FMA:11753","FMA:39147","FMA:45339","FMA:20605","FMA:20631","FMA:8898","FMA:6070","FMA:44892","FMA:16404","FMA:52942","FMA:6082","FMA:8861","FMA:82953","FMA:8808","FMA:8805","FMA:52994","FMA:65348","FMA:55173","FMA:7129","FMA:52674","FMA:44894","FMA:55159","FMA:65327","FMA:37320","FMA:6761","FMA:65349","FMA:11253","FMA:53507","FMA:11213","FMA:7307","FMA:6769","FMA:6759","FMA:55155","FMA:53675","FMA:53599","FMA:65282","FMA:53251","FMA:6731","FMA:11111","FMA:16497","FMA:8878","FMA:11211","FMA:65740","FMA:45367","FMA:53588","FMA:45365","UBERON:0011766","FMA:16502","FMA:6891","FMA:6091","FMA:11018","FMA:6090","FMA:292887","FMA:65401","FMA:65326","FMA:11215","FMA:44735","FMA:8735","FMA:53538","FMA:6849","FMA:53608","FMA:11217","FMA:8860","FMA:6134","FMA:6893","FMA:53534","FMA:45361","FMA:37321","FMA:82734","FMA:22112","FMA:7294","FMA:52987","FMA:65247","FMA:53535","FMA:6895","FMA:52787","FMA:53635","FMA:65920","FMA:55156","FMA:16498","FMA:53569","FMA:6739","FMA:8807","FMA:22110","FMA:81294","FMA:45450","FMA:8922","FMA:8725","FMA:20608","FMA:7308","FMA:65281","FMA:39084","FMA:78656","FMA:6133","FMA:53581","FMA:16494","FMA:53252","FMA:11789","FMA:45364","FMA:65345","FMA:44870","FMA:39083","FMA:45355","FMA:11193","FMA:16400","FMA:81287","FMA:52776","FMA:65747","FMA:8900","UBERON:0011767","FMA:45424","FMA:292830","FMA:44734","FMA:45381","FMA:82960","FMA:0328831","FMA:6689","FMA:7077","FMA:291236","FMA:8886","FMA:276381","FMA:6124","FMA:65336","FMA:65328","FMA:52670","FMA:53537","FMA:53636","FMA:6896","FMA:21879","FMA:8798","FMA:81288","FMA:53542","FMA:45368","FMA:53547","FMA:55157","FMA:65415","FMA:53309","FMA:65744","FMA:53367","FMA:53590","FMA:65923","FMA:53048","FMA:16499","FMA:53610","FMA:44951","FMA:44953","FMA:8832","FMA:45426","FMA:6114","FMA:52799","FMA:11039","FMA:53546","FMA:53589","FMA:8901","FMA:11681","FMA:52639","FMA:8905","FMA:52733","FMA:65992","FMA:52807","FMA:45435","FMA:53484","FMA:52975","FMA:7289","FMA:44905","FMA:37071","FMA:7130","FMA:65996","FMA:6132","FMA:8826","FMA:6741","FMA:11252","FMA:8917","FMA:82954","FMA:6832","FMA:37073","FMA:37074","FMA:44893","FMA:82959","FMA:20635","FMA:6093","FMA:65248","FMA:45362","FMA:52622","FMA:53508","FMA:11755","FMA:82958","FMA:52997","FMA:16501","FMA:65402","FMA:45427","FMA:52803","FMA:16402","FMA:8734","FMA:52784","FMA:45454","FMA:6736","FMA:7304","FMA:6742","FMA:52998","FMA:52804","FMA:11788","FMA:6713","FMA:52623","FMA:53536","FMA:11780","FMA:45334","FMA:52701","FMA:65998","FMA:11092","FMA:6684","FMA:52779","FMA:52778","FMA:78652","FMA:0328830","FMA:6733","FMA:44950","FMA:78653","FMA:45455","FMA:8864","FMA:8833","FMA:8876","FMA:8867","FMA:11752","FMA:53541","FMA:53611","FMA:8904","FMA:6745","FMA:21863","FMA:7297","FMA:52676","FMA:52798","FMA:8818","FMA:82735","FMA:52657","FMA:52786","FMA:6773","FMA:45253","FMA:6127","FMA:45263","FMA:8875","FMA:81295","FMA:11754","FMA:8812","FMA:45311","FMA:53568","FMA:276379","FMA:6842","FMA:8794","FMA:8820","FMA:53572","FMA:53409","FMA:37070","FMA:6119","FMA:53433","FMA:7123","FMA:8811","FMA:65444","FMA:52806","FMA:53245","FMA:65285","FMA:6768","FMA:8731","FMA:11220","FMA:6778","FMA:53509","FMA:55158","FMA:53567","FMA:65994","FMA:53539","FMA:45327","FMA:8865","FMA:44898","FMA:52673","FMA:80026","FMA:52980","FMA:53505","FMA:82952","FMA:21872","FMA:37065","FMA:52988","FMA:8815","FMA:53398","FMA:52729","FMA:81289","FMA:65398","FMA:52977","FMA:8887"],"subclass labels":["Left T9 white ramus communicans","Right T10 grey ramus communicans","Right T4 spinal nerve posterior ramus","Right fourth intercostal nerve","Right anterior interosseous nerve","Right perineal nerve","Left lateral calcaneal branch A of left sural nerve","Right C3 spinal nerve posterior ramus medial branch","Oesophageal branch of left recurrent laryngeal nerve","Anterior branch of lateral cutaneous branch of left third intercostal nerve","Left common plantar digital nerve F","Anterior cutaneous branch of right subcostal nerve","Left superior labial branch of infraorbital nerve","Left T1 spinal nerve posterior ramus","Anterior branch of left obturator nerve","Right T2 grey ramus communicans","Right T9 grey ramus communicans","Left T5 white ramus communicans","Left L3 spinal nerve posterior ramus lateral branch","Communicating branch of left vagus nerve with left glossopharyngeal nerve","Right second intercostal nerve","Right proper palmar digital nerve G","Left musculocutaneous nerve","Anterior cutaneous branch of left ninth intercostal nerve","Posterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve H","Communicating branch of right vagus nerve with right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right proper plantar digital nerve C","Left genital branch of genitofemoral nerve","Left T6 grey ramus communicans","Right proper palmar digital nerve I","Right T12 spinal nerve posterior ramus","Right ilioinguinal nerve","Right T8 spinal nerve posterior ramus","Left T9 spinal nerve posterior ramus","Right T11 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve J","Right medial sural cutaneous nerve","Right T6 spinal nerve posterior ramus medial branch","Right lesser occipital nerve","Right phrenic nerve","Right proper palmar digital nerve E","Left median nerve","Right S3 grey ramus communicans","Right T4 white ramus communicans","Right medial cutaneous nerve of forearm","Right posterior femoral cutaneous nerve","Right vestibular nerve","Lateral cutaneous branch of left sixth intercostal nerve","Left supratrochlear nerve","Right median nerve","Anterior branch of right medial cutaneous nerve of forearm","Right T5 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of right third intercostal nerve","Right C6 spinal nerve posterior ramus","Temporal branch of left facial nerve","Anterior cutaneous branch of left eighth intercostal nerve","Right buccal nerve","Right middle superior alveolar nerve","Temporal branch of right facial nerve","Left superficial branch of radial nerve","Left medial sural cutaneous nerve","Left C4 spinal nerve posterior ramus","Left lateral dorsal digital nerve of the third toe","Right T12 spinal nerve posterior ramus lateral branch","Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Left T12 spinal nerve posterior ramus","Left anterior supraclavicular nerve","Left lesser occipital nerve","Right deep fibular nerve","Left T11 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right anterior superior alveolar nerve","Left tenth intercostal nerve","Anterior branch of lateral cutaneous branch of right fourth intercostal nerve","Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve","Left iliohypogastric nerve","Cervical branch of left facial nerve","Right proper palmar digital nerve J","Lateral cutaneous branch of right sixth intercostal nerve","Right T8 white ramus communicans","Left maxillary nerve","Left intercostobrachial nerve","Left tentorial nerve","Right zygomaticotemporal nerve","Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve","Left fourth intercostal nerve","Brachial plexus left C7 root","Vagal branch to right carotid body","Right proper plantar digital nerve G","Right tympanic nerve","Left lateral plantar nerve","Lateral cutaneous branch of left tenth intercostal nerve","Right tibial nerve","Left third occipital nerve","Anterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right T8 spinal nerve posterior ramus lateral branch","Right S1 grey ramus communicans","Left L3 spinal nerve posterior ramus","Palmar cutaneous branch of left ulnar nerve","Right greater petrosal nerve","Left subcostal nerve","Anterior branch of left medial cutaneous nerve of forearm","Left proper plantar digital nerve C","Left C3 spinal nerve branch to left supraclavicular nerve","Right posterior cutaneous nerve of forearm","Posterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right sciatic nerve","Left L5 grey ramus communicans","Right C4 spinal nerve posterior ramus medial branch","Right L4 grey ramus communicans","Left T11 white ramus communicans","Posterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left L1 grey ramus communicans","Posterior branch of left medial cutaneous nerve of forearm","Left auriculotemporal nerve","Left L2 white ramus communicans","Marginal mandibular branch of right facial nerve","Right T8 grey ramus communicans","Right C4 spinal nerve posterior ramus","Right fifth intercostal nerve","Left common fibular nerve","Left posterior ethmoidal nerve","Pharyngeal branch of right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right third intercostal nerve","Communicating branch of right external laryngeal nerve with right superior cardiac nerve","Right posterior supraclavicular nerve","Left medial dorsal cutaneous nerve","Lateral cutaneous branch of right eleventh intercostal nerve","Posterior branch of lateral cutaneous branch of left subcostal nerve","Anterior cutaneous branch of left second intercostal nerve","Left lingual nerve","Right lateral calcaneal branch A of right sural nerve","Left phrenic nerve","Right hypogastric nerve","Medial calcaneal branch A of left tibial nerve","Left perineal nerve","Right posterior scrotal nerve","Right inferior alveolar nerve","Medial calcaneal branch A of right tibial nerve","Right T7 white ramus communicans","Left frontal nerve","Right T1 spinal nerve posterior ramus medial branch","Right genitofemoral nerve","Zygomatic branch of right facial nerve","Lateral cutaneous branch of left ninth intercostal nerve","Left C2 spinal nerve branch to left great auricular nerve","Right anterior supraclavicular nerve","Lateral cutaneous branch of right fourth intercostal nerve","Left T11 grey ramus communicans","Lingual branch of right vagus nerve","Left T1 white ramus communicans","Left C3 spinal nerve posterior ramus medial branch","Left proper plantar digital nerve J","Left T2 grey ramus communicans","Brachial plexus left C6 root","Left T10 spinal nerve posterior ramus","Right genital branch of genitofemoral nerve","Anterior cutaneous branch of right first intercostal nerve","Left middle meningeal nerve","Anterior cutaneous branch of left eleventh intercostal nerve","Left infratrochlear nerve","Vagal branch to left carotid body","Anterior cutaneous branch of right eleventh intercostal nerve","Right proper palmar digital nerve B","Left proper palmar digital nerve H","Anterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left seventh intercostal nerve","Right nasociliary nerve","Left posterior scrotal nerve","Left sural nerve","Right S5 grey ramus communicans","Brachial plexus right C7 root","Right inferior rectal nerve","Right transverse cervical nerve","Anterior cutaneous branch of left third intercostal nerve","Left proper plantar digital nerve H","Superficial branch of left ulnar nerve","Dorsal branch of left ulnar nerve","Right eleventh intercostal nerve","Right T2 white ramus communicans","Right common plantar digital nerve F","Infrapatellar branch of right saphenous nerve","Left T5 grey ramus communicans","Lingual branch of left vagus nerve","Thoracic cardiac branch of left vagus nerve","Right superior laryngeal nerve","Right C2 spinal nerve posterior ramus","Right zygomatic nerve","Right auriculotemporal nerve","Anterior branch of lateral cutaneous branch of left subcostal nerve","Left saphenous nerve","Right L3 spinal nerve posterior ramus","Right T7 grey ramus communicans","Left great auricular nerve posterior branch","Left proper palmar digital nerve A","Right infraorbital nerve","Cutaneous branch of right obturator nerve","Posterior branch of right obturator nerve","Left T1 grey ramus communicans","Right T12 white ramus communicans","Right proper plantar digital nerve F","Left posterior auricular nerve","Right posterior ethmoidal nerve","Buccal branch of right facial nerve","Right iliohypogastric nerve","Left dorsal nerve of penis","Right inferior lateral cutaneous nerve of arm","Left T7 spinal nerve posterior ramus lateral branch","Lateral cutaneous branch of left seventh intercostal nerve","Right posterior interosseous nerve","Left middle superior alveolar nerve","Right T9 white ramus communicans","Right T10 spinal nerve posterior ramus","Left deep fibular nerve","Hepatic branch of anterior vagal trunk","Left first intercostal nerve","Right L2 white ramus communicans","Buccal branch of left facial nerve","Right L5 grey ramus communicans","Right common fibular nerve","Left T6 spinal nerve posterior ramus medial branch","Right L2 grey ramus communicans","Right deep petrosal nerve","Left axillary nerve posterior branch","Right posterior auricular nerve","Anterior branch of lateral cutaneous branch of right subcostal nerve","Anterior branch of lateral cutaneous branch of right fifth intercostal nerve","Pyloric branch of greater posterior gastric nerve","Left T10 spinal nerve posterior ramus lateral branch","Superior cervical cardiac branch of right vagus nerve","Ganglionic branch of right maxillary nerve to pterygopalatine ganglion","Left proper palmar digital nerve C","Right superior cervical cardiac nerve","Right ninth intercostal nerve","Right lesser petrosal nerve","Communicating branch of left external laryngeal nerve with left superior cardiac nerve","Right long ciliary nerve B","Anterior cutaneous branch of right fourth intercostal nerve","Right third intercostal nerve","Left L4 grey ramus communicans","Right T7 spinal nerve posterior ramus","Left L2 spinal nerve posterior ramus lateral branch","Left proper palmar digital nerve F","Coeliac branch of posterior vagal trunk","Left lacrimal nerve","Right lacrimal nerve","Anterior cutaneous branch of right seventh intercostal nerve","Left femoral nerve","Right maxillary nerve","Lateral cutaneous branch of right third intercostal nerve","Right superficial fibular nerve","Left proper palmar digital nerve I","Anterior cutaneous branch of left seventh intercostal nerve","Left T12 spinal nerve posterior ramus lateral branch","Thoracic cardiac branch of right vagus nerve","Lateral cutaneous branch of left eighth intercostal nerve","Orbital branch of left maxillary nerve to left ethmoidal sinus","Left pudendal nerve","Left lesser petrosal nerve","Right eighth intercostal nerve","Left S5 grey ramus communicans","Right T10 white ramus communicans","Left T10 white ramus communicans","Left T4 white ramus communicans","Lateral cutaneous branch of left third intercostal nerve","Posterior branch of lateral cutaneous branch of left eighth intercostal nerve","Lateral cutaneous branch of right iliohypogastric nerve","Right supratrochlear nerve","Anterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right C3 spinal nerve branch to right supraclavicular nerve","Right T6 grey ramus communicans","Left T5 spinal nerve posterior ramus medial branch","Left proper palmar digital nerve G","Left posterior superior alveolar nerve","Lateral cutaneous branch of left subcostal nerve","Gluteal branch A of right posterior femoral cutaneous nerve","Right T5 white ramus communicans","Left greater petrosal nerve","Left T3 spinal nerve posterior ramus","Right subcostal nerve","Right femoral branch of genitofemoral nerve","Right sixth intercostal nerve","Anterior cutaneous branch of right ninth intercostal nerve","Left T11 spinal nerve posterior ramus lateral branch","Left T7 grey ramus communicans","Posterior branch of lateral cutaneous branch of right subcostal nerve","Left L2 grey ramus communicans","Posterior branch of lateral cutaneous branch of right third intercostal nerve","Right L1 white ramus communicans","Anterior branch of right obturator nerve","Anterior cutaneous branch of left fifth intercostal nerve","Left T4 grey ramus communicans","Right C5 spinal nerve posterior ramus medial branch","Right T4 spinal nerve posterior ramus medial branch","Left L1 white ramus communicans","Anterior cutaneous branch of right eighth intercostal nerve","Left subclavian nerve","Pericardial branch of left phrenic nerve","Left tympanic nerve","Right zygomaticofacial nerve","Right intercostobrachial nerve","Right cochlear nerve","Left internal laryngeal nerve","Right lateral dorsal digital nerve of the third toe","Left proper palmar digital nerve D","Inferior cervical cardiac branch of left vagus nerve","Left proper plantar digital nerve B","Right S2 grey ramus communicans","Right proper plantar digital nerve H","Right tentorial nerve","Right T1 white ramus communicans","Inferior ramus of left internal laryngeal nerve","Right L3 grey ramus communicans","Right posterior superior alveolar nerve","Tonsillar branch of right glossopharyngeal nerve","Lateral cutaneous branch of right subcostal nerve","Right proper palmar digital nerve C","Right first intercostal nerve","Posterior branch of right medial cutaneous nerve of forearm","Right lingual nerve","Lateral cutaneous branch of right fifth intercostal nerve","Left T4 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left third intercostal nerve","Right posterior superior lateral nasal branch of maxillary nerve","Posterior branch of lateral cutaneous branch of right fifth intercostal nerve","Left buccal nerve","Right third occipital nerve","Left anterior ethmoidal nerve","Right lingual branch of glossopharyngeal nerve","Left laryngopharyngeal branch of superior cervical ganglion","Right infratrochlear nerve","Left external laryngeal nerve branch to pharyngeal plexus","Left T7 white ramus communicans","Left L1 spinal nerve posterior ramus","Right S4 grey ramus communicans","Left proper palmar digital nerve J","Left zygomatic nerve","Left L1 spinal nerve posterior ramus lateral branch","Left greater occipital nerve","Left medial cutaneous nerve of forearm","Brachial plexus left C8 root","Left anterior femoral cutaneous branch A","Posterior branch of lateral cutaneous branch of left seventh intercostal nerve","Left T1 spinal nerve posterior ramus medial branch","Left meningeal branch of mandibular nerve","Left medial dorsal digital nerve of the fourth toe","Left C5 spinal nerve posterior ramus","Pharyngeal branch of left glossopharyngeal nerve","Right medial plantar nerve","Left proper plantar digital nerve F","Left deep petrosal nerve","Right supraorbital nerve","Left proper plantar digital nerve E","Right T9 spinal nerve posterior ramus lateral branch","Left posterior cutaneous nerve of forearm","Left posterior femoral cutaneous nerve","Left hypogastric nerve","Left genitofemoral nerve","Anterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T1 spinal nerve posterior ramus","Right common palmar digital nerve A","Right L3 spinal nerve posterior ramus lateral branch","Left anterior superior alveolar nerve","Right T1 grey ramus communicans","Anterior cutaneous branch of left sixth intercostal nerve","Left proper plantar digital nerve A","Left T5 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus","Right superior labial branch of infraorbital nerve","Left proper palmar digital nerve E","Left transverse cervical nerve","Posterior branch of lateral cutaneous branch of right fourth intercostal nerve","Left communicating branch of nasociliary nerve with ciliary ganglion","Superficial branch of right ulnar nerve","Right great auricular nerve posterior branch","Palmar branch of right median nerve","Right ulnar nerve","Right T5 grey ramus communicans","Palmar cutaneous branch of right ulnar nerve","Left T2 spinal nerve posterior ramus medial branch","Tonsillar branch of left glossopharyngeal nerve","Lateral cutaneous branch of right eighth intercostal nerve","Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Left T6 white ramus communicans","Right T4 grey ramus communicans","Branch of right vagus nerve to oesophageal nerve plexus","Superior cervical cardiac branch of left vagus nerve","Left long thoracic nerve","Right mental nerve","Left fifth intercostal nerve","Lateral cutaneous branch of left fourth intercostal nerve","Right lateral femoral cutaneous nerve","Posterior branch of lateral cutaneous branch of right seventh intercostal nerve","Lateral cutaneous branch of right seventh intercostal nerve","Left C4 spinal nerve posterior ramus medial branch","Right intermediate dorsal cutaneous nerve","Right medial dorsal cutaneous nerve","Left recurrent laryngeal nerve","Left obturator nerve","Left T8 grey ramus communicans","Right T2 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus medial branch","Left T2 spinal nerve posterior ramus","Right superficial branch of radial nerve","Right C3 spinal nerve branch to right great auricular nerve","Left anterior interosseous nerve","Lateral cutaneous branch of right ninth intercostal nerve","Left common plantar digital nerve E","Brachial plexus left C5 root","Left external laryngeal nerve","Left C3 spinal nerve posterior ramus","Oesophageal branch of right recurrent laryngeal nerve","Lateral cutaneous branch of right tenth intercostal nerve","Anterior cutaneous branch of right sixth intercostal nerve","Right T3 white ramus communicans","Left T9 grey ramus communicans","Auricular branch of right vagus nerve","Right lateral sural cutaneous nerve","Left ulnar nerve","Right long ciliary nerve A","Left sciatic nerve","Anterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right inferior palpebral branch of infraorbital nerve","Right medial cutaneous nerve of arm","Auricular branch of left vagus nerve","Left T10 grey ramus communicans","Left medial posterior superior nasal nerve","Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus","Left L3 grey ramus communicans","Left lateral femoral cutaneous nerve","Right external laryngeal nerve branch to pharyngeal plexus","Left eighth intercostal nerve","Right T5 spinal nerve posterior ramus","Left tibial nerve","Right superior lateral cutaneous nerve of arm","Right lateral plantar nerve","Anterior cutaneous branch of left first intercostal nerve","Brachial plexus right C8 root","Lateral cutaneous branch of left iliohypogastric nerve","Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Right long thoracic nerve","Left lateral cutaneous nerve of forearm","Left posterior supraclavicular nerve","Left T3 grey ramus communicans","Left ilioinguinal nerve","Left mental nerve","Left T12 white ramus communicans","Left superficial fibular nerve","Right proper palmar digital nerve F","Right proper palmar digital nerve D","Right lateral cutaneous nerve of forearm","Gluteal branch A of left posterior femoral cutaneous nerve","Lateral cutaneous branch of left fifth intercostal nerve","Right L1 spinal nerve posterior ramus lateral branch","Right axillary nerve anterior branch","Orbital branch of right maxillary nerve to right ethmoidal sinus","Right C6 spinal nerve posterior ramus medial branch","Posterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right recurrent laryngeal nerve","Right sural nerve","Dorsal branch of right ulnar nerve","Right common plantar digital nerve E","Right medial dorsal digital nerve of the fourth toe","Right proper plantar digital nerve E","Left caroticotympanic nerve","Greater posterior gastric nerve","Right L1 spinal nerve posterior ramus","Pericardial branch of right phrenic nerve","Anterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left incisive branch of inferior alveolar nerve","Right T3 grey ramus communicans","Left posterior interosseous nerve","Palmar branch of left median nerve","Left nasociliary nerve","Right external laryngeal nerve","Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus","Right T11 grey ramus communicans","Right dorsal nerve of penis","Left C6 spinal nerve posterior ramus","Left axillary nerve anterior branch","Meningeal branch of left vagus nerve","Left intermediate dorsal cutaneous nerve","Right laryngopharyngeal branch of superior cervical ganglion","Right great auricular nerve anterior branch","Zygomatic branch of left facial nerve","Left C5 spinal nerve posterior ramus medial branch","Marginal mandibular branch of left facial nerve","Right L1 grey ramus communicans","Right meningeal branch of mandibular nerve","Right femoral nerve","Tracheal branch of right recurrent laryngeal nerve","Left posterior cutaneous nerve of arm","Left inferior lateral cutaneous nerve of arm","Right L2 spinal nerve posterior ramus","Right lateral dorsal cutaneous nerve","Anterior cutaneous branch of right second intercostal nerve","Left nasopalatine nerve","Left T3 spinal nerve posterior ramus medial branch","Left superior cervical cardiac nerve","Posterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T7 spinal nerve posterior ramus lateral branch","Right frontal nerve","Anterior cutaneous branch of left tenth intercostal nerve","Ganglionic branch of left maxillary nerve to pterygopalatine ganglion","Left S1 grey ramus communicans","Left lesser palatine nerve","Left medial plantar nerve","Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve","Left zygomaticotemporal nerve","Anterior cutaneous branch of right fifth intercostal nerve","Left proper palmar digital nerve B","Left radial nerve","Posterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left S3 grey ramus communicans","Left T3 white ramus communicans","Right T11 spinal nerve posterior ramus","Left ninth intercostal nerve","Right T2 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of left subcostal nerve","Right proper plantar digital nerve B","Left C2 spinal nerve posterior ramus","Right axillary nerve","Left axillary nerve","Left common palmar digital nerve A","Left proper plantar digital nerve D","Left femoral branch of genitofemoral nerve","Left second intercostal nerve","Left medial cutaneous nerve of arm","Left lateral sural cutaneous nerve","Right ophthalmic nerve","Right carotid sinus nerve","Right T10 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve D","Right mandibular nerve","Right obturator nerve","Left C3 spinal nerve branch to left great auricular nerve","Left lateral dorsal cutaneous nerve","Right greater palatine nerve","Right L2 spinal nerve posterior ramus lateral branch","Brachial plexus right C5 root","Left posterior superior lateral nasal branch of maxillary nerve","Right proper plantar digital nerve I","Right seventh intercostal nerve","Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Right tenth intercostal nerve","Left mandibular nerve","Left greater palatine nerve","Left T12 grey ramus communicans","Inferior cervical cardiac branch of right vagus nerve","Left ophthalmic nerve","Left superior laryngeal nerve","Right T12 grey ramus communicans","Cutaneous branch of left obturator nerve","Left long ciliary nerve B","Left S4 grey ramus communicans","Left T4 spinal nerve posterior ramus medial branch","Greater anterior gastric nerve","Orbital branch of left maxillary nerve to left sphenoidal sinus","Orbital branch of right maxillary nerve to right sphenoidal sinus","Right middle supraclavicular nerve","Right caroticotympanic nerve","Left sixth intercostal nerve","Right posterior cutaneous nerve of arm","Left middle supraclavicular nerve","Left proper plantar digital nerve I","Anterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left L2 spinal nerve posterior ramus","Anterior branch of lateral cutaneous branch of left seventh intercostal nerve","Posterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left T8 spinal nerve posterior ramus lateral branch","Meningeal branch of right vagus nerve","Tracheal branch of left recurrent laryngeal nerve","Anterior cutaneous branch of right tenth intercostal nerve","Left eleventh intercostal nerve","Right pudendal nerve","Posterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right anterior ethmoidal nerve","Right nasopalatine nerve","Left T8 spinal nerve posterior ramus","Left long ciliary nerve A","Left supraorbital nerve","Right medial posterior superior nasal nerve","Left T8 white ramus communicans","Right anterior femoral cutaneous branch A","Left T2 white ramus communicans","Right saphenous nerve","Anterior branch of lateral cutaneous branch of right seventh intercostal nerve","Left superior lateral cutaneous nerve of arm","Left T9 spinal nerve posterior ramus lateral branch","Left T6 spinal nerve posterior ramus","Posterior branch of left obturator nerve","Left external laryngeal nerve branch to inferior pharyngeal constrictor","Right incisive branch of inferior alveolar nerve","Right C3 spinal nerve posterior ramus","Right C5 spinal nerve posterior ramus","Right T9 spinal nerve posterior ramus","Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve","Left vestibular nerve","Right radial nerve","Left third intercostal nerve","Left cochlear nerve","Anterior cutaneous branch of left fourth intercostal nerve","Right T6 spinal nerve posterior ramus","Right greater occipital nerve","Right lesser palatine nerve","Left inferior alveolar nerve","Right subclavian nerve","Right T6 white ramus communicans","Brachial plexus right C6 root","Lateral cutaneous branch of left eleventh intercostal nerve","Right T11 white ramus communicans","Left carotid sinus nerve","Left great auricular nerve anterior branch","Right external laryngeal nerve branch to inferior pharyngeal constrictor","Left S2 grey ramus communicans","Right internal laryngeal nerve","Infrapatellar branch of left saphenous nerve","Anterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve A","Right communicating branch of nasociliary nerve with ciliary ganglion","Left proper plantar digital nerve G","Left infraorbital nerve","Left lingual branch of glossopharyngeal nerve","Right proper plantar digital nerve A","Left inferior rectal nerve","Right musculocutaneous nerve","Left inferior palpebral branch of infraorbital nerve","Left T7 spinal nerve posterior ramus","Cervical branch of right facial nerve","Right middle meningeal nerve","Right axillary nerve posterior branch","Right C2 spinal nerve branch to right great auricular nerve","Left zygomaticofacial nerve","Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"]},{id:77,nerve_id:"UBERON:0001647",label:"facial nerve","FMA subclasses (in human nerves)":["FMA:50888","FMA:50889"],"subclass labels":["Right facial nerve","Left facial nerve"]},{id:78,nerve_id:"UBERON:0001148",label:"median nerve","FMA subclasses (in human nerves)":["FMA:37067","FMA:37068"],"subclass labels":["Right median nerve","Left median nerve"]},{id:79,nerve_id:"UBERON:0009009",label:"carotid sinus nerve","FMA subclasses (in human nerves)":["FMA:53508","FMA:53509"],"subclass labels":["Right carotid sinus nerve","Left carotid sinus nerve"]},{id:80,nerve_id:"UBERON:0003715",label:"splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6930","FMA:6960","FMA:6958","FMA:6959","FMA:6925","FMA:6956","FMA:6927","FMA:6955","FMA:6926","FMA:6957"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left least splanchnic nerve","Left lesser splanchnic nerve","Right least splanchnic nerve","Left first lumbar splanchnic nerve","Right greater splanchnic nerve","Left second lumbar splanchnic nerve","Left greater splanchnic nerve","Right second lumbar splanchnic nerve","Right lesser splanchnic nerve"]},{id:81,nerve_id:"ILX:0793826",label:"anterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:82,nerve_id:"UBERON:0001650",label:"hypoglossal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:83,nerve_id:"ILX:0794967",label:"posterior interosseous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:84,nerve_id:"ILX:0793713",label:"Deep petrosal nerve","FMA subclasses (in human nerves)":["FMA:0328827","FMA:0328826"],"subclass labels":["Left deep petrosal nerve","Right deep petrosal nerve"]},{id:85,nerve_id:"ILX:0793361",label:"white communicating ramus of third lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:86,nerve_id:"ILX:0787562",label:"gray communicating ramus of the third thoracic nerve","FMA subclasses (in human nerves)":["FMA:6133","FMA:6124"],"subclass labels":["Left T3 grey ramus communicans","Right T3 grey ramus communicans"]},{id:87,nerve_id:"ILX:0793211",label:"white communicating ramus of fifth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:88,nerve_id:"UBERON:0018679",label:"thoracic splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6958","FMA:6960","FMA:6955","FMA:6959","FMA:6957","FMA:6956"],"subclass labels":["Left lesser splanchnic nerve","Left least splanchnic nerve","Left greater splanchnic nerve","Right least splanchnic nerve","Right lesser splanchnic nerve","Right greater splanchnic nerve"]},{id:89,nerve_id:"ILX:0731969",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:90,nerve_id:"ILX:0788771",label:"gray communicating ramus of seventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6888","FMA:6889"],"subclass labels":["Right T7 grey ramus communicans","Left T7 grey ramus communicans"]},{id:91,nerve_id:"UBERON:0022301",label:"long ciliary nerve","FMA subclasses (in human nerves)":["FMA:52701","FMA:52700","FMA:82734","FMA:82735"],"subclass labels":["Left long ciliary nerve B","Right long ciliary nerve B","Right long ciliary nerve A","Left long ciliary nerve A"]},{id:92,nerve_id:"ILX:0793221",label:"white communicating ramus of second lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:93,nerve_id:"ILX:0785825",label:"gray communicating ramus of first lumbar nerve","FMA subclasses (in human nerves)":["FMA:65924","FMA:65923"],"subclass labels":["Left L1 grey ramus communicans","Right L1 grey ramus communicans"]},{id:94,nerve_id:"ILX:0793208",label:"white communicating ramus of second thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:95,nerve_id:"UBERON:0018412",label:"vidian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:96,nerve_id:"ILX:0739303",label:"gray communicating ramus of second thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:97,nerve_id:"ILX:0795006",label:"Suboccipital nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:98,nerve_id:"ILX:0785733",label:"gray communicating ramus of second lumbar nerve","FMA subclasses (in human nerves)":["FMA:65921","FMA:65922"],"subclass labels":["Right L2 grey ramus communicans","Left L2 grey ramus communicans"]},{id:99,nerve_id:"UBERON:0035207",label:"deep fibular nerve","FMA subclasses (in human nerves)":["FMA:45387","FMA:45388"],"subclass labels":["Right deep fibular nerve","Left deep fibular nerve"]},{id:100,nerve_id:"ILX:0739304",label:"gray communicating ramus of third thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:101,nerve_id:"UBERON:0002019",label:"accessory XI nerve","FMA subclasses (in human nerves)":["FMA:50899","FMA:50897"],"subclass labels":["Left accessory nerve","Right accessory nerve"]},{id:102,nerve_id:"ILX:0793217",label:"white communicating ramus of eleventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:103,nerve_id:"ILX:0793722",label:"Lesser petrosal nerve","FMA subclasses (in human nerves)":["FMA:53503","FMA:53502"],"subclass labels":["Left lesser petrosal nerve","Right lesser petrosal nerve"]},{id:104,nerve_id:"UBERON:0018675",label:"pelvic splanchnic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:105,nerve_id:"ILX:0793702",label:"Greater petrosal nerve","FMA subclasses (in human nerves)":["FMA:53423","FMA:53424"],"subclass labels":["Right greater petrosal nerve","Left greater petrosal nerve"]},{id:106,nerve_id:"ILX:0794916",label:"white ramus communicans","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:107,nerve_id:"UBERON:0003716",label:"Recurrent Laryngeal Nerve","FMA subclasses (in human nerves)":["UBERON:0011766","UBERON:0011767"],"subclass labels":["Left recurrent laryngeal nerve","Right recurrent laryngeal nerve"]},{id:108,nerve_id:"UBERON:0005465",label:"obturator nerve","FMA subclasses (in human nerves)":["FMA:16501","FMA:16502"],"subclass labels":["Right obturator nerve","Left obturator nerve"]},{id:109,nerve_id:"ILX:0793213",label:"white communicating ramus of seventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:110,nerve_id:"ILX:0785067",label:"gray communicating ramus of eleventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6897","FMA:6896"],"subclass labels":["Left T11 grey ramus communicans","Right T11 grey ramus communicans"]},{id:111,nerve_id:"UBERON:0001494",label:"ulnar nerve","FMA subclasses (in human nerves)":["FMA:37320","FMA:37321"],"subclass labels":["Right ulnar nerve","Left ulnar nerve"]},{id:112,nerve_id:"ILX:0794959",label:"posterior rami lower cervical nerves","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:113,nerve_id:"UBERON:0001493",label:"axillary nerve","FMA subclasses (in human nerves)":["FMA:37074","FMA:37073"],"subclass labels":["Left axillary nerve","Right axillary nerve"]},{id:114,nerve_id:"ILX:0787946",label:"gray communicating ramus of sixth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6762","FMA:6763"],"subclass labels":["Right T6 grey ramus communicans","Left T6 grey ramus communicans"]},{id:115,nerve_id:"ILX:0785542",label:"gray communicating ramus of ninth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6892","FMA:6893"],"subclass labels":["Right T9 grey ramus communicans","Left T9 grey ramus communicans"]}],t4=()=>{const n={};return e4.forEach(e=>{e.nerve_id&&e.label!=="nerve"&&e["subclass labels"].forEach(t=>{t in n||(n[t.toLowerCase()]=e.nerve_id)})}),n},n4=[{label:"urinary bladder",anatomicalId:"UBERON:0001255"},{label:"brainstem",anatomicalId:"UBERON:0002298"},{label:"caecum",anatomicalId:"UBERON:0001153"},{label:"colon",anatomicalId:"UBERON:0001155"},{label:"esophagus",anatomicalId:"UBERON:0001043"},{label:"small intestine",anatomicalId:"UBERON:0002108"},{label:"stomach",anatomicalId:"UBERON:0000945"},{label:"heart",anatomicalId:"UBERON:0000948"},{label:"lung",anatomicalId:"UBERON:0002048"}],i4=()=>{const n={};return n4.forEach(e=>{const t=e.label.toLowerCase();t in n||(n[t.toLowerCase()]=e.anatomicalId)}),n},Gx=t4(),Hx=i4(),r4={name:"ScaffoldVuer",components:{Button:ws,Col:Fn,Loading:$L,Option:As,Popover:Ml,Radio:hg,RadioGroup:dg,Row:Yn,Select:Ms,Slider:An,TabPane:Ng,Tabs:Og,MapSvgIcon:Of.MapSvgIcon,MapSvgSpriteColor:Of.MapSvgSpriteColor,PrimitiveControls:Ex,ScaffoldTooltip:Lx,ElIconWarningFilled:Hp,ElIconArrowDown:gu,ElIconArrowLeft:ki,DrawToolbar:Ua.DrawToolbar,ScaffoldTreeControls:Cx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new Wx.AnnotationService(`${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},isNerves:{type:Object,default:function(){return{regions:["nerves"]}}},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/"},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},usageConfig:{type:Object,default:function(){return{showTubeLinesControls:!0,tubeLines:!1}}}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,colourRadio:!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:[],outlinesRadio:!0,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","Neuron Connection":"Discover nerve connections by selecting a nerve and viewing its associated connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,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})}},beforeCreate:function(){this.$module=new Fx,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new QD},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 OD;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:{...Ga.mapStores(xf),...Ga.mapState(xf,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},enableColourPicker:function(){return this.showColourPicker&&this.colourRadio},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{zoomToNerves:function(n,e=!1){if(this.$module.scene){this.$module.setIgnorePicking(e);const t=[];this.$module.scene.getRootRegion().getChildRegions().forEach(r=>{r.getName()==="Nerves"&&e&&n.forEach(o=>{const l=this.findObjectsWithGroupName(o);t.push(...l)})}),this.$module.setSelectedByZincObjects(t,void 0,{},!0),this.$module.scene.viewAll()}},enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){var r;this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0);const e=n.groupName.toLowerCase();e in Hx&&n.setAnatomicalId(Hx[e]);const t=n.getGroup();t&&t.position?n.userData.originalPos=[t.position.x,t.position.y,t.position.z]:n.userData.originalPos=[0,0,0];const i=(r=this.isNerves)==null?void 0:r.regions;if(i){const s=n.getRegion().getFullPath().toLowerCase();for(let o=0;o{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=bx(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}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")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=bx(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}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&&(sD(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=Ao(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.authorisedUser||this.offlineAnnotationEnabled)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=tD(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=iD(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)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=nD(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=yx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else 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,region:r,group:n.identifiers[0].data.group}:n.identifiers.length===0&&(this.lastSelected={isSearch:!1,region:"",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.viewingMode==="Exploration"||this.viewingMode==="Annotation")&&(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.$module.isIgnorePicking()||(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=Ao(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=vx(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,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}];this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await xx(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await xx(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),wx(this.$module.scene,n)},changeViewingMode:function(n){let e=!0;this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate?(this.authorisedUser=t,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"?(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""):this.viewingMode==="Neuron Connection"&&(e=!1),this.viewingMode==="Exploration"||this.viewingMode==="Neuron Connection"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate(),n&&this.setObjectIsPickable(e))},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},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},setObjectIsPickable:function(n){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{var i;!((i=t.userData)!=null&&i.isNerves)&&!t.anatomicalId&&t.setIsPickable(n)})},setGreyScale:function(n,e=[]){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(i=>{var l;const r=i.groupName.toLowerCase(),s=(l=i.userData)==null?void 0:l.isNerves;(e.length>0&&s&&!e.includes(r)||e.length===0&&!s)&&(i.setGreyScale(n),i.userData.isGreyScale=n)}),this.$refs.scaffoldTreeControls.updateAllNodeColours()},setColour:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.colourRadio)&&(this.loading=!0,setTimeout(()=>{this.setGreyScale(!n),this.loading=!1,this.colourRadio=n},100))},setOutlines:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.outlinesRadio)&&(this.outlinesRadio=n,this.$nextTick(()=>this.$refs.scaffoldTreeControls.setOutlines(n)))},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();Ao(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=vx(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:"",group:"",isSearch:!0},this.objectSelected([],!0),!1;{this.lastSelected={region:"",group:n,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),"colour"in n&&this.setColour(n.colour),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),"outlines"in n&&this.setOutlines(n.outlines),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))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),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.isReady=!0,this.$nextTick(()=>{this.restoreSettings(n),this.$emit("on-ready")})}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,colour:this.colourRadio,outlines:this.outlinesRadio,viewingMode:this.viewingMode,usageConfig:this.usageConfig};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}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),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,colour:n.colour,outlines:n.outlines,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.colour||n.search||n.outlines||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,colour:n.colour,search:n.search,offlineAnnotations:n.offlineAnnotations,outlines:n.outlines,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){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);wx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){var t,i;if(n!=this._currentURL){const r={};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.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,colour:e==null?void 0:e.colour,outlines:e==null?void 0:e.outlines,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,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):(((t=this==null?void 0:this.usageConfig)!=null&&t.tubeLines||(i=e==null?void 0:e.usageConfig)!=null&&i.tubeLines)&&(r.tubeLines=!0),this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0,r)),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")}}},s4={ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},o4={class:"primitive-controls-box"},a4={class:"animation-data"},l4={class:"purple"},c4={class:"animation-data"},u4={class:"purple"},h4={class:"animation-data"},d4={class:"bottom-right-control"},f4={style:{"margin-bottom":"2px"}},p4={key:0,class:"viewing-mode-title"},m4=["onClick"],g4=["onClick"];function v4(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=Lx,u=a.resolveComponent("DrawToolbar"),c=Hp,f=dt,d=Ml,p=Cx,v=Ex,m=a.resolveComponent("map-svg-icon"),h=An,b=Yn,y=Ng,g=As,w=Ms,A=Og,S=ws,M=hg,F=dg,R=eh;return a.withDirectives((a.openBlock(),a.createElementBlock("div",s4,[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,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=_=>s.confirmCreate(_)),onCancelCreate:e[1]||(e[1]=_=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=_=>s.confirmComment(_)),onConfirmDelete:e[3]||(e[3]=_=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=_=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((..._)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(..._),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(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(d,{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[6]||(e[6]=_=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=_=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[31]||(e[31]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(d,{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[8]||(e[8]=_=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=_=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[32]||(e[32]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(d,{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(p,{ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":s.enableColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",o4,[a.createVNode(v,{ref:"primitiveControls",createData:n.createData,viewingMode:n.viewingMode,usageConfig:t.usageConfig,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","viewingMode","usageConfig","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(d,{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(A,{type:"card"},{default:a.withCtx(()=>[a.createVNode(y,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=_=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=_=>s.play(!0))})),a.createVNode(h,{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[12]||(e[12]=_=>s.timeChange(_))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(y,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",a4,[e[33]||(e[33]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",l4,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",c4,[e[34]||(e[34]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",u4,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",h4,[e[35]||(e[35]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=_=>s.speedChanged(_))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,_=>(a.openBlock(),a.createBlock(g,{key:_.value,label:_.label,value:_.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",d4,[a.createVNode(d,{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(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=_=>s.zoomIn()),onMouseover:e[15]||(e[15]=_=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=_=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(d,{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(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=_=>s.zoomOut()),onMouseover:e[18]||(e[18]=_=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=_=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(d,{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(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=_=>s.fitWindow()),onMouseover:e[21]||(e[21]=_=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=_=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[36]||(e[36]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(d,{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,_=>(a.openBlock(),a.createBlock(b,{key:_.key},{default:a.withCtx(()=>[a.createVNode(S,{type:"primary",plain:"",onClick:O=>n.$emit("open-map",_.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(_.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"320",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(()=>e[37]||(e[37]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",f4,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(_,O,E)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:O},[O===n.viewingMode?(a.openBlock(),a.createElementBlock("span",p4,[a.createElementVNode("b",null,a.toDisplayString(O),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:T=>s.changeViewingMode(O)},a.toDisplayString(O),9,m4))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[38]||(e[38]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[39]||(e[39]=[a.createTextVNode("Organs display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.colourRadio,"onUpdate:modelValue":e[23]||(e[23]=_=>n.colourRadio=_),class:"scaffold-radio",onChange:e[24]||(e[24]=_=>s.setColour(n.colourRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[40]||(e[40]=[a.createTextVNode("Colour")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[41]||(e[41]=[a.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[42]||(e[42]=[a.createTextVNode("Outlines display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.outlinesRadio,"onUpdate:modelValue":e[25]||(e[25]=_=>n.outlinesRadio=_),class:"scaffold-radio",onChange:e[26]||(e[26]=_=>s.setOutlines(n.outlinesRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[43]||(e[43]=[a.createTextVNode("Show")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[44]||(e[44]=[a.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[45]||(e[45]=[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,_=>(a.openBlock(),a.createElementBlock("div",{key:_,class:a.normalizeClass(["backgroundChoice",_,_==n.currentBackground?"active":""]),onClick:O=>s.backgroundChangeCallback(_)},null,10,g4))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group",{open:n.drawerOpen,close:!n.drawerOpen}])},[t.showOpenMapButton?(a.openBlock(),a.createBlock(b,{key:0},{default:a.withCtx(()=>[a.createVNode(d,{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(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[27]||(e[27]=_=>s.showHelpText(3)),onMouseout:e[28]||(e[28]=_=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0),t.showLocalSettings?(a.openBlock(),a.createBlock(b,{key:1},{default:a.withCtx(()=>[a.createVNode(d,{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(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[29]||(e[29]=_=>s.showHelpText(4)),onMouseout:e[30]||(e[30]=_=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0)],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])])),[[R,n.loading]])}const y4=Ii(r4,[["render",v4],["__scopeId","data-v-b5c791a7"]]);Ot.ScaffoldVuer=y4,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})});