@qispace/vue3-player 0.4.28 → 0.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- (function(h1,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("axios"),require("@qispace/player-core"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@qispace/player-core","three"],a):(h1=typeof globalThis<"u"?globalThis:h1||self,a(h1["vue3-player"]={},h1.Vue,h1.axios,h1.PlayerCore,h1.THREE))})(this,function(h1,a,Pt,z4,U2){"use strict";var mM=Object.defineProperty;var fM=(h1,a,Pt)=>a in h1?mM(h1,a,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):h1[a]=Pt;var D2=(h1,a,Pt)=>(fM(h1,typeof a!="symbol"?a+"":a,Pt),Pt);var _t,d1,er,It,tr,Ve,ir,rr,ar,nr,or,sr,lr,cr,dr,hr,l2,ur,mr,fr,pr,gr,_r,vr,xr,yr,Sr,C1,Mr,wr,jt,w1,Ar;function V4(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const B4=V4(z4),F4=a.defineComponent({__name:"VFloatingCard",props:{pos:{},isHoverable:{type:Boolean}},emits:["outside"],setup(e,{emit:t}){const i=e,r=t,n=a.computed(()=>{let o,s,l,d;return i.pos.x<=i.pos.width/2?(o="-100%",l="-8px"):(o="0%",l="8px"),i.pos.y<=i.pos.height/2?(s="-100%",d="-8px"):(s="0%",d="8px"),`translate(${o}, ${s}) translate(${l}, ${d})`});return(o,s)=>{const l=a.resolveComponent("v-dialog"),d=a.resolveComponent("v-fade-transition");return a.openBlock(),a.createBlock(d,{origin:`top left ${o.pos.x} ${o.pos.y}`},{default:a.withCtx(()=>[o.isHoverable?(a.openBlock(),a.createElementBlock("div",{key:0,class:"floating-card",style:a.normalizeStyle({left:`${o.pos.x}px`,top:`${o.pos.y}px`,pointerEvents:"none",transform:n.value})},[a.renderSlot(o.$slots,"default",{isHoverable:o.isHoverable},void 0,!0)],4)):(a.openBlock(),a.createBlock(l,{key:1,value:!0,width:"auto","onClick:outside":s[0]||(s[0]=c=>r("outside",c))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default",{isHoverable:o.isHoverable},void 0,!0)]),_:3}))]),_:3},8,["origin"])}}}),ke=(e,t)=>{const i=e.__vccOpts||e;for(const[r,n]of t)i[r]=n;return i},B0=ke(F4,[["__scopeId","data-v-7d5e6067"]]),F0=ke(a.defineComponent({__name:"VHoverProbe",setup(e,{expose:t}){const i=a.ref(),r=a.computed(()=>window.getComputedStyle(i.value).display==="none");return t({isHoverEnabled:r}),(n,o)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"hoverCheck",ref:i,class:"hover-check"},null,512))}}),[["__scopeId","data-v-eb9b348d"]]),H4="data:image/png;base64,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",E3=a.defineComponent({__name:"VNorthDirection",props:{longitude:{}},setup(e){const t=e,i=a.computed(()=>({transform:`rotate(${90-(t.longitude||0)}deg)`,transition:" transform 0.5s ease-in"}));return(r,n)=>{const o=a.resolveComponent("v-img");return a.openBlock(),a.createBlock(o,{src:a.unref(H4),style:a.normalizeStyle(i.value)},null,8,["src","style"])}}}),H0=ke(a.defineComponent({__name:"VZoomBox",props:{desktop:{type:Boolean,default:!0},mobile:{type:Boolean,default:!0},maxScale:{default:10},consumeMouseClickWhenMoved:{type:Boolean,default:!0},consumeMouseUpWhenMoved:{type:Boolean,default:!0},position:{default:"absolute"}},emits:["update"],setup(e,{expose:t,emit:i}){const r=e,n=i;t({adjustZoom:q});const o=a.ref(100),s=a.ref(0),l=a.ref(0),d=a.ref(!1),c=a.ref(!1),h=a.ref(void 0),u=a.ref(!1),m=a.ref(),f=a.computed(()=>`translateX(${s.value}px) translateY(${l.value}px) scale(${v.value})`),v=a.computed(()=>o.value/100),_=a.computed(()=>r.maxScale*100);a.watch([v,s,l],()=>{W()},{immediate:!0}),a.watch(()=>r.desktop,()=>{r.desktop?g():y()}),a.watch(()=>r.mobile,()=>{r.mobile?p():x()}),a.onMounted(()=>{r.desktop&&g(),r.mobile&&p()}),a.onBeforeUnmount(()=>{r.desktop&&y(),r.mobile&&x()});function g(){m.value.addEventListener("wheel",b,{capture:!0}),m.value.addEventListener("mousedown",N,{capture:!0}),m.value.addEventListener("mousemove",A,{capture:!0}),window.addEventListener("mouseup",C,{capture:!0}),window.addEventListener("click",U,{capture:!0})}function p(){m.value.addEventListener("touchstart",S,{capture:!0}),m.value.addEventListener("touchmove",M,{capture:!0}),window.addEventListener("touchend",k,{capture:!0}),window.addEventListener("touchcancel",k,{capture:!0})}function y(){m.value.removeEventListener("wheel",b,{capture:!0}),m.value.removeEventListener("mousedown",N,{capture:!0}),m.value.removeEventListener("mousemove",A,{capture:!0}),window.removeEventListener("mouseup",C,{capture:!0}),window.removeEventListener("click",U,{capture:!0})}function x(){m.value.removeEventListener("touchstart",S,{capture:!0}),m.value.removeEventListener("touchmove",M,{capture:!0}),window.removeEventListener("touchend",k,{capture:!0}),window.removeEventListener("touchcancel",k,{capture:!0})}function b(Q){const{x:z,y:J}=R(Q);q(-Q.deltaY/10,z,J),Q.preventDefault()}function N(Q){d.value=!0,u.value=!1,h.value=Q}function A(Q){if(d.value){const{x:z,y:J}=R(Q),{x:j,y:de}=R(h.value),oe={x:z-j,y:J-de};D(oe.x),V(oe.y),u.value=!0,h.value=Q}}function C(Q){d.value&&u.value&&r.consumeMouseUpWhenMoved&&(Q.preventDefault(),Q.stopImmediatePropagation())}function U(Q){d.value&&(u.value&&r.consumeMouseClickWhenMoved&&(Q.preventDefault(),Q.stopImmediatePropagation()),d.value=!1)}function S(Q){d.value=Q.touches.length===1,c.value=Q.touches.length===2,h.value=Q}function M(Q){if(d.value){const{x:z,y:J}=R(Q.touches[0]),{x:j,y:de}=R(h.value.touches[0]),oe={x:z-j,y:J-de};D(oe.x),V(oe.y)}else if(c.value&&Q.touches.length===2){const{x:z,y:J}=R(Q.touches[0]),{x:j,y:de}=R(h.value.touches[0]),{x:oe,y:X}=R(Q.touches[1]),{x:K,y:le}=R(h.value.touches[1]),ce=Math.hypot(j-K,de-le),ae=Math.hypot(z-oe,J-X),Me=(oe+z)/2,Be=(X+J)/2;q(ae-ce,Me,Be)}h.value=Q}function k(){d.value=!1,c.value=!1}function R(Q){const{left:z,top:J}=m.value.getBoundingClientRect();return{x:Q.clientX-z,y:Q.clientY-J}}function D(Q){const z=m.value.clientWidth,J=z*v.value;s.value=Math.max(Math.min(0,s.value+Q),-(J-z))}function V(Q){const z=m.value.clientHeight,J=z*v.value;l.value=Math.max(Math.min(0,l.value+Q),-(J-z))}function q(Q,z,J){const j=z!==void 0?z:m.value.clientWidth/2,de=J!==void 0?J:m.value.clientHeight/2,oe=m.value.clientWidth,X=m.value.clientHeight,K=oe*v.value,le=X*v.value;o.value=Math.min(Math.max(100,o.value+Q),_.value);const ce=oe*v.value,ae=X*v.value,Me=ce-K,Be=ae-le;s.value-=j/oe*Me,l.value-=de/X*Be,D(0),V(0)}function W(){n("update",{scale:v.value,x:s.value,y:l.value,current:Math.min(Math.max(100,o.value),_.value),min:100,max:_.value,resolve:(Q,z)=>{const J=m.value.clientWidth,j=m.value.clientHeight,de=s.value/-v.value,oe=l.value/-v.value,X=de+J/v.value,K=oe+j/v.value,le=Q/J*(X-de)+de,ce=z/j*(K-oe)+oe;return{x:le,y:ce}}})}return(Q,z)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"box",ref:m,class:"zoom-box-container",style:a.normalizeStyle({position:r.position})},[a.createElementVNode("div",{style:a.normalizeStyle({"transform-origin":"top left",transform:f.value}),class:"zoom-box"},[a.renderSlot(Q.$slots,"default",{},void 0,!0)],4)],4))}}),[["__scopeId","data-v-3e334a46"]]);var ai={};Object.defineProperty(ai,"__esModule",{value:!0});var G4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W4=typeof window<"u"&&typeof window.document<"u",j4=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,X4=(typeof self>"u"?"undefined":G4(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Y4=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),q4=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",G0=ai.isBrowser=W4;ai.isWebWorker=X4,ai.isNode=j4,ai.isJsDom=Y4,ai.isDeno=q4;function l1(e,t){return typeof e=="string"?`${e}${t}`:e(t)}const Z4={id:"player-wrapper"},Q4={id:"player-sizer"},J4={class:"player-control",id:"controls-top-left"},K4={class:"player-control",id:"controls-top-center"},$4={class:"player-control",id:"controls-top-right"},e5={class:"player-control",id:"controls-center-left"},t5={class:"player-control",id:"controls-center-center"},i5={class:"player-control",id:"controls-center-right"},r5={class:"player-control",id:"controls-bottom-left"},a5={class:"player-control",id:"controls-bottom-center"},n5={class:"player-control",id:"controls-bottom-right"},o5={id:"main-canvas"},s5=ke(a.defineComponent({__name:"VPlayer",props:{cdnFileResolver:{},interiorId:{},apartmentId:{},currentCameraId:{},showStaticImage:{type:Boolean},mouseSensitivity:{default:1}},emits:["newCameraCallback","newRotationCallback","newFloorCallback","newFovCallback","sunsimCallback","playerApiCallback","newSizeCallback","frontendMarkersUpdate"],setup(e,{expose:t,emit:i}){const r=B4.PlayerV2;t({updateFrontendMarkers:x=>{m.value&&g.value?m.value.updateFrontendMarkers(x):console.warn("Player API not initialized or not available. Cannot update frontend markers.")}});const n=e,{cdnFileResolver:o,interiorId:s,apartmentId:l,currentCameraId:d,showStaticImage:c,mouseSensitivity:h}=a.toRefs(n),u=i,m=a.ref(),f=a.ref(d.value),v=a.ref(0),_=a.ref(0),g=a.ref(!1);a.watch(d,()=>{f.value=d.value}),a.watch([s,l],async()=>{m.value&&await m.value.loadInterior(x=>l1(o.value,`/${s.value}/${l.value}${x}`),f.value,!1)}),a.watch(f,()=>{m.value&&m.value.goToCamera(f.value,!0),u("newCameraCallback",f.value)},{immediate:!0}),a.watch([o],async()=>{await y(),a.nextTick(async()=>{await p()})},{immediate:!0,deep:!0}),a.watch(m,()=>{if(m.value){u("playerApiCallback",m.value);const x=m.value.getCurrentCamera();x&&(f.value=x.id,u("sunsimCallback",x.sunsimDayOfYear))}});async function p(){y();const C={initialized:()=>{m.value=r.Main.getPlayerAPI();const S=m.value.getCurrentCamera();m.value.updateSettings({ACTIVE_TONEMAPPER:"AgXTonemap"}),S&&(f.value=S.id),g.value=!0},newCamera:S=>{u("newFloorCallback",S.floorLevel),u("sunsimCallback",S.sunsimDayOfYear),m.value&&m.value.resetMarkerBehaviour(0),f.value=S.id},newFOV:S=>{u("newFovCallback",S),_.value=S},newRotation:S=>{const M=S+0;u("newRotationCallback",M),v.value=M},onFrontendMarkersUpdate:S=>{u("frontendMarkersUpdate",S)}};if(!G0)return;const U=await new r.Main(S=>l1(o.value,`/${s.value}/${l.value}${S}`),"qpc",C,void 0,f.value);U&&(U.handleWindowResize(),window.addEventListener("resize",U.handleWindowResize.bind(U)),U.animate(),m.value=r.Main.getPlayerAPI(),m.value&&m.value.setLookSensitivity(h.value))}async function y(){m.value&&(await m.value.destroy(),m.value=void 0)}return a.onBeforeUnmount(()=>{y()}),(x,b)=>(a.openBlock(),a.createElementBlock("div",Z4,[a.createElementVNode("div",Q4,[a.renderSlot(x.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",J4,[a.renderSlot(x.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",K4,[a.renderSlot(x.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",$4,[a.renderSlot(x.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",e5,[a.renderSlot(x.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",t5,[a.renderSlot(x.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",i5,[a.renderSlot(x.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",r5,[a.renderSlot(x.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",a5,[a.renderSlot(x.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",n5,[a.renderSlot(x.$slots,"bottom-right",{},void 0,!0)]),a.createElementVNode("div",o5,[a.createElementVNode("canvas",{id:"qpc",style:a.normalizeStyle(a.unref(c)?"visibility:hidden":"visibility:visible")},null,4)])])]))}}),[["__scopeId","data-v-59081d9a"]]),H1=Symbol(),l5={style:{width:"24px",height:"24px"},viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg"},c5=["stroke"],d5=["stroke"],h5={class:"floor-level-label"},u5=ke(a.defineComponent({__name:"VFloorLevel",props:{level:{default:0},floorLevels:{default:()=>[]}},emits:["level"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(H1),o=a.computed(()=>{const h=i.floorLevels;return h.sort(),h}),s=a.computed(()=>o.value.indexOf(i.level)+1<=o.value.length/2?"lower":"upper"),l=a.computed(()=>s.value==="lower"),d=a.computed(()=>s.value==="upper");function c(){const h=i.level+1;h>=o.value.length?r("level",o.value[0]):r("level",o.value[h])}return(h,u)=>{const m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(f,{right:"",attach:""},{activator:a.withCtx(({props:v})=>[a.createVNode(m,a.mergeProps({style:{cursor:"pointer"},density:"comfortable",elevation:"1",icon:""},v,{onClick:c}),{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock("svg",l5,[a.createElementVNode("path",{d:"M8.98034 10.3472L1.54055 5.8855L8.98034 1.42384L16.4201 5.8855L8.98034 10.3472Z",fill:"white",stroke:d.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,c5),a.createElementVNode("path",{d:"M8.98034 14.7993L1.54055 10.3376L8.98034 5.87599L16.4201 10.3376L8.98034 14.7993Z",fill:"white",stroke:l.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,d5)]))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",h5,a.toDisplayString(a.unref(n).getLabel(s.value))+" "+a.toDisplayString(a.unref(n).getLabel("floor")),1)]),_:1})}}}),[["__scopeId","data-v-4c45966e"]]),m5={class:"d-none d-md-inline"},f5={class:"interior-selector-list"},p5=["onClick"],g5={class:"d-flex align-center justify-left pa-0 ma-0"},_5={class:"pa-0 ma-0"},v5={class:"text-caption ma-2 no-wrap"},x5=ke(a.defineComponent({__name:"VInteriorSelector",props:{cdnFileResolver:{type:[String,Function]},availableArchetypes:{},selectedIndex:{}},emits:["selectInterior"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(H1);return(o,s)=>{const l=a.resolveComponent("v-icon"),d=a.resolveComponent("v-btn"),c=a.resolveComponent("v-img"),h=a.resolveComponent("v-menu");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(h,{transition:"slide-x-reverse-transition",location:"top end",origin:"end bottom",elevation:"0",attach:""},{activator:a.withCtx(({props:u})=>[a.createVNode(d,a.mergeProps({rounded:""},u,{class:"text-capitalize"}),{default:a.withCtx(()=>[a.createVNode(l,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-palette-outline")]),_:1}),a.createElementVNode("span",m5,a.toDisplayString(a.unref(n).getLabel("interior")),1)]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("div",f5,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.availableArchetypes,(u,m)=>(a.openBlock(),a.createElementBlock("div",{key:`at-menuitem-${m}`,onClick:f=>r("selectInterior",u.archetypeID),class:a.normalizeClass(["interior-selector-list-item",{active:m===o.selectedIndex}])},[a.createElementVNode("div",g5,[a.createElementVNode("div",_5,[a.createVNode(c,{width:"100","max-width":"100",height:"66",src:u.url,class:"pa-0 ma-0"},null,8,["src"])]),a.createElementVNode("div",v5,a.toDisplayString(a.unref(n).get(u.title)),1)])],10,p5))),128))])]),_:1})])}}}),[["__scopeId","data-v-eece0130"]]),W0="data:image/png;base64,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",j0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMdSURBVHgB7dxBTttQEMbxsU32idouujM7FhjlBqQnaG5AbkBvUPUEpTegN8gR6AlAgQU70lWlQkUUscR+fVZrRKlL7CTQN6P/T0IJwYkUDfNhvzdEBAAAAAAAAAAAAAAAAAAAAAD+i+t+v3+5vT0Qg2IxqHBuP47jXTHIZMHEuYETeScGmSvYZb9fFiv1d7sWY9FcwWLn9u7ux/FbMcZeJPo4vLsrMhJjTBXsXhxWzMWiqYLdj8NKlCR7YoipgjnnhjUPDv11WVeMMFOwqywb+Zu6wnQlz81ck5kp2GNnhLmha7JIDCgjLy+K60cOmSVxvNk7OZmJciY6LM/z4YJDukVRmDj5sBGJcbywGLUnJAqpj0Qfh6mPw4smx/pY7GmPRfUd5uNw0PRYC7GoPxIbxGHFQiyqjsQ2cVjRHouqO8xHXOvVeP+cfVFMeySOpCV3bzVfI7WRuEwcVlxRvHl1dnYkCqntsFWiTfO8h+ZIXPqMT/PGpsqC1WxUtpVq3dhUWbC6jcrWr6F03kNnJK7hTE9rLKor2BrisKJy3kNdwdYRh3evpTAW9UXiGi98y1jUNu+hqmBXWTZcUxxWure3t31RRFXBoieIMG1jcGqWphrMbSxL1byHmg5rMLexrPIXQc3Jh5qCPekZnXMjUUJFJK6yMt+Ulo1NFR3WZm5jWVrmPXREYou5jWVpmfcIPhKfIw4rGmIx+A57jjisaIjF4AsWRVG7nWXnjhK/fJWUEefcuN1Tw4/FoCOxaRz6N3Hi22M8v7n5tDmd/hFp37a20qTTGcRR9F4aLGslSZL2jo+/SqA2JGALxthmviMO/RsY905Pv/zroNfn51N/c1h+XWfZbl7ug0VR2Um1i75Fno/8zQcJVNAd9mNn5+KvxV4feT4mx/P5/PPDbmrje5aN/N+DPV+8wYMfTV9OJpsSqGALVn78kI/D49/fzqKiOKiLvFWVkbnR6exHv7ouLR8LeQwu2IL57vroIy9NRA4ei7x1qiLTF2/6YjIJNhbxwEWamvkndgAAAAAAAAAAAAAAAAAAAAAAAAAAAABYxU+ILzGcMmFd0QAAAABJRU5ErkJggg==",y5=a.defineComponent({__name:"VCompass",props:{rotation:{}},setup(e){const t=e,i=a.ref(j0),r=a.ref({backgroundImage:`url(${W0})`,backgroundSize:"contain"}),n=a.computed(()=>({transform:`rotate(${-t.rotation+180}deg)`}));return(o,s)=>{const l=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(r.value),class:"compass-wrapper"},[a.createVNode(l,{class:"compass-needle",src:i.value,style:a.normalizeStyle(n.value)},null,8,["src","style"])],4)}}}),X0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAllBMVEUAAAD/rwD/rwD/qgP/qwL/qAL/qwP/qwH/rAL/rAL/qwL/qQD/qwL/qwD/qQD/qwL/pQD/qgH/nwD/pwD/qQL/rAL/qwD/qwT/rAP/qwL/rAL/rAD/rAL/qgD/qwL/qQP/rAP/rAH/qgH/qwL/qwD/qgL/rwD/qgD/qwH/qgD/qgL/rAD/qgD/qgD/qwH/rAP/qgX/qwA+O5E+AAAAMnRSTlMAECBg/3C/v5Dff4+PT1/PMN8QII9vf0CfgO9vnzDvUF+vr3BA3zA/z2+fX59g71AwcDsf6p0AAAFGSURBVHicvdRtT8MgEABgaM9hu1aHXV/cpm6zWt829f//OYEK9qC3NDF6HxYCTw5GuWPsd8GjqTIGOJtIZwDi/ymnKPflOSTub6cAcwdnkHk5AQY2v3Dzl2phga1EFkl5hScLbZc+LbUs/FltK5OpLpsmrS0NpbLLSu3Er1dgIsn0cdabEdlHlICL5IZSRq5gELcn7DCnsfQL24AX5PeNfAlAHSEOaYrFXaNiqwa7kO7V9L1dt9u25kX58cBY7dbZYz/MKdr2o06nrZ6klNX4AYRdf8aHzkL6QtxAG9KculjhS0nJMO0rSVmF5ZyWnn2jFC+36vcgLTzq+3lPRx6XrjjTqQ7iqJxY6+KLydp0ZWhrVHWE0JoqHq1NSHBxF0h+1Mh6LUMM5LC/Kht8h+5nG9zeTtbt37Ti3XT6+d29pkTXTZVEfAEKARRF2iiwhQAAAB10RVh0U29mdHdhcmUAQGx1bmFwYWludC9wbmctY29kZWP1QxkeAAAAAElFTkSuQmCC",S5={class:"d-flex flex-column align-center justify-center clock-face"},M5={class:"clock-icon"},w5={class:"clock-value grey--text text--darken-3"},A5=ke(a.defineComponent({__name:"VTimeOfDay",props:{hours:{default:0},minutes:{default:0}},setup(e){const t=e,i=a.computed(()=>[r(t.hours),":",r(t.minutes)].join(""));function r(n){return("0"+n).slice(-2)}return(n,o)=>{const s=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",S5,[a.createElementVNode("div",M5,[a.createVNode(s,{src:a.unref(X0),"aspect-ratio":"1"},null,8,["src"])]),a.createElementVNode("div",w5,a.toDisplayString(i.value),1)])}}}),[["__scopeId","data-v-874b2271"]]),b3=e=>(a.pushScopeId("data-v-86d91cc1"),e=e(),a.popScopeId(),e),E5={key:0,width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},b5=[b3(()=>a.createElementVNode("path",{d:"M5.38544 13C3.30939 13.9424 2 15.3211 2 16.8571C2 19.6975 6.47715 22 12 22C17.5228 22 22 19.6975 22 16.8571C22 15.3211 20.6906 13.9424 18.6146 13",class:"fill-grey"},null,-1)),b3(()=>a.createElementVNode("path",{d:"M8 9C8 7.89543 8.89543 7 10 7H14C15.1046 7 16 7.89543 16 9V12.875C16 13.4273 15.5523 13.875 15 13.875H14V17C14 17.5523 13.5523 18 13 18H11C10.4477 18 10 17.5523 10 17V13.875H9C8.44772 13.875 8 13.4273 8 12.875V9Z"},null,-1)),b3(()=>a.createElementVNode("path",{d:"M15 4C15 5.65685 13.6569 7 12 7C10.3431 7 9 5.65685 9 4C9 2.34315 10.3431 1 12 1C13.6569 1 15 2.34315 15 4Z"},null,-1))],C5=ke(a.defineComponent({__name:"VViewModeToggle",props:{showStaticImage:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(H1),o=a.computed(()=>{let s="virtualTour";return i.showStaticImage||(s="slideShow"),s});return(s,l)=>{const d=a.resolveComponent("v-icon"),c=a.resolveComponent("v-btn"),h=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(h,{location:"top"},{activator:a.withCtx(({props:u})=>[a.createVNode(c,a.mergeProps({density:"comfortable",elevation:"1",icon:"",onClick:l[0]||(l[0]=m=>r("toggle"))},u),{default:a.withCtx(()=>[o.value==="virtualTour"?(a.openBlock(),a.createElementBlock("svg",E5,b5)):(a.openBlock(),a.createBlock(d,{key:1},{default:a.withCtx(()=>[a.createTextVNode("mdi-image-multiple")]),_:1}))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(n).getLabel(o.value)),1)]),_:1})}}}),[["__scopeId","data-v-86d91cc1"]]),k2=e=>(a.pushScopeId("data-v-627f8ee6"),e=e(),a.popScopeId(),e),T5={key:0,class:"desktop-content"},I5={class:"d-flex align-center justify-center"},P5={class:"box col d-flex flex-column align-bottom justify-center"},N5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M72 30H86.9736M86.9736 30L81 36M86.9736 30L81 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M27.9736 30H13M13 30L18.9736 36M13 30L18.9736 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M36 30H64V40C64 47.732 57.732 54 50 54V54C42.268 54 36 47.732 36 40V30Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 25C36 17.268 42.268 11 50 11V11V30H36V25Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 25C64 17.268 57.732 11 50 11V11V30H64V25Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 23V30C53.25 31.7949 51.7949 33.25 50 33.25C48.2051 33.25 46.75 31.7949 46.75 30V23C46.75 21.2051 48.2051 19.75 50 19.75C51.7949 19.75 53.25 21.2051 53.25 23Z",fill:"white",stroke:"black","stroke-width":"1.5"})])],-1)),L5={class:"text-div text-center text mt-2"},R5={class:"box col d-flex flex-column align-bottom justify-center"},D5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9936 27.0175C79.9881 19.276 66.3321 13.0323 49.492 13.0719C32.652 13.1116 19.0049 19.4194 19.0105 27.1609C19.016 34.9025 32.6721 41.1461 49.5121 41.1065C66.3521 41.0669 79.9992 34.759 79.9936 27.0175Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M61.8032 45.179L56.543 50.3218V28.0361L72.543 43.4647H65.0909L67.9402 50.3218L64.6526 52.0361L61.8032 45.179Z",fill:"white",stroke:"black","stroke-width":"1.5","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"})])],-1)),U5={class:"text-div text-center text mt-2"},k5={class:"box col d-flex flex-column align-bottom justify-center"},O5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M36 33H64V43C64 50.732 57.732 57 50 57V57C42.268 57 36 50.732 36 43V33Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 28C36 20.268 42.268 14 50 14V14V33H36V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 28C64 20.268 57.732 14 50 14V14V33H64V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 26V33C53.25 34.7949 51.7949 36.25 50 36.25C48.2051 36.25 46.75 34.7949 46.75 33V26C46.75 24.2051 48.2051 22.75 50 22.75C51.7949 22.75 53.25 24.2051 53.25 26Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M74.5352 20.7593L80.3458 26.5699C80.9316 27.1557 80.9316 28.1055 80.3458 28.6913C79.76 29.277 78.8103 29.277 78.2245 28.6913L72.4138 22.8806L74.5352 20.7593Z",fill:"black",stroke:"black","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("circle",{cx:"66.5",cy:"15.5",r:"9.75",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"66",y:"11",width:"1",height:"9",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"}),a.createElementVNode("rect",{x:"71",y:"15",width:"1",height:"9",transform:"rotate(90 71 15)",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"})])],-1)),z5={class:"text-div text-center text mt-2"},V5={class:"box col d-flex flex-column align-bottom justify-center"},B5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("rect",{x:"65.0967",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"39.5488",y:"29.6777",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-90 39.5488 29.6777)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"60.4512",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(90 60.4512 34.3228)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"34.9033",y:"55.2261",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-180 34.9033 55.2261)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M77.7025 44.3796C77.9599 44.5798 77.9599 44.9688 77.7025 45.169L74.6621 47.5338C74.3337 47.7892 73.8551 47.5552 73.8551 47.1391L73.8551 42.4095C73.8551 41.9935 74.3337 41.7594 74.6621 42.0149L77.7025 44.3796Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M49.6047 17.0724C49.8049 16.815 50.1939 16.815 50.3941 17.0724L52.7589 20.1128C53.0143 20.4412 52.7803 20.9198 52.3642 20.9198L47.6346 20.9198C47.2185 20.9198 46.9845 20.4412 47.2399 20.1128L49.6047 17.0724Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M50.3953 46.9281C50.1951 47.1855 49.8061 47.1855 49.6059 46.9281L47.2411 43.8877C46.9857 43.5592 47.2197 43.0807 47.6358 43.0807L52.3654 43.0807C52.7815 43.0807 53.0155 43.5592 52.7601 43.8877L50.3953 46.9281Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M22.2975 45.1692C22.0401 44.969 22.0401 44.58 22.2975 44.3798L25.3379 42.0151C25.6663 41.7596 26.1449 41.9937 26.1449 42.4097L26.1449 47.1393C26.1449 47.5554 25.6663 47.7894 25.3379 47.534L22.2975 45.1692Z",fill:"#FF3E3E"})])],-1)),F5={class:"text-div text-center text mt-2"},H5={key:1,class:"d-flex tablet-mobile-content"},G5={class:"box col my-1"},W5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50.5",height:"32.5",viewBox:"0 0 101 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M68 28H87.9736M87.9736 28L82 34M87.9736 28L82 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M33.9727 28H13.999M13.999 28L19.9727 34M13.999 28L19.9727 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.0361 33.0479C60.7502 31.9809 59.6536 31.3478 58.5866 31.6337C57.5197 31.9195 56.8865 33.0162 57.1724 34.0831L56.7195 32.3928C56.3979 31.1925 55.1641 30.4802 53.9638 30.8018C52.7635 31.1234 52.0512 32.3572 52.3728 33.5575L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M53.7316 38.6286L52.6963 34.7649M52.6963 34.7649L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233V25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516V39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176V43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779V33.0779V33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.942 36.4286M52.6963 34.7649L52.3728 33.5575C52.0512 32.3572 52.7635 31.1234 53.9638 30.8018V30.8018C55.1641 30.4802 56.3979 31.1925 56.7195 32.3928L57.3018 34.5661M58.2077 37.9469L57.3018 34.5661M57.3018 34.5661L57.1724 34.0831C56.8865 33.0162 57.5197 31.9195 58.5866 31.6337V31.6337C59.6536 31.3478 60.7502 31.9809 61.0361 33.0479L61.942 36.4286M62.3302 37.8775L61.942 36.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),j5={class:"text text-col text-center"},X5={class:"box col my-1"},Y5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9927 29.9814C79.9871 22.2398 66.3311 15.9962 49.491 16.0358C32.651 16.0754 19.0039 22.3833 19.0095 30.1248C19.015 37.8663 32.6711 44.11 49.5111 44.0704C66.3512 44.0308 79.9982 37.7229 79.9927 29.9814Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L68.5361 36.0479C68.2502 34.9809 67.1536 34.3478 66.0866 34.6337C65.0197 34.9195 64.3865 36.0162 64.6724 37.0831L64.2195 35.3928C63.8979 34.1925 62.6641 33.4802 61.4638 33.8018C60.2635 34.1234 59.5512 35.3572 59.8728 36.5575L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M61.2316 41.6286L60.1963 37.7649M60.1963 37.7649L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233V28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516V42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176V46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779V36.0779V36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L69.442 39.4286M60.1963 37.7649L59.8728 36.5575C59.5512 35.3572 60.2635 34.1234 61.4638 33.8018V33.8018C62.6641 33.4802 63.8979 34.1925 64.2195 35.3928L64.8018 37.5661M65.7077 40.9469L64.8018 37.5661M64.8018 37.5661L64.6724 37.0831C64.3865 36.0162 65.0197 34.9195 66.0866 34.6337V34.6337C67.1536 34.3478 68.2502 34.9809 68.5361 36.0479L69.442 39.4286M69.8302 40.8775L69.442 39.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),q5={class:"text text-col text-center"},Z5={class:"box col my-1"},Q5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M31 24.9736L31 10M31 10L25 15.9736M31 10L37 15.9736",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M31 40L31 54.9736M31 54.9736L25 49M31 54.9736L37 49",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L56.0348 26.8433C55.4825 25.8867 54.2593 25.5589 53.3027 26.1112C52.3462 26.6635 52.0184 27.8867 52.5707 28.8433L51.6957 27.3277C51.0744 26.2516 49.6983 25.8828 48.6221 26.5042C47.546 27.1255 47.1773 28.5016 47.7986 29.5777L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852Z",fill:"white"}),a.createElementVNode("path",{d:"M50.4236 34.1244L48.4236 30.6603M48.4236 30.6603L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23V23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728V42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442V35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013V26.4013V26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L57.7848 29.8744M48.4236 30.6603L47.7986 29.5777C47.1773 28.5016 47.546 27.1255 48.6221 26.5042V26.5042C49.6983 25.8828 51.0744 26.2516 51.6957 27.3277L52.8207 29.2763M54.5707 32.3074L52.8207 29.2763M52.8207 29.2763L52.5707 28.8433C52.0184 27.8867 52.3462 26.6635 53.3027 26.1112V26.1112C54.2593 25.5589 55.4825 25.8867 56.0348 26.8433L57.7848 29.8744M58.5348 31.1734L57.7848 29.8744",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),J5={class:"text text-col text-center"},K5={class:"text-h6 text-capitalize"},$5={class:"mt-2"},ec={class:"d-flex justify-center align-center checkbox-container"},tc={class:"text-caption"},ic=ke(a.defineComponent({__name:"VTutorial",emits:["closeTutorial"],setup(e,{emit:t}){const i=t,r=a.inject(H1),n=a.ref(!1),o=a.ref(!1),s=a.computed(()=>[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(c=>navigator.userAgent.match(c)));function l(){i("closeTutorial",n.value)}return(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-card-title"),m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-divider"),v=a.resolveComponent("v-card-text"),_=a.resolveComponent("v-card-actions"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-expand-transition"),y=a.resolveComponent("v-checkbox");return a.openBlock(),a.createBlock(a.Transition,{name:"fade-transition"},{default:a.withCtx(()=>[a.createVNode(g,{class:"mx-auto",elevation:"16"},{default:a.withCtx(()=>[a.createVNode(u,{class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small"},{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),_:1}),a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",null,a.toDisplayString(a.unref(r).getLabel("disclaimerTextShort")),1),a.createVNode(m,{variant:"tonal",size:"small",onClick:c[0]||(c[0]=x=>o.value=!0),class:"text-capitalize mt-2"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("learnMore"))+" ",1),a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-right")]),_:1})]),_:1}),a.createVNode(f,{class:"my-3"}),s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",T5,[a.createElementVNode("div",I5,[a.createElementVNode("div",P5,[N5,a.createElementVNode("div",L5,a.toDisplayString(a.unref(r).getLabel("clickAndDragToLookAround")),1)]),a.createElementVNode("div",R5,[D5,a.createElementVNode("div",U5,a.toDisplayString(a.unref(r).getLabel("clickOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",k5,[O5,a.createElementVNode("div",z5,a.toDisplayString(a.unref(r).getLabel("useTheMouseWheelToZoom")),1)]),a.createElementVNode("div",V5,[B5,a.createElementVNode("div",F5,a.toDisplayString(a.unref(r).getLabel("youCanAlsoUseTheArrowKeysToMoveAround")),1)])])])),s.value?(a.openBlock(),a.createElementBlock("div",H5,[a.createElementVNode("div",G5,[W5,a.createElementVNode("div",j5,a.toDisplayString(a.unref(r).getLabel("tapAndDragToLookAround")),1)]),a.createElementVNode("div",X5,[Y5,a.createElementVNode("div",q5,a.toDisplayString(a.unref(r).getLabel("tapOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",Z5,[Q5,a.createElementVNode("div",J5,a.toDisplayString(a.unref(r).getLabel("useTwoFingersToZoom")),1)])])):a.createCommentVNode("",!0),a.createVNode(f,{class:"my-1"})]),_:1}),a.createVNode(p,null,{default:a.withCtx(()=>[o.value?(a.openBlock(),a.createBlock(g,{key:0,class:"position-absolute w-100 bg-white",height:"100%",style:{bottom:"0"}},{default:a.withCtx(()=>[a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",K5,[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),a.createElementVNode("p",$5,a.toDisplayString(a.unref(r).getLabel("disclaimerText")),1)]),_:1}),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",size:"small",onClick:c[1]||(c[1]=x=>o.value=!1),class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-left")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("back")),1)]),_:1})]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",ec,[a.createVNode(y,{density:"compact",modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=x=>n.value=x),"hide-details":""},{label:a.withCtx(()=>[a.createElementVNode("span",tc,a.toDisplayString(a.unref(r).getLabel("dontShowAgain")),1)]),_:1},8,["modelValue"])]),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",onClick:c[3]||(c[3]=x=>l()),block:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("iUnderstand")),1)]),_:1})]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-627f8ee6"]]),rc=e=>(a.pushScopeId("data-v-bd4f66c3"),e=e(),a.popScopeId(),e),ac={class:"player-settings-ui"},nc={id:"settings-ui-form"},oc={class:"form-inputs"},sc={class:"setting-label"},lc={class:"setting-label"},cc=["max","min","step"],dc={class:"setting-label"},hc={class:"flex-grow-1 flex-shrink-0"},uc=["onUpdate:modelValue"],mc={key:3,"d-block":"",class:"mt-3"},fc={class:"d-flex justify-space-between"},pc={class:"setting-label"},gc={class:"mt-5 d-block",style:{width:"300px"}},_c=rc(()=>a.createElementVNode("div",{class:"setting-label"},"Enter Lut URL:",-1)),vc={class:"d-block",style:{width:"300px"}},xc={class:"form-buttons"},yc=ke(a.defineComponent({__name:"VPlayerSettingsUi",props:{initialSettings:{}},emits:["updateSettings","saveSettings"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(f(i.initialSettings));a.watch(n,()=>{s()},{deep:!0});const o=a.computed(()=>{let v={};for(const[_,g]of Object.entries(n.value))_==="whitePoint"?v[_]=h(g.value):v[_]=g.value;return v});function s(){r("updateSettings",o.value)}function l(){const v=document.createElement("a");v.href=URL.createObjectURL(new Blob([JSON.stringify(o.value,null,2)]));const _=`player-settings-${Date.now()}.json`;v.download=_,v.style.display="none",document.body.appendChild(v),v.click(),document.body.removeChild(v)}function d(){r("saveSettings",o.value)}function c(){n.value=f(),r("updateSettings",o.value)}function h(v){const _=parseInt(v.substr(1,2),16)/255,g=parseInt(v.substr(3,2),16)/255,p=parseInt(v.substr(5,2),16)/255;return[_,g,p]}function u(v){var _=v.toString(16);return _.length==1?"0"+_:_}function m([v,_,g]){return"#"+u(parseInt((v*255).toString()))+u(parseInt((_*255).toString()))+u(parseInt((g*255).toString()))}function f(v={}){const _=["Cool 5","Cool 10","Cool 15","Cool 20","Cool 25","Warm 20","Warm 25","Warm 10","Warm 15","Warm 5","bw"];let g={temperature:6500,targetLuminance:1,exposureFovScale:.6,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:"",...v};return{exposureFovScale:{label:"Exposure Fov Scale",type:"slider",min:0,max:1,step:.01,value:g.exposureFovScale},targetLuminance:{label:"Target Luminance",type:"slider",min:0,max:15,step:.1,value:g.targetLuminance},sharpenFilter_amount:{label:"Sharpen Filter Amount",type:"slider",min:0,max:100,step:.1,value:g.sharpenFilter_amount},UNREAL_BLOOM_ENABLED:{label:"Enable Bloom?",type:"boolean",value:g.UNREAL_BLOOM_ENABLED},UNREAL_BLOOM_STRENGTH:{label:"Bloom Strength",type:"slider",min:0,max:1,step:.01,value:g.UNREAL_BLOOM_STRENGTH},TRANSITION_MOVEMENT_SCALE:{label:"Transition Movement Speed",type:"slider",min:.2,max:25,step:.1,value:g.TRANSITION_MOVEMENT_SCALE},temperature:{label:"Temperature / White Balance",type:"slider",min:1e3,max:12e3,step:1,value:g.temperature},whitePoint:{label:"White Point",type:"color",value:m(g.whitePoint)},lut:{label:"Lut",type:"lut",items:_.map(p=>({text:p,value:`https://cdn.visuado.com/luts/${p}.png`})),value:g.lut}}}return(v,_)=>{const g=a.resolveComponent("v-text-field"),p=a.resolveComponent("v-slider"),y=a.resolveComponent("v-checkbox"),x=a.resolveComponent("v-btn"),b=a.resolveComponent("v-select"),N=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",ac,[a.createElementVNode("form",nc,[a.createElementVNode("div",oc,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(A,C,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,"d-block":""},[A.type==="slider"?(a.openBlock(),a.createBlock(p,{key:0,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s,max:A.max,min:A.min,step:A.step},{prepend:a.withCtx(()=>[a.createElementVNode("div",sc,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",type:"number",max:A.max,min:A.min,step:A.step,style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue","max","min","step"])])]),_:2},1032,["modelValue","onUpdate:modelValue","max","min","step"])):a.createCommentVNode("",!0),A.type==="boolean"?(a.openBlock(),a.createBlock(y,{key:1,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s},{prepend:a.withCtx(()=>[a.createElementVNode("div",lc,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,a.toDisplayString(A.value),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.createCommentVNode("",!0),A.type==="color"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"d-flex",max:A.max,min:A.min,step:A.step},[a.createElementVNode("div",dc,a.toDisplayString(A.label),1),a.createElementVNode("div",hc,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S=>n.value[C].value=S,type:"color",onChange:s},null,40,uc),[[a.vModelText,n.value[C].value]])]),a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",readonly:"",type:"text",style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue"])])],8,cc)):a.createCommentVNode("",!0),A.type==="lut"?(a.openBlock(),a.createElementBlock("div",mc,[a.createElementVNode("div",fc,[a.createElementVNode("div",pc,a.toDisplayString(A.label),1),a.createElementVNode("div",null,[a.createVNode(x,{class:"ml-2","x-small":"",onClick:S=>n.value[C].value=null},{default:a.withCtx(()=>[a.createTextVNode(" Clear Lut ")]),_:2},1032,["onClick"])])]),a.createElementVNode("div",null,[a.createElementVNode("div",gc,[a.createElementVNode("div",null,[a.createVNode(b,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,items:A.items,"item-title":"title","item-value":"value",dense:"",label:"Select Lut",onChange:s},null,8,["modelValue","onUpdate:modelValue","items"])])]),a.createElementVNode("div",null,[_c,a.createElementVNode("div",vc,[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",type:"url",onChange:s},null,8,["modelValue","onUpdate:modelValue"])])])])])])):a.createCommentVNode("",!0)]))),128))]),a.createElementVNode("div",xc,[a.createVNode(x,{onClick:_[0]||(_[0]=A=>c())},{default:a.withCtx(()=>[a.createTextVNode("Reset")]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[1]||(_[1]=A=>l())},{default:a.withCtx(()=>[a.createTextVNode(" Download Json "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-download")]),_:1})]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[2]||(_[2]=A=>d())},{default:a.withCtx(()=>[a.createTextVNode(" Save Settings "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-save")]),_:1})]),_:1})])])])}}}),[["__scopeId","data-v-bd4f66c3"]]),Sc={class:"top-left"},Mc={class:"top-right"},wc={class:"header-slot anchor elevation-5"},Ac={id:"moveableBody",class:"body-slot moveable-body d-flex justify-center align-center position-relative"},Ec={class:"moveable-footer elevation-5"},bc=ke(a.defineComponent({__name:"VMoveable",props:{size:{}},setup(e,{expose:t}){const i=a.ref(void 0),r=a.ref(void 0);t({bodyWidth:i,bodyHeight:r}),a.onMounted(()=>{o(document.getElementById("moveableDiv")),n(document.querySelector("#moveableDiv"))});const n=s=>{new ResizeObserver(()=>{const d=document.getElementById("moveableBody");d&&(i.value=d.clientWidth,r.value=d.clientHeight)}).observe(s)},o=s=>{const l=document.getElementsByClassName("anchor");for(let _=0;_<l.length;_++){const g=l[_];g.addEventListener("touchstart",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!1}),g.addEventListener("mousedown",m,{passive:!1}),g.addEventListener("mouseup",v,{passive:!1})}let d=0,c=0,h=0,u=0;function m(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchstart"&&(g=_.touches[0]),h=g.clientX,u=g.clientY,document.addEventListener("mouseup",v,{passive:!1}),document.addEventListener("touchend",v,{passive:!1}),document.addEventListener("mousemove",f,{passive:!1}),document.addEventListener("touchmove",f,{passive:!1})}function f(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchmove"&&(g=_.touches[0]),d=h-g.clientX,c=u-g.clientY,h=g.clientX,u=g.clientY,s.style.top=s.offsetTop-c+"px",s.style.left=s.offsetLeft-d+"px"}function v(){document.removeEventListener("mouseup",v,!1),document.removeEventListener("mousemove",f,!1),document.removeEventListener("touchend",v,!1),document.removeEventListener("touchmove",f,!1)}};return(s,l)=>(a.openBlock(),a.createElementBlock("div",{id:"moveableDiv",class:a.normalizeClass([s.size,"sizer rounded"])},[a.createElementVNode("div",Sc,[a.renderSlot(s.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",Mc,[a.renderSlot(s.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",wc,[a.renderSlot(s.$slots,"header",{},void 0,!0)]),a.createElementVNode("div",Ac,[a.renderSlot(s.$slots,"body",{},void 0,!0)]),a.createElementVNode("div",Ec,[a.renderSlot(s.$slots,"footer",{},void 0,!0)])],2))}}),[["__scopeId","data-v-a4cb28cf"]]),Cc={class:"rotation-marker-svg",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg"},Tc=a.createStaticVNode('<defs><radialGradient id="Gradient" cx="0" cy="0" r="0.9" fx="0" fy="0"><stop offset="0%" class="stop1"></stop><stop offset="60%" class="stop2"></stop><stop offset="90%" class="stop3"></stop></radialGradient><linearGradient id="LineGradient" gradientTransform="rotate(90)"><stop offset="0%" class="stop1"></stop><stop offset="75%" class="stop2"></stop><stop offset="100%" class="stop3"></stop></linearGradient></defs>',1),Ic=["transform"],Pc=[a.createStaticVNode('<rect id="field-of-view-gradient" x="20" y="20" width="38" height="38" transform="rotate(0)" transform-origin="20 20" fill="url(#Gradient)"></rect><rect class="field-of-view-border" x="20" y="20" width="1" height="25" fill="url(#LineGradient)" transform="rotate(0)" transform-origin="20 20"></rect><rect class="field-of-view-border" x="19" y="19" width="1" height="25" fill="url(#LineGradient)" transform="rotate(-90)" transform-origin="20 20"></rect><circle cx="20" cy="20" r="5" fill="white"></circle><circle cx="20" cy="20" r="3" fill="red"></circle>',5)],Nc=a.defineComponent({__name:"VRotationMarker",props:{rotation:{}},setup(e){return(t,i)=>(a.openBlock(),a.createElementBlock("svg",Cc,[Tc,a.createElementVNode("g",{"transform-origin":"20 20",transform:`rotate(${45+t.rotation})`},Pc,8,Ic)]))}}),Lc={class:"minimap-wrapper"},Rc={class:"minimap-container"},Dc=["id"],C3=ke(a.defineComponent({__name:"VMiniMapMap",props:{backgroundImage:{},allCameras:{},storey:{},currentCamera:{},rotation:{},transformAngle:{},containerWidth:{},containerHeight:{},fit:{type:Boolean}},emits:["goToCamera"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(512),o=a.ref(384),s=a.ref(512),l=a.ref(384),d=a.ref(new U2.Vector3),c=a.ref(new U2.Object3D),h=a.ref({}),u=a.ref(1),m=a.ref(),f=n.value/n.value,v=a.computed(()=>{const V=i.containerWidth/i.containerHeight;let q;return V>f?q=i.containerHeight/o.value:q=i.containerWidth/n.value,q}),_=a.computed(()=>i.allCameras),g=a.computed(()=>i.allCameras.find(V=>V.id===i.currentCamera)),p=a.computed(()=>i.rotation),y=a.computed(()=>new U2.Vector3(i.storey.position.x,i.storey.position.y,i.storey.position.z)),x=a.computed(()=>parseFloat(g.value.floor_vertical_position)),b=a.computed(()=>_.value.map(V=>{const q=V.uposition.split(","),W=new U2.Vector3(Number(q[0])-y.value.x,0,Number(q[2])-y.value.z);return{...V,...M(d.value,W)}})),N=a.computed(()=>({backgroundImage:`url(${i.backgroundImage})`,backgroundSize:"contain"})),A=a.computed(()=>({transform:`scale(${i.fit?1:v.value*.75}) rotate(${i.transformAngle}deg)`}));a.onMounted(()=>{k(),U(),R();const V=document.getElementById("moveableDiv");V&&(m.value=new ResizeObserver(R).observe(V))}),a.onBeforeUpdate(()=>{k(),U()}),a.onBeforeUnmount(()=>{m.value&&m.value.unobserve(document.getElementById("moveableDiv"))});function C(V){return U2.MathUtils.degToRad(V)}function U(){c.value.rotation.x=180,c.value.rotation.y=i.storey.rotation.y*-1,h.value={transform:`rotateZ(${c.value.rotation.y}deg) rotateX(${c.value.rotation.x}deg)`}}function S(V){return{top:`${Math.abs(V.top)}%`,left:`${Math.abs(V.left)}%`}}function M(V,q){var W=new U2.Vector3;const Q=W.subVectors(V,q);return{relativePosition:Q,left:Q.x/s.value*100,top:Q.z/l.value*100}}function k(){const V=i.storey.position.y-x.value;l.value=2*(V*Math.tan(C(i.storey.fovY/2))),s.value=512/384*l.value;const q=l.value/2,W=s.value/2,Q=new U2.Vector3(W*-1,0,q*-1);d.value=Q}function R(){const V=document.getElementById("moveableDiv");if(!V)return;const q=V.offsetHeight/384*.8,W=V.offsetWidth/512*.8;V.offsetHeight>V.offsetWidth?u.value=W*.5:u.value=q*.9}function D(V){const W=V.currentTarget.getBoundingClientRect(),Q=V.clientX-W.left,z=V.clientY-W.top,J=document.querySelectorAll(".single-camera-marker");let j=null,de=1/0;if(J.forEach(oe=>{const X=oe,K=X.getBoundingClientRect(),le=K.left+K.width/2-W.left,ce=K.top+K.height/2-W.top,ae=Math.sqrt((Q-le)**2+(z-ce)**2);ae<de&&(de=ae,j=X)}),j){const oe=j.getBoundingClientRect(),X=oe.left+oe.width/2,K=oe.top+oe.height/2;for(let ce=0;ce<3;ce++){const ae=document.createElement("div");ae.className="ripple-effect",ae.style.position="fixed",ae.style.left=`${X}px`,ae.style.top=`${K}px`,ae.style.pointerEvents="none",ae.style.animationDelay=`${ce*.5}s`,document.body.appendChild(ae),setTimeout(()=>{ae.remove()},500+ce*500)}const le=j.id.split("single-camera-marker-")[1];le&&r("goToCamera",le)}}return(V,q)=>(a.openBlock(),a.createElementBlock("div",Lc,[a.createElementVNode("div",Rc,[a.createElementVNode("div",{class:"web-minimap",style:a.normalizeStyle(A.value),onClick:D},[a.createElementVNode("div",{class:"minimap-background-image",style:a.normalizeStyle(N.value)},null,4),a.createElementVNode("div",{class:"center-pivot",style:a.normalizeStyle(h.value)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,W=>(a.openBlock(),a.createElementBlock("div",{key:W.id},[g.value.floorLevel===W.floorLevel?(a.openBlock(),a.createElementBlock("div",{key:0,class:"single-camera-marker",id:`single-camera-marker-${W.id}`,style:a.normalizeStyle(S(W))},null,12,Dc)):a.createCommentVNode("",!0),a.renderSlot(V.$slots,"default",{id:W.id,camera:W,active:g.value.id===W.id,style:a.normalizeStyle({...S(W),position:"absolute",zIndex:"3"})},()=>[g.value.id===W.id&&i.rotation!==null?(a.openBlock(),a.createBlock(Nc,{key:0,class:"rotation-marker-component-base rotation-marker-component",rotation:p.value,style:a.normalizeStyle({...S(W)})},null,8,["rotation","style"])):a.createCommentVNode("",!0)],!0)]))),128))],4)],4)])]))}}),[["__scopeId","data-v-03e6f060"]]),T3=ke(a.defineComponent({__name:"VMiniMapCompass",props:{scale:{},rotation:{},transformAngle:{}},setup(e){const t=e,i=a.computed(()=>t.rotation+t.transformAngle-90);return(r,n)=>(a.openBlock(),a.createElementBlock("div",{class:"minimap-compass elevation-5",style:a.normalizeStyle({scale:r.scale})},[a.createVNode(E3,{class:"north-indicator",longitude:i.value},null,8,["longitude"])],4))}}),[["__scopeId","data-v-d047dca8"]]),Uc={class:"ss-wrapper"},kc={class:"slider"},Oc={class:"minimap-sun-slider"},zc={class:"d-flex flex-column align-center justify-center"},Vc={key:0,class:"time-label"},I3=ke(a.defineComponent({__name:"VSunSimulationSlider",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},level:{}},emits:["setBackgroundImage"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(new Date().getHours()),o=a.ref(!0),s=a.ref(!0),l=a.ref(""),d=a.ref(new Map),c=a.computed(()=>i.minimapJson.storeys[i.level]),h=a.computed(()=>`${Math.floor(n.value).toString().padStart(2,"0")}:00`),u=a.computed(()=>{if(c.value.sunsimFilesTimeStamps[n.value]){const p=c.value.sunsimFilesTimeStamps[n.value].split(" ");return`${p[0]} ${p[1]}`}return""});a.onMounted(async()=>{l.value=await v(c.value.sunsimFiles[n.value]),r("setBackgroundImage",l.value),s.value=!1;const p=await f(i.minimapJson.storeys);d.value=p,o.value=!1,r("setBackgroundImage",m(i.level,n.value))}),a.watch(n,()=>{const p=m(i.level,n.value);r("setBackgroundImage",p)}),a.watch(()=>i.level,()=>{r("setBackgroundImage",m(i.level,n.value))},{immediate:!0});function m(p,y){return d.value.get(`sunsim${p}_${y}`)?d.value.get(`sunsim${p}_${y}`):""}async function f(p){let y=new Map;for(let x=0;x<p.length;x++){const b=p[x].sunsimFiles;for(let N=0;N<b.length;N++){const A=b[N];try{const C=A,U=A.split("."),S=await v(C);y.set(U[0],S)}catch{continue}}}return y}async function v(p){const x=await(await fetch(l1(i.cdnFileResolver,`/${i.apartmentJson.type}/${i.apartmentJson.id}/minimap/${p}`))).blob(),b=await g(x);return _(b)}function _(p){return"data:image/jpeg;base64,"+p}async function g(p){return new Promise((y,x)=>{const b=new FileReader;b.onload=()=>{const N=b.result.split(",")[1];y(N)},b.onerror=x,b.readAsDataURL(p)})}return(p,y)=>{const x=a.resolveComponent("v-progress-linear"),b=a.resolveComponent("v-icon"),N=a.resolveComponent("v-slider");return a.openBlock(),a.createElementBlock("div",Uc,[a.createElementVNode("div",kc,[a.createElementVNode("div",Oc,[o.value?(a.openBlock(),a.createBlock(x,{key:0,indeterminate:"",rounded:"",height:"6",color:"grey lighten-1",class:"mr-2"})):(a.openBlock(),a.createBlock(N,{key:1,modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=A=>n.value=A),min:0,max:23,step:1,color:"#373737","track-color":"#373737","thumb-color":"#373737","hide-details":!0,"thumb-label":"always"},{prepend:a.withCtx(()=>[a.createElementVNode("div",zc,[a.createVNode(b,{color:"#ffab02"},{default:a.withCtx(()=>[a.createTextVNode("mdi-white-balance-sunny")]),_:1}),a.createElementVNode("span",null,a.toDisplayString(u.value),1)])]),"thumb-label":a.withCtx(()=>[a.createTextVNode(a.toDisplayString(h.value),1)]),_:1},8,["modelValue"]))]),o.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Vc))])])}}}),[["__scopeId","data-v-52f122f2"]]),Bc=e=>(a.pushScopeId("data-v-8c96c13c"),e=e(),a.popScopeId(),e),Fc={class:"left"},Hc={class:"right"},Gc=Bc(()=>a.createElementVNode("div",{class:"d-flex justify-space-between pa-1"},[a.createElementVNode("div",{class:"center"}," ")],-1)),Wc={class:"map-container"},Y0=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},currentCamera:{},level:{},rotation:{}},emits:["close","goToCamera"],setup(e,{emit:t}){const i=a.ref(null),r=e,n=t,o=a.ref(),s=a.ref(0),l=a.computed(()=>r.minimapJson.storeys[r.level]),d=a.ref(0);a.watch(()=>r.apartmentJson,()=>{d.value=d.value+1}),a.watch(l,()=>{o.value=l.value.defaultSunsimFile?`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/sunsim0_13.jpg`:`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/${l.value.defaultSunsimFile}`},{immediate:!0,once:!0});const c=a.computed(()=>{let p=1;return s.value!==0&&(Math.abs(s.value)%180===0?p=1:p=-1),f.value==="small"&&(p=.6),p});function h(p){o.value=p}const u=["big","bigger","small"];function m(){const y=(u.indexOf(f.value)+1)%u.length;f.value=u[y]}const f=a.ref("big");function v(){s.value=s.value+90}const _=()=>{n("close")};function g(p){n("goToCamera",p)}return(p,y)=>{const x=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(bc,{ref_key:"minimapMoveable",ref:i,size:f.value},{"top-left":a.withCtx(()=>[a.createElementVNode("div",Fc,[a.createVNode(x,{icon:"mdi-window-close",size:"x-small",onClick:_})])]),"top-right":a.withCtx(()=>[a.createElementVNode("div",Hc,[a.createVNode(x,{class:"rotate-icon",size:"x-small",icon:"mdi mdi-rotate-right",onClick:a.withModifiers(v,["stop"]),title:"Rotate"}),a.createVNode(x,{class:"resize-icon ml-1",icon:"mdi-image-size-select-small",size:"x-small",onClick:m,title:"Resize"})])]),header:a.withCtx(()=>[Gc]),body:a.withCtx(()=>[a.createVNode(T3,{scale:c.value,rotation:l.value.rotation.y,"transform-angle":s.value},null,8,["scale","rotation","transform-angle"]),a.createElementVNode("div",Wc,[a.createVNode(C3,{"transform-angle":s.value,"all-cameras":p.apartmentJson.cameras,"background-image":o.value,rotation:p.rotation,"current-camera":p.currentCamera,storey:l.value,containerWidth:i.value&&i.value.bodyWidth||512,containerHeight:i.value&&i.value.bodyHeight||384,onGoToCamera:g},null,8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey","containerWidth","containerHeight"])])]),footer:a.withCtx(()=>[(a.openBlock(),a.createBlock(I3,{key:d.value,"cdn-file-resolver":r.cdnFileResolver,"minimap-json":r.minimapJson,"apartment-json":r.apartmentJson,level:r.level,onSetBackgroundImage:h},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"]))]),_:1},8,["size"])}}}),[["__scopeId","data-v-8c96c13c"]]);function ni(e){const t=e*60,i=Math.floor(t/60),r=t%60;return`${i.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}const jc={class:"d-flex align-center"},Xc={class:"d-block mr-1"},Yc={class:"small"},qc={class:"small"},q0=ke(a.defineComponent({__name:"VSunsimSlider",props:{currentDay:{},currentTime:{},disabled:{type:Boolean}},emits:["onTimeChange","toggleSunStudy"],setup(e,{emit:t}){const i=e,{currentDay:r,currentTime:n,disabled:o}=a.toRefs(i),s=t,l=a.ref(n.value.timeInHours);return a.watch(n,()=>{l.value=n.value.timeInHours}),a.watch(l,()=>{s("onTimeChange",r.value.timeSamples.find(d=>d.timeInHours===l.value))},{immediate:!0}),(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-slider"),m=a.resolveComponent("v-field"),f=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",jc,[a.createElementVNode("div",Xc,[a.createVNode(m,{class:"ss-slider-field",style:{},variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.unref(r).timeSamples.length>1?(a.openBlock(),a.createBlock(u,{key:0,class:"pa-2 pr-2",modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=v=>l.value=v),min:a.unref(r).startTime,max:a.unref(r).endTime,step:a.unref(r).interval,disabled:!!a.unref(o),density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(h,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Yc,a.toDisplayString(a.unref(ni)(l.value)),1)]),_:1},8,["modelValue","min","max","step","disabled"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(h,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",qc,a.toDisplayString(a.unref(ni)(l.value)),1)],64))]),_:1})]),a.createElementVNode("div",null,[a.createVNode(f,{size:"small",class:"sun-study-toggle text-capitalize rounded-xl",icon:"mdi-close",onClick:c[1]||(c[1]=v=>s("toggleSunStudy"))})])])}}}),[["__scopeId","data-v-c06c753d"]]),Zc=a.defineComponent({__name:"VSunStudyToggle",props:{displaySunsim:{type:Boolean},showUI:{type:Boolean}},emits:["toggleSunStudy"],setup(e,{emit:t}){const i=t,r=a.inject(H1);return(n,o)=>{const s=a.resolveComponent("v-btn");return!n.displaySunsim&&n.showUI?(a.openBlock(),a.createBlock(s,{key:0,size:"small",varient:"tonal",prependIcon:"mdi-white-balance-sunny",class:"sun-study-toggle text-capitalize rounded-xl",onClick:o[0]||(o[0]=l=>i("toggleSunStudy"))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("openSunStudy")),1)]),_:1})):a.createCommentVNode("",!0)}}}),Z0=ke(a.defineComponent({__name:"VAutoplay",props:{autoplayStatus:{type:Boolean}},emits:["toggleAutoPlay"],setup(e,{emit:t}){const i=t,r=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));return(n,o)=>{const s=a.resolveComponent("v-icon"),l=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(l,{size:"x-small",class:a.normalizeClass(["autoplay-btn",{mobile:r.value,"mt-1":r.value,"mx-1":r.value}]),onClick:o[0]||(o[0]=d=>i("toggleAutoPlay"))},{default:a.withCtx(()=>[a.createVNode(s,{icon:n.autoplayStatus?"mdi-pause":"mdi-play",size:"x-large",class:"pa-0 ma-0"},null,8,["icon"])]),_:1},8,["class"])}}}),[["__scopeId","data-v-7fd2b4f3"]]),Qc={key:0,class:"sun-icon-wrapper"},Jc=37,Kc=39,xa=ke(a.defineComponent({__name:"VWaypointCarousel",props:{thumbnails:{},active:{},cameraHasSunStudy:{type:Function,default:e=>!1}},emits:["previous","next","goto"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(0),o=a.computed({get(){return i.active},set(c){n.value=c}}),s=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));a.onMounted(()=>{window.addEventListener("keydown",l)}),a.onBeforeUnmount(()=>{window.removeEventListener("keydown",l)});function l(c){switch(c.keyCode){case c.keyCode===Jc:r("previous");break;case c.keyCode===Kc:r("next");break;default:return}}function d(c,h){h(),r("goto",c)}return(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-img"),f=a.resolveComponent("v-icon"),v=a.resolveComponent("v-card"),_=a.resolveComponent("v-slide-group-item"),g=a.resolveComponent("v-slide-group");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["d-flex align-center justify-center",{mobileWaypointWrapper:s.value,desktopWaypointWrapper:!s.value," waypoint-carousel":!0}])},[a.renderSlot(c.$slots,"before",{},void 0,!0),a.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":h[2]||(h[2]=p=>o.value=p),class:a.normalizeClass({mobileWaypoint:s.value}),"active-class":"active-apt","selected-class":"active-apt","show-arrows":!s.value,"center-active":"",mandatory:""},{prev:a.withCtx(()=>[s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass(["carousel-button",{mobile:s.value}]),icon:"mdi-chevron-left",varient:"tonal",size:"small",onClick:h[0]||(h[0]=p=>r("previous"))},null,8,["class"]))]),next:a.withCtx(()=>[s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass(["carousel-button",{mobile:s.value}]),icon:"mdi-chevron-right",varient:"tonal",size:"small",onClick:h[1]||(h[1]=p=>r("next"))},null,8,["class"]))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.thumbnails,p=>(a.openBlock(),a.createBlock(_,{key:p.id},{default:a.withCtx(({toggle:y,selectedClass:x})=>[a.createVNode(v,{class:a.normalizeClass(["position-relative",[s.value?"ma-0":"ma-1",x,"single-waypoint"]]),align:"center",justify:"center",style:{overflow:"hidden"},onClick:b=>d(p.id,y)},{default:a.withCtx(()=>[a.createVNode(m,{cover:"","aspect-ratio":1,src:p.thumbnailUrl},null,8,["src"]),i.cameraHasSunStudy(p.id)?(a.openBlock(),a.createElementBlock("div",Qc,[a.createVNode(f,{class:"sun-icon",icon:"mdi-white-balance-sunny"})])):a.createCommentVNode("",!0)]),_:2},1032,["class","onClick"])]),_:2},1024))),128))]),_:1},8,["modelValue","class","show-arrows"]),a.renderSlot(c.$slots,"after",{},void 0,!0)],2)}}}),[["__scopeId","data-v-9cc758dc"]]),$c={id:"share-btns-wrapper",class:"text-center"},Q0=ke(a.defineComponent({__name:"VSocialShare",setup(e){const t=a.inject(H1),i=a.ref(!1),r=a.ref(location.href);function n(){return window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href),"facebook-share-dialog","width=626,height=436"),!1}function o(){return window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(location.href),"twitter-share-dialog","width=626,height=436"),!1}function s(){return window.open("https://www.linkedin.com/sharing/share-offsite/?url="+encodeURIComponent(location.href),"linkedin-share-dialog","width=626,height=736"),!1}function l(){navigator.clipboard.writeText(location.href)}return(d,c)=>{const h=a.resolveComponent("v-btn"),u=a.resolveComponent("v-tooltip"),m=a.resolveComponent("v-toolbar-title"),f=a.resolveComponent("v-spacer"),v=a.resolveComponent("v-toolbar"),_=a.resolveComponent("v-card-text"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-dialog");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(u,{elevation:"2",top:"",attach:""},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({density:"comfortable",elevation:"1",icon:"mdi-share-variant",onClick:c[0]||(c[0]=x=>i.value=!i.value)},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(p,{id:"share-box",width:"400",modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=y=>i.value=y)},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(v,{elevation:"0"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small",icon:"mdi-close",onClick:c[1]||(c[1]=y=>i.value=!1)}),a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(f)]),_:1}),a.createVNode(_,{class:"mt-5"},{default:a.withCtx(()=>[a.createElementVNode("p",$c,[a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-facebook"},y,{onClick:n}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToFacebook")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-linkedin"},y,{onClick:s}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToLinkedin")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-twitter"},y,{onClick:o}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToTwitter")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-email",link:"",href:`mailto:?body=${r.value}`},y),null,16,["href"])]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareViaEmail")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-content-copy",onClick:l},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("copyLink")),1)]),_:1}),a.createVNode(f)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-bb7d0a99"]]),ed={class:"static-image-wrapper"},J0=ke(a.defineComponent({__name:"VSingleImage",props:{image:{},aspectRatio:{default:"wide"}},setup(e){const t=e,i=a.computed(()=>({"background-image":`url("${encodeURI(t.image)}")`}));return(r,n)=>(a.openBlock(),a.createElementBlock("div",ed,[a.createElementVNode("div",{class:a.normalizeClass(["img-div",[r.aspectRatio]]),style:a.normalizeStyle(i.value)},null,6)]))}}),[["__scopeId","data-v-31489804"]]),td={id:"btn-fullscreen",class:"btn-placeholder mr-2"},K0=a.defineComponent({__name:"VFullScreenButton",props:{isFullScreen:{type:Boolean}},emits:["toggleFullscreen"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",td,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:r.isFullScreen?"mdi-fullscreen-exit":"mdi-fullscreen",onClick:n[0]||(n[0]=s=>i("toggleFullscreen"))},null,8,["icon"])])}}});class h2{constructor({labels:t,language:i}={labels:null,language:null}){D2(this,"_labels");D2(this,"_language");t?this._labels={...t||{}}:fetch("https://l10n.visuado.com/all.json").then(r=>r.json()).then(r=>{this._labels=r}),this._language=i||"nb"}getLabel(t){return this._labels&&this._language in this._labels&&t in this._labels[this._language]?this._labels[this._language][t]:t}get(t){return typeof t=="string"?t:typeof t=="object"&&this._language in t&&t[this._language]?t[this._language]:""}}class P3{constructor(t,i){D2(this,"_doc");D2(this,"_elemId");D2(this,"_state");this._doc=t,this._elemId=i,this._state={isActive:!1}}get isActive(){return this._state.isActive}setup(){const t=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"],i=this._getElement();t.forEach(r=>{i.addEventListener(r,this._toggle.bind(this),!1)})}toggle(){this.isActive?this._exit():this._enter()}_enter(){const t=this._getElement(),i=t.requestFullscreen||t.webkitRequestFullscreen||t.mozRequestFullscreen||t.msRequestFullscreen;i&&i.apply(t)}_exit(){const t=this._doc.exitFullscreen||this._doc.webkitExitFullscreen||this._doc.mozExitFullscreen||this._doc.document.msExitFullscreen;t&&t.apply(document)}_getElement(){return this._doc.getElementById(this._elemId)}_toggle(){const t=!!(this._doc.fullscreenElement||this._doc.webkitFullscreenElement||this._doc.mozFullscreenElement||this._doc.msFullscreenElement);this._state.isActive=t}}function Cr(e){return("0"+e).slice(-2)}function id(){const e=new Date;return[e.getFullYear().toString(),Cr(e.getMonth()+1),Cr(e.getDate())," ",Cr(e.getHours()),Cr(e.getMinutes()),Cr(e.getSeconds())].join("")}function rd(){return"Visuado-Snapshot-"+id()}let $0=class{constructor(t,i){D2(this,"data");this.data=t}download(t=null){t=t||rd();const i=document.createElement("a");typeof i.download=="string"?(document.body.appendChild(i),i.download=t,i.href=this.data,i.click(),document.body.removeChild(i)):location.replace(this.data)}};const ad={id:"btn-magic",class:"btn-placeholder mr-2"},nd=a.defineComponent({__name:"VVisuadoCreateButton",emits:["onSnapshot"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",ad,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:"mdi-creation",onClick:n[0]||(n[0]=s=>i("onSnapshot"))})])}}}),od={key:0,class:"player-error"},sd={class:"player-and-components-wrapper"},ld={key:3,class:"settings-panel"},cd={key:0,class:"compass-wrapper"},dd={key:1,class:"btn-placeholder mr-2"},hd={class:"btn-placeholder mr-2"},ud={key:2,class:"btn-placeholder mr-2"},md={key:3,class:"btn-placeholder mr-2"},fd={class:"d-flex flex-column align-end"},pd={key:0,class:"d-flex align-center flex-column sun-study mt-2"},gd={key:2,class:"render-version"},eo=ke(a.defineComponent({__name:"VVirtualTour",props:{cdnFileResolver:{},apartmentId:{},defaultInteriorId:{},validInteriorIds:{default:()=>[]},displayViewModeSwitch:{type:Boolean,default:!0},websiteUrl:{},i18nConfig:{},showCarousel:{type:Boolean,default:!0},showTimeOfDay:{type:Boolean,default:!0},showCompass:{type:Boolean,default:!0},showFullScreen:{type:Boolean,default:!0},showSnapshot:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},showInteriorOptions:{type:Boolean,default:!0},showMiniMap:{type:Boolean,default:!0},showFloorLevel:{type:Boolean,default:!0},defaultWaypointIndex:{default:0},defaultViewMode:{default:"virtualTour"},mouseSensitivity:{default:1},isInIframe:{type:Boolean},adminMode:{type:Boolean,default:!1},playerSettings:{default:()=>({temperature:6500,targetLuminance:1,exposureFovScale:.3,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:""})},hasMarkersJson:{type:Boolean,default:!1},dynamicMarkers:{default:null},version:{},showVersion:{type:Boolean,default:!0},enableAutoplay:{type:Boolean,default:!1},showVisuadoCreateButton:{type:Boolean,default:!1}},emits:["onSnapshot","onVisuadoCreateButtonClicked","saveSettings","onInteriorUpdate","onCameraUpdate","onSunsimUpdate","onError","onFrontendMarkersUpdate","onInitialized"],setup(e,{expose:t,emit:i}){const r=e,{cdnFileResolver:n,apartmentId:o,defaultInteriorId:s,validInteriorIds:l,displayViewModeSwitch:d,i18nConfig:c,showCarousel:h,showTimeOfDay:u,showCompass:m,showFullScreen:f,showSnapshot:v,showShare:_,showInteriorOptions:g,showMiniMap:p,showFloorLevel:y,defaultWaypointIndex:x,defaultViewMode:b,mouseSensitivity:N,adminMode:A,playerSettings:C,hasMarkersJson:U,dynamicMarkers:S,version:M,showVersion:k}=a.toRefs(r),R=i,D=a.ref(!1),V=a.ref(!1),q=a.ref(!1),W=a.ref(),Q=a.ref(),z=a.ref(),J=a.ref(),j=a.ref(),de=a.ref(0),oe=a.ref(),X=a.ref(),K=a.ref(),le=a.ref(0),ce=a.ref(0),ae=a.ref(0),Me=a.ref(!1),Be=a.ref(!1),O=a.ref(),Ee=a.ref(!1),ve=a.ref(!1),Re=a.ref({startTime:0,startX:0,startY:0}),we=a.ref(new P3(document,"player-wrapper"));t({updateSelectedInterior:a1,takeSnapshot:ge,setCurrentCamera:A1,getCurrentRotation:pe,setCurrentRotation:se,getCurrentFov:Oe,setCurrentFov:Pe,loadDynamicMarkers:B,screenToWorld:Y,setFrontendMarkers:xt,clearCurrentMarkerLayer:E,apartmentJson:Q});const Je=a.computed(()=>{if(Q.value){const F=Q.value.cameras.map(De=>De.floorLevel);let te=[...new Set(F)];return te=te.sort(),te}else return[]}),Te=a.computed(()=>{let F=0;if(Q.value){const te=Q.value.cameras.map(nt=>nt.floorLevel);let De=[...new Set(te)];De=De.sort();const b1=De.findIndex(nt=>nt===ce.value);b1!==-1&&(F=b1)}return F}),T=a.computed(()=>$.value.findIndex(F=>F.archetypeID===oe.value)),w=a.computed(()=>z.value?z.value.cameras.map(F=>({...F,thumbnailUrl:Ne(`/${oe.value}/${o.value}/thumbs/200/${F.id}.jpg`),imageUrl:Ne(`/${oe.value}/${o.value}/images/1600/${F.id}.jpg`)})):[]),G=a.computed(()=>!w.value||!w.value[de.value]?"":w.value[de.value].imageUrl),$=a.computed(()=>{let F=[];return W.value&&(F=W.value.archetypes),l.value.length?F.filter(te=>l.value.includes(te.archetypeID)):F}),re=a.computed(()=>z.value?$.value.map(F=>{var De;const te=(De=w.value[de.value])==null?void 0:De.id;return{...F,url:Ne(`/${F.archetypeID}/${o.value}/thumbs/200/${te}.jpg`)}}):[]),L=a.computed(()=>{if(J.value&&J.value.storeys&&Te.value in J.value.storeys)return J.value.storeys[Te.value]}),ie=a.computed(()=>Q.value&&Q.value.timeInHours),ee=a.computed(()=>{if(Q.value&&Q.value.timeInHours&&u.value)return Ge(Q.value.timeInHours)});a.provide(H1,c.value?new h2(c.value):new h2);const he=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent)),fe=a.computed(()=>he.value?"platform-mobile":"platform-desktop"),ne=a.computed(()=>{const F=l1(n.value,"/config.json");return localStorage.getItem(`${F}-dont-show-tutorial`)});a.watch(s,()=>{s.value&&(oe.value=s.value)}),a.watch([n,o],async()=>{try{X.value=void 0,await Ie(),Xe(),await Ae(),we.value.setup(),ze()}catch(F){q.value=!0,R("onError",F)}},{immediate:!0}),a.watch(b,()=>{b.value==="virtualTour"&&(Me.value=!1),b.value==="slideShow"&&(Me.value=!0,ve.value=!0)},{immediate:!0}),a.watch(Ee,()=>{if(Ee.value){ve.value=!1;const F=P1(K.value);O.value=F[0].timeSamples.find(te=>te.timeInHours===F[0].defaultHour)}else ve.value=!0,j.value.unloadSunSim()}),a.onMounted(async()=>{try{ne.value?(D.value=!1,ve.value=!0):setTimeout(()=>{D.value=!0},1e3)}catch(F){q.value=!0,R("onError",F)}}),a.onBeforeUnmount(()=>{document.removeEventListener("wheel",e1)});function Se(F=!1){ve.value=!0,D.value=!1,F&&be()}function be(){const F=l1(n.value,"/config.json");localStorage.setItem(`${F}-dont-show-tutorial`,"true")}async function Ie(){W.value=await i1()}async function Ae(){var F;if(Q.value=await p1(oe.value,o.value),Q.value&&(X.value=(F=Q.value.cameras[0])==null?void 0:F.id),z.value=await xe(oe.value,o.value),z.value){const te=x.value!==null?x.value:0;de.value=te,X.value=z.value.cameras[te].id,K.value=z.value.cameras[te].id}p.value&&(J.value=await P(oe.value,o.value))}function Xe(){let F=s.value;F||(F=W.value.defaultArchetypeID),l.value&&l.value.length>0&&!l.value.includes(F)?F=l.value[0]:console.warn("illegal interior id",F,l),F||(F=W.value.archetypes[0].archetypeID),oe.value=F}function ze(){const F=document.getElementById("main-canvas");F.addEventListener("touchmove",te,{passive:!1});function te(De){De.preventDefault(),window.scrollBy(0,0)}F.addEventListener("mouseenter",()=>{document.addEventListener("wheel",e1,{passive:!1})},{passive:!1}),F.addEventListener("mouseleave",()=>{document.removeEventListener("wheel",e1)},{passive:!1}),F.addEventListener("mousedown",De=>{Re.value.startTime=new Date().getTime(),Re.value.startX=De.clientX,Re.value.startY=De.clientY},{passive:!1}),F.addEventListener("mouseup",De=>{new Date().getTime()-Re.value.startTime<200&&Math.sqrt(Math.pow(De.clientX,2)+Math.pow(De.clientY,2))-Math.sqrt(Math.pow(Re.value.startX,2)+Math.pow(Re.value.startY,2))<5&&(Ee.value=!1)},{passive:!1})}function e1(F){F.preventDefault(),window.scrollBy(0,0)}async function i1(){try{return await Le("/config.json")}catch(F){console.error("Error loading config.json - ",l1(n.value,"/config.json"),F);return}}async function p1(F,te){try{return await Le(`/${F}/${te}/apartment.json`)}catch(De){console.error("Error loading apartment.json - ",`/${F}/${te}/apartment.json`,De);return}}async function xe(F,te){try{return await Le(`/${F}/${te}/thumbs.json`)}catch{console.error("Error loading thumbs.json - ",`/${F}/${te}/thumbs.json`);return}}async function P(F,te){try{return await Le(`/${F}/${te}/minimap/minimap.json`)}catch{console.error("Error loading minimap.json - ",`/${F}/${te}/minimap/minimap.json`);return}}function pe(){return j.value.getCameraRotation()}function se(F){return j.value.setCameraRotation(F)}function Oe(){return j.value.getCameraFov()}function Pe(F){return j.value.setCameraFov(F)}function Ke(){let F=de.value+1;F>=w.value.length&&(F=0),de.value=F,A1(w.value[de.value].id)}function r1(){let F=de.value-1;F<0&&(F=w.value.length-1),de.value=F,A1(w.value[de.value].id)}function o1(F,te=!0){let De=w.value.findIndex(b1=>b1.id===F);De!=-1&&(de.value=De,te&&A1(F))}function A1(F){Ee.value=!1,X.value=F}function a1(F){oe.value=F,ue(),R("onInteriorUpdate",F),R("onCameraUpdate",K.value,Q.value)}async function ue(){Q.value=await p1(oe.value,o.value),z.value=await xe(oe.value,o.value),p.value&&(J.value=await P(oe.value,o.value))}function me(F){K.value=F,K.value&&(o1(K.value,!1),R("onCameraUpdate",K.value,Q.value))}const s1=a.computed(()=>F=>{const te=P1(F);return!te||!te[0]||!te[0].timeSamples?!1:te[0].timeSamples.length>1}),P1=F=>{const te=Q.value.cameras.find(De=>De.id===F);return te==null?void 0:te.sunsimDayOfYear};function $e(F){R("onSunsimUpdate",F)}function Ye(F){j.value.loadSunSim(F.timeInHours)}function c2(F){le.value=F}function vt(F){ce.value=F}function B1(F){ae.value=F}function E1(F,te){}function ri(F){R("onFrontendMarkersUpdate",F)}function xt(F){if(!j.value){console.warn("Player API is not initialized, cannot set frontend markers.");return}j.value.updateFrontendMarkers(F)}function d2(F){j.value=F,j.value&&(C.value&&j.value.updateSettings(C.value),U.value?j.value.loadMarkersJson():S.value&&j.value.loadDynamicMarkers(S.value),R("onInitialized",j.value))}function E(){j.value.clearCurrentMarkerLayer()}function B(F){j.value.loadDynamicMarkers(F)}function Y(F){return j.value.screenToWorld(F)}function Z(){we.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function H(){Me.value=!Me.value}async function ge(){const F=180/Math.PI,te=await j.value.takePhoto(),De=j.value.getRotationEuler(),b1=j.value.getCurrentCamera(),nt=new $0(te,b1),S3=[De.x*-F,De.y*-F,De.z*F];return R("onSnapshot",nt,S3),nt}async function Ce(){console.log("Here onVisuadoCreateButtonClicked");const F=await j.value.takePhoto(),te=j.value.getCurrentCamera(),De=new $0(F,te);R("onVisuadoCreateButtonClicked",De)}function Ne(F){let te=l1(n.value,F);return te&&A.value&&!te.startsWith("blob:")&&(te=te+`?v=${Date.now()}`),te}async function Le(F){const te=Ne(F);try{return(await Pt.get(te)).data}catch(De){throw new Error(De)}}function qe(F){j.value.updateSettings(F)}function He(F){R("saveSettings",F)}function Ge(F){if(F===void 0)return null;const te=Math.floor(F),De=Math.floor((te-F)*60);return{hours:te,minutes:De}}const _1=a.ref(!1),T1=a.ref(null),q1=a.ref(1);function yt(){if(_1.value){clearInterval(T1.value),_1.value=!1,j.value.toggleAutoRotate();return}_1.value=!0,j.value.toggleAutoRotate(),T1.value=setInterval(()=>{q1.value=1*q1.value,j.value.setAutoRotateSpeed(q1.value),Ke()},5e3)}return(F,te)=>{const De=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["virtual-tour-wrapper",[fe.value]])},[q.value?(a.openBlock(),a.createElementBlock("div",od,"Error loading the player!!")):a.createCommentVNode("",!0),a.createElementVNode("div",sd,[!we.value.isActive&&J.value&&K.value&&L.value&&oe.value&&Be.value?(a.openBlock(),a.createBlock(Y0,{key:0,"cdn-file-resolver":a.unref(n),"apartment-json":Q.value,level:Te.value,"minimap-json":J.value,rotation:le.value,"current-camera":K.value,onGoToCamera:A1,onClose:te[0]||(te[0]=b1=>Be.value=!1)},null,8,["cdn-file-resolver","apartment-json","level","minimap-json","rotation","current-camera"])):a.createCommentVNode("",!0),oe.value&&X.value?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["v-player",[fe.value]])},[a.createVNode(s5,{ref:"vPlayerInstance","cdn-file-resolver":a.unref(n),style:a.normalizeStyle({zIndex:Me.value?1:2}),"show-static-image":Me.value,"current-camera-id":X.value,"mouse-sensitivity":a.unref(N),"interior-id":oe.value,"apartment-id":a.unref(o),onNewCameraCallback:me,onNewRotationCallback:c2,onNewFloorCallback:vt,onNewFovCallback:B1,onNewSizeCallback:E1,onSunsimCallback:$e,onPlayerApiCallback:d2,onFrontendMarkersUpdate:ri},{"slideshow-image":a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(J0,{key:0,image:G.value},null,8,["image"])):a.createCommentVNode("",!0)]),"top-left":a.withCtx(()=>[a.unref(A)?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",icon:"mdi-cog-outline",elevation:"3",class:"mr-2",onClick:te[1]||(te[1]=b1=>V.value=!V.value)})):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(De,{density:"comfortable",icon:"mdi-alert-outline",elevation:"3",class:"mr-2",onClick:te[2]||(te[2]=b1=>D.value=!D.value)},null,512),[[a.vShow,ve.value]]),J.value&&X.value&&L.value?a.withDirectives((a.openBlock(),a.createBlock(De,{key:1,density:"comfortable",elevation:"3",icon:"mdi-floor-plan",class:"mr-2",onClick:te[3]||(te[3]=b1=>Be.value=!Be.value)},null,512)),[[a.vShow,ve.value]]):a.createCommentVNode("",!0),ve.value&&a.unref(y)&&Je.value.length>1?(a.openBlock(),a.createBlock(u5,{key:2,level:ce.value,"floor-levels":Je.value,onLevel:vt},null,8,["level","floor-levels"])):a.createCommentVNode("",!0),a.unref(A)&&V.value?(a.openBlock(),a.createElementBlock("div",ld,[a.createVNode(yc,{"initial-settings":a.unref(C),onUpdateSettings:qe,onSaveSettings:He},null,8,["initial-settings"])])):a.createCommentVNode("",!0)]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[Q.value&&a.unref(m)?a.withDirectives((a.openBlock(),a.createElementBlock("div",cd,[a.createVNode(y5,{rotation:le.value},null,8,["rotation"])],512)),[[a.vShow,ve.value]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:te[4]||(te[4]=b1=>Be.value=!Be.value)},[ve.value&&Q.value&&ie.value&&a.unref(u)?(a.openBlock(),a.createBlock(A5,{key:0,hours:ee.value.hours,minutes:ee.value.minutes,class:"time-of-day",style:a.normalizeStyle({cursor:J.value&&K.value&&L.value?"pointer":"default"})},null,8,["hours","minutes","style"])):a.createCommentVNode("",!0)])]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:r1})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[D.value?(a.openBlock(),a.createBlock(ic,{key:0,onCloseTutorial:te[5]||(te[5]=b1=>Se(b1))})):a.createCommentVNode("",!0),we.value.isActive&&J.value&&K.value&&L.value&&Be.value?(a.openBlock(),a.createBlock(Y0,{key:1,"cdn-file-resolver":a.unref(n),"apartment-json":Q.value,"minimap-json":J.value,rotation:le.value,"current-camera":K.value,level:Te.value,onClose:te[6]||(te[6]=b1=>Be.value=!1),onGoToCamera:A1},null,8,["cdn-file-resolver","apartment-json","minimap-json","rotation","current-camera","level"])):a.createCommentVNode("",!0)]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:Ke})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[a.unref(f)?(a.openBlock(),a.createBlock(K0,{key:0,"is-full-screen":we.value.isActive,class:"btn-fullscreen",onToggleFullscreen:Z},null,8,["is-full-screen"])):a.createCommentVNode("",!0),a.unref(v)?(a.openBlock(),a.createElementBlock("div",dd,[a.createVNode(De,{density:"comfortable",elevation:"3",icon:"mdi-camera",onClick:ge})])):a.createCommentVNode("",!0),a.createElementVNode("div",hd,[a.unref(d)&&ve.value?(a.openBlock(),a.createBlock(C5,{key:0,"show-static-image":Me.value,onToggle:H},null,8,["show-static-image"])):a.createCommentVNode("",!0)]),ve.value&&a.unref(_)&&!we.value.isActive?(a.openBlock(),a.createElementBlock("div",ud,[a.createVNode(Q0)])):a.createCommentVNode("",!0),ve.value&&F.showVisuadoCreateButton?(a.openBlock(),a.createElementBlock("div",md,[a.createVNode(nd,{onOnSnapshot:Ce})])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createVNode(a.Transition,null,{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(["d-flex justify-center",{"mb-2":!he.value}])},[!_1.value&&s1.value(K.value)?(a.openBlock(),a.createBlock(Zc,{key:0,class:"ml-2",displaySunsim:Ee.value,showUI:ve.value,onToggleSunStudy:te[7]||(te[7]=b1=>Ee.value=!Ee.value)},null,8,["displaySunsim","showUI"])):a.createCommentVNode("",!0)],2),!he.value&&!_1.value&&X.value&&Ee.value&&s1.value(K.value)&&P1(K.value)[0]&&O.value?(a.openBlock(),a.createBlock(q0,{key:0,class:"sunsim-slider-desktop","current-day":s1.value(K.value)?P1(K.value)[0]:void 0,"current-time":O.value,onOnTimeChange:Ye,onToggleSunStudy:te[8]||(te[8]=b1=>Ee.value=!Ee.value)},null,8,["current-day","current-time"])):a.createCommentVNode("",!0),!he.value&&ve.value&&a.unref(h)?(a.openBlock(),a.createBlock(xa,{key:1,class:a.normalizeClass([we.value.isActive?"full-screen":""]),thumbnails:w.value,active:de.value,cameraHasSunStudy:s1.value,onNext:Ke,onPrevious:r1,onGoto:o1},{before:a.withCtx(()=>[F.enableAutoplay&&ve.value&&!he.value?(a.openBlock(),a.createBlock(Z0,{key:0,autoplayStatus:_1.value,onToggleAutoPlay:te[9]||(te[9]=b1=>yt())},null,8,["autoplayStatus"])):a.createCommentVNode("",!0)]),_:1},8,["class","thumbnails","active","cameraHasSunStudy"])):a.createCommentVNode("",!0)])]),_:1})]),"bottom-right":a.withCtx(()=>[a.createElementVNode("div",fd,[ve.value&&a.unref(g)&&re.value?(a.openBlock(),a.createBlock(x5,{key:0,"cdn-file-resolver":a.unref(n),"available-archetypes":re.value,"selected-index":T.value,onSelectInterior:a1},null,8,["cdn-file-resolver","available-archetypes","selected-index"])):a.createCommentVNode("",!0)])]),_:1},8,["cdn-file-resolver","style","show-static-image","current-camera-id","mouse-sensitivity","interior-id","apartment-id"]),a.createVNode(a.Transition,null,{default:a.withCtx(()=>[a.unref(h)&&z.value&&he.value&&ve.value?(a.openBlock(),a.createBlock(xa,{key:0,class:"waypoint-carousel below-player",thumbnails:w.value,active:de.value,cameraHasSunStudy:s1.value,onNext:Ke,onPrevious:r1,onGoto:o1},{before:a.withCtx(()=>[F.enableAutoplay&&ve.value?(a.openBlock(),a.createBlock(Z0,{key:0,autoplayStatus:_1.value,onToggleAutoPlay:te[10]||(te[10]=b1=>yt())},null,8,["autoplayStatus"])):a.createCommentVNode("",!0)]),_:1},8,["thumbnails","active","cameraHasSunStudy"])):a.createCommentVNode("",!0)]),_:1}),he.value?(a.openBlock(),a.createElementBlock("div",pd,[!_1.value&&X.value&&Ee.value&&s1.value(K.value)&&P1(K.value)[0]&&O.value?(a.openBlock(),a.createBlock(q0,{key:0,class:"mt-1","current-day":s1.value(K.value)?P1(K.value)[0]:void 0,"current-time":O.value,onOnTimeChange:Ye,onToggleSunStudy:te[11]||(te[11]=b1=>Ee.value=!Ee.value)},null,8,["current-day","current-time"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),a.unref(M)&&a.unref(k)?(a.openBlock(),a.createElementBlock("div",gd," version: "+a.toDisplayString(a.unref(M)),1)):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-4c9ca3de"]]);var _d=0,to=1,vd=2,io=1,xd=2,Xt=3,Nt=0,tt=1,ut=2,Yt=0,oi=1,N3=2,ro=3,ao=4,yd=5,O2=100,Sd=101,Md=102,wd=103,Ad=104,Ed=200,bd=201,Cd=202,Td=203,L3=204,R3=205,Id=206,Pd=207,Nd=208,Ld=209,Rd=210,Dd=211,Ud=212,kd=213,Od=214,zd=0,Vd=1,Bd=2,ya=3,Fd=4,Hd=5,Gd=6,Wd=7,no=0,jd=1,Xd=2,u2=0,Yd=1,qd=2,Zd=3,Qd=4,Jd=5,Kd=6,$d=7,oo="attached",eh="detached",so=300,si=301,li=302,D3=303,U3=304,Sa=306,D1=1e3,Lt=1001,Ma=1002,u1=1003,lo=1004,Tr=1005,m1=1006,wa=1007,qt=1008,Rt=1009,th=1010,ih=1011,co=1012,ho=1013,ci=1014,Q1=1015,ot=1016,uo=1017,mo=1018,Ir=1020,rh=35902,ah=1021,nh=1022,U1=1023,oh=1024,sh=1025,di=1026,Pr=1027,k3=1028,fo=1029,lh=1030,po=1031,go=1033,O3=33776,z3=33777,V3=33778,B3=33779,_o=35840,vo=35841,xo=35842,yo=35843,So=36196,Mo=37492,wo=37496,Ao=37808,Eo=37809,bo=37810,Co=37811,To=37812,Io=37813,Po=37814,No=37815,Lo=37816,Ro=37817,Do=37818,Uo=37819,ko=37820,Oo=37821,F3=36492,zo=36494,Vo=36495,ch=36283,Bo=36284,Fo=36285,Ho=36286,Nr=2300,hi=2301,H3=2302,Go=2400,Wo=2401,jo=2402,dh=2500,hh=0,Xo=1,G3=2,uh=3200,mh=3201,Yo=0,fh=1,m2="",J1="srgb",k1="srgb-linear",W3="display-p3",Aa="display-p3-linear",Ea="linear",g1="srgb",ba="rec709",Ca="p3",ui=7680,qo=519,ph=512,gh=513,_h=514,Zo=515,vh=516,xh=517,yh=518,Sh=519,j3=35044,Qo="300 es",Zt=2e3,Ta=2001,mi=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let 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;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let i=this._listeners[e];if(i!==void 0){let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let t=this._listeners[e.type];if(t!==void 0){e.target=this;let i=t.slice(0);for(let r=0,n=i.length;r<n;r++)i[r].call(this,e);e.target=null}}},G1=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Jo=1234567,Lr=Math.PI/180,fi=180/Math.PI;function Mt(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(G1[e&255]+G1[e>>8&255]+G1[e>>16&255]+G1[e>>24&255]+"-"+G1[t&255]+G1[t>>8&255]+"-"+G1[t>>16&15|64]+G1[t>>24&255]+"-"+G1[i&63|128]+G1[i>>8&255]+"-"+G1[i>>16&255]+G1[i>>24&255]+G1[r&255]+G1[r>>8&255]+G1[r>>16&255]+G1[r>>24&255]).toLowerCase()}function W1(e,t,i){return Math.max(t,Math.min(i,e))}function X3(e,t){return(e%t+t)%t}function Mh(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)}function wh(e,t,i){return e!==t?(i-e)/(t-e):0}function Rr(e,t,i){return(1-i)*e+i*t}function Ah(e,t,i,r){return Rr(e,t,1-Math.exp(-i*r))}function Eh(e,t=1){return t-Math.abs(X3(e,t*2)-t)}function bh(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))}function Ch(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(e*6-15)+10))}function Th(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Ih(e,t){return e+Math.random()*(t-e)}function Ph(e){return e*(.5-Math.random())}function Nh(e){e!==void 0&&(Jo=e);let t=Jo+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Lh(e){return e*Lr}function Rh(e){return e*fi}function Dh(e){return(e&e-1)===0&&e!==0}function Uh(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function kh(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Oh(e,t,i,r,n){let o=Math.cos,s=Math.sin,l=o(i/2),d=s(i/2),c=o((t+r)/2),h=s((t+r)/2),u=o((t-r)/2),m=s((t-r)/2),f=o((r-t)/2),v=s((r-t)/2);switch(n){case"XYX":e.set(l*h,d*u,d*m,l*c);break;case"YZY":e.set(d*m,l*h,d*u,l*c);break;case"ZXZ":e.set(d*u,d*m,l*h,l*c);break;case"XZX":e.set(l*h,d*v,d*f,l*c);break;case"YXY":e.set(d*f,l*h,d*v,l*c);break;case"ZYZ":e.set(d*v,d*f,l*h,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function wt(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function c1(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}var pi={DEG2RAD:Lr,RAD2DEG:fi,generateUUID:Mt,clamp:W1,euclideanModulo:X3,mapLinear:Mh,inverseLerp:wh,lerp:Rr,damp:Ah,pingpong:Eh,smoothstep:bh,smootherstep:Ch,randInt:Th,randFloat:Ih,randFloatSpread:Ph,seededRandom:Nh,degToRad:Lh,radToDeg:Rh,isPowerOfTwo:Dh,ceilPowerOfTwo:Uh,floorPowerOfTwo:kh,setQuaternionFromProperEuler:Oh,normalize:c1,denormalize:wt},ye=class b4{constructor(t=0,i=0){b4.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let i=this.x,r=this.y,n=t.elements;return this.x=n[0]*i+n[3]*r+n[6],this.y=n[1]*i+n[4]*r+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;let r=this.dot(t)/i;return Math.acos(W1(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y;return i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){let r=Math.cos(i),n=Math.sin(i),o=this.x-t.x,s=this.y-t.y;return this.x=o*r-s*n+t.x,this.y=o*n+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},je=class C4{constructor(t,i,r,n,o,s,l,d,c){C4.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,r,n,o,s,l,d,c)}set(t,i,r,n,o,s,l,d,c){let h=this.elements;return h[0]=t,h[1]=n,h[2]=l,h[3]=i,h[4]=o,h[5]=d,h[6]=r,h[7]=s,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],this}extractBasis(t,i,r){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,o=this.elements,s=r[0],l=r[3],d=r[6],c=r[1],h=r[4],u=r[7],m=r[2],f=r[5],v=r[8],_=n[0],g=n[3],p=n[6],y=n[1],x=n[4],b=n[7],N=n[2],A=n[5],C=n[8];return o[0]=s*_+l*y+d*N,o[3]=s*g+l*x+d*A,o[6]=s*p+l*b+d*C,o[1]=c*_+h*y+u*N,o[4]=c*g+h*x+u*A,o[7]=c*p+h*b+u*C,o[2]=m*_+f*y+v*N,o[5]=m*g+f*x+v*A,o[8]=m*p+f*b+v*C,this}multiplyScalar(t){let i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8];return i*s*h-i*l*c-r*o*h+r*l*d+n*o*c-n*s*d}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8],u=h*s-l*c,m=l*d-h*o,f=c*o-s*d,v=i*u+r*m+n*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);let _=1/v;return t[0]=u*_,t[1]=(n*c-h*r)*_,t[2]=(l*r-n*s)*_,t[3]=m*_,t[4]=(h*i-n*d)*_,t[5]=(n*o-l*i)*_,t[6]=f*_,t[7]=(r*d-c*i)*_,t[8]=(s*i-r*o)*_,this}transpose(){let t,i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,r,n,o,s,l){let d=Math.cos(o),c=Math.sin(o);return this.set(r*d,r*c,-r*(d*s+c*l)+s+t,-n*c,n*d,-n*(-c*s+d*l)+l+i,0,0,1),this}scale(t,i){return this.premultiply(Y3.makeScale(t,i)),this}rotate(t){return this.premultiply(Y3.makeRotation(-t)),this}translate(t,i){return this.premultiply(Y3.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,r,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<9;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<9;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Y3=new je;function Ko(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Dr(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function zh(){let e=Dr("canvas");return e.style.display="block",e}var $o={};function es(e){e in $o||($o[e]=!0,console.warn(e))}var ts=new je().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),is=new je().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ia={[k1]:{transfer:Ea,primaries:ba,toReference:e=>e,fromReference:e=>e},[J1]:{transfer:g1,primaries:ba,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[Aa]:{transfer:Ea,primaries:Ca,toReference:e=>e.applyMatrix3(is),fromReference:e=>e.applyMatrix3(ts)},[W3]:{transfer:g1,primaries:Ca,toReference:e=>e.convertSRGBToLinear().applyMatrix3(is),fromReference:e=>e.applyMatrix3(ts).convertLinearToSRGB()}},Vh=new Set([k1,Aa]),n1={enabled:!0,_workingColorSpace:k1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Vh.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,i){if(this.enabled===!1||t===i||!t||!i)return e;let r=Ia[t].toReference,n=Ia[i].fromReference;return n(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Ia[e].primaries},getTransfer:function(e){return e===m2?Ea:Ia[e].transfer}};function gi(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function q3(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}var _i,Bh=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{_i===void 0&&(_i=Dr("canvas")),_i.width=e.width,_i.height=e.height;let i=_i.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=_i}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Dr("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),n=r.data;for(let o=0;o<n.length;o++)n[o]=gi(n[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(gi(t[i]/255)*255):t[i]=gi(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},Fh=0,rs=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Fh++}),this.uuid=Mt(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let n;if(Array.isArray(r)){n=[];for(let o=0,s=r.length;o<s;o++)r[o].isDataTexture?n.push(Z3(r[o].image)):n.push(Z3(r[o]))}else n=Z3(r);i.url=n}return t||(e.images[this.uuid]=i),i}};function Z3(e){return typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap?Bh.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Hh=0,it=class M3 extends mi{constructor(t=M3.DEFAULT_IMAGE,i=M3.DEFAULT_MAPPING,r=Lt,n=Lt,o=m1,s=qt,l=U1,d=Rt,c=M3.DEFAULT_ANISOTROPY,h=m2){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Hh++}),this.uuid=Mt(),this.name="",this.source=new rs(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=r,this.wrapT=n,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=d,this.offset=new ye(0,0),this.repeat=new ye(1,1),this.center=new ye(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),i||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==so)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case D1:t.x=t.x-Math.floor(t.x);break;case Lt:t.x=t.x<0?0:1;break;case Ma:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case D1:t.y=t.y-Math.floor(t.y);break;case Lt:t.y=t.y<0?0:1;break;case Ma:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};it.DEFAULT_IMAGE=null,it.DEFAULT_MAPPING=so,it.DEFAULT_ANISOTROPY=1;var f1=class T4{constructor(t=0,i=0,r=0,n=1){T4.prototype.isVector4=!0,this.x=t,this.y=i,this.z=r,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,r,n){return this.x=t,this.y=i,this.z=r,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,o=this.w,s=t.elements;return this.x=s[0]*i+s[4]*r+s[8]*n+s[12]*o,this.y=s[1]*i+s[5]*r+s[9]*n+s[13]*o,this.z=s[2]*i+s[6]*r+s[10]*n+s[14]*o,this.w=s[3]*i+s[7]*r+s[11]*n+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,r,n,o,s=t.elements,l=s[0],d=s[4],c=s[8],h=s[1],u=s[5],m=s[9],f=s[2],v=s[6],_=s[10];if(Math.abs(d-h)<.01&&Math.abs(c-f)<.01&&Math.abs(m-v)<.01){if(Math.abs(d+h)<.1&&Math.abs(c+f)<.1&&Math.abs(m+v)<.1&&Math.abs(l+u+_-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;let p=(l+1)/2,y=(u+1)/2,x=(_+1)/2,b=(d+h)/4,N=(c+f)/4,A=(m+v)/4;return p>y&&p>x?p<.01?(r=0,n=.707106781,o=.707106781):(r=Math.sqrt(p),n=b/r,o=N/r):y>x?y<.01?(r=.707106781,n=0,o=.707106781):(n=Math.sqrt(y),r=b/n,o=A/n):x<.01?(r=.707106781,n=.707106781,o=0):(o=Math.sqrt(x),r=N/o,n=A/o),this.set(r,n,o,i),this}let g=Math.sqrt((v-m)*(v-m)+(c-f)*(c-f)+(h-d)*(h-d));return Math.abs(g)<.001&&(g=1),this.x=(v-m)/g,this.y=(c-f)/g,this.z=(h-d)/g,this.w=Math.acos((l+u+_-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this.w=t.w+(i.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Gh=class extends mi{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new f1(0,0,e,t),this.scissorTest=!1,this.viewport=new f1(0,0,e,t);let r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:m1,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let n=new it(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);n.flipY=!1,n.generateMipmaps=i.generateMipmaps,n.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s<o;s++)this.textures[s]=n.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,n=this.textures.length;r<n;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,r=e.textures.length;i<r;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new rs(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},S1=class extends Gh{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}},as=class extends it{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=u1,this.minFilter=u1,this.wrapR=Lt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},ns=class extends it{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=u1,this.minFilter=u1,this.wrapR=Lt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},f2=class{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,n,o,s){let l=i[r+0],d=i[r+1],c=i[r+2],h=i[r+3],u=n[o+0],m=n[o+1],f=n[o+2],v=n[o+3];if(s===0){e[t+0]=l,e[t+1]=d,e[t+2]=c,e[t+3]=h;return}if(s===1){e[t+0]=u,e[t+1]=m,e[t+2]=f,e[t+3]=v;return}if(h!==v||l!==u||d!==m||c!==f){let _=1-s,g=l*u+d*m+c*f+h*v,p=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){let b=Math.sqrt(y),N=Math.atan2(b,g*p);_=Math.sin(_*N)/b,s=Math.sin(s*N)/b}let x=s*p;if(l=l*_+u*x,d=d*_+m*x,c=c*_+f*x,h=h*_+v*x,_===1-s){let b=1/Math.sqrt(l*l+d*d+c*c+h*h);l*=b,d*=b,c*=b,h*=b}}e[t]=l,e[t+1]=d,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,n,o){let s=i[r],l=i[r+1],d=i[r+2],c=i[r+3],h=n[o],u=n[o+1],m=n[o+2],f=n[o+3];return e[t]=s*f+c*h+l*m-d*u,e[t+1]=l*f+c*u+d*h-s*m,e[t+2]=d*f+c*m+s*u-l*h,e[t+3]=c*f-s*h-l*u-d*m,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=!0){let i=e._x,r=e._y,n=e._z,o=e._order,s=Math.cos,l=Math.sin,d=s(i/2),c=s(r/2),h=s(n/2),u=l(i/2),m=l(r/2),f=l(n/2);switch(o){case"XYZ":this._x=u*c*h+d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h-u*m*f;break;case"YXZ":this._x=u*c*h+d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h+u*m*f;break;case"ZXY":this._x=u*c*h-d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h-u*m*f;break;case"ZYX":this._x=u*c*h-d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h+u*m*f;break;case"YZX":this._x=u*c*h+d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h-u*m*f;break;case"XZY":this._x=u*c*h-d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h+u*m*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let 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){let t=e.elements,i=t[0],r=t[4],n=t[8],o=t[1],s=t[5],l=t[9],d=t[2],c=t[6],h=t[10],u=i+s+h;if(u>0){let m=.5/Math.sqrt(u+1);this._w=.25/m,this._x=(c-l)*m,this._y=(n-d)*m,this._z=(o-r)*m}else if(i>s&&i>h){let m=2*Math.sqrt(1+i-s-h);this._w=(c-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(n+d)/m}else if(s>h){let m=2*Math.sqrt(1+s-i-h);this._w=(n-d)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+c)/m}else{let m=2*Math.sqrt(1+h-i-s);this._w=(o-r)/m,this._x=(n+d)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(W1(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let 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){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,r=e._y,n=e._z,o=e._w,s=t._x,l=t._y,d=t._z,c=t._w;return this._x=i*c+o*s+r*d-n*l,this._y=r*c+o*l+n*s-i*d,this._z=n*c+o*d+i*l-r*s,this._w=o*c-i*s-r*l-n*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,r=this._y,n=this._z,o=this._w,s=o*e._w+i*e._x+r*e._y+n*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;let l=1-s*s;if(l<=Number.EPSILON){let m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*n+t*this._z,this.normalize(),this}let d=Math.sqrt(l),c=Math.atan2(d,s),h=Math.sin((1-t)*c)/d,u=Math.sin(t*c)/d;return this._w=o*h+this._w*u,this._x=i*h+this._x*u,this._y=r*h+this._y*u,this._z=n*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),n=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),n*Math.sin(t),n*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},I=class I4{constructor(t=0,i=0,r=0){I4.prototype.isVector3=!0,this.x=t,this.y=i,this.z=r}set(t,i,r){return r===void 0&&(r=this.z),this.x=t,this.y=i,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(os.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(os.setFromAxisAngle(t,i))}applyMatrix3(t){let i=this.x,r=this.y,n=this.z,o=t.elements;return this.x=o[0]*i+o[3]*r+o[6]*n,this.y=o[1]*i+o[4]*r+o[7]*n,this.z=o[2]*i+o[5]*r+o[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,o=t.elements,s=1/(o[3]*i+o[7]*r+o[11]*n+o[15]);return this.x=(o[0]*i+o[4]*r+o[8]*n+o[12])*s,this.y=(o[1]*i+o[5]*r+o[9]*n+o[13])*s,this.z=(o[2]*i+o[6]*r+o[10]*n+o[14])*s,this}applyQuaternion(t){let i=this.x,r=this.y,n=this.z,o=t.x,s=t.y,l=t.z,d=t.w,c=2*(s*n-l*r),h=2*(l*i-o*n),u=2*(o*r-s*i);return this.x=i+d*c+s*u-l*h,this.y=r+d*h+l*c-o*u,this.z=n+d*u+o*h-s*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let i=this.x,r=this.y,n=this.z,o=t.elements;return this.x=o[0]*i+o[4]*r+o[8]*n,this.y=o[1]*i+o[5]*r+o[9]*n,this.z=o[2]*i+o[6]*r+o[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){let r=t.x,n=t.y,o=t.z,s=i.x,l=i.y,d=i.z;return this.x=n*d-o*l,this.y=o*s-r*d,this.z=r*l-n*s,this}projectOnVector(t){let i=t.lengthSq();if(i===0)return this.set(0,0,0);let r=t.dot(this)/i;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return Q3.copy(this).projectOnVector(t),this.sub(Q3)}reflect(t){return this.sub(Q3.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;let r=this.dot(t)/i;return Math.acos(W1(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return i*i+r*r+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,r){let n=Math.sin(i)*t;return this.x=n*Math.sin(r),this.y=Math.cos(i)*t,this.z=n*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,r){return this.x=t*Math.sin(i),this.y=r,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){let i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){let i=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=r,this.z=n,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,i=Math.random()*2-1,r=Math.sqrt(1-i*i);return this.x=r*Math.cos(t),this.y=i,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Q3=new I,os=new f2,Qt=class{constructor(e=new I(1/0,1/0,1/0),t=new I(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(At.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(At.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=At.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let n=i.getAttribute("position");if(t===!0&&n!==void 0&&e.isInstancedMesh!==!0)for(let o=0,s=n.count;o<s;o++)e.isMesh===!0?e.getVertexPosition(o,At):At.fromBufferAttribute(n,o),At.applyMatrix4(e.matrixWorld),this.expandByPoint(At);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Pa.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Pa.copy(i.boundingBox)),Pa.applyMatrix4(e.matrixWorld),this.union(Pa)}let r=e.children;for(let n=0,o=r.length;n<o;n++)this.expandByObject(r[n],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,At),At.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(Ur),Na.subVectors(this.max,Ur),vi.subVectors(e.a,Ur),xi.subVectors(e.b,Ur),yi.subVectors(e.c,Ur),p2.subVectors(xi,vi),g2.subVectors(yi,xi),z2.subVectors(vi,yi);let t=[0,-p2.z,p2.y,0,-g2.z,g2.y,0,-z2.z,z2.y,p2.z,0,-p2.x,g2.z,0,-g2.x,z2.z,0,-z2.x,-p2.y,p2.x,0,-g2.y,g2.x,0,-z2.y,z2.x,0];return!J3(t,vi,xi,yi,Na)||(t=[1,0,0,0,1,0,0,0,1],!J3(t,vi,xi,yi,Na))?!1:(La.crossVectors(p2,g2),t=[La.x,La.y,La.z],J3(t,vi,xi,yi,Na))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,At).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(At).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:(Jt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Jt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Jt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Jt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Jt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Jt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Jt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Jt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Jt),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)}},Jt=[new I,new I,new I,new I,new I,new I,new I,new I],At=new I,Pa=new Qt,vi=new I,xi=new I,yi=new I,p2=new I,g2=new I,z2=new I,Ur=new I,Na=new I,La=new I,V2=new I;function J3(e,t,i,r,n){for(let o=0,s=e.length-3;o<=s;o+=3){V2.fromArray(e,o);let l=n.x*Math.abs(V2.x)+n.y*Math.abs(V2.y)+n.z*Math.abs(V2.z),d=t.dot(V2),c=i.dot(V2),h=r.dot(V2);if(Math.max(-Math.max(d,c,h),Math.min(d,c,h))>l)return!1}return!0}var Wh=new Qt,kr=new I,K3=new I,Dt=class{constructor(e=new I,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):Wh.setFromPoints(e).getCenter(i);let r=0;for(let n=0,o=e.length;n<o;n++)r=Math.max(r,i.distanceToSquared(e[n]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;kr.subVectors(e,this.center);let t=kr.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(kr,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(K3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(kr.copy(e.center).add(K3)),this.expandByPoint(kr.copy(e.center).sub(K3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Kt=new I,$3=new I,Ra=new I,_2=new I,en=new I,Da=new I,tn=new I,Or=class{constructor(e=new I,t=new I(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Kt)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Kt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Kt.copy(this.origin).addScaledVector(this.direction,t),Kt.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){$3.copy(e).add(t).multiplyScalar(.5),Ra.copy(t).sub(e).normalize(),_2.copy(this.origin).sub($3);let n=e.distanceTo(t)*.5,o=-this.direction.dot(Ra),s=_2.dot(this.direction),l=-_2.dot(Ra),d=_2.lengthSq(),c=Math.abs(1-o*o),h,u,m,f;if(c>0)if(h=o*l-s,u=o*s-l,f=n*c,h>=0)if(u>=-f)if(u<=f){let v=1/c;h*=v,u*=v,m=h*(h+o*u+2*s)+u*(o*h+u+2*l)+d}else u=n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;else u=-n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;else u<=-f?(h=Math.max(0,-(-o*n+s)),u=h>0?-n:Math.min(Math.max(-n,-l),n),m=-h*h+u*(u+2*l)+d):u<=f?(h=0,u=Math.min(Math.max(-n,-l),n),m=u*(u+2*l)+d):(h=Math.max(0,-(o*n+s)),u=h>0?n:Math.min(Math.max(-n,-l),n),m=-h*h+u*(u+2*l)+d);else u=o>0?-n:n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy($3).addScaledVector(Ra,u),m}intersectSphere(e,t){Kt.subVectors(e.center,this.origin);let i=Kt.dot(this.direction),r=Kt.dot(Kt)-i*i,n=e.radius*e.radius;if(r>n)return null;let o=Math.sqrt(n-r),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,n,o,s,l,d=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return d>=0?(i=(e.min.x-u.x)*d,r=(e.max.x-u.x)*d):(i=(e.max.x-u.x)*d,r=(e.min.x-u.x)*d),c>=0?(n=(e.min.y-u.y)*c,o=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,o=(e.min.y-u.y)*c),i>o||n>r||((n>i||isNaN(i))&&(i=n),(o<r||isNaN(r))&&(r=o),h>=0?(s=(e.min.z-u.z)*h,l=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,l=(e.min.z-u.z)*h),i>l||s>r)||((s>i||i!==i)&&(i=s),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Kt)!==null}intersectTriangle(e,t,i,r,n){en.subVectors(t,e),Da.subVectors(i,e),tn.crossVectors(en,Da);let o=this.direction.dot(tn),s;if(o>0){if(r)return null;s=1}else if(o<0)s=-1,o=-o;else return null;_2.subVectors(this.origin,e);let l=s*this.direction.dot(Da.crossVectors(_2,Da));if(l<0)return null;let d=s*this.direction.dot(en.cross(_2));if(d<0||l+d>o)return null;let c=-s*_2.dot(tn);return c<0?null:this.at(c/o,n)}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)}},Fe=class z0{constructor(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g){z0.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g)}set(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g){let p=this.elements;return p[0]=t,p[4]=i,p[8]=r,p[12]=n,p[1]=o,p[5]=s,p[9]=l,p[13]=d,p[2]=c,p[6]=h,p[10]=u,p[14]=m,p[3]=f,p[7]=v,p[11]=_,p[15]=g,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 z0().fromArray(this.elements)}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this}copyPosition(t){let i=this.elements,r=t.elements;return i[12]=r[12],i[13]=r[13],i[14]=r[14],this}setFromMatrix3(t){let i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,r){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,i,r){return this.set(t.x,i.x,r.x,0,t.y,i.y,r.y,0,t.z,i.z,r.z,0,0,0,0,1),this}extractRotation(t){let i=this.elements,r=t.elements,n=1/Si.setFromMatrixColumn(t,0).length(),o=1/Si.setFromMatrixColumn(t,1).length(),s=1/Si.setFromMatrixColumn(t,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[3]=0,i[4]=r[4]*o,i[5]=r[5]*o,i[6]=r[6]*o,i[7]=0,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){let i=this.elements,r=t.x,n=t.y,o=t.z,s=Math.cos(r),l=Math.sin(r),d=Math.cos(n),c=Math.sin(n),h=Math.cos(o),u=Math.sin(o);if(t.order==="XYZ"){let m=s*h,f=s*u,v=l*h,_=l*u;i[0]=d*h,i[4]=-d*u,i[8]=c,i[1]=f+v*c,i[5]=m-_*c,i[9]=-l*d,i[2]=_-m*c,i[6]=v+f*c,i[10]=s*d}else if(t.order==="YXZ"){let m=d*h,f=d*u,v=c*h,_=c*u;i[0]=m+_*l,i[4]=v*l-f,i[8]=s*c,i[1]=s*u,i[5]=s*h,i[9]=-l,i[2]=f*l-v,i[6]=_+m*l,i[10]=s*d}else if(t.order==="ZXY"){let m=d*h,f=d*u,v=c*h,_=c*u;i[0]=m-_*l,i[4]=-s*u,i[8]=v+f*l,i[1]=f+v*l,i[5]=s*h,i[9]=_-m*l,i[2]=-s*c,i[6]=l,i[10]=s*d}else if(t.order==="ZYX"){let m=s*h,f=s*u,v=l*h,_=l*u;i[0]=d*h,i[4]=v*c-f,i[8]=m*c+_,i[1]=d*u,i[5]=_*c+m,i[9]=f*c-v,i[2]=-c,i[6]=l*d,i[10]=s*d}else if(t.order==="YZX"){let m=s*d,f=s*c,v=l*d,_=l*c;i[0]=d*h,i[4]=_-m*u,i[8]=v*u+f,i[1]=u,i[5]=s*h,i[9]=-l*h,i[2]=-c*h,i[6]=f*u+v,i[10]=m-_*u}else if(t.order==="XZY"){let m=s*d,f=s*c,v=l*d,_=l*c;i[0]=d*h,i[4]=-u,i[8]=c*h,i[1]=m*u+_,i[5]=s*h,i[9]=f*u-v,i[2]=v*u-f,i[6]=l*h,i[10]=_*u+m}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(jh,t,Xh)}lookAt(t,i,r){let n=this.elements;return st.subVectors(t,i),st.lengthSq()===0&&(st.z=1),st.normalize(),v2.crossVectors(r,st),v2.lengthSq()===0&&(Math.abs(r.z)===1?st.x+=1e-4:st.z+=1e-4,st.normalize(),v2.crossVectors(r,st)),v2.normalize(),Ua.crossVectors(st,v2),n[0]=v2.x,n[4]=Ua.x,n[8]=st.x,n[1]=v2.y,n[5]=Ua.y,n[9]=st.y,n[2]=v2.z,n[6]=Ua.z,n[10]=st.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,o=this.elements,s=r[0],l=r[4],d=r[8],c=r[12],h=r[1],u=r[5],m=r[9],f=r[13],v=r[2],_=r[6],g=r[10],p=r[14],y=r[3],x=r[7],b=r[11],N=r[15],A=n[0],C=n[4],U=n[8],S=n[12],M=n[1],k=n[5],R=n[9],D=n[13],V=n[2],q=n[6],W=n[10],Q=n[14],z=n[3],J=n[7],j=n[11],de=n[15];return o[0]=s*A+l*M+d*V+c*z,o[4]=s*C+l*k+d*q+c*J,o[8]=s*U+l*R+d*W+c*j,o[12]=s*S+l*D+d*Q+c*de,o[1]=h*A+u*M+m*V+f*z,o[5]=h*C+u*k+m*q+f*J,o[9]=h*U+u*R+m*W+f*j,o[13]=h*S+u*D+m*Q+f*de,o[2]=v*A+_*M+g*V+p*z,o[6]=v*C+_*k+g*q+p*J,o[10]=v*U+_*R+g*W+p*j,o[14]=v*S+_*D+g*Q+p*de,o[3]=y*A+x*M+b*V+N*z,o[7]=y*C+x*k+b*q+N*J,o[11]=y*U+x*R+b*W+N*j,o[15]=y*S+x*D+b*Q+N*de,this}multiplyScalar(t){let i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[4],n=t[8],o=t[12],s=t[1],l=t[5],d=t[9],c=t[13],h=t[2],u=t[6],m=t[10],f=t[14],v=t[3],_=t[7],g=t[11],p=t[15];return v*(+o*d*u-n*c*u-o*l*m+r*c*m+n*l*f-r*d*f)+_*(+i*d*f-i*c*m+o*s*m-n*s*f+n*c*h-o*d*h)+g*(+i*c*u-i*l*f-o*s*u+r*s*f+o*l*h-r*c*h)+p*(-n*l*h-i*d*u+i*l*m+n*s*u-r*s*m+r*d*h)}transpose(){let t=this.elements,i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,r){let n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=i,n[14]=r),this}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8],u=t[9],m=t[10],f=t[11],v=t[12],_=t[13],g=t[14],p=t[15],y=u*g*c-_*m*c+_*d*f-l*g*f-u*d*p+l*m*p,x=v*m*c-h*g*c-v*d*f+s*g*f+h*d*p-s*m*p,b=h*_*c-v*u*c+v*l*f-s*_*f-h*l*p+s*u*p,N=v*u*d-h*_*d-v*l*m+s*_*m+h*l*g-s*u*g,A=i*y+r*x+n*b+o*N;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let C=1/A;return t[0]=y*C,t[1]=(_*m*o-u*g*o-_*n*f+r*g*f+u*n*p-r*m*p)*C,t[2]=(l*g*o-_*d*o+_*n*c-r*g*c-l*n*p+r*d*p)*C,t[3]=(u*d*o-l*m*o-u*n*c+r*m*c+l*n*f-r*d*f)*C,t[4]=x*C,t[5]=(h*g*o-v*m*o+v*n*f-i*g*f-h*n*p+i*m*p)*C,t[6]=(v*d*o-s*g*o-v*n*c+i*g*c+s*n*p-i*d*p)*C,t[7]=(s*m*o-h*d*o+h*n*c-i*m*c-s*n*f+i*d*f)*C,t[8]=b*C,t[9]=(v*u*o-h*_*o-v*r*f+i*_*f+h*r*p-i*u*p)*C,t[10]=(s*_*o-v*l*o+v*r*c-i*_*c-s*r*p+i*l*p)*C,t[11]=(h*l*o-s*u*o-h*r*c+i*u*c+s*r*f-i*l*f)*C,t[12]=N*C,t[13]=(h*_*n-v*u*n+v*r*m-i*_*m-h*r*g+i*u*g)*C,t[14]=(v*l*n-s*_*n-v*r*d+i*_*d+s*r*g-i*l*g)*C,t[15]=(s*u*n-h*l*n+h*r*d-i*u*d-s*r*m+i*l*m)*C,this}scale(t){let i=this.elements,r=t.x,n=t.y,o=t.z;return i[0]*=r,i[4]*=n,i[8]*=o,i[1]*=r,i[5]*=n,i[9]*=o,i[2]*=r,i[6]*=n,i[10]*=o,i[3]*=r,i[7]*=n,i[11]*=o,this}getMaxScaleOnAxis(){let t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,r,n))}makeTranslation(t,i,r){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,r,0,0,0,1),this}makeRotationX(t){let i=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,i,-r,0,0,r,i,0,0,0,0,1),this}makeRotationY(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,0,r,0,0,1,0,0,-r,0,i,0,0,0,0,1),this}makeRotationZ(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){let r=Math.cos(i),n=Math.sin(i),o=1-r,s=t.x,l=t.y,d=t.z,c=o*s,h=o*l;return this.set(c*s+r,c*l-n*d,c*d+n*l,0,c*l+n*d,h*l+r,h*d-n*s,0,c*d-n*l,h*d+n*s,o*d*d+r,0,0,0,0,1),this}makeScale(t,i,r){return this.set(t,0,0,0,0,i,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,i,r,n,o,s){return this.set(1,r,o,0,t,1,s,0,i,n,1,0,0,0,0,1),this}compose(t,i,r){let n=this.elements,o=i._x,s=i._y,l=i._z,d=i._w,c=o+o,h=s+s,u=l+l,m=o*c,f=o*h,v=o*u,_=s*h,g=s*u,p=l*u,y=d*c,x=d*h,b=d*u,N=r.x,A=r.y,C=r.z;return n[0]=(1-(_+p))*N,n[1]=(f+b)*N,n[2]=(v-x)*N,n[3]=0,n[4]=(f-b)*A,n[5]=(1-(m+p))*A,n[6]=(g+y)*A,n[7]=0,n[8]=(v+x)*C,n[9]=(g-y)*C,n[10]=(1-(m+_))*C,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,i,r){let n=this.elements,o=Si.set(n[0],n[1],n[2]).length(),s=Si.set(n[4],n[5],n[6]).length(),l=Si.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],Et.copy(this);let d=1/o,c=1/s,h=1/l;return Et.elements[0]*=d,Et.elements[1]*=d,Et.elements[2]*=d,Et.elements[4]*=c,Et.elements[5]*=c,Et.elements[6]*=c,Et.elements[8]*=h,Et.elements[9]*=h,Et.elements[10]*=h,i.setFromRotationMatrix(Et),r.x=o,r.y=s,r.z=l,this}makePerspective(t,i,r,n,o,s,l=Zt){let d=this.elements,c=2*o/(i-t),h=2*o/(r-n),u=(i+t)/(i-t),m=(r+n)/(r-n),f,v;if(l===Zt)f=-(s+o)/(s-o),v=-2*s*o/(s-o);else if(l===Ta)f=-s/(s-o),v=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return d[0]=c,d[4]=0,d[8]=u,d[12]=0,d[1]=0,d[5]=h,d[9]=m,d[13]=0,d[2]=0,d[6]=0,d[10]=f,d[14]=v,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,i,r,n,o,s,l=Zt){let d=this.elements,c=1/(i-t),h=1/(r-n),u=1/(s-o),m=(i+t)*c,f=(r+n)*h,v,_;if(l===Zt)v=(s+o)*u,_=-2*u;else if(l===Ta)v=o*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return d[0]=2*c,d[4]=0,d[8]=0,d[12]=-m,d[1]=0,d[5]=2*h,d[9]=0,d[13]=-f,d[2]=0,d[6]=0,d[10]=_,d[14]=-v,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<16;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<16;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t[i+9]=r[9],t[i+10]=r[10],t[i+11]=r[11],t[i+12]=r[12],t[i+13]=r[13],t[i+14]=r[14],t[i+15]=r[15],t}},Si=new I,Et=new Fe,jh=new I(0,0,0),Xh=new I(1,1,1),v2=new I,Ua=new I,st=new I,ss=new Fe,ls=new f2,O1=class P4{constructor(t=0,i=0,r=0,n=P4.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=r,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,r,n=this._order){return this._x=t,this._y=i,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,r=!0){let n=t.elements,o=n[0],s=n[4],l=n[8],d=n[1],c=n[5],h=n[9],u=n[2],m=n[6],f=n[10];switch(i){case"XYZ":this._y=Math.asin(W1(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-W1(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,f),this._z=Math.atan2(d,c)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(W1(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(d,o));break;case"ZYX":this._y=Math.asin(-W1(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(m,f),this._z=Math.atan2(d,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(W1(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(l,f));break;case"XZY":this._z=Math.asin(-W1(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,r===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,r){return ss.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ss,i,r)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return ls.setFromEuler(this),this.setFromQuaternion(ls,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};O1.DEFAULT_ORDER="XYZ";var rn=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},Yh=0,cs=new I,Mi=new f2,$t=new Fe,ka=new I,zr=new I,qh=new I,Zh=new f2,ds=new I(1,0,0),hs=new I(0,1,0),us=new I(0,0,1),ms={type:"added"},Qh={type:"removed"},wi={type:"childadded",child:null},an={type:"childremoved",child:null},N1=class w3 extends mi{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Yh++}),this.uuid=Mt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=w3.DEFAULT_UP.clone();let t=new I,i=new O1,r=new f2,n=new I(1,1,1);function o(){r.setFromEuler(i,!1)}function s(){i.setFromQuaternion(r,void 0,!1)}i._onChange(o),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Fe},normalMatrix:{value:new je}}),this.matrix=new Fe,this.matrixWorld=new Fe,this.matrixAutoUpdate=w3.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=w3.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new rn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Mi.setFromAxisAngle(t,i),this.quaternion.multiply(Mi),this}rotateOnWorldAxis(t,i){return Mi.setFromAxisAngle(t,i),this.quaternion.premultiply(Mi),this}rotateX(t){return this.rotateOnAxis(ds,t)}rotateY(t){return this.rotateOnAxis(hs,t)}rotateZ(t){return this.rotateOnAxis(us,t)}translateOnAxis(t,i){return cs.copy(t).applyQuaternion(this.quaternion),this.position.add(cs.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(ds,t)}translateY(t){return this.translateOnAxis(hs,t)}translateZ(t){return this.translateOnAxis(us,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4($t.copy(this.matrixWorld).invert())}lookAt(t,i,r){t.isVector3?ka.copy(t):ka.set(t,i,r);let n=this.parent;this.updateWorldMatrix(!0,!1),zr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$t.lookAt(zr,ka,this.up):$t.lookAt(ka,zr,this.up),this.quaternion.setFromRotationMatrix($t),n&&($t.extractRotation(n.matrixWorld),Mi.setFromRotationMatrix($t),this.quaternion.premultiply(Mi.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(ms),wi.child=t,this.dispatchEvent(wi),wi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(Qh),an.child=t,this.dispatchEvent(an),an.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),$t.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),$t.multiply(t.parent.matrixWorld)),t.applyMatrix4($t),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(ms),wi.child=t,this.dispatchEvent(wi),wi.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let r=0,n=this.children.length;r<n;r++){let o=this.children[r].getObjectByProperty(t,i);if(o!==void 0)return o}}getObjectsByProperty(t,i,r=[]){this[t]===i&&r.push(this);let n=this.children;for(let o=0,s=n.length;o<s;o++)n[o].getObjectsByProperty(t,i,r);return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zr,t,qh),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(zr,Zh,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverseVisible(t)}traverseAncestors(t){let i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let i=this.children;for(let r=0,n=i.length;r<n;r++){let o=i[r];(o.matrixWorldAutoUpdate===!0||t===!0)&&o.updateMatrixWorld(t)}}updateWorldMatrix(t,i){let r=this.parent;if(t===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i===!0){let n=this.children;for(let o=0,s=n.length;o<s;o++){let l=n[o];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(t){let i=t===void 0||typeof t=="string",r={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let n={};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),this.frustumCulled===!1&&(n.frustumCulled=!1),this.renderOrder!==0&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),this.boundingBox!==null&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()}));function o(l,d){return l[d.uuid]===void 0&&(l[d.uuid]=d.toJSON(t)),d.uuid}if(this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let d=l.shapes;if(Array.isArray(d))for(let c=0,h=d.length;c<h;c++){let u=d[c];o(t.shapes,u)}else o(t.shapes,d)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let d=0,c=this.material.length;d<c;d++)l.push(o(t.materials,this.material[d]));n.material=l}else n.material=o(t.materials,this.material);if(this.children.length>0){n.children=[];for(let l=0;l<this.children.length;l++)n.children.push(this.children[l].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let l=0;l<this.animations.length;l++){let d=this.animations[l];n.animations.push(o(t.animations,d))}}if(i){let l=s(t.geometries),d=s(t.materials),c=s(t.textures),h=s(t.images),u=s(t.shapes),m=s(t.skeletons),f=s(t.animations),v=s(t.nodes);l.length>0&&(r.geometries=l),d.length>0&&(r.materials=d),c.length>0&&(r.textures=c),h.length>0&&(r.images=h),u.length>0&&(r.shapes=u),m.length>0&&(r.skeletons=m),f.length>0&&(r.animations=f),v.length>0&&(r.nodes=v)}return r.object=n,r;function s(l){let d=[];for(let c in l){let h=l[c];delete h.metadata,d.push(h)}return d}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let r=0;r<t.children.length;r++){let n=t.children[r];this.add(n.clone())}return this}};N1.DEFAULT_UP=new I(0,1,0),N1.DEFAULT_MATRIX_AUTO_UPDATE=!0,N1.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var bt=new I,e2=new I,nn=new I,t2=new I,Ai=new I,Ei=new I,fs=new I,on=new I,sn=new I,ln=new I,Oa=class Er{constructor(t=new I,i=new I,r=new I){this.a=t,this.b=i,this.c=r}static getNormal(t,i,r,n){n.subVectors(r,i),bt.subVectors(t,i),n.cross(bt);let o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}static getBarycoord(t,i,r,n,o){bt.subVectors(n,i),e2.subVectors(r,i),nn.subVectors(t,i);let s=bt.dot(bt),l=bt.dot(e2),d=bt.dot(nn),c=e2.dot(e2),h=e2.dot(nn),u=s*c-l*l;if(u===0)return o.set(0,0,0),null;let m=1/u,f=(c*d-l*h)*m,v=(s*h-l*d)*m;return o.set(1-f-v,v,f)}static containsPoint(t,i,r,n){return this.getBarycoord(t,i,r,n,t2)===null?!1:t2.x>=0&&t2.y>=0&&t2.x+t2.y<=1}static getInterpolation(t,i,r,n,o,s,l,d){return this.getBarycoord(t,i,r,n,t2)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(o,t2.x),d.addScaledVector(s,t2.y),d.addScaledVector(l,t2.z),d)}static isFrontFacing(t,i,r,n){return bt.subVectors(r,i),e2.subVectors(t,i),bt.cross(e2).dot(n)<0}set(t,i,r){return this.a.copy(t),this.b.copy(i),this.c.copy(r),this}setFromPointsAndIndices(t,i,r,n){return this.a.copy(t[i]),this.b.copy(t[r]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,i,r,n){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,n),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return bt.subVectors(this.c,this.b),e2.subVectors(this.a,this.b),bt.cross(e2).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Er.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Er.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,r,n,o){return Er.getInterpolation(t,this.a,this.b,this.c,i,r,n,o)}containsPoint(t){return Er.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Er.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){let r=this.a,n=this.b,o=this.c,s,l;Ai.subVectors(n,r),Ei.subVectors(o,r),on.subVectors(t,r);let d=Ai.dot(on),c=Ei.dot(on);if(d<=0&&c<=0)return i.copy(r);sn.subVectors(t,n);let h=Ai.dot(sn),u=Ei.dot(sn);if(h>=0&&u<=h)return i.copy(n);let m=d*u-h*c;if(m<=0&&d>=0&&h<=0)return s=d/(d-h),i.copy(r).addScaledVector(Ai,s);ln.subVectors(t,o);let f=Ai.dot(ln),v=Ei.dot(ln);if(v>=0&&f<=v)return i.copy(o);let _=f*c-d*v;if(_<=0&&c>=0&&v<=0)return l=c/(c-v),i.copy(r).addScaledVector(Ei,l);let g=h*v-f*u;if(g<=0&&u-h>=0&&f-v>=0)return fs.subVectors(o,n),l=(u-h)/(u-h+(f-v)),i.copy(n).addScaledVector(fs,l);let p=1/(g+_+m);return s=_*p,l=m*p,i.copy(r).addScaledVector(Ai,s).addScaledVector(Ei,l)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ps={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},x2={h:0,s:0,l:0},za={h:0,s:0,l:0};function cn(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}var Ue=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=J1){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,n1.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=n1.workingColorSpace){return this.r=e,this.g=t,this.b=i,n1.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=n1.workingColorSpace){if(e=X3(e,1),t=W1(t,0,1),i=W1(i,0,1),t===0)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,o=2*i-n;this.r=cn(o,n,e+1/3),this.g=cn(o,n,e),this.b=cn(o,n,e-1/3)}return n1.toWorkingColorSpace(this,r),this}setStyle(e,t=J1){function i(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let n,o=r[1],s=r[2];switch(o){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],o=n.length;if(o===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=J1){let i=ps[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=gi(e.r),this.g=gi(e.g),this.b=gi(e.b),this}copyLinearToSRGB(e){return this.r=q3(e.r),this.g=q3(e.g),this.b=q3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=J1){return n1.fromWorkingColorSpace(j1.copy(this),e),Math.round(W1(j1.r*255,0,255))*65536+Math.round(W1(j1.g*255,0,255))*256+Math.round(W1(j1.b*255,0,255))}getHexString(e=J1){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=n1.workingColorSpace){n1.fromWorkingColorSpace(j1.copy(this),t);let i=j1.r,r=j1.g,n=j1.b,o=Math.max(i,r,n),s=Math.min(i,r,n),l,d,c=(s+o)/2;if(s===o)l=0,d=0;else{let h=o-s;switch(d=c<=.5?h/(o+s):h/(2-o-s),o){case i:l=(r-n)/h+(r<n?6:0);break;case r:l=(n-i)/h+2;break;case n:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=d,e.l=c,e}getRGB(e,t=n1.workingColorSpace){return n1.fromWorkingColorSpace(j1.copy(this),t),e.r=j1.r,e.g=j1.g,e.b=j1.b,e}getStyle(e=J1){n1.fromWorkingColorSpace(j1.copy(this),e);let t=j1.r,i=j1.g,r=j1.b;return e!==J1?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(x2),this.setHSL(x2.h+e,x2.s+t,x2.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(x2),e.getHSL(za);let i=Rr(x2.h,za.h,t),r=Rr(x2.s,za.s,t),n=Rr(x2.l,za.l,t);return this.setHSL(i,r,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,r=this.b,n=e.elements;return this.r=n[0]*t+n[3]*i+n[6]*r,this.g=n[1]*t+n[4]*i+n[7]*r,this.b=n[2]*t+n[5]*i+n[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},j1=new Ue;Ue.NAMES=ps;var Jh=0,mt=class extends mi{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Jh++}),this.uuid=Mt(),this.name="",this.type="Material",this.blending=oi,this.side=Nt,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=L3,this.blendDst=R3,this.blendEquation=O2,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ue(0,0,0),this.blendAlpha=0,this.depthFunc=ya,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=qo,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ui,this.stencilZFail=ui,this.stencilZPass=ui,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,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!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.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.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),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&&this.attenuationDistance!==1/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!==oi&&(i.blending=this.blending),this.side!==Nt&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==L3&&(i.blendSrc=this.blendSrc),this.blendDst!==R3&&(i.blendDst=this.blendDst),this.blendEquation!==O2&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ya&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==qo&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ui&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ui&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ui&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&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!==void 0&&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.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(n){let o=[];for(let s in n){let l=n[s];delete l.metadata,o.push(l)}return o}if(t){let n=r(e.textures),o=r(e.images);n.length>0&&(i.textures=n),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let r=t.length;i=new Array(r);for(let n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},lt=class extends mt{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ue(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new O1,this.combine=no,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},I1=new I,Va=new ye,X1=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=j3,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Q1,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return es("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,n=this.itemSize;r<n;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Va.fromBufferAttribute(this,t),Va.applyMatrix3(e),this.setXY(t,Va.x,Va.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)I1.fromBufferAttribute(this,t),I1.applyMatrix3(e),this.setXYZ(t,I1.x,I1.y,I1.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)I1.fromBufferAttribute(this,t),I1.applyMatrix4(e),this.setXYZ(t,I1.x,I1.y,I1.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)I1.fromBufferAttribute(this,t),I1.applyNormalMatrix(e),this.setXYZ(t,I1.x,I1.y,I1.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)I1.fromBufferAttribute(this,t),I1.transformDirection(e),this.setXYZ(t,I1.x,I1.y,I1.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=wt(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=c1(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=wt(t,this.array)),t}setX(e,t){return this.normalized&&(t=c1(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=wt(t,this.array)),t}setY(e,t){return this.normalized&&(t=c1(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=wt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=c1(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=wt(t,this.array)),t}setW(e,t){return this.normalized&&(t=c1(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=c1(t,this.array),i=c1(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=c1(t,this.array),i=c1(i,this.array),r=c1(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,n){return e*=this.itemSize,this.normalized&&(t=c1(t,this.array),i=c1(i,this.array),r=c1(r,this.array),n=c1(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==j3&&(e.usage=this.usage),e}},gs=class extends X1{constructor(e,t,i){super(new Uint16Array(e),t,i)}},_s=class extends X1{constructor(e,t,i){super(new Uint32Array(e),t,i)}},rt=class extends X1{constructor(e,t,i){super(new Float32Array(e),t,i)}},Kh=0,ft=new Fe,dn=new N1,bi=new I,ct=new Qt,Vr=new Qt,z1=new I,Ut=class N4 extends mi{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Kh++}),this.uuid=Mt(),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(t){return Array.isArray(t)?this.index=new(Ko(t)?_s:gs)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,r=0){this.groups.push({start:t,count:i,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){let i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);let r=this.attributes.normal;if(r!==void 0){let o=new je().getNormalMatrix(t);r.applyNormalMatrix(o),r.needsUpdate=!0}let n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ft.makeRotationFromQuaternion(t),this.applyMatrix4(ft),this}rotateX(t){return ft.makeRotationX(t),this.applyMatrix4(ft),this}rotateY(t){return ft.makeRotationY(t),this.applyMatrix4(ft),this}rotateZ(t){return ft.makeRotationZ(t),this.applyMatrix4(ft),this}translate(t,i,r){return ft.makeTranslation(t,i,r),this.applyMatrix4(ft),this}scale(t,i,r){return ft.makeScale(t,i,r),this.applyMatrix4(ft),this}lookAt(t){return dn.lookAt(t),dn.updateMatrix(),this.applyMatrix4(dn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(bi).negate(),this.translate(bi.x,bi.y,bi.z),this}setFromPoints(t){let i=[];for(let r=0,n=t.length;r<n;r++){let o=t[r];i.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new rt(i,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qt);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let r=0,n=i.length;r<n;r++){let o=i[r];ct.setFromBufferAttribute(o),this.morphTargetsRelative?(z1.addVectors(this.boundingBox.min,ct.min),this.boundingBox.expandByPoint(z1),z1.addVectors(this.boundingBox.max,ct.max),this.boundingBox.expandByPoint(z1)):(this.boundingBox.expandByPoint(ct.min),this.boundingBox.expandByPoint(ct.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dt);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new I,1/0);return}if(t){let r=this.boundingSphere.center;if(ct.setFromBufferAttribute(t),i)for(let o=0,s=i.length;o<s;o++){let l=i[o];Vr.setFromBufferAttribute(l),this.morphTargetsRelative?(z1.addVectors(ct.min,Vr.min),ct.expandByPoint(z1),z1.addVectors(ct.max,Vr.max),ct.expandByPoint(z1)):(ct.expandByPoint(Vr.min),ct.expandByPoint(Vr.max))}ct.getCenter(r);let n=0;for(let o=0,s=t.count;o<s;o++)z1.fromBufferAttribute(t,o),n=Math.max(n,r.distanceToSquared(z1));if(i)for(let o=0,s=i.length;o<s;o++){let l=i[o],d=this.morphTargetsRelative;for(let c=0,h=l.count;c<h;c++)z1.fromBufferAttribute(l,c),d&&(bi.fromBufferAttribute(t,c),z1.add(bi)),n=Math.max(n,r.distanceToSquared(z1))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let r=i.position,n=i.normal,o=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new X1(new Float32Array(4*r.count),4));let s=this.getAttribute("tangent"),l=[],d=[];for(let U=0;U<r.count;U++)l[U]=new I,d[U]=new I;let c=new I,h=new I,u=new I,m=new ye,f=new ye,v=new ye,_=new I,g=new I;function p(U,S,M){c.fromBufferAttribute(r,U),h.fromBufferAttribute(r,S),u.fromBufferAttribute(r,M),m.fromBufferAttribute(o,U),f.fromBufferAttribute(o,S),v.fromBufferAttribute(o,M),h.sub(c),u.sub(c),f.sub(m),v.sub(m);let k=1/(f.x*v.y-v.x*f.y);isFinite(k)&&(_.copy(h).multiplyScalar(v.y).addScaledVector(u,-f.y).multiplyScalar(k),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-v.x).multiplyScalar(k),l[U].add(_),l[S].add(_),l[M].add(_),d[U].add(g),d[S].add(g),d[M].add(g))}let y=this.groups;y.length===0&&(y=[{start:0,count:t.count}]);for(let U=0,S=y.length;U<S;++U){let M=y[U],k=M.start,R=M.count;for(let D=k,V=k+R;D<V;D+=3)p(t.getX(D+0),t.getX(D+1),t.getX(D+2))}let x=new I,b=new I,N=new I,A=new I;function C(U){N.fromBufferAttribute(n,U),A.copy(N);let S=l[U];x.copy(S),x.sub(N.multiplyScalar(N.dot(S))).normalize(),b.crossVectors(A,S);let M=b.dot(d[U])<0?-1:1;s.setXYZW(U,x.x,x.y,x.z,M)}for(let U=0,S=y.length;U<S;++U){let M=y[U],k=M.start,R=M.count;for(let D=k,V=k+R;D<V;D+=3)C(t.getX(D+0)),C(t.getX(D+1)),C(t.getX(D+2))}}computeVertexNormals(){let t=this.index,i=this.getAttribute("position");if(i!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new X1(new Float32Array(i.count*3),3),this.setAttribute("normal",r);else for(let m=0,f=r.count;m<f;m++)r.setXYZ(m,0,0,0);let n=new I,o=new I,s=new I,l=new I,d=new I,c=new I,h=new I,u=new I;if(t)for(let m=0,f=t.count;m<f;m+=3){let v=t.getX(m+0),_=t.getX(m+1),g=t.getX(m+2);n.fromBufferAttribute(i,v),o.fromBufferAttribute(i,_),s.fromBufferAttribute(i,g),h.subVectors(s,o),u.subVectors(n,o),h.cross(u),l.fromBufferAttribute(r,v),d.fromBufferAttribute(r,_),c.fromBufferAttribute(r,g),l.add(h),d.add(h),c.add(h),r.setXYZ(v,l.x,l.y,l.z),r.setXYZ(_,d.x,d.y,d.z),r.setXYZ(g,c.x,c.y,c.z)}else for(let m=0,f=i.count;m<f;m+=3)n.fromBufferAttribute(i,m+0),o.fromBufferAttribute(i,m+1),s.fromBufferAttribute(i,m+2),h.subVectors(s,o),u.subVectors(n,o),h.cross(u),r.setXYZ(m+0,h.x,h.y,h.z),r.setXYZ(m+1,h.x,h.y,h.z),r.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let i=0,r=t.count;i<r;i++)z1.fromBufferAttribute(t,i),z1.normalize(),t.setXYZ(i,z1.x,z1.y,z1.z)}toNonIndexed(){function t(l,d){let c=l.array,h=l.itemSize,u=l.normalized,m=new c.constructor(d.length*h),f=0,v=0;for(let _=0,g=d.length;_<g;_++){l.isInterleavedBufferAttribute?f=d[_]*l.data.stride+l.offset:f=d[_]*h;for(let p=0;p<h;p++)m[v++]=c[f++]}return new X1(m,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let i=new N4,r=this.index.array,n=this.attributes;for(let l in n){let d=n[l],c=t(d,r);i.setAttribute(l,c)}let o=this.morphAttributes;for(let l in o){let d=[],c=o[l];for(let h=0,u=c.length;h<u;h++){let m=c[h],f=t(m,r);d.push(f)}i.morphAttributes[l]=d}i.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let l=0,d=s.length;l<d;l++){let c=s[l];i.addGroup(c.start,c.count,c.materialIndex)}return i}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let d=this.parameters;for(let c in d)d[c]!==void 0&&(t[c]=d[c]);return t}t.data={attributes:{}};let i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});let r=this.attributes;for(let d in r){let c=r[d];t.data.attributes[d]=c.toJSON(t.data)}let n={},o=!1;for(let d in this.morphAttributes){let c=this.morphAttributes[d],h=[];for(let u=0,m=c.length;u<m;u++){let f=c[u];h.push(f.toJSON(t.data))}h.length>0&&(n[d]=h,o=!0)}o&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));let l=this.boundingSphere;return l!==null&&(t.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let i={};this.name=t.name;let r=t.index;r!==null&&this.setIndex(r.clone(i));let n=t.attributes;for(let c in n){let h=n[c];this.setAttribute(c,h.clone(i))}let o=t.morphAttributes;for(let c in o){let h=[],u=o[c];for(let m=0,f=u.length;m<f;m++)h.push(u[m].clone(i));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let s=t.groups;for(let c=0,h=s.length;c<h;c++){let u=s[c];this.addGroup(u.start,u.count,u.materialIndex)}let l=t.boundingBox;l!==null&&(this.boundingBox=l.clone());let d=t.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},vs=new Fe,B2=new Or,Ba=new Dt,xs=new I,Ci=new I,Ti=new I,Ii=new I,hn=new I,Fa=new I,Ha=new ye,Ga=new ye,Wa=new ye,ys=new I,Ss=new I,Ms=new I,ja=new I,Xa=new I,v1=class extends N1{constructor(e=new Ut,t=new lt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){let i=this.geometry,r=i.attributes.position,n=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);let s=this.morphTargetInfluences;if(n&&s){Fa.set(0,0,0);for(let l=0,d=n.length;l<d;l++){let c=s[l],h=n[l];c!==0&&(hn.fromBufferAttribute(h,e),o?Fa.addScaledVector(hn,c):Fa.addScaledVector(hn.sub(t),c))}t.add(Fa)}return t}raycast(e,t){let i=this.geometry,r=this.material,n=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ba.copy(i.boundingSphere),Ba.applyMatrix4(n),B2.copy(e.ray).recast(e.near),!(Ba.containsPoint(B2.origin)===!1&&(B2.intersectSphere(Ba,xs)===null||B2.origin.distanceToSquared(xs)>(e.far-e.near)**2))&&(vs.copy(n).invert(),B2.copy(e.ray).applyMatrix4(vs),!(i.boundingBox!==null&&B2.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,B2)))}_computeIntersections(e,t,i){let r,n=this.geometry,o=this.material,s=n.index,l=n.attributes.position,d=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,m=n.drawRange;if(s!==null)if(Array.isArray(o))for(let f=0,v=u.length;f<v;f++){let _=u[f],g=o[_.materialIndex],p=Math.max(_.start,m.start),y=Math.min(s.count,Math.min(_.start+_.count,m.start+m.count));for(let x=p,b=y;x<b;x+=3){let N=s.getX(x),A=s.getX(x+1),C=s.getX(x+2);r=Ya(this,g,e,i,d,c,h,N,A,C),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{let f=Math.max(0,m.start),v=Math.min(s.count,m.start+m.count);for(let _=f,g=v;_<g;_+=3){let p=s.getX(_),y=s.getX(_+1),x=s.getX(_+2);r=Ya(this,o,e,i,d,c,h,p,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let f=0,v=u.length;f<v;f++){let _=u[f],g=o[_.materialIndex],p=Math.max(_.start,m.start),y=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let x=p,b=y;x<b;x+=3){let N=x,A=x+1,C=x+2;r=Ya(this,g,e,i,d,c,h,N,A,C),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{let f=Math.max(0,m.start),v=Math.min(l.count,m.start+m.count);for(let _=f,g=v;_<g;_+=3){let p=_,y=_+1,x=_+2;r=Ya(this,o,e,i,d,c,h,p,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}};function $h(e,t,i,r,n,o,s,l){let d;if(t.side===tt?d=r.intersectTriangle(s,o,n,!0,l):d=r.intersectTriangle(n,o,s,t.side===Nt,l),d===null)return null;Xa.copy(l),Xa.applyMatrix4(e.matrixWorld);let c=i.ray.origin.distanceTo(Xa);return c<i.near||c>i.far?null:{distance:c,point:Xa.clone(),object:e}}function Ya(e,t,i,r,n,o,s,l,d,c){e.getVertexPosition(l,Ci),e.getVertexPosition(d,Ti),e.getVertexPosition(c,Ii);let h=$h(e,t,i,r,Ci,Ti,Ii,ja);if(h){n&&(Ha.fromBufferAttribute(n,l),Ga.fromBufferAttribute(n,d),Wa.fromBufferAttribute(n,c),h.uv=Oa.getInterpolation(ja,Ci,Ti,Ii,Ha,Ga,Wa,new ye)),o&&(Ha.fromBufferAttribute(o,l),Ga.fromBufferAttribute(o,d),Wa.fromBufferAttribute(o,c),h.uv1=Oa.getInterpolation(ja,Ci,Ti,Ii,Ha,Ga,Wa,new ye)),s&&(ys.fromBufferAttribute(s,l),Ss.fromBufferAttribute(s,d),Ms.fromBufferAttribute(s,c),h.normal=Oa.getInterpolation(ja,Ci,Ti,Ii,ys,Ss,Ms,new I),h.normal.dot(r.direction)>0&&h.normal.multiplyScalar(-1));let u={a:l,b:d,c,normal:new I,materialIndex:0};Oa.getNormal(Ci,Ti,Ii,u.normal),h.face=u}return h}var un=class L4 extends Ut{constructor(t=1,i=1,r=1,n=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:r,widthSegments:n,heightSegments:o,depthSegments:s};let l=this;n=Math.floor(n),o=Math.floor(o),s=Math.floor(s);let d=[],c=[],h=[],u=[],m=0,f=0;v("z","y","x",-1,-1,r,i,t,s,o,0),v("z","y","x",1,-1,r,i,-t,s,o,1),v("x","z","y",1,1,t,r,i,n,s,2),v("x","z","y",1,-1,t,r,-i,n,s,3),v("x","y","z",1,-1,t,i,r,n,o,4),v("x","y","z",-1,-1,t,i,-r,n,o,5),this.setIndex(d),this.setAttribute("position",new rt(c,3)),this.setAttribute("normal",new rt(h,3)),this.setAttribute("uv",new rt(u,2));function v(_,g,p,y,x,b,N,A,C,U,S){let M=b/C,k=N/U,R=b/2,D=N/2,V=A/2,q=C+1,W=U+1,Q=0,z=0,J=new I;for(let j=0;j<W;j++){let de=j*k-D;for(let oe=0;oe<q;oe++){let X=oe*M-R;J[_]=X*y,J[g]=de*x,J[p]=V,c.push(J.x,J.y,J.z),J[_]=0,J[g]=0,J[p]=A>0?1:-1,h.push(J.x,J.y,J.z),u.push(oe/C),u.push(1-j/U),Q+=1}}for(let j=0;j<U;j++)for(let de=0;de<C;de++){let oe=m+de+q*j,X=m+de+q*(j+1),K=m+(de+1)+q*(j+1),le=m+(de+1)+q*j;d.push(oe,X,le),d.push(X,K,le),z+=6}l.addGroup(f,z,S),f+=z,m+=Q}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new L4(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Pi(e){let t={};for(let i in e){t[i]={};for(let r in e[i]){let n=e[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][r]=null):t[i][r]=n.clone():Array.isArray(n)?t[i][r]=n.slice():t[i][r]=n}}return t}function K1(e){let t={};for(let i=0;i<e.length;i++){let r=Pi(e[i]);for(let n in r)t[n]=r[n]}return t}function eu(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}function ws(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:n1.workingColorSpace}var qa={clone:Pi,merge:K1},tu=`void main() {
1
+ (function(h1,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("axios"),require("@qispace/player-core"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@qispace/player-core","three"],a):(h1=typeof globalThis<"u"?globalThis:h1||self,a(h1["vue3-player"]={},h1.Vue,h1.axios,h1.PlayerCore,h1.THREE))})(this,function(h1,a,Pt,z4,U2){"use strict";var mM=Object.defineProperty;var fM=(h1,a,Pt)=>a in h1?mM(h1,a,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):h1[a]=Pt;var D2=(h1,a,Pt)=>(fM(h1,typeof a!="symbol"?a+"":a,Pt),Pt);var _t,c1,$i,Tt,er,Ve,tr,ir,rr,ar,nr,or,sr,lr,cr,dr,l2,hr,ur,mr,fr,pr,gr,_r,vr,xr,yr,b1,Sr,Mr,jt,w1,wr;function V4(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const B4=V4(z4),F4=a.defineComponent({__name:"VFloatingCard",props:{pos:{},isHoverable:{type:Boolean}},emits:["outside"],setup(e,{emit:t}){const i=e,r=t,n=a.computed(()=>{let o,s,l,d;return i.pos.x<=i.pos.width/2?(o="-100%",l="-8px"):(o="0%",l="8px"),i.pos.y<=i.pos.height/2?(s="-100%",d="-8px"):(s="0%",d="8px"),`translate(${o}, ${s}) translate(${l}, ${d})`});return(o,s)=>{const l=a.resolveComponent("v-dialog"),d=a.resolveComponent("v-fade-transition");return a.openBlock(),a.createBlock(d,{origin:`top left ${o.pos.x} ${o.pos.y}`},{default:a.withCtx(()=>[o.isHoverable?(a.openBlock(),a.createElementBlock("div",{key:0,class:"floating-card",style:a.normalizeStyle({left:`${o.pos.x}px`,top:`${o.pos.y}px`,pointerEvents:"none",transform:n.value})},[a.renderSlot(o.$slots,"default",{isHoverable:o.isHoverable},void 0,!0)],4)):(a.openBlock(),a.createBlock(l,{key:1,value:!0,width:"auto","onClick:outside":s[0]||(s[0]=c=>r("outside",c))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default",{isHoverable:o.isHoverable},void 0,!0)]),_:3}))]),_:3},8,["origin"])}}}),ke=(e,t)=>{const i=e.__vccOpts||e;for(const[r,n]of t)i[r]=n;return i},B0=ke(F4,[["__scopeId","data-v-7d5e6067"]]),F0=ke(a.defineComponent({__name:"VHoverProbe",setup(e,{expose:t}){const i=a.ref(),r=a.computed(()=>window.getComputedStyle(i.value).display==="none");return t({isHoverEnabled:r}),(n,o)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"hoverCheck",ref:i,class:"hover-check"},null,512))}}),[["__scopeId","data-v-eb9b348d"]]),H4="data:image/png;base64,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",E3=a.defineComponent({__name:"VNorthDirection",props:{longitude:{}},setup(e){const t=e,i=a.computed(()=>({transform:`rotate(${90-(t.longitude||0)}deg)`,transition:" transform 0.5s ease-in"}));return(r,n)=>{const o=a.resolveComponent("v-img");return a.openBlock(),a.createBlock(o,{src:a.unref(H4),style:a.normalizeStyle(i.value)},null,8,["src","style"])}}}),H0=ke(a.defineComponent({__name:"VZoomBox",props:{desktop:{type:Boolean,default:!0},mobile:{type:Boolean,default:!0},maxScale:{default:10},consumeMouseClickWhenMoved:{type:Boolean,default:!0},consumeMouseUpWhenMoved:{type:Boolean,default:!0},position:{default:"absolute"}},emits:["update"],setup(e,{expose:t,emit:i}){const r=e,n=i;t({adjustZoom:Z});const o=a.ref(100),s=a.ref(0),l=a.ref(0),d=a.ref(!1),c=a.ref(!1),h=a.ref(void 0),u=a.ref(!1),m=a.ref(),f=a.computed(()=>`translateX(${s.value}px) translateY(${l.value}px) scale(${v.value})`),v=a.computed(()=>o.value/100),_=a.computed(()=>r.maxScale*100);a.watch([v,s,l],()=>{j()},{immediate:!0}),a.watch(()=>r.desktop,()=>{r.desktop?g():y()}),a.watch(()=>r.mobile,()=>{r.mobile?p():x()}),a.onMounted(()=>{r.desktop&&g(),r.mobile&&p()}),a.onBeforeUnmount(()=>{r.desktop&&y(),r.mobile&&x()});function g(){m.value.addEventListener("wheel",b,{capture:!0}),m.value.addEventListener("mousedown",N,{capture:!0}),m.value.addEventListener("mousemove",A,{capture:!0}),window.addEventListener("mouseup",C,{capture:!0}),window.addEventListener("click",U,{capture:!0})}function p(){m.value.addEventListener("touchstart",S,{capture:!0}),m.value.addEventListener("touchmove",M,{capture:!0}),window.addEventListener("touchend",k,{capture:!0}),window.addEventListener("touchcancel",k,{capture:!0})}function y(){m.value.removeEventListener("wheel",b,{capture:!0}),m.value.removeEventListener("mousedown",N,{capture:!0}),m.value.removeEventListener("mousemove",A,{capture:!0}),window.removeEventListener("mouseup",C,{capture:!0}),window.removeEventListener("click",U,{capture:!0})}function x(){m.value.removeEventListener("touchstart",S,{capture:!0}),m.value.removeEventListener("touchmove",M,{capture:!0}),window.removeEventListener("touchend",k,{capture:!0}),window.removeEventListener("touchcancel",k,{capture:!0})}function b(Q){const{x:V,y:J}=R(Q);Z(-Q.deltaY/10,V,J),Q.preventDefault()}function N(Q){d.value=!0,u.value=!1,h.value=Q}function A(Q){if(d.value){const{x:V,y:J}=R(Q),{x:Y,y:he}=R(h.value),ne={x:V-Y,y:J-he};D(ne.x),B(ne.y),u.value=!0,h.value=Q}}function C(Q){d.value&&u.value&&r.consumeMouseUpWhenMoved&&(Q.preventDefault(),Q.stopImmediatePropagation())}function U(Q){d.value&&(u.value&&r.consumeMouseClickWhenMoved&&(Q.preventDefault(),Q.stopImmediatePropagation()),d.value=!1)}function S(Q){d.value=Q.touches.length===1,c.value=Q.touches.length===2,h.value=Q}function M(Q){if(d.value){const{x:V,y:J}=R(Q.touches[0]),{x:Y,y:he}=R(h.value.touches[0]),ne={x:V-Y,y:J-he};D(ne.x),B(ne.y)}else if(c.value&&Q.touches.length===2){const{x:V,y:J}=R(Q.touches[0]),{x:Y,y:he}=R(h.value.touches[0]),{x:ne,y:q}=R(Q.touches[1]),{x:K,y:le}=R(h.value.touches[1]),de=Math.hypot(Y-K,he-le),ae=Math.hypot(V-ne,J-q),Me=(ne+V)/2,Be=(q+J)/2;Z(ae-de,Me,Be)}h.value=Q}function k(){d.value=!1,c.value=!1}function R(Q){const{left:V,top:J}=m.value.getBoundingClientRect();return{x:Q.clientX-V,y:Q.clientY-J}}function D(Q){const V=m.value.clientWidth,J=V*v.value;s.value=Math.max(Math.min(0,s.value+Q),-(J-V))}function B(Q){const V=m.value.clientHeight,J=V*v.value;l.value=Math.max(Math.min(0,l.value+Q),-(J-V))}function Z(Q,V,J){const Y=V!==void 0?V:m.value.clientWidth/2,he=J!==void 0?J:m.value.clientHeight/2,ne=m.value.clientWidth,q=m.value.clientHeight,K=ne*v.value,le=q*v.value;o.value=Math.min(Math.max(100,o.value+Q),_.value);const de=ne*v.value,ae=q*v.value,Me=de-K,Be=ae-le;s.value-=Y/ne*Me,l.value-=he/q*Be,D(0),B(0)}function j(){n("update",{scale:v.value,x:s.value,y:l.value,current:Math.min(Math.max(100,o.value),_.value),min:100,max:_.value,resolve:(Q,V)=>{const J=m.value.clientWidth,Y=m.value.clientHeight,he=s.value/-v.value,ne=l.value/-v.value,q=he+J/v.value,K=ne+Y/v.value,le=Q/J*(q-he)+he,de=V/Y*(K-ne)+ne;return{x:le,y:de}}})}return(Q,V)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"box",ref:m,class:"zoom-box-container",style:a.normalizeStyle({position:r.position})},[a.createElementVNode("div",{style:a.normalizeStyle({"transform-origin":"top left",transform:f.value}),class:"zoom-box"},[a.renderSlot(Q.$slots,"default",{},void 0,!0)],4)],4))}}),[["__scopeId","data-v-3e334a46"]]);var ri={};Object.defineProperty(ri,"__esModule",{value:!0});var G4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W4=typeof window<"u"&&typeof window.document<"u",j4=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,X4=(typeof self>"u"?"undefined":G4(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Y4=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),q4=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",G0=ri.isBrowser=W4;ri.isWebWorker=X4,ri.isNode=j4,ri.isJsDom=Y4,ri.isDeno=q4;function s1(e,t){return typeof e=="string"?`${e}${t}`:e(t)}const Z4={id:"player-wrapper"},Q4={id:"player-sizer"},J4={class:"player-control",id:"controls-top-left"},K4={class:"player-control",id:"controls-top-center"},$4={class:"player-control",id:"controls-top-right"},e5={class:"player-control",id:"controls-center-left"},t5={class:"player-control",id:"controls-center-center"},i5={class:"player-control",id:"controls-center-right"},r5={class:"player-control",id:"controls-bottom-left"},a5={class:"player-control",id:"controls-bottom-center"},n5={class:"player-control",id:"controls-bottom-right"},o5={id:"main-canvas"},s5=ke(a.defineComponent({__name:"VPlayer",props:{cdnFileResolver:{},interiorId:{},apartmentId:{},currentCameraId:{},showStaticImage:{type:Boolean},mouseSensitivity:{default:1}},emits:["newCameraCallback","newRotationCallback","newFloorCallback","newFovCallback","sunsimCallback","playerApiCallback","newSizeCallback","frontendMarkersUpdate"],setup(e,{expose:t,emit:i}){const r=B4.PlayerV2;t({updateFrontendMarkers:x=>{m.value&&g.value?m.value.updateFrontendMarkers(x):console.warn("Player API not initialized or not available. Cannot update frontend markers.")}});const n=e,{cdnFileResolver:o,interiorId:s,apartmentId:l,currentCameraId:d,showStaticImage:c,mouseSensitivity:h}=a.toRefs(n),u=i,m=a.ref(),f=a.ref(d.value),v=a.ref(0),_=a.ref(0),g=a.ref(!1);a.watch(d,()=>{f.value=d.value}),a.watch([s,l],async()=>{m.value&&await m.value.loadInterior(x=>s1(o.value,`/${s.value}/${l.value}${x}`),f.value,!1)}),a.watch(f,()=>{m.value&&m.value.goToCamera(f.value,!0),u("newCameraCallback",f.value)},{immediate:!0}),a.watch([o],async()=>{await y(),a.nextTick(async()=>{await p()})},{immediate:!0,deep:!0}),a.watch(m,()=>{if(m.value){u("playerApiCallback",m.value);const x=m.value.getCurrentCamera();x&&(f.value=x.id,u("sunsimCallback",x.sunsimDayOfYear))}});async function p(){y();const C={initialized:()=>{m.value=r.Main.getPlayerAPI();const S=m.value.getCurrentCamera();m.value.updateSettings({ACTIVE_TONEMAPPER:"AgXTonemap"}),S&&(f.value=S.id),g.value=!0},newCamera:S=>{u("newFloorCallback",S.floorLevel),u("sunsimCallback",S.sunsimDayOfYear),m.value&&m.value.resetMarkerBehaviour(0),f.value=S.id},newFOV:S=>{u("newFovCallback",S),_.value=S},newRotation:S=>{const M=S+0;u("newRotationCallback",M),v.value=M},onFrontendMarkersUpdate:S=>{u("frontendMarkersUpdate",S)}};if(!G0)return;const U=await new r.Main(S=>s1(o.value,`/${s.value}/${l.value}${S}`),"qpc",C,void 0,f.value);U&&(U.handleWindowResize(),window.addEventListener("resize",U.handleWindowResize.bind(U)),U.animate(),m.value=r.Main.getPlayerAPI(),m.value&&m.value.setLookSensitivity(h.value))}async function y(){m.value&&(await m.value.destroy(),m.value=void 0)}return a.onBeforeUnmount(()=>{y()}),(x,b)=>(a.openBlock(),a.createElementBlock("div",Z4,[a.createElementVNode("div",Q4,[a.renderSlot(x.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",J4,[a.renderSlot(x.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",K4,[a.renderSlot(x.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",$4,[a.renderSlot(x.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",e5,[a.renderSlot(x.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",t5,[a.renderSlot(x.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",i5,[a.renderSlot(x.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",r5,[a.renderSlot(x.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",a5,[a.renderSlot(x.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",n5,[a.renderSlot(x.$slots,"bottom-right",{},void 0,!0)]),a.createElementVNode("div",o5,[a.createElementVNode("canvas",{id:"qpc",style:a.normalizeStyle(a.unref(c)?"visibility:hidden":"visibility:visible")},null,4)])])]))}}),[["__scopeId","data-v-59081d9a"]]),B1=Symbol(),l5={style:{width:"24px",height:"24px"},viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg"},c5=["stroke"],d5=["stroke"],h5={class:"floor-level-label"},u5=ke(a.defineComponent({__name:"VFloorLevel",props:{level:{default:0},floorLevels:{default:()=>[]}},emits:["level"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(B1),o=a.computed(()=>{const h=i.floorLevels;return h.sort(),h}),s=a.computed(()=>o.value.indexOf(i.level)+1<=o.value.length/2?"lower":"upper"),l=a.computed(()=>s.value==="lower"),d=a.computed(()=>s.value==="upper");function c(){const h=i.level+1;h>=o.value.length?r("level",o.value[0]):r("level",o.value[h])}return(h,u)=>{const m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(f,{right:"",attach:""},{activator:a.withCtx(({props:v})=>[a.createVNode(m,a.mergeProps({style:{cursor:"pointer"},density:"comfortable",elevation:"1",icon:""},v,{onClick:c}),{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock("svg",l5,[a.createElementVNode("path",{d:"M8.98034 10.3472L1.54055 5.8855L8.98034 1.42384L16.4201 5.8855L8.98034 10.3472Z",fill:"white",stroke:d.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,c5),a.createElementVNode("path",{d:"M8.98034 14.7993L1.54055 10.3376L8.98034 5.87599L16.4201 10.3376L8.98034 14.7993Z",fill:"white",stroke:l.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,d5)]))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",h5,a.toDisplayString(a.unref(n).getLabel(s.value))+" "+a.toDisplayString(a.unref(n).getLabel("floor")),1)]),_:1})}}}),[["__scopeId","data-v-4c45966e"]]),m5={class:"d-none d-md-inline"},f5={class:"interior-selector-list"},p5=["onClick"],g5={class:"d-flex align-center justify-left pa-0 ma-0"},_5={class:"pa-0 ma-0"},v5={class:"text-caption ma-2 no-wrap"},x5=ke(a.defineComponent({__name:"VInteriorSelector",props:{cdnFileResolver:{type:[String,Function]},availableArchetypes:{},selectedIndex:{}},emits:["selectInterior"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(B1);return(o,s)=>{const l=a.resolveComponent("v-icon"),d=a.resolveComponent("v-btn"),c=a.resolveComponent("v-img"),h=a.resolveComponent("v-menu");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(h,{transition:"slide-x-reverse-transition",location:"top end",origin:"end bottom",elevation:"0",attach:""},{activator:a.withCtx(({props:u})=>[a.createVNode(d,a.mergeProps({rounded:""},u,{class:"text-capitalize"}),{default:a.withCtx(()=>[a.createVNode(l,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-palette-outline")]),_:1}),a.createElementVNode("span",m5,a.toDisplayString(a.unref(n).getLabel("interior")),1)]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("div",f5,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.availableArchetypes,(u,m)=>(a.openBlock(),a.createElementBlock("div",{key:`at-menuitem-${m}`,onClick:f=>r("selectInterior",u.archetypeID),class:a.normalizeClass(["interior-selector-list-item",{active:m===o.selectedIndex}])},[a.createElementVNode("div",g5,[a.createElementVNode("div",_5,[a.createVNode(c,{width:"100","max-width":"100",height:"66",src:u.url,class:"pa-0 ma-0"},null,8,["src"])]),a.createElementVNode("div",v5,a.toDisplayString(a.unref(n).get(u.title)),1)])],10,p5))),128))])]),_:1})])}}}),[["__scopeId","data-v-eece0130"]]),W0="data:image/png;base64,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",j0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMdSURBVHgB7dxBTttQEMbxsU32idouujM7FhjlBqQnaG5AbkBvUPUEpTegN8gR6AlAgQU70lWlQkUUscR+fVZrRKlL7CTQN6P/T0IJwYkUDfNhvzdEBAAAAAAAAAAAAAAAAAAAAAD+i+t+v3+5vT0Qg2IxqHBuP47jXTHIZMHEuYETeScGmSvYZb9fFiv1d7sWY9FcwWLn9u7ux/FbMcZeJPo4vLsrMhJjTBXsXhxWzMWiqYLdj8NKlCR7YoipgjnnhjUPDv11WVeMMFOwqywb+Zu6wnQlz81ck5kp2GNnhLmha7JIDCgjLy+K60cOmSVxvNk7OZmJciY6LM/z4YJDukVRmDj5sBGJcbywGLUnJAqpj0Qfh6mPw4smx/pY7GmPRfUd5uNw0PRYC7GoPxIbxGHFQiyqjsQ2cVjRHouqO8xHXOvVeP+cfVFMeySOpCV3bzVfI7WRuEwcVlxRvHl1dnYkCqntsFWiTfO8h+ZIXPqMT/PGpsqC1WxUtpVq3dhUWbC6jcrWr6F03kNnJK7hTE9rLKor2BrisKJy3kNdwdYRh3evpTAW9UXiGi98y1jUNu+hqmBXWTZcUxxWure3t31RRFXBoieIMG1jcGqWphrMbSxL1byHmg5rMLexrPIXQc3Jh5qCPekZnXMjUUJFJK6yMt+Ulo1NFR3WZm5jWVrmPXREYou5jWVpmfcIPhKfIw4rGmIx+A57jjisaIjF4AsWRVG7nWXnjhK/fJWUEefcuN1Tw4/FoCOxaRz6N3Hi22M8v7n5tDmd/hFp37a20qTTGcRR9F4aLGslSZL2jo+/SqA2JGALxthmviMO/RsY905Pv/zroNfn51N/c1h+XWfZbl7ug0VR2Um1i75Fno/8zQcJVNAd9mNn5+KvxV4feT4mx/P5/PPDbmrje5aN/N+DPV+8wYMfTV9OJpsSqGALVn78kI/D49/fzqKiOKiLvFWVkbnR6exHv7ouLR8LeQwu2IL57vroIy9NRA4ei7x1qiLTF2/6YjIJNhbxwEWamvkndgAAAAAAAAAAAAAAAAAAAAAAAAAAAABYxU+ILzGcMmFd0QAAAABJRU5ErkJggg==",y5=a.defineComponent({__name:"VCompass",props:{rotation:{}},setup(e){const t=e,i=a.ref(j0),r=a.ref({backgroundImage:`url(${W0})`,backgroundSize:"contain"}),n=a.computed(()=>({transform:`rotate(${-t.rotation+180}deg)`}));return(o,s)=>{const l=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(r.value),class:"compass-wrapper"},[a.createVNode(l,{class:"compass-needle",src:i.value,style:a.normalizeStyle(n.value)},null,8,["src","style"])],4)}}}),X0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAllBMVEUAAAD/rwD/rwD/qgP/qwL/qAL/qwP/qwH/rAL/rAL/qwL/qQD/qwL/qwD/qQD/qwL/pQD/qgH/nwD/pwD/qQL/rAL/qwD/qwT/rAP/qwL/rAL/rAD/rAL/qgD/qwL/qQP/rAP/rAH/qgH/qwL/qwD/qgL/rwD/qgD/qwH/qgD/qgL/rAD/qgD/qgD/qwH/rAP/qgX/qwA+O5E+AAAAMnRSTlMAECBg/3C/v5Dff4+PT1/PMN8QII9vf0CfgO9vnzDvUF+vr3BA3zA/z2+fX59g71AwcDsf6p0AAAFGSURBVHicvdRtT8MgEABgaM9hu1aHXV/cpm6zWt829f//OYEK9qC3NDF6HxYCTw5GuWPsd8GjqTIGOJtIZwDi/ymnKPflOSTub6cAcwdnkHk5AQY2v3Dzl2phga1EFkl5hScLbZc+LbUs/FltK5OpLpsmrS0NpbLLSu3Er1dgIsn0cdabEdlHlICL5IZSRq5gELcn7DCnsfQL24AX5PeNfAlAHSEOaYrFXaNiqwa7kO7V9L1dt9u25kX58cBY7dbZYz/MKdr2o06nrZ6klNX4AYRdf8aHzkL6QtxAG9KculjhS0nJMO0rSVmF5ZyWnn2jFC+36vcgLTzq+3lPRx6XrjjTqQ7iqJxY6+KLydp0ZWhrVHWE0JoqHq1NSHBxF0h+1Mh6LUMM5LC/Kht8h+5nG9zeTtbt37Ti3XT6+d29pkTXTZVEfAEKARRF2iiwhQAAAB10RVh0U29mdHdhcmUAQGx1bmFwYWludC9wbmctY29kZWP1QxkeAAAAAElFTkSuQmCC",S5={class:"d-flex flex-column align-center justify-center clock-face"},M5={class:"clock-icon"},w5={class:"clock-value grey--text text--darken-3"},A5=ke(a.defineComponent({__name:"VTimeOfDay",props:{hours:{default:0},minutes:{default:0}},setup(e){const t=e,i=a.computed(()=>[r(t.hours),":",r(t.minutes)].join(""));function r(n){return("0"+n).slice(-2)}return(n,o)=>{const s=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",S5,[a.createElementVNode("div",M5,[a.createVNode(s,{src:a.unref(X0),"aspect-ratio":"1"},null,8,["src"])]),a.createElementVNode("div",w5,a.toDisplayString(i.value),1)])}}}),[["__scopeId","data-v-874b2271"]]),b3=e=>(a.pushScopeId("data-v-86d91cc1"),e=e(),a.popScopeId(),e),E5={key:0,width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},b5=[b3(()=>a.createElementVNode("path",{d:"M5.38544 13C3.30939 13.9424 2 15.3211 2 16.8571C2 19.6975 6.47715 22 12 22C17.5228 22 22 19.6975 22 16.8571C22 15.3211 20.6906 13.9424 18.6146 13",class:"fill-grey"},null,-1)),b3(()=>a.createElementVNode("path",{d:"M8 9C8 7.89543 8.89543 7 10 7H14C15.1046 7 16 7.89543 16 9V12.875C16 13.4273 15.5523 13.875 15 13.875H14V17C14 17.5523 13.5523 18 13 18H11C10.4477 18 10 17.5523 10 17V13.875H9C8.44772 13.875 8 13.4273 8 12.875V9Z"},null,-1)),b3(()=>a.createElementVNode("path",{d:"M15 4C15 5.65685 13.6569 7 12 7C10.3431 7 9 5.65685 9 4C9 2.34315 10.3431 1 12 1C13.6569 1 15 2.34315 15 4Z"},null,-1))],C5=ke(a.defineComponent({__name:"VViewModeToggle",props:{showStaticImage:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const i=e,r=t,n=a.inject(B1),o=a.computed(()=>{let s="virtualTour";return i.showStaticImage||(s="slideShow"),s});return(s,l)=>{const d=a.resolveComponent("v-icon"),c=a.resolveComponent("v-btn"),h=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(h,{location:"top"},{activator:a.withCtx(({props:u})=>[a.createVNode(c,a.mergeProps({density:"comfortable",elevation:"1",icon:"",onClick:l[0]||(l[0]=m=>r("toggle"))},u),{default:a.withCtx(()=>[o.value==="virtualTour"?(a.openBlock(),a.createElementBlock("svg",E5,b5)):(a.openBlock(),a.createBlock(d,{key:1},{default:a.withCtx(()=>[a.createTextVNode("mdi-image-multiple")]),_:1}))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(n).getLabel(o.value)),1)]),_:1})}}}),[["__scopeId","data-v-86d91cc1"]]),k2=e=>(a.pushScopeId("data-v-627f8ee6"),e=e(),a.popScopeId(),e),T5={key:0,class:"desktop-content"},I5={class:"d-flex align-center justify-center"},P5={class:"box col d-flex flex-column align-bottom justify-center"},N5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M72 30H86.9736M86.9736 30L81 36M86.9736 30L81 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M27.9736 30H13M13 30L18.9736 36M13 30L18.9736 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M36 30H64V40C64 47.732 57.732 54 50 54V54C42.268 54 36 47.732 36 40V30Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 25C36 17.268 42.268 11 50 11V11V30H36V25Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 25C64 17.268 57.732 11 50 11V11V30H64V25Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 23V30C53.25 31.7949 51.7949 33.25 50 33.25C48.2051 33.25 46.75 31.7949 46.75 30V23C46.75 21.2051 48.2051 19.75 50 19.75C51.7949 19.75 53.25 21.2051 53.25 23Z",fill:"white",stroke:"black","stroke-width":"1.5"})])],-1)),L5={class:"text-div text-center text mt-2"},R5={class:"box col d-flex flex-column align-bottom justify-center"},D5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9936 27.0175C79.9881 19.276 66.3321 13.0323 49.492 13.0719C32.652 13.1116 19.0049 19.4194 19.0105 27.1609C19.016 34.9025 32.6721 41.1461 49.5121 41.1065C66.3521 41.0669 79.9992 34.759 79.9936 27.0175Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M61.8032 45.179L56.543 50.3218V28.0361L72.543 43.4647H65.0909L67.9402 50.3218L64.6526 52.0361L61.8032 45.179Z",fill:"white",stroke:"black","stroke-width":"1.5","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"})])],-1)),U5={class:"text-div text-center text mt-2"},k5={class:"box col d-flex flex-column align-bottom justify-center"},O5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M36 33H64V43C64 50.732 57.732 57 50 57V57C42.268 57 36 50.732 36 43V33Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 28C36 20.268 42.268 14 50 14V14V33H36V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 28C64 20.268 57.732 14 50 14V14V33H64V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 26V33C53.25 34.7949 51.7949 36.25 50 36.25C48.2051 36.25 46.75 34.7949 46.75 33V26C46.75 24.2051 48.2051 22.75 50 22.75C51.7949 22.75 53.25 24.2051 53.25 26Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M74.5352 20.7593L80.3458 26.5699C80.9316 27.1557 80.9316 28.1055 80.3458 28.6913C79.76 29.277 78.8103 29.277 78.2245 28.6913L72.4138 22.8806L74.5352 20.7593Z",fill:"black",stroke:"black","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("circle",{cx:"66.5",cy:"15.5",r:"9.75",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"66",y:"11",width:"1",height:"9",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"}),a.createElementVNode("rect",{x:"71",y:"15",width:"1",height:"9",transform:"rotate(90 71 15)",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"})])],-1)),z5={class:"text-div text-center text mt-2"},V5={class:"box col d-flex flex-column align-bottom justify-center"},B5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("rect",{x:"65.0967",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"39.5488",y:"29.6777",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-90 39.5488 29.6777)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"60.4512",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(90 60.4512 34.3228)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"34.9033",y:"55.2261",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-180 34.9033 55.2261)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M77.7025 44.3796C77.9599 44.5798 77.9599 44.9688 77.7025 45.169L74.6621 47.5338C74.3337 47.7892 73.8551 47.5552 73.8551 47.1391L73.8551 42.4095C73.8551 41.9935 74.3337 41.7594 74.6621 42.0149L77.7025 44.3796Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M49.6047 17.0724C49.8049 16.815 50.1939 16.815 50.3941 17.0724L52.7589 20.1128C53.0143 20.4412 52.7803 20.9198 52.3642 20.9198L47.6346 20.9198C47.2185 20.9198 46.9845 20.4412 47.2399 20.1128L49.6047 17.0724Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M50.3953 46.9281C50.1951 47.1855 49.8061 47.1855 49.6059 46.9281L47.2411 43.8877C46.9857 43.5592 47.2197 43.0807 47.6358 43.0807L52.3654 43.0807C52.7815 43.0807 53.0155 43.5592 52.7601 43.8877L50.3953 46.9281Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M22.2975 45.1692C22.0401 44.969 22.0401 44.58 22.2975 44.3798L25.3379 42.0151C25.6663 41.7596 26.1449 41.9937 26.1449 42.4097L26.1449 47.1393C26.1449 47.5554 25.6663 47.7894 25.3379 47.534L22.2975 45.1692Z",fill:"#FF3E3E"})])],-1)),F5={class:"text-div text-center text mt-2"},H5={key:1,class:"d-flex tablet-mobile-content"},G5={class:"box col my-1"},W5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50.5",height:"32.5",viewBox:"0 0 101 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M68 28H87.9736M87.9736 28L82 34M87.9736 28L82 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M33.9727 28H13.999M13.999 28L19.9727 34M13.999 28L19.9727 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.0361 33.0479C60.7502 31.9809 59.6536 31.3478 58.5866 31.6337C57.5197 31.9195 56.8865 33.0162 57.1724 34.0831L56.7195 32.3928C56.3979 31.1925 55.1641 30.4802 53.9638 30.8018C52.7635 31.1234 52.0512 32.3572 52.3728 33.5575L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M53.7316 38.6286L52.6963 34.7649M52.6963 34.7649L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233V25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516V39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176V43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779V33.0779V33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.942 36.4286M52.6963 34.7649L52.3728 33.5575C52.0512 32.3572 52.7635 31.1234 53.9638 30.8018V30.8018C55.1641 30.4802 56.3979 31.1925 56.7195 32.3928L57.3018 34.5661M58.2077 37.9469L57.3018 34.5661M57.3018 34.5661L57.1724 34.0831C56.8865 33.0162 57.5197 31.9195 58.5866 31.6337V31.6337C59.6536 31.3478 60.7502 31.9809 61.0361 33.0479L61.942 36.4286M62.3302 37.8775L61.942 36.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),j5={class:"text text-col text-center"},X5={class:"box col my-1"},Y5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9927 29.9814C79.9871 22.2398 66.3311 15.9962 49.491 16.0358C32.651 16.0754 19.0039 22.3833 19.0095 30.1248C19.015 37.8663 32.6711 44.11 49.5111 44.0704C66.3512 44.0308 79.9982 37.7229 79.9927 29.9814Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L68.5361 36.0479C68.2502 34.9809 67.1536 34.3478 66.0866 34.6337C65.0197 34.9195 64.3865 36.0162 64.6724 37.0831L64.2195 35.3928C63.8979 34.1925 62.6641 33.4802 61.4638 33.8018C60.2635 34.1234 59.5512 35.3572 59.8728 36.5575L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M61.2316 41.6286L60.1963 37.7649M60.1963 37.7649L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233V28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516V42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176V46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779V36.0779V36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L69.442 39.4286M60.1963 37.7649L59.8728 36.5575C59.5512 35.3572 60.2635 34.1234 61.4638 33.8018V33.8018C62.6641 33.4802 63.8979 34.1925 64.2195 35.3928L64.8018 37.5661M65.7077 40.9469L64.8018 37.5661M64.8018 37.5661L64.6724 37.0831C64.3865 36.0162 65.0197 34.9195 66.0866 34.6337V34.6337C67.1536 34.3478 68.2502 34.9809 68.5361 36.0479L69.442 39.4286M69.8302 40.8775L69.442 39.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),q5={class:"text text-col text-center"},Z5={class:"box col my-1"},Q5=k2(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M31 24.9736L31 10M31 10L25 15.9736M31 10L37 15.9736",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M31 40L31 54.9736M31 54.9736L25 49M31 54.9736L37 49",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L56.0348 26.8433C55.4825 25.8867 54.2593 25.5589 53.3027 26.1112C52.3462 26.6635 52.0184 27.8867 52.5707 28.8433L51.6957 27.3277C51.0744 26.2516 49.6983 25.8828 48.6221 26.5042C47.546 27.1255 47.1773 28.5016 47.7986 29.5777L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852Z",fill:"white"}),a.createElementVNode("path",{d:"M50.4236 34.1244L48.4236 30.6603M48.4236 30.6603L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23V23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728V42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442V35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013V26.4013V26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L57.7848 29.8744M48.4236 30.6603L47.7986 29.5777C47.1773 28.5016 47.546 27.1255 48.6221 26.5042V26.5042C49.6983 25.8828 51.0744 26.2516 51.6957 27.3277L52.8207 29.2763M54.5707 32.3074L52.8207 29.2763M52.8207 29.2763L52.5707 28.8433C52.0184 27.8867 52.3462 26.6635 53.3027 26.1112V26.1112C54.2593 25.5589 55.4825 25.8867 56.0348 26.8433L57.7848 29.8744M58.5348 31.1734L57.7848 29.8744",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),J5={class:"text text-col text-center"},K5={class:"text-h6 text-capitalize"},$5={class:"mt-2"},ec={class:"d-flex justify-center align-center checkbox-container"},tc={class:"text-caption"},ic=ke(a.defineComponent({__name:"VTutorial",emits:["closeTutorial"],setup(e,{emit:t}){const i=t,r=a.inject(B1),n=a.ref(!1),o=a.ref(!1),s=a.computed(()=>[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(c=>navigator.userAgent.match(c)));function l(){i("closeTutorial",n.value)}return(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-card-title"),m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-divider"),v=a.resolveComponent("v-card-text"),_=a.resolveComponent("v-card-actions"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-expand-transition"),y=a.resolveComponent("v-checkbox");return a.openBlock(),a.createBlock(a.Transition,{name:"fade-transition"},{default:a.withCtx(()=>[a.createVNode(g,{class:"mx-auto",elevation:"16"},{default:a.withCtx(()=>[a.createVNode(u,{class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small"},{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),_:1}),a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",null,a.toDisplayString(a.unref(r).getLabel("disclaimerTextShort")),1),a.createVNode(m,{variant:"tonal",size:"small",onClick:c[0]||(c[0]=x=>o.value=!0),class:"text-capitalize mt-2"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("learnMore"))+" ",1),a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-right")]),_:1})]),_:1}),a.createVNode(f,{class:"my-3"}),s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",T5,[a.createElementVNode("div",I5,[a.createElementVNode("div",P5,[N5,a.createElementVNode("div",L5,a.toDisplayString(a.unref(r).getLabel("clickAndDragToLookAround")),1)]),a.createElementVNode("div",R5,[D5,a.createElementVNode("div",U5,a.toDisplayString(a.unref(r).getLabel("clickOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",k5,[O5,a.createElementVNode("div",z5,a.toDisplayString(a.unref(r).getLabel("useTheMouseWheelToZoom")),1)]),a.createElementVNode("div",V5,[B5,a.createElementVNode("div",F5,a.toDisplayString(a.unref(r).getLabel("youCanAlsoUseTheArrowKeysToMoveAround")),1)])])])),s.value?(a.openBlock(),a.createElementBlock("div",H5,[a.createElementVNode("div",G5,[W5,a.createElementVNode("div",j5,a.toDisplayString(a.unref(r).getLabel("tapAndDragToLookAround")),1)]),a.createElementVNode("div",X5,[Y5,a.createElementVNode("div",q5,a.toDisplayString(a.unref(r).getLabel("tapOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",Z5,[Q5,a.createElementVNode("div",J5,a.toDisplayString(a.unref(r).getLabel("useTwoFingersToZoom")),1)])])):a.createCommentVNode("",!0),a.createVNode(f,{class:"my-1"})]),_:1}),a.createVNode(p,null,{default:a.withCtx(()=>[o.value?(a.openBlock(),a.createBlock(g,{key:0,class:"position-absolute w-100 bg-white",height:"100%",style:{bottom:"0"}},{default:a.withCtx(()=>[a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",K5,[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),a.createElementVNode("p",$5,a.toDisplayString(a.unref(r).getLabel("disclaimerText")),1)]),_:1}),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",size:"small",onClick:c[1]||(c[1]=x=>o.value=!1),class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-left")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("back")),1)]),_:1})]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",ec,[a.createVNode(y,{density:"compact",modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=x=>n.value=x),"hide-details":""},{label:a.withCtx(()=>[a.createElementVNode("span",tc,a.toDisplayString(a.unref(r).getLabel("dontShowAgain")),1)]),_:1},8,["modelValue"])]),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",onClick:c[3]||(c[3]=x=>l()),block:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("iUnderstand")),1)]),_:1})]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-627f8ee6"]]),rc=e=>(a.pushScopeId("data-v-bd4f66c3"),e=e(),a.popScopeId(),e),ac={class:"player-settings-ui"},nc={id:"settings-ui-form"},oc={class:"form-inputs"},sc={class:"setting-label"},lc={class:"setting-label"},cc=["max","min","step"],dc={class:"setting-label"},hc={class:"flex-grow-1 flex-shrink-0"},uc=["onUpdate:modelValue"],mc={key:3,"d-block":"",class:"mt-3"},fc={class:"d-flex justify-space-between"},pc={class:"setting-label"},gc={class:"mt-5 d-block",style:{width:"300px"}},_c=rc(()=>a.createElementVNode("div",{class:"setting-label"},"Enter Lut URL:",-1)),vc={class:"d-block",style:{width:"300px"}},xc={class:"form-buttons"},yc=ke(a.defineComponent({__name:"VPlayerSettingsUi",props:{initialSettings:{}},emits:["updateSettings","saveSettings"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(f(i.initialSettings));a.watch(n,()=>{s()},{deep:!0});const o=a.computed(()=>{let v={};for(const[_,g]of Object.entries(n.value))_==="whitePoint"?v[_]=h(g.value):v[_]=g.value;return v});function s(){r("updateSettings",o.value)}function l(){const v=document.createElement("a");v.href=URL.createObjectURL(new Blob([JSON.stringify(o.value,null,2)]));const _=`player-settings-${Date.now()}.json`;v.download=_,v.style.display="none",document.body.appendChild(v),v.click(),document.body.removeChild(v)}function d(){r("saveSettings",o.value)}function c(){n.value=f(),r("updateSettings",o.value)}function h(v){const _=parseInt(v.substr(1,2),16)/255,g=parseInt(v.substr(3,2),16)/255,p=parseInt(v.substr(5,2),16)/255;return[_,g,p]}function u(v){var _=v.toString(16);return _.length==1?"0"+_:_}function m([v,_,g]){return"#"+u(parseInt((v*255).toString()))+u(parseInt((_*255).toString()))+u(parseInt((g*255).toString()))}function f(v={}){const _=["Cool 5","Cool 10","Cool 15","Cool 20","Cool 25","Warm 20","Warm 25","Warm 10","Warm 15","Warm 5","bw"];let g={temperature:6500,targetLuminance:1,exposureFovScale:.6,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:"",...v};return{exposureFovScale:{label:"Exposure Fov Scale",type:"slider",min:0,max:1,step:.01,value:g.exposureFovScale},targetLuminance:{label:"Target Luminance",type:"slider",min:0,max:15,step:.1,value:g.targetLuminance},sharpenFilter_amount:{label:"Sharpen Filter Amount",type:"slider",min:0,max:100,step:.1,value:g.sharpenFilter_amount},UNREAL_BLOOM_ENABLED:{label:"Enable Bloom?",type:"boolean",value:g.UNREAL_BLOOM_ENABLED},UNREAL_BLOOM_STRENGTH:{label:"Bloom Strength",type:"slider",min:0,max:1,step:.01,value:g.UNREAL_BLOOM_STRENGTH},TRANSITION_MOVEMENT_SCALE:{label:"Transition Movement Speed",type:"slider",min:.2,max:25,step:.1,value:g.TRANSITION_MOVEMENT_SCALE},temperature:{label:"Temperature / White Balance",type:"slider",min:1e3,max:12e3,step:1,value:g.temperature},whitePoint:{label:"White Point",type:"color",value:m(g.whitePoint)},lut:{label:"Lut",type:"lut",items:_.map(p=>({text:p,value:`https://cdn.visuado.com/luts/${p}.png`})),value:g.lut}}}return(v,_)=>{const g=a.resolveComponent("v-text-field"),p=a.resolveComponent("v-slider"),y=a.resolveComponent("v-checkbox"),x=a.resolveComponent("v-btn"),b=a.resolveComponent("v-select"),N=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",ac,[a.createElementVNode("form",nc,[a.createElementVNode("div",oc,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(A,C,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,"d-block":""},[A.type==="slider"?(a.openBlock(),a.createBlock(p,{key:0,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s,max:A.max,min:A.min,step:A.step},{prepend:a.withCtx(()=>[a.createElementVNode("div",sc,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",type:"number",max:A.max,min:A.min,step:A.step,style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue","max","min","step"])])]),_:2},1032,["modelValue","onUpdate:modelValue","max","min","step"])):a.createCommentVNode("",!0),A.type==="boolean"?(a.openBlock(),a.createBlock(y,{key:1,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s},{prepend:a.withCtx(()=>[a.createElementVNode("div",lc,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,a.toDisplayString(A.value),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.createCommentVNode("",!0),A.type==="color"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"d-flex",max:A.max,min:A.min,step:A.step},[a.createElementVNode("div",dc,a.toDisplayString(A.label),1),a.createElementVNode("div",hc,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S=>n.value[C].value=S,type:"color",onChange:s},null,40,uc),[[a.vModelText,n.value[C].value]])]),a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",readonly:"",type:"text",style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue"])])],8,cc)):a.createCommentVNode("",!0),A.type==="lut"?(a.openBlock(),a.createElementBlock("div",mc,[a.createElementVNode("div",fc,[a.createElementVNode("div",pc,a.toDisplayString(A.label),1),a.createElementVNode("div",null,[a.createVNode(x,{class:"ml-2","x-small":"",onClick:S=>n.value[C].value=null},{default:a.withCtx(()=>[a.createTextVNode(" Clear Lut ")]),_:2},1032,["onClick"])])]),a.createElementVNode("div",null,[a.createElementVNode("div",gc,[a.createElementVNode("div",null,[a.createVNode(b,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,items:A.items,"item-title":"title","item-value":"value",dense:"",label:"Select Lut",onChange:s},null,8,["modelValue","onUpdate:modelValue","items"])])]),a.createElementVNode("div",null,[_c,a.createElementVNode("div",vc,[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",type:"url",onChange:s},null,8,["modelValue","onUpdate:modelValue"])])])])])])):a.createCommentVNode("",!0)]))),128))]),a.createElementVNode("div",xc,[a.createVNode(x,{onClick:_[0]||(_[0]=A=>c())},{default:a.withCtx(()=>[a.createTextVNode("Reset")]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[1]||(_[1]=A=>l())},{default:a.withCtx(()=>[a.createTextVNode(" Download Json "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-download")]),_:1})]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[2]||(_[2]=A=>d())},{default:a.withCtx(()=>[a.createTextVNode(" Save Settings "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-save")]),_:1})]),_:1})])])])}}}),[["__scopeId","data-v-bd4f66c3"]]),Sc={class:"top-left"},Mc={class:"top-right"},wc={class:"header-slot anchor elevation-5"},Ac={id:"moveableBody",class:"body-slot moveable-body d-flex justify-center align-center position-relative"},Ec={class:"moveable-footer elevation-5"},bc=ke(a.defineComponent({__name:"VMoveable",props:{size:{}},setup(e,{expose:t}){const i=a.ref(void 0),r=a.ref(void 0);t({bodyWidth:i,bodyHeight:r}),a.onMounted(()=>{o(document.getElementById("moveableDiv")),n(document.querySelector("#moveableDiv"))});const n=s=>{new ResizeObserver(()=>{const d=document.getElementById("moveableBody");d&&(i.value=d.clientWidth,r.value=d.clientHeight)}).observe(s)},o=s=>{const l=document.getElementsByClassName("anchor");for(let _=0;_<l.length;_++){const g=l[_];g.addEventListener("touchstart",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!1}),g.addEventListener("mousedown",m,{passive:!1}),g.addEventListener("mouseup",v,{passive:!1})}let d=0,c=0,h=0,u=0;function m(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchstart"&&(g=_.touches[0]),h=g.clientX,u=g.clientY,document.addEventListener("mouseup",v,{passive:!1}),document.addEventListener("touchend",v,{passive:!1}),document.addEventListener("mousemove",f,{passive:!1}),document.addEventListener("touchmove",f,{passive:!1})}function f(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchmove"&&(g=_.touches[0]),d=h-g.clientX,c=u-g.clientY,h=g.clientX,u=g.clientY,s.style.top=s.offsetTop-c+"px",s.style.left=s.offsetLeft-d+"px"}function v(){document.removeEventListener("mouseup",v,!1),document.removeEventListener("mousemove",f,!1),document.removeEventListener("touchend",v,!1),document.removeEventListener("touchmove",f,!1)}};return(s,l)=>(a.openBlock(),a.createElementBlock("div",{id:"moveableDiv",class:a.normalizeClass([s.size,"sizer rounded"])},[a.createElementVNode("div",Sc,[a.renderSlot(s.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",Mc,[a.renderSlot(s.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",wc,[a.renderSlot(s.$slots,"header",{},void 0,!0)]),a.createElementVNode("div",Ac,[a.renderSlot(s.$slots,"body",{},void 0,!0)]),a.createElementVNode("div",Ec,[a.renderSlot(s.$slots,"footer",{},void 0,!0)])],2))}}),[["__scopeId","data-v-a4cb28cf"]]),Cc={class:"rotation-marker-svg",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg"},Tc=a.createStaticVNode('<defs><radialGradient id="Gradient" cx="0" cy="0" r="0.9" fx="0" fy="0"><stop offset="0%" class="stop1"></stop><stop offset="60%" class="stop2"></stop><stop offset="90%" class="stop3"></stop></radialGradient><linearGradient id="LineGradient" gradientTransform="rotate(90)"><stop offset="0%" class="stop1"></stop><stop offset="75%" class="stop2"></stop><stop offset="100%" class="stop3"></stop></linearGradient></defs>',1),Ic=["transform"],Pc=[a.createStaticVNode('<rect id="field-of-view-gradient" x="20" y="20" width="38" height="38" transform="rotate(0)" transform-origin="20 20" fill="url(#Gradient)"></rect><rect class="field-of-view-border" x="20" y="20" width="1" height="25" fill="url(#LineGradient)" transform="rotate(0)" transform-origin="20 20"></rect><rect class="field-of-view-border" x="19" y="19" width="1" height="25" fill="url(#LineGradient)" transform="rotate(-90)" transform-origin="20 20"></rect><circle cx="20" cy="20" r="5" fill="white"></circle><circle cx="20" cy="20" r="3" fill="red"></circle>',5)],Nc=a.defineComponent({__name:"VRotationMarker",props:{rotation:{}},setup(e){return(t,i)=>(a.openBlock(),a.createElementBlock("svg",Cc,[Tc,a.createElementVNode("g",{"transform-origin":"20 20",transform:`rotate(${45+t.rotation})`},Pc,8,Ic)]))}}),Lc={class:"minimap-wrapper"},Rc={class:"minimap-container"},Dc=["id"],C3=ke(a.defineComponent({__name:"VMiniMapMap",props:{backgroundImage:{},allCameras:{},storey:{},currentCamera:{},rotation:{},transformAngle:{},containerWidth:{},containerHeight:{},fit:{type:Boolean}},emits:["goToCamera"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(512),o=a.ref(384),s=a.ref(512),l=a.ref(384),d=a.ref(new U2.Vector3),c=a.ref(new U2.Object3D),h=a.ref({}),u=a.ref(1),m=a.ref(),f=n.value/n.value,v=a.computed(()=>{const B=i.containerWidth/i.containerHeight;let Z;return B>f?Z=i.containerHeight/o.value:Z=i.containerWidth/n.value,Z}),_=a.computed(()=>i.allCameras),g=a.computed(()=>i.allCameras.find(B=>B.id===i.currentCamera)),p=a.computed(()=>i.rotation),y=a.computed(()=>new U2.Vector3(i.storey.position.x,i.storey.position.y,i.storey.position.z)),x=a.computed(()=>parseFloat(g.value.floor_vertical_position)),b=a.computed(()=>_.value.map(B=>{const Z=B.uposition.split(","),j=new U2.Vector3(Number(Z[0])-y.value.x,0,Number(Z[2])-y.value.z);return{...B,...M(d.value,j)}})),N=a.computed(()=>({backgroundImage:`url(${i.backgroundImage})`,backgroundSize:"contain"})),A=a.computed(()=>({transform:`scale(${i.fit?1:v.value*.75}) rotate(${i.transformAngle}deg)`}));a.onMounted(()=>{k(),U(),R();const B=document.getElementById("moveableDiv");B&&(m.value=new ResizeObserver(R).observe(B))}),a.onBeforeUpdate(()=>{k(),U()}),a.onBeforeUnmount(()=>{m.value&&m.value.unobserve(document.getElementById("moveableDiv"))});function C(B){return U2.MathUtils.degToRad(B)}function U(){c.value.rotation.x=180,c.value.rotation.y=i.storey.rotation.y*-1,h.value={transform:`rotateZ(${c.value.rotation.y}deg) rotateX(${c.value.rotation.x}deg)`}}function S(B){return{top:`${Math.abs(B.top)}%`,left:`${Math.abs(B.left)}%`}}function M(B,Z){var j=new U2.Vector3;const Q=j.subVectors(B,Z);return{relativePosition:Q,left:Q.x/s.value*100,top:Q.z/l.value*100}}function k(){const B=i.storey.position.y-x.value;l.value=2*(B*Math.tan(C(i.storey.fovY/2))),s.value=512/384*l.value;const Z=l.value/2,j=s.value/2,Q=new U2.Vector3(j*-1,0,Z*-1);d.value=Q}function R(){const B=document.getElementById("moveableDiv");if(!B)return;const Z=B.offsetHeight/384*.8,j=B.offsetWidth/512*.8;B.offsetHeight>B.offsetWidth?u.value=j*.5:u.value=Z*.9}function D(B){const j=B.currentTarget.getBoundingClientRect(),Q=B.clientX-j.left,V=B.clientY-j.top,J=document.querySelectorAll(".single-camera-marker");let Y=null,he=1/0;if(J.forEach(ne=>{const q=ne,K=q.getBoundingClientRect(),le=K.left+K.width/2-j.left,de=K.top+K.height/2-j.top,ae=Math.sqrt((Q-le)**2+(V-de)**2);ae<he&&(he=ae,Y=q)}),Y){const ne=Y.getBoundingClientRect(),q=ne.left+ne.width/2,K=ne.top+ne.height/2;for(let de=0;de<3;de++){const ae=document.createElement("div");ae.className="ripple-effect",ae.style.position="fixed",ae.style.left=`${q}px`,ae.style.top=`${K}px`,ae.style.pointerEvents="none",ae.style.animationDelay=`${de*.5}s`,document.body.appendChild(ae),setTimeout(()=>{ae.remove()},500+de*500)}const le=Y.id.split("single-camera-marker-")[1];le&&r("goToCamera",le)}}return(B,Z)=>(a.openBlock(),a.createElementBlock("div",Lc,[a.createElementVNode("div",Rc,[a.createElementVNode("div",{class:"web-minimap",style:a.normalizeStyle(A.value),onClick:D},[a.createElementVNode("div",{class:"minimap-background-image",style:a.normalizeStyle(N.value)},null,4),a.createElementVNode("div",{class:"center-pivot",style:a.normalizeStyle(h.value)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,j=>(a.openBlock(),a.createElementBlock("div",{key:j.id},[g.value.floorLevel===j.floorLevel?(a.openBlock(),a.createElementBlock("div",{key:0,class:"single-camera-marker",id:`single-camera-marker-${j.id}`,style:a.normalizeStyle(S(j))},null,12,Dc)):a.createCommentVNode("",!0),a.renderSlot(B.$slots,"default",{id:j.id,camera:j,active:g.value.id===j.id,style:a.normalizeStyle({...S(j),position:"absolute",zIndex:"3"})},()=>[g.value.id===j.id&&i.rotation!==null?(a.openBlock(),a.createBlock(Nc,{key:0,class:"rotation-marker-component-base rotation-marker-component",rotation:p.value,style:a.normalizeStyle({...S(j)})},null,8,["rotation","style"])):a.createCommentVNode("",!0)],!0)]))),128))],4)],4)])]))}}),[["__scopeId","data-v-03e6f060"]]),T3=ke(a.defineComponent({__name:"VMiniMapCompass",props:{scale:{},rotation:{},transformAngle:{}},setup(e){const t=e,i=a.computed(()=>t.rotation+t.transformAngle-90);return(r,n)=>(a.openBlock(),a.createElementBlock("div",{class:"minimap-compass elevation-5",style:a.normalizeStyle({scale:r.scale})},[a.createVNode(E3,{class:"north-indicator",longitude:i.value},null,8,["longitude"])],4))}}),[["__scopeId","data-v-d047dca8"]]),Uc={class:"ss-wrapper"},kc={class:"slider"},Oc={class:"minimap-sun-slider"},zc={class:"d-flex flex-column align-center justify-center"},Vc={key:0,class:"time-label"},I3=ke(a.defineComponent({__name:"VSunSimulationSlider",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},level:{}},emits:["setBackgroundImage"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(new Date().getHours()),o=a.ref(!0),s=a.ref(!0),l=a.ref(""),d=a.ref(new Map),c=a.computed(()=>i.minimapJson.storeys[i.level]),h=a.computed(()=>`${Math.floor(n.value).toString().padStart(2,"0")}:00`),u=a.computed(()=>{if(c.value.sunsimFilesTimeStamps[n.value]){const p=c.value.sunsimFilesTimeStamps[n.value].split(" ");return`${p[0]} ${p[1]}`}return""});a.onMounted(async()=>{l.value=await v(c.value.sunsimFiles[n.value]),r("setBackgroundImage",l.value),s.value=!1;const p=await f(i.minimapJson.storeys);d.value=p,o.value=!1,r("setBackgroundImage",m(i.level,n.value))}),a.watch(n,()=>{const p=m(i.level,n.value);r("setBackgroundImage",p)}),a.watch(()=>i.level,()=>{r("setBackgroundImage",m(i.level,n.value))},{immediate:!0});function m(p,y){return d.value.get(`sunsim${p}_${y}`)?d.value.get(`sunsim${p}_${y}`):""}async function f(p){let y=new Map;for(let x=0;x<p.length;x++){const b=p[x].sunsimFiles;for(let N=0;N<b.length;N++){const A=b[N];try{const C=A,U=A.split("."),S=await v(C);y.set(U[0],S)}catch{continue}}}return y}async function v(p){const x=await(await fetch(s1(i.cdnFileResolver,`/${i.apartmentJson.type}/${i.apartmentJson.id}/minimap/${p}`))).blob(),b=await g(x);return _(b)}function _(p){return"data:image/jpeg;base64,"+p}async function g(p){return new Promise((y,x)=>{const b=new FileReader;b.onload=()=>{const N=b.result.split(",")[1];y(N)},b.onerror=x,b.readAsDataURL(p)})}return(p,y)=>{const x=a.resolveComponent("v-progress-linear"),b=a.resolveComponent("v-icon"),N=a.resolveComponent("v-slider");return a.openBlock(),a.createElementBlock("div",Uc,[a.createElementVNode("div",kc,[a.createElementVNode("div",Oc,[o.value?(a.openBlock(),a.createBlock(x,{key:0,indeterminate:"",rounded:"",height:"6",color:"grey lighten-1",class:"mr-2"})):(a.openBlock(),a.createBlock(N,{key:1,modelValue:n.value,"onUpdate:modelValue":y[0]||(y[0]=A=>n.value=A),min:0,max:23,step:1,color:"#373737","track-color":"#373737","thumb-color":"#373737","hide-details":!0,"thumb-label":"always"},{prepend:a.withCtx(()=>[a.createElementVNode("div",zc,[a.createVNode(b,{color:"#ffab02"},{default:a.withCtx(()=>[a.createTextVNode("mdi-white-balance-sunny")]),_:1}),a.createElementVNode("span",null,a.toDisplayString(u.value),1)])]),"thumb-label":a.withCtx(()=>[a.createTextVNode(a.toDisplayString(h.value),1)]),_:1},8,["modelValue"]))]),o.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Vc))])])}}}),[["__scopeId","data-v-52f122f2"]]),Bc=e=>(a.pushScopeId("data-v-8c96c13c"),e=e(),a.popScopeId(),e),Fc={class:"left"},Hc={class:"right"},Gc=Bc(()=>a.createElementVNode("div",{class:"d-flex justify-space-between pa-1"},[a.createElementVNode("div",{class:"center"}," ")],-1)),Wc={class:"map-container"},Y0=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},currentCamera:{},level:{},rotation:{}},emits:["close","goToCamera"],setup(e,{emit:t}){const i=a.ref(null),r=e,n=t,o=a.ref(),s=a.ref(0),l=a.computed(()=>r.minimapJson.storeys[r.level]),d=a.ref(0);a.watch(()=>r.apartmentJson,()=>{d.value=d.value+1}),a.watch(l,()=>{o.value=l.value.defaultSunsimFile?`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/sunsim0_13.jpg`:`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/${l.value.defaultSunsimFile}`},{immediate:!0,once:!0});const c=a.computed(()=>{let p=1;return s.value!==0&&(Math.abs(s.value)%180===0?p=1:p=-1),f.value==="small"&&(p=.6),p});function h(p){o.value=p}const u=["big","bigger","small"];function m(){const y=(u.indexOf(f.value)+1)%u.length;f.value=u[y]}const f=a.ref("big");function v(){s.value=s.value+90}const _=()=>{n("close")};function g(p){n("goToCamera",p)}return(p,y)=>{const x=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(bc,{ref_key:"minimapMoveable",ref:i,size:f.value},{"top-left":a.withCtx(()=>[a.createElementVNode("div",Fc,[a.createVNode(x,{icon:"mdi-window-close",size:"x-small",onClick:_})])]),"top-right":a.withCtx(()=>[a.createElementVNode("div",Hc,[a.createVNode(x,{class:"rotate-icon",size:"x-small",icon:"mdi mdi-rotate-right",onClick:a.withModifiers(v,["stop"]),title:"Rotate"}),a.createVNode(x,{class:"resize-icon ml-1",icon:"mdi-image-size-select-small",size:"x-small",onClick:m,title:"Resize"})])]),header:a.withCtx(()=>[Gc]),body:a.withCtx(()=>[a.createVNode(T3,{scale:c.value,rotation:l.value.rotation.y,"transform-angle":s.value},null,8,["scale","rotation","transform-angle"]),a.createElementVNode("div",Wc,[a.createVNode(C3,{"transform-angle":s.value,"all-cameras":p.apartmentJson.cameras,"background-image":o.value,rotation:p.rotation,"current-camera":p.currentCamera,storey:l.value,containerWidth:i.value&&i.value.bodyWidth||512,containerHeight:i.value&&i.value.bodyHeight||384,onGoToCamera:g},null,8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey","containerWidth","containerHeight"])])]),footer:a.withCtx(()=>[(a.openBlock(),a.createBlock(I3,{key:d.value,"cdn-file-resolver":r.cdnFileResolver,"minimap-json":r.minimapJson,"apartment-json":r.apartmentJson,level:r.level,onSetBackgroundImage:h},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"]))]),_:1},8,["size"])}}}),[["__scopeId","data-v-8c96c13c"]]);function ai(e){const t=e*60,i=Math.floor(t/60),r=t%60;return`${i.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}const jc={class:"d-flex align-center"},Xc={class:"d-block mr-1"},Yc={class:"small"},qc={class:"small"},q0=ke(a.defineComponent({__name:"VSunsimSlider",props:{currentDay:{},currentTime:{},disabled:{type:Boolean}},emits:["onTimeChange","toggleSunStudy"],setup(e,{emit:t}){const i=e,{currentDay:r,currentTime:n,disabled:o}=a.toRefs(i),s=t,l=a.ref(n.value.timeInHours);return a.watch(n,()=>{l.value=n.value.timeInHours}),a.watch(l,()=>{s("onTimeChange",r.value.timeSamples.find(d=>d.timeInHours===l.value))},{immediate:!0}),(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-slider"),m=a.resolveComponent("v-field"),f=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",jc,[a.createElementVNode("div",Xc,[a.createVNode(m,{class:"ss-slider-field",style:{},variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.unref(r).timeSamples.length>1?(a.openBlock(),a.createBlock(u,{key:0,class:"pa-2 pr-2",modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=v=>l.value=v),min:a.unref(r).startTime,max:a.unref(r).endTime,step:a.unref(r).interval,disabled:!!a.unref(o),density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(h,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Yc,a.toDisplayString(a.unref(ai)(l.value)),1)]),_:1},8,["modelValue","min","max","step","disabled"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(h,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",qc,a.toDisplayString(a.unref(ai)(l.value)),1)],64))]),_:1})]),a.createElementVNode("div",null,[a.createVNode(f,{size:"small",class:"sun-study-toggle text-capitalize rounded-xl",icon:"mdi-close",onClick:c[1]||(c[1]=v=>s("toggleSunStudy"))})])])}}}),[["__scopeId","data-v-c06c753d"]]),Zc=a.defineComponent({__name:"VSunStudyToggle",props:{displaySunsim:{type:Boolean},showUI:{type:Boolean}},emits:["toggleSunStudy"],setup(e,{emit:t}){const i=t,r=a.inject(B1);return(n,o)=>{const s=a.resolveComponent("v-btn");return!n.displaySunsim&&n.showUI?(a.openBlock(),a.createBlock(s,{key:0,size:"small",varient:"tonal",prependIcon:"mdi-white-balance-sunny",class:"sun-study-toggle text-capitalize rounded-xl",onClick:o[0]||(o[0]=l=>i("toggleSunStudy"))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("openSunStudy")),1)]),_:1})):a.createCommentVNode("",!0)}}}),Z0=ke(a.defineComponent({__name:"VAutoplay",props:{autoplayStatus:{type:Boolean}},emits:["toggleAutoPlay"],setup(e,{emit:t}){const i=t,r=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));return(n,o)=>{const s=a.resolveComponent("v-icon"),l=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(l,{size:"x-small",class:a.normalizeClass(["autoplay-btn",{mobile:r.value,"mt-1":r.value,"mx-1":r.value}]),onClick:o[0]||(o[0]=d=>i("toggleAutoPlay"))},{default:a.withCtx(()=>[a.createVNode(s,{icon:n.autoplayStatus?"mdi-pause":"mdi-play",size:"x-large",class:"pa-0 ma-0"},null,8,["icon"])]),_:1},8,["class"])}}}),[["__scopeId","data-v-7fd2b4f3"]]),Qc={key:0,class:"sun-icon-wrapper"},Jc=37,Kc=39,xa=ke(a.defineComponent({__name:"VWaypointCarousel",props:{thumbnails:{},active:{},cameraHasSunStudy:{type:Function,default:e=>!1}},emits:["previous","next","goto"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(0),o=a.computed({get(){return i.active},set(c){n.value=c}}),s=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));a.onMounted(()=>{window.addEventListener("keydown",l)}),a.onBeforeUnmount(()=>{window.removeEventListener("keydown",l)});function l(c){switch(c.keyCode){case c.keyCode===Jc:r("previous");break;case c.keyCode===Kc:r("next");break;default:return}}function d(c,h){h(),r("goto",c)}return(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-img"),f=a.resolveComponent("v-icon"),v=a.resolveComponent("v-card"),_=a.resolveComponent("v-slide-group-item"),g=a.resolveComponent("v-slide-group");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["d-flex align-center justify-center",{mobileWaypointWrapper:s.value,desktopWaypointWrapper:!s.value," waypoint-carousel":!0}])},[a.renderSlot(c.$slots,"before",{},void 0,!0),a.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":h[2]||(h[2]=p=>o.value=p),class:a.normalizeClass({mobileWaypoint:s.value}),"active-class":"active-apt","selected-class":"active-apt","show-arrows":!s.value,"center-active":"",mandatory:""},{prev:a.withCtx(()=>[s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass(["carousel-button",{mobile:s.value}]),icon:"mdi-chevron-left",varient:"tonal",size:"small",onClick:h[0]||(h[0]=p=>r("previous"))},null,8,["class"]))]),next:a.withCtx(()=>[s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass(["carousel-button",{mobile:s.value}]),icon:"mdi-chevron-right",varient:"tonal",size:"small",onClick:h[1]||(h[1]=p=>r("next"))},null,8,["class"]))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.thumbnails,p=>(a.openBlock(),a.createBlock(_,{key:p.id},{default:a.withCtx(({toggle:y,selectedClass:x})=>[a.createVNode(v,{class:a.normalizeClass(["position-relative",[s.value?"ma-0":"ma-1",x,"single-waypoint"]]),align:"center",justify:"center",style:{overflow:"hidden"},onClick:b=>d(p.id,y)},{default:a.withCtx(()=>[a.createVNode(m,{cover:"","aspect-ratio":1,src:p.thumbnailUrl},null,8,["src"]),i.cameraHasSunStudy(p.id)?(a.openBlock(),a.createElementBlock("div",Qc,[a.createVNode(f,{class:"sun-icon",icon:"mdi-white-balance-sunny"})])):a.createCommentVNode("",!0)]),_:2},1032,["class","onClick"])]),_:2},1024))),128))]),_:1},8,["modelValue","class","show-arrows"]),a.renderSlot(c.$slots,"after",{},void 0,!0)],2)}}}),[["__scopeId","data-v-9cc758dc"]]),$c={id:"share-btns-wrapper",class:"text-center"},Q0=ke(a.defineComponent({__name:"VSocialShare",setup(e){const t=a.inject(B1),i=a.ref(!1),r=a.ref(location.href);function n(){return window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href),"facebook-share-dialog","width=626,height=436"),!1}function o(){return window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(location.href),"twitter-share-dialog","width=626,height=436"),!1}function s(){return window.open("https://www.linkedin.com/sharing/share-offsite/?url="+encodeURIComponent(location.href),"linkedin-share-dialog","width=626,height=736"),!1}function l(){navigator.clipboard.writeText(location.href)}return(d,c)=>{const h=a.resolveComponent("v-btn"),u=a.resolveComponent("v-tooltip"),m=a.resolveComponent("v-toolbar-title"),f=a.resolveComponent("v-spacer"),v=a.resolveComponent("v-toolbar"),_=a.resolveComponent("v-card-text"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-dialog");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(u,{elevation:"2",top:"",attach:""},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({density:"comfortable",elevation:"1",icon:"mdi-share-variant",onClick:c[0]||(c[0]=x=>i.value=!i.value)},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(p,{id:"share-box",width:"400",modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=y=>i.value=y)},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(v,{elevation:"0"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small",icon:"mdi-close",onClick:c[1]||(c[1]=y=>i.value=!1)}),a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(f)]),_:1}),a.createVNode(_,{class:"mt-5"},{default:a.withCtx(()=>[a.createElementVNode("p",$c,[a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-facebook"},y,{onClick:n}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToFacebook")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-linkedin"},y,{onClick:s}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToLinkedin")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-twitter"},y,{onClick:o}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToTwitter")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-email",link:"",href:`mailto:?body=${r.value}`},y),null,16,["href"])]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareViaEmail")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-content-copy",onClick:l},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("copyLink")),1)]),_:1}),a.createVNode(f)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-bb7d0a99"]]),ed={class:"static-image-wrapper"},J0=ke(a.defineComponent({__name:"VSingleImage",props:{image:{},aspectRatio:{default:"wide"}},setup(e){const t=e,i=a.computed(()=>({"background-image":`url("${encodeURI(t.image)}")`}));return(r,n)=>(a.openBlock(),a.createElementBlock("div",ed,[a.createElementVNode("div",{class:a.normalizeClass(["img-div",[r.aspectRatio]]),style:a.normalizeStyle(i.value)},null,6)]))}}),[["__scopeId","data-v-31489804"]]),td={id:"btn-fullscreen",class:"btn-placeholder mr-2"},K0=a.defineComponent({__name:"VFullScreenButton",props:{isFullScreen:{type:Boolean}},emits:["toggleFullscreen"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",td,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:r.isFullScreen?"mdi-fullscreen-exit":"mdi-fullscreen",onClick:n[0]||(n[0]=s=>i("toggleFullscreen"))},null,8,["icon"])])}}});class d2{constructor({labels:t,language:i}={labels:null,language:null}){D2(this,"_labels");D2(this,"_language");t?this._labels={...t||{}}:fetch("https://l10n.visuado.com/all.json").then(r=>r.json()).then(r=>{this._labels=r}),this._language=i||"nb"}getLabel(t){return this._labels&&this._language in this._labels&&t in this._labels[this._language]?this._labels[this._language][t]:t}get(t){return typeof t=="string"?t:typeof t=="object"&&this._language in t&&t[this._language]?t[this._language]:""}}class P3{constructor(t,i){D2(this,"_doc");D2(this,"_elemId");D2(this,"_state");this._doc=t,this._elemId=i,this._state={isActive:!1}}get isActive(){return this._state.isActive}setup(){const t=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"],i=this._getElement();t.forEach(r=>{i.addEventListener(r,this._toggle.bind(this),!1)})}toggle(){this.isActive?this._exit():this._enter()}_enter(){const t=this._getElement(),i=t.requestFullscreen||t.webkitRequestFullscreen||t.mozRequestFullscreen||t.msRequestFullscreen;i&&i.apply(t)}_exit(){const t=this._doc.exitFullscreen||this._doc.webkitExitFullscreen||this._doc.mozExitFullscreen||this._doc.document.msExitFullscreen;t&&t.apply(document)}_getElement(){return this._doc.getElementById(this._elemId)}_toggle(){const t=!!(this._doc.fullscreenElement||this._doc.webkitFullscreenElement||this._doc.mozFullscreenElement||this._doc.msFullscreenElement);this._state.isActive=t}}function br(e){return("0"+e).slice(-2)}function id(){const e=new Date;return[e.getFullYear().toString(),br(e.getMonth()+1),br(e.getDate())," ",br(e.getHours()),br(e.getMinutes()),br(e.getSeconds())].join("")}function rd(){return"Visuado-Snapshot-"+id()}let $0=class{constructor(t,i){D2(this,"data");this.data=t}download(t=null){t=t||rd();const i=document.createElement("a");typeof i.download=="string"?(document.body.appendChild(i),i.download=t,i.href=this.data,i.click(),document.body.removeChild(i)):location.replace(this.data)}};const ad={id:"btn-magic",class:"btn-placeholder mr-2"},nd=a.defineComponent({__name:"VVisuadoCreateButton",emits:["onSnapshot"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",ad,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:"mdi-creation",onClick:n[0]||(n[0]=s=>i("onSnapshot"))})])}}}),od={key:0,class:"player-error"},sd={class:"player-and-components-wrapper"},ld={key:3,class:"settings-panel"},cd={key:0,class:"compass-wrapper"},dd={key:1,class:"btn-placeholder mr-2"},hd={class:"btn-placeholder mr-2"},ud={key:2,class:"btn-placeholder mr-2"},md={key:3,class:"btn-placeholder mr-2"},fd={class:"d-flex flex-column align-end"},pd={key:0,class:"d-flex align-center flex-column sun-study mt-2"},gd={key:2,class:"render-version"},eo=ke(a.defineComponent({__name:"VVirtualTour",props:{cdnFileResolver:{},apartmentId:{},defaultInteriorId:{},validInteriorIds:{default:()=>[]},displayViewModeSwitch:{type:Boolean,default:!0},websiteUrl:{},i18nConfig:{},showCarousel:{type:Boolean,default:!0},showTimeOfDay:{type:Boolean,default:!0},showCompass:{type:Boolean,default:!0},showFullScreen:{type:Boolean,default:!0},showSnapshot:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},showInteriorOptions:{type:Boolean,default:!0},showMiniMap:{type:Boolean,default:!0},showFloorLevel:{type:Boolean,default:!0},defaultWaypointIndex:{default:0},defaultViewMode:{default:"virtualTour"},mouseSensitivity:{default:1},isInIframe:{type:Boolean},adminMode:{type:Boolean,default:!1},playerSettings:{default:()=>({temperature:6500,targetLuminance:1,exposureFovScale:.3,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:""})},hasMarkersJson:{type:Boolean,default:!1},dynamicMarkers:{default:null},version:{},showVersion:{type:Boolean,default:!0},enableAutoplay:{type:Boolean,default:!1},showVisuadoCreateButton:{type:Boolean,default:!1}},emits:["onSnapshot","onVisuadoCreateButtonClicked","saveSettings","onInteriorUpdate","onCameraUpdate","onSunsimUpdate","onError","onFrontendMarkersUpdate","onInitialized"],setup(e,{expose:t,emit:i}){const r=e,{cdnFileResolver:n,apartmentId:o,defaultInteriorId:s,validInteriorIds:l,displayViewModeSwitch:d,i18nConfig:c,showCarousel:h,showTimeOfDay:u,showCompass:m,showFullScreen:f,showSnapshot:v,showShare:_,showInteriorOptions:g,showMiniMap:p,showFloorLevel:y,defaultWaypointIndex:x,defaultViewMode:b,mouseSensitivity:N,adminMode:A,playerSettings:C,hasMarkersJson:U,dynamicMarkers:S,version:M,showVersion:k}=a.toRefs(r),R=i,D=a.ref(!1),B=a.ref(!1),Z=a.ref(!1),j=a.ref(),Q=a.ref(),V=a.ref(),J=a.ref(),Y=a.ref(),he=a.ref(0),ne=a.ref(),q=a.ref(),K=a.ref(),le=a.ref(0),de=a.ref(0),ae=a.ref(0),Me=a.ref(!1),Be=a.ref(!1),z=a.ref(),Ee=a.ref(!1),ve=a.ref(!1),Le=a.ref({startTime:0,startX:0,startY:0}),we=a.ref(new P3(document,"player-wrapper"));t({updateSelectedInterior:a1,takeSnapshot:ue,setCurrentCamera:A1,getCurrentRotation:pe,setCurrentRotation:se,getCurrentFov:Oe,setCurrentFov:Pe,loadDynamicMarkers:O,screenToWorld:H,setFrontendMarkers:Je,clearCurrentMarkerLayer:E,apartmentJson:Q});const Qe=a.computed(()=>{if(Q.value){const G=Q.value.cameras.map(De=>De.floorLevel);let te=[...new Set(G)];return te=te.sort(),te}else return[]}),Ce=a.computed(()=>{let G=0;if(Q.value){const te=Q.value.cameras.map(nt=>nt.floorLevel);let De=[...new Set(te)];De=De.sort();const E1=De.findIndex(nt=>nt===de.value);E1!==-1&&(G=E1)}return G}),T=a.computed(()=>$.value.findIndex(G=>G.archetypeID===ne.value)),w=a.computed(()=>V.value?V.value.cameras.map(G=>({...G,thumbnailUrl:Ne(`/${ne.value}/${o.value}/thumbs/200/${G.id}.jpg`),imageUrl:Ne(`/${ne.value}/${o.value}/images/1600/${G.id}.jpg`)})):[]),W=a.computed(()=>!w.value||!w.value[he.value]?"":w.value[he.value].imageUrl),$=a.computed(()=>{let G=[];return j.value&&(G=j.value.archetypes),l.value.length?G.filter(te=>l.value.includes(te.archetypeID)):G}),re=a.computed(()=>V.value?$.value.map(G=>{var De;const te=(De=w.value[he.value])==null?void 0:De.id;return{...G,url:Ne(`/${G.archetypeID}/${o.value}/thumbs/200/${te}.jpg`)}}):[]),L=a.computed(()=>{if(J.value&&J.value.storeys&&Ce.value in J.value.storeys)return J.value.storeys[Ce.value]}),ie=a.computed(()=>Q.value&&Q.value.timeInHours),ee=a.computed(()=>{if(Q.value&&Q.value.timeInHours&&u.value)return Ge(Q.value.timeInHours)});a.provide(B1,c.value?new d2(c.value):new d2);const me=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent)),fe=a.computed(()=>me.value?"platform-mobile":"platform-desktop"),oe=a.computed(()=>{const G=s1(n.value,"/config.json");return localStorage.getItem(`${G}-dont-show-tutorial`)});a.watch(s,()=>{s.value&&(ne.value=s.value)}),a.watch([n,o],async()=>{try{q.value=void 0,await Ie(),Xe(),await Ae(),we.value.setup(),ze()}catch(G){Z.value=!0,R("onError",G)}},{immediate:!0}),a.watch(b,()=>{b.value==="virtualTour"&&(Me.value=!1),b.value==="slideShow"&&(Me.value=!0,ve.value=!0)},{immediate:!0}),a.watch(Ee,()=>{if(Ee.value){ve.value=!1;const G=It(K.value);z.value=G[0].timeSamples.find(te=>te.timeInHours===G[0].defaultHour)}else ve.value=!0,Y.value.unloadSunSim()}),a.onMounted(async()=>{try{oe.value?(D.value=!1,ve.value=!0):setTimeout(()=>{D.value=!0},1e3)}catch(G){Z.value=!0,R("onError",G)}}),a.onBeforeUnmount(()=>{document.removeEventListener("wheel",e1)});function Se(G=!1){ve.value=!0,D.value=!1,G&&be()}function be(){const G=s1(n.value,"/config.json");localStorage.setItem(`${G}-dont-show-tutorial`,"true")}async function Ie(){j.value=await i1()}async function Ae(){var G;if(Q.value=await p1(ne.value,o.value),Q.value&&(q.value=(G=Q.value.cameras[0])==null?void 0:G.id),V.value=await xe(ne.value,o.value),V.value){const te=x.value!==null?x.value:0;he.value=te,q.value=V.value.cameras[te].id,K.value=V.value.cameras[te].id}p.value&&(J.value=await P(ne.value,o.value))}function Xe(){let G=s.value;G||(G=j.value.defaultArchetypeID),l.value&&l.value.length>0&&!l.value.includes(G)?G=l.value[0]:console.warn("illegal interior id",G,l),G||(G=j.value.archetypes[0].archetypeID),ne.value=G}function ze(){const G=document.getElementById("main-canvas");G.addEventListener("touchmove",te,{passive:!1});function te(De){De.preventDefault(),window.scrollBy(0,0)}G.addEventListener("mouseenter",()=>{document.addEventListener("wheel",e1,{passive:!1})},{passive:!1}),G.addEventListener("mouseleave",()=>{document.removeEventListener("wheel",e1)},{passive:!1}),G.addEventListener("mousedown",De=>{Le.value.startTime=new Date().getTime(),Le.value.startX=De.clientX,Le.value.startY=De.clientY},{passive:!1}),G.addEventListener("mouseup",De=>{new Date().getTime()-Le.value.startTime<200&&Math.sqrt(Math.pow(De.clientX,2)+Math.pow(De.clientY,2))-Math.sqrt(Math.pow(Le.value.startX,2)+Math.pow(Le.value.startY,2))<5&&(Ee.value=!1)},{passive:!1})}function e1(G){G.preventDefault(),window.scrollBy(0,0)}async function i1(){try{return await Re("/config.json")}catch(G){console.error("Error loading config.json - ",s1(n.value,"/config.json"),G);return}}async function p1(G,te){try{return await Re(`/${G}/${te}/apartment.json`)}catch(De){console.error("Error loading apartment.json - ",`/${G}/${te}/apartment.json`,De);return}}async function xe(G,te){try{return await Re(`/${G}/${te}/thumbs.json`)}catch{console.error("Error loading thumbs.json - ",`/${G}/${te}/thumbs.json`);return}}async function P(G,te){try{return await Re(`/${G}/${te}/minimap/minimap.json`)}catch{console.error("Error loading minimap.json - ",`/${G}/${te}/minimap/minimap.json`);return}}function pe(){return Y.value.getCameraRotation()}function se(G){return Y.value.setCameraRotation(G)}function Oe(){return Y.value.getCameraFov()}function Pe(G){return Y.value.setCameraFov(G)}function Ke(){let G=he.value+1;G>=w.value.length&&(G=0),he.value=G,A1(w.value[he.value].id)}function r1(){let G=he.value-1;G<0&&(G=w.value.length-1),he.value=G,A1(w.value[he.value].id)}function o1(G,te=!0){let De=w.value.findIndex(E1=>E1.id===G);De!=-1&&(he.value=De,te&&A1(G))}function A1(G){Ee.value=!1,q.value=G}function a1(G){ne.value=G,at(),R("onInteriorUpdate",G),R("onCameraUpdate",K.value,Q.value)}async function at(){Q.value=await p1(ne.value,o.value),V.value=await xe(ne.value,o.value),p.value&&(J.value=await P(ne.value,o.value))}function L1(G){K.value=G,K.value&&(o1(K.value,!1),R("onCameraUpdate",K.value,Q.value))}const vt=a.computed(()=>G=>{const te=It(G);return!te||!te[0]||!te[0].timeSamples?!1:te[0].timeSamples.length>1}),It=G=>{const te=Q.value.cameras.find(De=>De.id===G);return te==null?void 0:te.sunsimDayOfYear};function pa(G){R("onSunsimUpdate",G)}function c2(G){Y.value.loadSunSim(G.timeInHours)}function ce(G){le.value=G}function ge(G){de.value=G}function d1(G){ae.value=G}function $1(G,te){}function $e(G){R("onFrontendMarkersUpdate",G)}function Je(G){if(!Y.value){console.warn("Player API is not initialized, cannot set frontend markers.");return}Y.value.updateFrontendMarkers(G)}function L2(G){Y.value=G,Y.value&&(C.value&&Y.value.updateSettings(C.value),U.value?Y.value.loadMarkersJson():S.value&&Y.value.loadDynamicMarkers(S.value),R("onInitialized",Y.value))}function E(){Y.value.clearCurrentMarkerLayer()}function O(G){Y.value.loadDynamicMarkers(G)}function H(G){return Y.value.screenToWorld(G)}function X(){we.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function F(){Me.value=!Me.value}async function ue(){const G=180/Math.PI,te=await Y.value.takePhoto(),De=Y.value.getRotationEuler(),E1=Y.value.getCurrentCamera(),nt=new $0(te,E1),S3=[De.x*-G,De.y*-G,De.z*G];return R("onSnapshot",nt,S3),nt}async function Te(){console.log("Here onVisuadoCreateButtonClicked");const G=await Y.value.takePhoto(),te=Y.value.getCurrentCamera(),De=new $0(G,te);R("onVisuadoCreateButtonClicked",De)}function Ne(G){let te=s1(n.value,G);return te&&A.value&&!te.startsWith("blob:")&&(te=te+`?v=${Date.now()}`),te}async function Re(G){const te=Ne(G);try{return(await Pt.get(te)).data}catch(De){throw new Error(De)}}function Ye(G){Y.value.updateSettings(G)}function He(G){R("saveSettings",G)}function Ge(G){if(G===void 0)return null;const te=Math.floor(G),De=Math.floor((te-G)*60);return{hours:te,minutes:De}}const _1=a.ref(!1),C1=a.ref(null),X1=a.ref(1);function xt(){if(_1.value){clearInterval(C1.value),_1.value=!1,Y.value.toggleAutoRotate();return}_1.value=!0,Y.value.toggleAutoRotate(),C1.value=setInterval(()=>{X1.value=1*X1.value,Y.value.setAutoRotateSpeed(X1.value),Ke()},5e3)}return(G,te)=>{const De=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["virtual-tour-wrapper",[fe.value]])},[Z.value?(a.openBlock(),a.createElementBlock("div",od,"Error loading the player!!")):a.createCommentVNode("",!0),a.createElementVNode("div",sd,[!we.value.isActive&&J.value&&K.value&&L.value&&ne.value&&Be.value?(a.openBlock(),a.createBlock(Y0,{key:0,"cdn-file-resolver":a.unref(n),"apartment-json":Q.value,level:Ce.value,"minimap-json":J.value,rotation:le.value,"current-camera":K.value,onGoToCamera:A1,onClose:te[0]||(te[0]=E1=>Be.value=!1)},null,8,["cdn-file-resolver","apartment-json","level","minimap-json","rotation","current-camera"])):a.createCommentVNode("",!0),ne.value&&q.value?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["v-player",[fe.value]])},[a.createVNode(s5,{ref:"vPlayerInstance","cdn-file-resolver":a.unref(n),style:a.normalizeStyle({zIndex:Me.value?1:2}),"show-static-image":Me.value,"current-camera-id":q.value,"mouse-sensitivity":a.unref(N),"interior-id":ne.value,"apartment-id":a.unref(o),onNewCameraCallback:L1,onNewRotationCallback:ce,onNewFloorCallback:ge,onNewFovCallback:d1,onNewSizeCallback:$1,onSunsimCallback:pa,onPlayerApiCallback:L2,onFrontendMarkersUpdate:$e},{"slideshow-image":a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(J0,{key:0,image:W.value},null,8,["image"])):a.createCommentVNode("",!0)]),"top-left":a.withCtx(()=>[a.unref(A)?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",icon:"mdi-cog-outline",elevation:"3",class:"mr-2",onClick:te[1]||(te[1]=E1=>B.value=!B.value)})):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(De,{density:"comfortable",icon:"mdi-alert-outline",elevation:"3",class:"mr-2",onClick:te[2]||(te[2]=E1=>D.value=!D.value)},null,512),[[a.vShow,ve.value]]),J.value&&q.value&&L.value?a.withDirectives((a.openBlock(),a.createBlock(De,{key:1,density:"comfortable",elevation:"3",icon:"mdi-floor-plan",class:"mr-2",onClick:te[3]||(te[3]=E1=>Be.value=!Be.value)},null,512)),[[a.vShow,ve.value]]):a.createCommentVNode("",!0),ve.value&&a.unref(y)&&Qe.value.length>1?(a.openBlock(),a.createBlock(u5,{key:2,level:de.value,"floor-levels":Qe.value,onLevel:ge},null,8,["level","floor-levels"])):a.createCommentVNode("",!0),a.unref(A)&&B.value?(a.openBlock(),a.createElementBlock("div",ld,[a.createVNode(yc,{"initial-settings":a.unref(C),onUpdateSettings:Ye,onSaveSettings:He},null,8,["initial-settings"])])):a.createCommentVNode("",!0)]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[Q.value&&a.unref(m)?a.withDirectives((a.openBlock(),a.createElementBlock("div",cd,[a.createVNode(y5,{rotation:le.value},null,8,["rotation"])],512)),[[a.vShow,ve.value]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:te[4]||(te[4]=E1=>Be.value=!Be.value)},[ve.value&&Q.value&&ie.value&&a.unref(u)?(a.openBlock(),a.createBlock(A5,{key:0,hours:ee.value.hours,minutes:ee.value.minutes,class:"time-of-day",style:a.normalizeStyle({cursor:J.value&&K.value&&L.value?"pointer":"default"})},null,8,["hours","minutes","style"])):a.createCommentVNode("",!0)])]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:r1})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[D.value?(a.openBlock(),a.createBlock(ic,{key:0,onCloseTutorial:te[5]||(te[5]=E1=>Se(E1))})):a.createCommentVNode("",!0),we.value.isActive&&J.value&&K.value&&L.value&&Be.value?(a.openBlock(),a.createBlock(Y0,{key:1,"cdn-file-resolver":a.unref(n),"apartment-json":Q.value,"minimap-json":J.value,rotation:le.value,"current-camera":K.value,level:Ce.value,onClose:te[6]||(te[6]=E1=>Be.value=!1),onGoToCamera:A1},null,8,["cdn-file-resolver","apartment-json","minimap-json","rotation","current-camera","level"])):a.createCommentVNode("",!0)]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[Me.value?(a.openBlock(),a.createBlock(De,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:Ke})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[a.unref(f)?(a.openBlock(),a.createBlock(K0,{key:0,"is-full-screen":we.value.isActive,class:"btn-fullscreen",onToggleFullscreen:X},null,8,["is-full-screen"])):a.createCommentVNode("",!0),a.unref(v)?(a.openBlock(),a.createElementBlock("div",dd,[a.createVNode(De,{density:"comfortable",elevation:"3",icon:"mdi-camera",onClick:ue})])):a.createCommentVNode("",!0),a.createElementVNode("div",hd,[a.unref(d)&&ve.value?(a.openBlock(),a.createBlock(C5,{key:0,"show-static-image":Me.value,onToggle:F},null,8,["show-static-image"])):a.createCommentVNode("",!0)]),ve.value&&a.unref(_)&&!we.value.isActive?(a.openBlock(),a.createElementBlock("div",ud,[a.createVNode(Q0)])):a.createCommentVNode("",!0),ve.value&&G.showVisuadoCreateButton?(a.openBlock(),a.createElementBlock("div",md,[a.createVNode(nd,{onOnSnapshot:Te})])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createVNode(a.Transition,null,{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(["d-flex justify-center",{"mb-2":!me.value}])},[!_1.value&&vt.value(K.value)?(a.openBlock(),a.createBlock(Zc,{key:0,class:"ml-2",displaySunsim:Ee.value,showUI:ve.value,onToggleSunStudy:te[7]||(te[7]=E1=>Ee.value=!Ee.value)},null,8,["displaySunsim","showUI"])):a.createCommentVNode("",!0)],2),!me.value&&!_1.value&&q.value&&Ee.value&&vt.value(K.value)&&It(K.value)[0]&&z.value?(a.openBlock(),a.createBlock(q0,{key:0,class:"sunsim-slider-desktop","current-day":vt.value(K.value)?It(K.value)[0]:void 0,"current-time":z.value,onOnTimeChange:c2,onToggleSunStudy:te[8]||(te[8]=E1=>Ee.value=!Ee.value)},null,8,["current-day","current-time"])):a.createCommentVNode("",!0),!me.value&&ve.value&&a.unref(h)?(a.openBlock(),a.createBlock(xa,{key:1,class:a.normalizeClass([we.value.isActive?"full-screen":""]),thumbnails:w.value,active:he.value,cameraHasSunStudy:vt.value,onNext:Ke,onPrevious:r1,onGoto:o1},{before:a.withCtx(()=>[G.enableAutoplay&&ve.value&&!me.value?(a.openBlock(),a.createBlock(Z0,{key:0,autoplayStatus:_1.value,onToggleAutoPlay:te[9]||(te[9]=E1=>xt())},null,8,["autoplayStatus"])):a.createCommentVNode("",!0)]),_:1},8,["class","thumbnails","active","cameraHasSunStudy"])):a.createCommentVNode("",!0)])]),_:1})]),"bottom-right":a.withCtx(()=>[a.createElementVNode("div",fd,[ve.value&&a.unref(g)&&re.value?(a.openBlock(),a.createBlock(x5,{key:0,"cdn-file-resolver":a.unref(n),"available-archetypes":re.value,"selected-index":T.value,onSelectInterior:a1},null,8,["cdn-file-resolver","available-archetypes","selected-index"])):a.createCommentVNode("",!0)])]),_:1},8,["cdn-file-resolver","style","show-static-image","current-camera-id","mouse-sensitivity","interior-id","apartment-id"]),a.createVNode(a.Transition,null,{default:a.withCtx(()=>[a.unref(h)&&V.value&&me.value&&ve.value?(a.openBlock(),a.createBlock(xa,{key:0,class:"waypoint-carousel below-player",thumbnails:w.value,active:he.value,cameraHasSunStudy:vt.value,onNext:Ke,onPrevious:r1,onGoto:o1},{before:a.withCtx(()=>[G.enableAutoplay&&ve.value?(a.openBlock(),a.createBlock(Z0,{key:0,autoplayStatus:_1.value,onToggleAutoPlay:te[10]||(te[10]=E1=>xt())},null,8,["autoplayStatus"])):a.createCommentVNode("",!0)]),_:1},8,["thumbnails","active","cameraHasSunStudy"])):a.createCommentVNode("",!0)]),_:1}),me.value?(a.openBlock(),a.createElementBlock("div",pd,[!_1.value&&q.value&&Ee.value&&vt.value(K.value)&&It(K.value)[0]&&z.value?(a.openBlock(),a.createBlock(q0,{key:0,class:"mt-1","current-day":vt.value(K.value)?It(K.value)[0]:void 0,"current-time":z.value,onOnTimeChange:c2,onToggleSunStudy:te[11]||(te[11]=E1=>Ee.value=!Ee.value)},null,8,["current-day","current-time"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),a.unref(M)&&a.unref(k)?(a.openBlock(),a.createElementBlock("div",gd," version: "+a.toDisplayString(a.unref(M)),1)):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-4c9ca3de"]]);var _d=0,to=1,vd=2,io=1,xd=2,Xt=3,Nt=0,et=1,ut=2,Yt=0,ni=1,N3=2,ro=3,ao=4,yd=5,O2=100,Sd=101,Md=102,wd=103,Ad=104,Ed=200,bd=201,Cd=202,Td=203,L3=204,R3=205,Id=206,Pd=207,Nd=208,Ld=209,Rd=210,Dd=211,Ud=212,kd=213,Od=214,zd=0,Vd=1,Bd=2,ya=3,Fd=4,Hd=5,Gd=6,Wd=7,no=0,jd=1,Xd=2,h2=0,Yd=1,qd=2,Zd=3,Qd=4,Jd=5,Kd=6,$d=7,oo="attached",eh="detached",so=300,oi=301,si=302,D3=303,U3=304,Sa=306,R1=1e3,Lt=1001,Ma=1002,u1=1003,lo=1004,Cr=1005,m1=1006,wa=1007,qt=1008,Rt=1009,th=1010,ih=1011,co=1012,ho=1013,li=1014,q1=1015,ot=1016,uo=1017,mo=1018,Tr=1020,rh=35902,ah=1021,nh=1022,D1=1023,oh=1024,sh=1025,ci=1026,Ir=1027,k3=1028,fo=1029,lh=1030,po=1031,go=1033,O3=33776,z3=33777,V3=33778,B3=33779,_o=35840,vo=35841,xo=35842,yo=35843,So=36196,Mo=37492,wo=37496,Ao=37808,Eo=37809,bo=37810,Co=37811,To=37812,Io=37813,Po=37814,No=37815,Lo=37816,Ro=37817,Do=37818,Uo=37819,ko=37820,Oo=37821,F3=36492,zo=36494,Vo=36495,ch=36283,Bo=36284,Fo=36285,Ho=36286,Pr=2300,di=2301,H3=2302,Go=2400,Wo=2401,jo=2402,dh=2500,hh=0,Xo=1,G3=2,uh=3200,mh=3201,Yo=0,fh=1,u2="",Z1="srgb",U1="srgb-linear",W3="display-p3",Aa="display-p3-linear",Ea="linear",g1="srgb",ba="rec709",Ca="p3",hi=7680,qo=519,ph=512,gh=513,_h=514,Zo=515,vh=516,xh=517,yh=518,Sh=519,j3=35044,Qo="300 es",Zt=2e3,Ta=2001,ui=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let 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;let i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let i=this._listeners[e];if(i!==void 0){let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let t=this._listeners[e.type];if(t!==void 0){e.target=this;let i=t.slice(0);for(let r=0,n=i.length;r<n;r++)i[r].call(this,e);e.target=null}}},F1=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Jo=1234567,Nr=Math.PI/180,mi=180/Math.PI;function St(){let e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(F1[e&255]+F1[e>>8&255]+F1[e>>16&255]+F1[e>>24&255]+"-"+F1[t&255]+F1[t>>8&255]+"-"+F1[t>>16&15|64]+F1[t>>24&255]+"-"+F1[i&63|128]+F1[i>>8&255]+"-"+F1[i>>16&255]+F1[i>>24&255]+F1[r&255]+F1[r>>8&255]+F1[r>>16&255]+F1[r>>24&255]).toLowerCase()}function H1(e,t,i){return Math.max(t,Math.min(i,e))}function X3(e,t){return(e%t+t)%t}function Mh(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)}function wh(e,t,i){return e!==t?(i-e)/(t-e):0}function Lr(e,t,i){return(1-i)*e+i*t}function Ah(e,t,i,r){return Lr(e,t,1-Math.exp(-i*r))}function Eh(e,t=1){return t-Math.abs(X3(e,t*2)-t)}function bh(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))}function Ch(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(e*6-15)+10))}function Th(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Ih(e,t){return e+Math.random()*(t-e)}function Ph(e){return e*(.5-Math.random())}function Nh(e){e!==void 0&&(Jo=e);let t=Jo+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Lh(e){return e*Nr}function Rh(e){return e*mi}function Dh(e){return(e&e-1)===0&&e!==0}function Uh(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function kh(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function Oh(e,t,i,r,n){let o=Math.cos,s=Math.sin,l=o(i/2),d=s(i/2),c=o((t+r)/2),h=s((t+r)/2),u=o((t-r)/2),m=s((t-r)/2),f=o((r-t)/2),v=s((r-t)/2);switch(n){case"XYX":e.set(l*h,d*u,d*m,l*c);break;case"YZY":e.set(d*m,l*h,d*u,l*c);break;case"ZXZ":e.set(d*u,d*m,l*h,l*c);break;case"XZX":e.set(l*h,d*v,d*f,l*c);break;case"YXY":e.set(d*f,l*h,d*v,l*c);break;case"ZYZ":e.set(d*v,d*f,l*h,l*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+n)}}function Mt(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function l1(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw new Error("Invalid component type.")}}var fi={DEG2RAD:Nr,RAD2DEG:mi,generateUUID:St,clamp:H1,euclideanModulo:X3,mapLinear:Mh,inverseLerp:wh,lerp:Lr,damp:Ah,pingpong:Eh,smoothstep:bh,smootherstep:Ch,randInt:Th,randFloat:Ih,randFloatSpread:Ph,seededRandom:Nh,degToRad:Lh,radToDeg:Rh,isPowerOfTwo:Dh,ceilPowerOfTwo:Uh,floorPowerOfTwo:kh,setQuaternionFromProperEuler:Oh,normalize:l1,denormalize:Mt},ye=class b4{constructor(t=0,i=0){b4.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let i=this.x,r=this.y,n=t.elements;return this.x=n[0]*i+n[3]*r+n[6],this.y=n[1]*i+n[4]*r+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;let r=this.dot(t)/i;return Math.acos(H1(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y;return i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){let r=Math.cos(i),n=Math.sin(i),o=this.x-t.x,s=this.y-t.y;return this.x=o*r-s*n+t.x,this.y=o*n+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},je=class C4{constructor(t,i,r,n,o,s,l,d,c){C4.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,r,n,o,s,l,d,c)}set(t,i,r,n,o,s,l,d,c){let h=this.elements;return h[0]=t,h[1]=n,h[2]=l,h[3]=i,h[4]=o,h[5]=d,h[6]=r,h[7]=s,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],this}extractBasis(t,i,r){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,o=this.elements,s=r[0],l=r[3],d=r[6],c=r[1],h=r[4],u=r[7],m=r[2],f=r[5],v=r[8],_=n[0],g=n[3],p=n[6],y=n[1],x=n[4],b=n[7],N=n[2],A=n[5],C=n[8];return o[0]=s*_+l*y+d*N,o[3]=s*g+l*x+d*A,o[6]=s*p+l*b+d*C,o[1]=c*_+h*y+u*N,o[4]=c*g+h*x+u*A,o[7]=c*p+h*b+u*C,o[2]=m*_+f*y+v*N,o[5]=m*g+f*x+v*A,o[8]=m*p+f*b+v*C,this}multiplyScalar(t){let i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8];return i*s*h-i*l*c-r*o*h+r*l*d+n*o*c-n*s*d}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8],u=h*s-l*c,m=l*d-h*o,f=c*o-s*d,v=i*u+r*m+n*f;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);let _=1/v;return t[0]=u*_,t[1]=(n*c-h*r)*_,t[2]=(l*r-n*s)*_,t[3]=m*_,t[4]=(h*i-n*d)*_,t[5]=(n*o-l*i)*_,t[6]=f*_,t[7]=(r*d-c*i)*_,t[8]=(s*i-r*o)*_,this}transpose(){let t,i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,r,n,o,s,l){let d=Math.cos(o),c=Math.sin(o);return this.set(r*d,r*c,-r*(d*s+c*l)+s+t,-n*c,n*d,-n*(-c*s+d*l)+l+i,0,0,1),this}scale(t,i){return this.premultiply(Y3.makeScale(t,i)),this}rotate(t){return this.premultiply(Y3.makeRotation(-t)),this}translate(t,i){return this.premultiply(Y3.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,r,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<9;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<9;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}},Y3=new je;function Ko(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function Rr(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function zh(){let e=Rr("canvas");return e.style.display="block",e}var $o={};function es(e){e in $o||($o[e]=!0,console.warn(e))}var ts=new je().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),is=new je().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ia={[U1]:{transfer:Ea,primaries:ba,toReference:e=>e,fromReference:e=>e},[Z1]:{transfer:g1,primaries:ba,toReference:e=>e.convertSRGBToLinear(),fromReference:e=>e.convertLinearToSRGB()},[Aa]:{transfer:Ea,primaries:Ca,toReference:e=>e.applyMatrix3(is),fromReference:e=>e.applyMatrix3(ts)},[W3]:{transfer:g1,primaries:Ca,toReference:e=>e.convertSRGBToLinear().applyMatrix3(is),fromReference:e=>e.applyMatrix3(ts).convertLinearToSRGB()}},Vh=new Set([U1,Aa]),n1={enabled:!0,_workingColorSpace:U1,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Vh.has(e))throw new Error(`Unsupported working color space, "${e}".`);this._workingColorSpace=e},convert:function(e,t,i){if(this.enabled===!1||t===i||!t||!i)return e;let r=Ia[t].toReference,n=Ia[i].fromReference;return n(r(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Ia[e].primaries},getTransfer:function(e){return e===u2?Ea:Ia[e].transfer}};function pi(e){return e<.04045?e*.0773993808:Math.pow(e*.9478672986+.0521327014,2.4)}function q3(e){return e<.0031308?e*12.92:1.055*Math.pow(e,.41666)-.055}var gi,Bh=class{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{gi===void 0&&(gi=Rr("canvas")),gi.width=e.width,gi.height=e.height;let i=gi.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=gi}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let t=Rr("canvas");t.width=e.width,t.height=e.height;let i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);let r=i.getImageData(0,0,e.width,e.height),n=r.data;for(let o=0;o<n.length;o++)n[o]=pi(n[o]/255)*255;return i.putImageData(r,0,0),t}else if(e.data){let t=e.data.slice(0);for(let i=0;i<t.length;i++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[i]=Math.floor(pi(t[i]/255)*255):t[i]=pi(t[i]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}},Fh=0,rs=class{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Fh++}),this.uuid=St(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){let t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];let i={uuid:this.uuid,url:""},r=this.data;if(r!==null){let n;if(Array.isArray(r)){n=[];for(let o=0,s=r.length;o<s;o++)r[o].isDataTexture?n.push(Z3(r[o].image)):n.push(Z3(r[o]))}else n=Z3(r);i.url=n}return t||(e.images[this.uuid]=i),i}};function Z3(e){return typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap?Bh.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Hh=0,tt=class M3 extends ui{constructor(t=M3.DEFAULT_IMAGE,i=M3.DEFAULT_MAPPING,r=Lt,n=Lt,o=m1,s=qt,l=D1,d=Rt,c=M3.DEFAULT_ANISOTROPY,h=u2){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Hh++}),this.uuid=St(),this.name="",this.source=new rs(t),this.mipmaps=[],this.mapping=i,this.channel=0,this.wrapS=r,this.wrapT=n,this.magFilter=o,this.minFilter=s,this.anisotropy=c,this.format=l,this.internalFormat=null,this.type=d,this.offset=new ye(0,0),this.repeat=new ye(1,1),this.center=new ye(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new je,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),i||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==so)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case R1:t.x=t.x-Math.floor(t.x);break;case Lt:t.x=t.x<0?0:1;break;case Ma:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case R1:t.y=t.y-Math.floor(t.y);break;case Lt:t.y=t.y<0?0:1;break;case Ma:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};tt.DEFAULT_IMAGE=null,tt.DEFAULT_MAPPING=so,tt.DEFAULT_ANISOTROPY=1;var f1=class T4{constructor(t=0,i=0,r=0,n=1){T4.prototype.isVector4=!0,this.x=t,this.y=i,this.z=r,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,r,n){return this.x=t,this.y=i,this.z=r,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){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: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,o=this.w,s=t.elements;return this.x=s[0]*i+s[4]*r+s[8]*n+s[12]*o,this.y=s[1]*i+s[5]*r+s[9]*n+s[13]*o,this.z=s[2]*i+s[6]*r+s[10]*n+s[14]*o,this.w=s[3]*i+s[7]*r+s[11]*n+s[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,r,n,o,s=t.elements,l=s[0],d=s[4],c=s[8],h=s[1],u=s[5],m=s[9],f=s[2],v=s[6],_=s[10];if(Math.abs(d-h)<.01&&Math.abs(c-f)<.01&&Math.abs(m-v)<.01){if(Math.abs(d+h)<.1&&Math.abs(c+f)<.1&&Math.abs(m+v)<.1&&Math.abs(l+u+_-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;let p=(l+1)/2,y=(u+1)/2,x=(_+1)/2,b=(d+h)/4,N=(c+f)/4,A=(m+v)/4;return p>y&&p>x?p<.01?(r=0,n=.707106781,o=.707106781):(r=Math.sqrt(p),n=b/r,o=N/r):y>x?y<.01?(r=.707106781,n=0,o=.707106781):(n=Math.sqrt(y),r=b/n,o=A/n):x<.01?(r=.707106781,n=.707106781,o=0):(o=Math.sqrt(x),r=N/o,n=A/o),this.set(r,n,o,i),this}let g=Math.sqrt((v-m)*(v-m)+(c-f)*(c-f)+(h-d)*(h-d));return Math.abs(g)<.001&&(g=1),this.x=(v-m)/g,this.y=(c-f)/g,this.z=(h-d)/g,this.w=Math.acos((l+u+_-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this.w=t.w+(i.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},Gh=class extends ui{constructor(e=1,t=1,i={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new f1(0,0,e,t),this.scissorTest=!1,this.viewport=new f1(0,0,e,t);let r={width:e,height:t,depth:1};i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:m1,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},i);let n=new tt(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace);n.flipY=!1,n.generateMipmaps=i.generateMipmaps,n.internalFormat=i.internalFormat,this.textures=[];let o=i.count;for(let s=0;s<o;s++)this.textures[s]=n.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.depthTexture=i.depthTexture,this.samples=i.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let r=0,n=this.textures.length;r<n;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=i;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let i=0,r=e.textures.length;i<r;i++)this.textures[i]=e.textures[i].clone(),this.textures[i].isRenderTargetTexture=!0;let t=Object.assign({},e.texture.image);return this.texture.source=new rs(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},S1=class extends Gh{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}},as=class extends tt{constructor(e=null,t=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=u1,this.minFilter=u1,this.wrapR=Lt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},ns=class extends tt{constructor(e=null,t=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:r},this.magFilter=u1,this.minFilter=u1,this.wrapR=Lt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},m2=class{constructor(e=0,t=0,i=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=r}static slerpFlat(e,t,i,r,n,o,s){let l=i[r+0],d=i[r+1],c=i[r+2],h=i[r+3],u=n[o+0],m=n[o+1],f=n[o+2],v=n[o+3];if(s===0){e[t+0]=l,e[t+1]=d,e[t+2]=c,e[t+3]=h;return}if(s===1){e[t+0]=u,e[t+1]=m,e[t+2]=f,e[t+3]=v;return}if(h!==v||l!==u||d!==m||c!==f){let _=1-s,g=l*u+d*m+c*f+h*v,p=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){let b=Math.sqrt(y),N=Math.atan2(b,g*p);_=Math.sin(_*N)/b,s=Math.sin(s*N)/b}let x=s*p;if(l=l*_+u*x,d=d*_+m*x,c=c*_+f*x,h=h*_+v*x,_===1-s){let b=1/Math.sqrt(l*l+d*d+c*c+h*h);l*=b,d*=b,c*=b,h*=b}}e[t]=l,e[t+1]=d,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,i,r,n,o){let s=i[r],l=i[r+1],d=i[r+2],c=i[r+3],h=n[o],u=n[o+1],m=n[o+2],f=n[o+3];return e[t]=s*f+c*h+l*m-d*u,e[t+1]=l*f+c*u+d*h-s*m,e[t+2]=d*f+c*m+s*u-l*h,e[t+3]=c*f-s*h-l*u-d*m,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=!0){let i=e._x,r=e._y,n=e._z,o=e._order,s=Math.cos,l=Math.sin,d=s(i/2),c=s(r/2),h=s(n/2),u=l(i/2),m=l(r/2),f=l(n/2);switch(o){case"XYZ":this._x=u*c*h+d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h-u*m*f;break;case"YXZ":this._x=u*c*h+d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h+u*m*f;break;case"ZXY":this._x=u*c*h-d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h-u*m*f;break;case"ZYX":this._x=u*c*h-d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h+u*m*f;break;case"YZX":this._x=u*c*h+d*m*f,this._y=d*m*h+u*c*f,this._z=d*c*f-u*m*h,this._w=d*c*h-u*m*f;break;case"XZY":this._x=u*c*h-d*m*f,this._y=d*m*h-u*c*f,this._z=d*c*f+u*m*h,this._w=d*c*h+u*m*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let 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){let t=e.elements,i=t[0],r=t[4],n=t[8],o=t[1],s=t[5],l=t[9],d=t[2],c=t[6],h=t[10],u=i+s+h;if(u>0){let m=.5/Math.sqrt(u+1);this._w=.25/m,this._x=(c-l)*m,this._y=(n-d)*m,this._z=(o-r)*m}else if(i>s&&i>h){let m=2*Math.sqrt(1+i-s-h);this._w=(c-l)/m,this._x=.25*m,this._y=(r+o)/m,this._z=(n+d)/m}else if(s>h){let m=2*Math.sqrt(1+s-i-h);this._w=(n-d)/m,this._x=(r+o)/m,this._y=.25*m,this._z=(l+c)/m}else{let m=2*Math.sqrt(1+h-i-s);this._w=(o-r)/m,this._x=(n+d)/m,this._y=(l+c)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<Number.EPSILON?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(H1(this.dot(e),-1,1)))}rotateTowards(e,t){let i=this.angleTo(e);if(i===0)return this;let 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){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let i=e._x,r=e._y,n=e._z,o=e._w,s=t._x,l=t._y,d=t._z,c=t._w;return this._x=i*c+o*s+r*d-n*l,this._y=r*c+o*l+n*s-i*d,this._z=n*c+o*d+i*l-r*s,this._w=o*c-i*s-r*l-n*d,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);let i=this._x,r=this._y,n=this._z,o=this._w,s=o*e._w+i*e._x+r*e._y+n*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;let l=1-s*s;if(l<=Number.EPSILON){let m=1-t;return this._w=m*o+t*this._w,this._x=m*i+t*this._x,this._y=m*r+t*this._y,this._z=m*n+t*this._z,this.normalize(),this}let d=Math.sqrt(l),c=Math.atan2(d,s),h=Math.sin((1-t)*c)/d,u=Math.sin(t*c)/d;return this._w=o*h+this._w*u,this._x=i*h+this._x*u,this._y=r*h+this._y*u,this._z=n*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),n=Math.sqrt(i);return this.set(r*Math.sin(e),r*Math.cos(e),n*Math.sin(t),n*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},I=class I4{constructor(t=0,i=0,r=0){I4.prototype.isVector3=!0,this.x=t,this.y=i,this.z=r}set(t,i,r){return r===void 0&&(r=this.z),this.x=t,this.y=i,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(os.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(os.setFromAxisAngle(t,i))}applyMatrix3(t){let i=this.x,r=this.y,n=this.z,o=t.elements;return this.x=o[0]*i+o[3]*r+o[6]*n,this.y=o[1]*i+o[4]*r+o[7]*n,this.z=o[2]*i+o[5]*r+o[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,o=t.elements,s=1/(o[3]*i+o[7]*r+o[11]*n+o[15]);return this.x=(o[0]*i+o[4]*r+o[8]*n+o[12])*s,this.y=(o[1]*i+o[5]*r+o[9]*n+o[13])*s,this.z=(o[2]*i+o[6]*r+o[10]*n+o[14])*s,this}applyQuaternion(t){let i=this.x,r=this.y,n=this.z,o=t.x,s=t.y,l=t.z,d=t.w,c=2*(s*n-l*r),h=2*(l*i-o*n),u=2*(o*r-s*i);return this.x=i+d*c+s*u-l*h,this.y=r+d*h+l*c-o*u,this.z=n+d*u+o*h-s*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let i=this.x,r=this.y,n=this.z,o=t.elements;return this.x=o[0]*i+o[4]*r+o[8]*n,this.y=o[1]*i+o[5]*r+o[9]*n,this.z=o[2]*i+o[6]*r+o[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){let r=t.x,n=t.y,o=t.z,s=i.x,l=i.y,d=i.z;return this.x=n*d-o*l,this.y=o*s-r*d,this.z=r*l-n*s,this}projectOnVector(t){let i=t.lengthSq();if(i===0)return this.set(0,0,0);let r=t.dot(this)/i;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return Q3.copy(this).projectOnVector(t),this.sub(Q3)}reflect(t){return this.sub(Q3.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;let r=this.dot(t)/i;return Math.acos(H1(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return i*i+r*r+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,r){let n=Math.sin(i)*t;return this.x=n*Math.sin(r),this.y=Math.cos(i)*t,this.z=n*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,r){return this.x=t*Math.sin(i),this.y=r,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){let i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){let i=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=r,this.z=n,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,i=Math.random()*2-1,r=Math.sqrt(1-i*i);return this.x=r*Math.cos(t),this.y=i,this.z=r*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Q3=new I,os=new m2,Qt=class{constructor(e=new I(1/0,1/0,1/0),t=new I(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(wt.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(wt.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){let i=wt.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);let i=e.geometry;if(i!==void 0){let n=i.getAttribute("position");if(t===!0&&n!==void 0&&e.isInstancedMesh!==!0)for(let o=0,s=n.count;o<s;o++)e.isMesh===!0?e.getVertexPosition(o,wt):wt.fromBufferAttribute(n,o),wt.applyMatrix4(e.matrixWorld),this.expandByPoint(wt);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),Pa.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),Pa.copy(i.boundingBox)),Pa.applyMatrix4(e.matrixWorld),this.union(Pa)}let r=e.children;for(let n=0,o=r.length;n<o;n++)this.expandByObject(r[n],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,wt),wt.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(Dr),Na.subVectors(this.max,Dr),_i.subVectors(e.a,Dr),vi.subVectors(e.b,Dr),xi.subVectors(e.c,Dr),f2.subVectors(vi,_i),p2.subVectors(xi,vi),z2.subVectors(_i,xi);let t=[0,-f2.z,f2.y,0,-p2.z,p2.y,0,-z2.z,z2.y,f2.z,0,-f2.x,p2.z,0,-p2.x,z2.z,0,-z2.x,-f2.y,f2.x,0,-p2.y,p2.x,0,-z2.y,z2.x,0];return!J3(t,_i,vi,xi,Na)||(t=[1,0,0,0,1,0,0,0,1],!J3(t,_i,vi,xi,Na))?!1:(La.crossVectors(f2,p2),t=[La.x,La.y,La.z],J3(t,_i,vi,xi,Na))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,wt).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(wt).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:(Jt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Jt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Jt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Jt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Jt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Jt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Jt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Jt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Jt),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)}},Jt=[new I,new I,new I,new I,new I,new I,new I,new I],wt=new I,Pa=new Qt,_i=new I,vi=new I,xi=new I,f2=new I,p2=new I,z2=new I,Dr=new I,Na=new I,La=new I,V2=new I;function J3(e,t,i,r,n){for(let o=0,s=e.length-3;o<=s;o+=3){V2.fromArray(e,o);let l=n.x*Math.abs(V2.x)+n.y*Math.abs(V2.y)+n.z*Math.abs(V2.z),d=t.dot(V2),c=i.dot(V2),h=r.dot(V2);if(Math.max(-Math.max(d,c,h),Math.min(d,c,h))>l)return!1}return!0}var Wh=new Qt,Ur=new I,K3=new I,Dt=class{constructor(e=new I,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let i=this.center;t!==void 0?i.copy(t):Wh.setFromPoints(e).getCenter(i);let r=0;for(let n=0,o=e.length;n<o;n++)r=Math.max(r,i.distanceToSquared(e[n]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){let t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){let i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Ur.subVectors(e,this.center);let t=Ur.lengthSq();if(t>this.radius*this.radius){let i=Math.sqrt(t),r=(i-this.radius)*.5;this.center.addScaledVector(Ur,r/i),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(K3.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Ur.copy(e.center).add(K3)),this.expandByPoint(Ur.copy(e.center).sub(K3))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}},Kt=new I,$3=new I,Ra=new I,g2=new I,en=new I,Da=new I,tn=new I,kr=class{constructor(e=new I,t=new I(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Kt)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Kt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Kt.copy(this.origin).addScaledVector(this.direction,t),Kt.distanceToSquared(e))}distanceSqToSegment(e,t,i,r){$3.copy(e).add(t).multiplyScalar(.5),Ra.copy(t).sub(e).normalize(),g2.copy(this.origin).sub($3);let n=e.distanceTo(t)*.5,o=-this.direction.dot(Ra),s=g2.dot(this.direction),l=-g2.dot(Ra),d=g2.lengthSq(),c=Math.abs(1-o*o),h,u,m,f;if(c>0)if(h=o*l-s,u=o*s-l,f=n*c,h>=0)if(u>=-f)if(u<=f){let v=1/c;h*=v,u*=v,m=h*(h+o*u+2*s)+u*(o*h+u+2*l)+d}else u=n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;else u=-n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;else u<=-f?(h=Math.max(0,-(-o*n+s)),u=h>0?-n:Math.min(Math.max(-n,-l),n),m=-h*h+u*(u+2*l)+d):u<=f?(h=0,u=Math.min(Math.max(-n,-l),n),m=u*(u+2*l)+d):(h=Math.max(0,-(o*n+s)),u=h>0?n:Math.min(Math.max(-n,-l),n),m=-h*h+u*(u+2*l)+d);else u=o>0?-n:n,h=Math.max(0,-(o*u+s)),m=-h*h+u*(u+2*l)+d;return i&&i.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy($3).addScaledVector(Ra,u),m}intersectSphere(e,t){Kt.subVectors(e.center,this.origin);let i=Kt.dot(this.direction),r=Kt.dot(Kt)-i*i,n=e.radius*e.radius;if(r>n)return null;let o=Math.sqrt(n-r),s=i-o,l=i+o;return l<0?null:s<0?this.at(l,t):this.at(s,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){let i=this.distanceToPlane(e);return i===null?null:this.at(i,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,r,n,o,s,l,d=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return d>=0?(i=(e.min.x-u.x)*d,r=(e.max.x-u.x)*d):(i=(e.max.x-u.x)*d,r=(e.min.x-u.x)*d),c>=0?(n=(e.min.y-u.y)*c,o=(e.max.y-u.y)*c):(n=(e.max.y-u.y)*c,o=(e.min.y-u.y)*c),i>o||n>r||((n>i||isNaN(i))&&(i=n),(o<r||isNaN(r))&&(r=o),h>=0?(s=(e.min.z-u.z)*h,l=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,l=(e.min.z-u.z)*h),i>l||s>r)||((s>i||i!==i)&&(i=s),(l<r||r!==r)&&(r=l),r<0)?null:this.at(i>=0?i:r,t)}intersectsBox(e){return this.intersectBox(e,Kt)!==null}intersectTriangle(e,t,i,r,n){en.subVectors(t,e),Da.subVectors(i,e),tn.crossVectors(en,Da);let o=this.direction.dot(tn),s;if(o>0){if(r)return null;s=1}else if(o<0)s=-1,o=-o;else return null;g2.subVectors(this.origin,e);let l=s*this.direction.dot(Da.crossVectors(g2,Da));if(l<0)return null;let d=s*this.direction.dot(en.cross(g2));if(d<0||l+d>o)return null;let c=-s*g2.dot(tn);return c<0?null:this.at(c/o,n)}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)}},Fe=class z0{constructor(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g){z0.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g)}set(t,i,r,n,o,s,l,d,c,h,u,m,f,v,_,g){let p=this.elements;return p[0]=t,p[4]=i,p[8]=r,p[12]=n,p[1]=o,p[5]=s,p[9]=l,p[13]=d,p[2]=c,p[6]=h,p[10]=u,p[14]=m,p[3]=f,p[7]=v,p[11]=_,p[15]=g,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 z0().fromArray(this.elements)}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this}copyPosition(t){let i=this.elements,r=t.elements;return i[12]=r[12],i[13]=r[13],i[14]=r[14],this}setFromMatrix3(t){let i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,r){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,i,r){return this.set(t.x,i.x,r.x,0,t.y,i.y,r.y,0,t.z,i.z,r.z,0,0,0,0,1),this}extractRotation(t){let i=this.elements,r=t.elements,n=1/yi.setFromMatrixColumn(t,0).length(),o=1/yi.setFromMatrixColumn(t,1).length(),s=1/yi.setFromMatrixColumn(t,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[3]=0,i[4]=r[4]*o,i[5]=r[5]*o,i[6]=r[6]*o,i[7]=0,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){let i=this.elements,r=t.x,n=t.y,o=t.z,s=Math.cos(r),l=Math.sin(r),d=Math.cos(n),c=Math.sin(n),h=Math.cos(o),u=Math.sin(o);if(t.order==="XYZ"){let m=s*h,f=s*u,v=l*h,_=l*u;i[0]=d*h,i[4]=-d*u,i[8]=c,i[1]=f+v*c,i[5]=m-_*c,i[9]=-l*d,i[2]=_-m*c,i[6]=v+f*c,i[10]=s*d}else if(t.order==="YXZ"){let m=d*h,f=d*u,v=c*h,_=c*u;i[0]=m+_*l,i[4]=v*l-f,i[8]=s*c,i[1]=s*u,i[5]=s*h,i[9]=-l,i[2]=f*l-v,i[6]=_+m*l,i[10]=s*d}else if(t.order==="ZXY"){let m=d*h,f=d*u,v=c*h,_=c*u;i[0]=m-_*l,i[4]=-s*u,i[8]=v+f*l,i[1]=f+v*l,i[5]=s*h,i[9]=_-m*l,i[2]=-s*c,i[6]=l,i[10]=s*d}else if(t.order==="ZYX"){let m=s*h,f=s*u,v=l*h,_=l*u;i[0]=d*h,i[4]=v*c-f,i[8]=m*c+_,i[1]=d*u,i[5]=_*c+m,i[9]=f*c-v,i[2]=-c,i[6]=l*d,i[10]=s*d}else if(t.order==="YZX"){let m=s*d,f=s*c,v=l*d,_=l*c;i[0]=d*h,i[4]=_-m*u,i[8]=v*u+f,i[1]=u,i[5]=s*h,i[9]=-l*h,i[2]=-c*h,i[6]=f*u+v,i[10]=m-_*u}else if(t.order==="XZY"){let m=s*d,f=s*c,v=l*d,_=l*c;i[0]=d*h,i[4]=-u,i[8]=c*h,i[1]=m*u+_,i[5]=s*h,i[9]=f*u-v,i[2]=v*u-f,i[6]=l*h,i[10]=_*u+m}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(jh,t,Xh)}lookAt(t,i,r){let n=this.elements;return st.subVectors(t,i),st.lengthSq()===0&&(st.z=1),st.normalize(),_2.crossVectors(r,st),_2.lengthSq()===0&&(Math.abs(r.z)===1?st.x+=1e-4:st.z+=1e-4,st.normalize(),_2.crossVectors(r,st)),_2.normalize(),Ua.crossVectors(st,_2),n[0]=_2.x,n[4]=Ua.x,n[8]=st.x,n[1]=_2.y,n[5]=Ua.y,n[9]=st.y,n[2]=_2.z,n[6]=Ua.z,n[10]=st.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,o=this.elements,s=r[0],l=r[4],d=r[8],c=r[12],h=r[1],u=r[5],m=r[9],f=r[13],v=r[2],_=r[6],g=r[10],p=r[14],y=r[3],x=r[7],b=r[11],N=r[15],A=n[0],C=n[4],U=n[8],S=n[12],M=n[1],k=n[5],R=n[9],D=n[13],B=n[2],Z=n[6],j=n[10],Q=n[14],V=n[3],J=n[7],Y=n[11],he=n[15];return o[0]=s*A+l*M+d*B+c*V,o[4]=s*C+l*k+d*Z+c*J,o[8]=s*U+l*R+d*j+c*Y,o[12]=s*S+l*D+d*Q+c*he,o[1]=h*A+u*M+m*B+f*V,o[5]=h*C+u*k+m*Z+f*J,o[9]=h*U+u*R+m*j+f*Y,o[13]=h*S+u*D+m*Q+f*he,o[2]=v*A+_*M+g*B+p*V,o[6]=v*C+_*k+g*Z+p*J,o[10]=v*U+_*R+g*j+p*Y,o[14]=v*S+_*D+g*Q+p*he,o[3]=y*A+x*M+b*B+N*V,o[7]=y*C+x*k+b*Z+N*J,o[11]=y*U+x*R+b*j+N*Y,o[15]=y*S+x*D+b*Q+N*he,this}multiplyScalar(t){let i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[4],n=t[8],o=t[12],s=t[1],l=t[5],d=t[9],c=t[13],h=t[2],u=t[6],m=t[10],f=t[14],v=t[3],_=t[7],g=t[11],p=t[15];return v*(+o*d*u-n*c*u-o*l*m+r*c*m+n*l*f-r*d*f)+_*(+i*d*f-i*c*m+o*s*m-n*s*f+n*c*h-o*d*h)+g*(+i*c*u-i*l*f-o*s*u+r*s*f+o*l*h-r*c*h)+p*(-n*l*h-i*d*u+i*l*m+n*s*u-r*s*m+r*d*h)}transpose(){let t=this.elements,i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,r){let n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=i,n[14]=r),this}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],l=t[5],d=t[6],c=t[7],h=t[8],u=t[9],m=t[10],f=t[11],v=t[12],_=t[13],g=t[14],p=t[15],y=u*g*c-_*m*c+_*d*f-l*g*f-u*d*p+l*m*p,x=v*m*c-h*g*c-v*d*f+s*g*f+h*d*p-s*m*p,b=h*_*c-v*u*c+v*l*f-s*_*f-h*l*p+s*u*p,N=v*u*d-h*_*d-v*l*m+s*_*m+h*l*g-s*u*g,A=i*y+r*x+n*b+o*N;if(A===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let C=1/A;return t[0]=y*C,t[1]=(_*m*o-u*g*o-_*n*f+r*g*f+u*n*p-r*m*p)*C,t[2]=(l*g*o-_*d*o+_*n*c-r*g*c-l*n*p+r*d*p)*C,t[3]=(u*d*o-l*m*o-u*n*c+r*m*c+l*n*f-r*d*f)*C,t[4]=x*C,t[5]=(h*g*o-v*m*o+v*n*f-i*g*f-h*n*p+i*m*p)*C,t[6]=(v*d*o-s*g*o-v*n*c+i*g*c+s*n*p-i*d*p)*C,t[7]=(s*m*o-h*d*o+h*n*c-i*m*c-s*n*f+i*d*f)*C,t[8]=b*C,t[9]=(v*u*o-h*_*o-v*r*f+i*_*f+h*r*p-i*u*p)*C,t[10]=(s*_*o-v*l*o+v*r*c-i*_*c-s*r*p+i*l*p)*C,t[11]=(h*l*o-s*u*o-h*r*c+i*u*c+s*r*f-i*l*f)*C,t[12]=N*C,t[13]=(h*_*n-v*u*n+v*r*m-i*_*m-h*r*g+i*u*g)*C,t[14]=(v*l*n-s*_*n-v*r*d+i*_*d+s*r*g-i*l*g)*C,t[15]=(s*u*n-h*l*n+h*r*d-i*u*d-s*r*m+i*l*m)*C,this}scale(t){let i=this.elements,r=t.x,n=t.y,o=t.z;return i[0]*=r,i[4]*=n,i[8]*=o,i[1]*=r,i[5]*=n,i[9]*=o,i[2]*=r,i[6]*=n,i[10]*=o,i[3]*=r,i[7]*=n,i[11]*=o,this}getMaxScaleOnAxis(){let t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,r,n))}makeTranslation(t,i,r){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,r,0,0,0,1),this}makeRotationX(t){let i=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,i,-r,0,0,r,i,0,0,0,0,1),this}makeRotationY(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,0,r,0,0,1,0,0,-r,0,i,0,0,0,0,1),this}makeRotationZ(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){let r=Math.cos(i),n=Math.sin(i),o=1-r,s=t.x,l=t.y,d=t.z,c=o*s,h=o*l;return this.set(c*s+r,c*l-n*d,c*d+n*l,0,c*l+n*d,h*l+r,h*d-n*s,0,c*d-n*l,h*d+n*s,o*d*d+r,0,0,0,0,1),this}makeScale(t,i,r){return this.set(t,0,0,0,0,i,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,i,r,n,o,s){return this.set(1,r,o,0,t,1,s,0,i,n,1,0,0,0,0,1),this}compose(t,i,r){let n=this.elements,o=i._x,s=i._y,l=i._z,d=i._w,c=o+o,h=s+s,u=l+l,m=o*c,f=o*h,v=o*u,_=s*h,g=s*u,p=l*u,y=d*c,x=d*h,b=d*u,N=r.x,A=r.y,C=r.z;return n[0]=(1-(_+p))*N,n[1]=(f+b)*N,n[2]=(v-x)*N,n[3]=0,n[4]=(f-b)*A,n[5]=(1-(m+p))*A,n[6]=(g+y)*A,n[7]=0,n[8]=(v+x)*C,n[9]=(g-y)*C,n[10]=(1-(m+_))*C,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,i,r){let n=this.elements,o=yi.set(n[0],n[1],n[2]).length(),s=yi.set(n[4],n[5],n[6]).length(),l=yi.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],At.copy(this);let d=1/o,c=1/s,h=1/l;return At.elements[0]*=d,At.elements[1]*=d,At.elements[2]*=d,At.elements[4]*=c,At.elements[5]*=c,At.elements[6]*=c,At.elements[8]*=h,At.elements[9]*=h,At.elements[10]*=h,i.setFromRotationMatrix(At),r.x=o,r.y=s,r.z=l,this}makePerspective(t,i,r,n,o,s,l=Zt){let d=this.elements,c=2*o/(i-t),h=2*o/(r-n),u=(i+t)/(i-t),m=(r+n)/(r-n),f,v;if(l===Zt)f=-(s+o)/(s-o),v=-2*s*o/(s-o);else if(l===Ta)f=-s/(s-o),v=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return d[0]=c,d[4]=0,d[8]=u,d[12]=0,d[1]=0,d[5]=h,d[9]=m,d[13]=0,d[2]=0,d[6]=0,d[10]=f,d[14]=v,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,i,r,n,o,s,l=Zt){let d=this.elements,c=1/(i-t),h=1/(r-n),u=1/(s-o),m=(i+t)*c,f=(r+n)*h,v,_;if(l===Zt)v=(s+o)*u,_=-2*u;else if(l===Ta)v=o*u,_=-1*u;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return d[0]=2*c,d[4]=0,d[8]=0,d[12]=-m,d[1]=0,d[5]=2*h,d[9]=0,d[13]=-f,d[2]=0,d[6]=0,d[10]=_,d[14]=-v,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<16;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<16;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t[i+9]=r[9],t[i+10]=r[10],t[i+11]=r[11],t[i+12]=r[12],t[i+13]=r[13],t[i+14]=r[14],t[i+15]=r[15],t}},yi=new I,At=new Fe,jh=new I(0,0,0),Xh=new I(1,1,1),_2=new I,Ua=new I,st=new I,ss=new Fe,ls=new m2,k1=class P4{constructor(t=0,i=0,r=0,n=P4.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=r,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,r,n=this._order){return this._x=t,this._y=i,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,r=!0){let n=t.elements,o=n[0],s=n[4],l=n[8],d=n[1],c=n[5],h=n[9],u=n[2],m=n[6],f=n[10];switch(i){case"XYZ":this._y=Math.asin(H1(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(m,c),this._z=0);break;case"YXZ":this._x=Math.asin(-H1(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,f),this._z=Math.atan2(d,c)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(H1(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(d,o));break;case"ZYX":this._y=Math.asin(-H1(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(m,f),this._z=Math.atan2(d,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(H1(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(l,f));break;case"XZY":this._z=Math.asin(-H1(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(m,c),this._y=Math.atan2(l,o)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,r===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,r){return ss.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ss,i,r)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return ls.setFromEuler(this),this.setFromQuaternion(ls,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};k1.DEFAULT_ORDER="XYZ";var rn=class{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}},Yh=0,cs=new I,Si=new m2,$t=new Fe,ka=new I,Or=new I,qh=new I,Zh=new m2,ds=new I(1,0,0),hs=new I(0,1,0),us=new I(0,0,1),ms={type:"added"},Qh={type:"removed"},Mi={type:"childadded",child:null},an={type:"childremoved",child:null},I1=class w3 extends ui{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Yh++}),this.uuid=St(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=w3.DEFAULT_UP.clone();let t=new I,i=new k1,r=new m2,n=new I(1,1,1);function o(){r.setFromEuler(i,!1)}function s(){i.setFromQuaternion(r,void 0,!1)}i._onChange(o),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Fe},normalMatrix:{value:new je}}),this.matrix=new Fe,this.matrixWorld=new Fe,this.matrixAutoUpdate=w3.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=w3.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new rn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return Si.setFromAxisAngle(t,i),this.quaternion.multiply(Si),this}rotateOnWorldAxis(t,i){return Si.setFromAxisAngle(t,i),this.quaternion.premultiply(Si),this}rotateX(t){return this.rotateOnAxis(ds,t)}rotateY(t){return this.rotateOnAxis(hs,t)}rotateZ(t){return this.rotateOnAxis(us,t)}translateOnAxis(t,i){return cs.copy(t).applyQuaternion(this.quaternion),this.position.add(cs.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(ds,t)}translateY(t){return this.translateOnAxis(hs,t)}translateZ(t){return this.translateOnAxis(us,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4($t.copy(this.matrixWorld).invert())}lookAt(t,i,r){t.isVector3?ka.copy(t):ka.set(t,i,r);let n=this.parent;this.updateWorldMatrix(!0,!1),Or.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?$t.lookAt(Or,ka,this.up):$t.lookAt(ka,Or,this.up),this.quaternion.setFromRotationMatrix($t),n&&($t.extractRotation(n.matrixWorld),Si.setFromRotationMatrix($t),this.quaternion.premultiply(Si.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(ms),Mi.child=t,this.dispatchEvent(Mi),Mi.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let i=this.children.indexOf(t);return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(Qh),an.child=t,this.dispatchEvent(an),an.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),$t.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),$t.multiply(t.parent.matrixWorld)),t.applyMatrix4($t),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(ms),Mi.child=t,this.dispatchEvent(Mi),Mi.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let r=0,n=this.children.length;r<n;r++){let o=this.children[r].getObjectByProperty(t,i);if(o!==void 0)return o}}getObjectsByProperty(t,i,r=[]){this[t]===i&&r.push(this);let n=this.children;for(let o=0,s=n.length;o<s;o++)n[o].getObjectsByProperty(t,i,r);return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Or,t,qh),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Or,Zh,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverseVisible(t)}traverseAncestors(t){let i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let i=this.children;for(let r=0,n=i.length;r<n;r++){let o=i[r];(o.matrixWorldAutoUpdate===!0||t===!0)&&o.updateMatrixWorld(t)}}updateWorldMatrix(t,i){let r=this.parent;if(t===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i===!0){let n=this.children;for(let o=0,s=n.length;o<s;o++){let l=n[o];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(t){let i=t===void 0||typeof t=="string",r={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let n={};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),this.frustumCulled===!1&&(n.frustumCulled=!1),this.renderOrder!==0&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),this.boundingBox!==null&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()}));function o(l,d){return l[d.uuid]===void 0&&(l[d.uuid]=d.toJSON(t)),d.uuid}if(this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(t.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let d=l.shapes;if(Array.isArray(d))for(let c=0,h=d.length;c<h;c++){let u=d[c];o(t.shapes,u)}else o(t.shapes,d)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(o(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let d=0,c=this.material.length;d<c;d++)l.push(o(t.materials,this.material[d]));n.material=l}else n.material=o(t.materials,this.material);if(this.children.length>0){n.children=[];for(let l=0;l<this.children.length;l++)n.children.push(this.children[l].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let l=0;l<this.animations.length;l++){let d=this.animations[l];n.animations.push(o(t.animations,d))}}if(i){let l=s(t.geometries),d=s(t.materials),c=s(t.textures),h=s(t.images),u=s(t.shapes),m=s(t.skeletons),f=s(t.animations),v=s(t.nodes);l.length>0&&(r.geometries=l),d.length>0&&(r.materials=d),c.length>0&&(r.textures=c),h.length>0&&(r.images=h),u.length>0&&(r.shapes=u),m.length>0&&(r.skeletons=m),f.length>0&&(r.animations=f),v.length>0&&(r.nodes=v)}return r.object=n,r;function s(l){let d=[];for(let c in l){let h=l[c];delete h.metadata,d.push(h)}return d}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let r=0;r<t.children.length;r++){let n=t.children[r];this.add(n.clone())}return this}};I1.DEFAULT_UP=new I(0,1,0),I1.DEFAULT_MATRIX_AUTO_UPDATE=!0,I1.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Et=new I,e2=new I,nn=new I,t2=new I,wi=new I,Ai=new I,fs=new I,on=new I,sn=new I,ln=new I,Oa=class Ar{constructor(t=new I,i=new I,r=new I){this.a=t,this.b=i,this.c=r}static getNormal(t,i,r,n){n.subVectors(r,i),Et.subVectors(t,i),n.cross(Et);let o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}static getBarycoord(t,i,r,n,o){Et.subVectors(n,i),e2.subVectors(r,i),nn.subVectors(t,i);let s=Et.dot(Et),l=Et.dot(e2),d=Et.dot(nn),c=e2.dot(e2),h=e2.dot(nn),u=s*c-l*l;if(u===0)return o.set(0,0,0),null;let m=1/u,f=(c*d-l*h)*m,v=(s*h-l*d)*m;return o.set(1-f-v,v,f)}static containsPoint(t,i,r,n){return this.getBarycoord(t,i,r,n,t2)===null?!1:t2.x>=0&&t2.y>=0&&t2.x+t2.y<=1}static getInterpolation(t,i,r,n,o,s,l,d){return this.getBarycoord(t,i,r,n,t2)===null?(d.x=0,d.y=0,"z"in d&&(d.z=0),"w"in d&&(d.w=0),null):(d.setScalar(0),d.addScaledVector(o,t2.x),d.addScaledVector(s,t2.y),d.addScaledVector(l,t2.z),d)}static isFrontFacing(t,i,r,n){return Et.subVectors(r,i),e2.subVectors(t,i),Et.cross(e2).dot(n)<0}set(t,i,r){return this.a.copy(t),this.b.copy(i),this.c.copy(r),this}setFromPointsAndIndices(t,i,r,n){return this.a.copy(t[i]),this.b.copy(t[r]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,i,r,n){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,n),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Et.subVectors(this.c,this.b),e2.subVectors(this.a,this.b),Et.cross(e2).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Ar.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return Ar.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,r,n,o){return Ar.getInterpolation(t,this.a,this.b,this.c,i,r,n,o)}containsPoint(t){return Ar.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Ar.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){let r=this.a,n=this.b,o=this.c,s,l;wi.subVectors(n,r),Ai.subVectors(o,r),on.subVectors(t,r);let d=wi.dot(on),c=Ai.dot(on);if(d<=0&&c<=0)return i.copy(r);sn.subVectors(t,n);let h=wi.dot(sn),u=Ai.dot(sn);if(h>=0&&u<=h)return i.copy(n);let m=d*u-h*c;if(m<=0&&d>=0&&h<=0)return s=d/(d-h),i.copy(r).addScaledVector(wi,s);ln.subVectors(t,o);let f=wi.dot(ln),v=Ai.dot(ln);if(v>=0&&f<=v)return i.copy(o);let _=f*c-d*v;if(_<=0&&c>=0&&v<=0)return l=c/(c-v),i.copy(r).addScaledVector(Ai,l);let g=h*v-f*u;if(g<=0&&u-h>=0&&f-v>=0)return fs.subVectors(o,n),l=(u-h)/(u-h+(f-v)),i.copy(n).addScaledVector(fs,l);let p=1/(g+_+m);return s=_*p,l=m*p,i.copy(r).addScaledVector(wi,s).addScaledVector(Ai,l)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ps={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},v2={h:0,s:0,l:0},za={h:0,s:0,l:0};function cn(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*6*(2/3-i):e}var Ue=class{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(t===void 0&&i===void 0){let r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Z1){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,n1.toWorkingColorSpace(this,t),this}setRGB(e,t,i,r=n1.workingColorSpace){return this.r=e,this.g=t,this.b=i,n1.toWorkingColorSpace(this,r),this}setHSL(e,t,i,r=n1.workingColorSpace){if(e=X3(e,1),t=H1(t,0,1),i=H1(i,0,1),t===0)this.r=this.g=this.b=i;else{let n=i<=.5?i*(1+t):i+t-i*t,o=2*i-n;this.r=cn(o,n,e+1/3),this.g=cn(o,n,e),this.b=cn(o,n,e-1/3)}return n1.toWorkingColorSpace(this,r),this}setStyle(e,t=Z1){function i(n){n!==void 0&&parseFloat(n)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let n,o=r[1],s=r[2];switch(o){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(255,parseInt(n[1],10))/255,Math.min(255,parseInt(n[2],10))/255,Math.min(255,parseInt(n[3],10))/255,t);if(n=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setRGB(Math.min(100,parseInt(n[1],10))/100,Math.min(100,parseInt(n[2],10))/100,Math.min(100,parseInt(n[3],10))/100,t);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(n[4]),this.setHSL(parseFloat(n[1])/360,parseFloat(n[2])/100,parseFloat(n[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],o=n.length;if(o===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(n,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Z1){let i=ps[e.toLowerCase()];return i!==void 0?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=pi(e.r),this.g=pi(e.g),this.b=pi(e.b),this}copyLinearToSRGB(e){return this.r=q3(e.r),this.g=q3(e.g),this.b=q3(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Z1){return n1.fromWorkingColorSpace(G1.copy(this),e),Math.round(H1(G1.r*255,0,255))*65536+Math.round(H1(G1.g*255,0,255))*256+Math.round(H1(G1.b*255,0,255))}getHexString(e=Z1){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=n1.workingColorSpace){n1.fromWorkingColorSpace(G1.copy(this),t);let i=G1.r,r=G1.g,n=G1.b,o=Math.max(i,r,n),s=Math.min(i,r,n),l,d,c=(s+o)/2;if(s===o)l=0,d=0;else{let h=o-s;switch(d=c<=.5?h/(o+s):h/(2-o-s),o){case i:l=(r-n)/h+(r<n?6:0);break;case r:l=(n-i)/h+2;break;case n:l=(i-r)/h+4;break}l/=6}return e.h=l,e.s=d,e.l=c,e}getRGB(e,t=n1.workingColorSpace){return n1.fromWorkingColorSpace(G1.copy(this),t),e.r=G1.r,e.g=G1.g,e.b=G1.b,e}getStyle(e=Z1){n1.fromWorkingColorSpace(G1.copy(this),e);let t=G1.r,i=G1.g,r=G1.b;return e!==Z1?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(i*255)},${Math.round(r*255)})`}offsetHSL(e,t,i){return this.getHSL(v2),this.setHSL(v2.h+e,v2.s+t,v2.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(v2),e.getHSL(za);let i=Lr(v2.h,za.h,t),r=Lr(v2.s,za.s,t),n=Lr(v2.l,za.l,t);return this.setHSL(i,r,n),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let t=this.r,i=this.g,r=this.b,n=e.elements;return this.r=n[0]*t+n[3]*i+n[6]*r,this.g=n[1]*t+n[4]*i+n[7]*r,this.b=n[2]*t+n[5]*i+n[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},G1=new Ue;Ue.NAMES=ps;var Jh=0,mt=class extends ui{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Jh++}),this.uuid=St(),this.name="",this.type="Material",this.blending=ni,this.side=Nt,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=L3,this.blendDst=R3,this.blendEquation=O2,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ue(0,0,0),this.blendAlpha=0,this.depthFunc=ya,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=qo,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=hi,this.stencilZFail=hi,this.stencilZPass=hi,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let i=e[t];if(i===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[t]=i}}toJSON(e){let t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});let i={metadata:{version:4.6,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!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.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.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),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&&this.attenuationDistance!==1/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!==ni&&(i.blending=this.blending),this.side!==Nt&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==L3&&(i.blendSrc=this.blendSrc),this.blendDst!==R3&&(i.blendDst=this.blendDst),this.blendEquation!==O2&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==ya&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==qo&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==hi&&(i.stencilFail=this.stencilFail),this.stencilZFail!==hi&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==hi&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&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!==void 0&&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.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(n){let o=[];for(let s in n){let l=n[s];delete l.metadata,o.push(l)}return o}if(t){let n=r(e.textures),o=r(e.images);n.length>0&&(i.textures=n),o.length>0&&(i.images=o)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,i=null;if(t!==null){let r=t.length;i=new Array(r);for(let n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}},lt=class extends mt{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ue(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new k1,this.combine=no,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},T1=new I,Va=new ye,W1=class{constructor(e,t,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=i,this.usage=j3,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=q1,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return es("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let r=0,n=this.itemSize;r<n;r++)this.array[e+r]=t.array[i+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,i=this.count;t<i;t++)Va.fromBufferAttribute(this,t),Va.applyMatrix3(e),this.setXY(t,Va.x,Va.y);else if(this.itemSize===3)for(let t=0,i=this.count;t<i;t++)T1.fromBufferAttribute(this,t),T1.applyMatrix3(e),this.setXYZ(t,T1.x,T1.y,T1.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)T1.fromBufferAttribute(this,t),T1.applyMatrix4(e),this.setXYZ(t,T1.x,T1.y,T1.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)T1.fromBufferAttribute(this,t),T1.applyNormalMatrix(e),this.setXYZ(t,T1.x,T1.y,T1.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)T1.fromBufferAttribute(this,t),T1.transformDirection(e),this.setXYZ(t,T1.x,T1.y,T1.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=Mt(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=l1(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Mt(t,this.array)),t}setX(e,t){return this.normalized&&(t=l1(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Mt(t,this.array)),t}setY(e,t){return this.normalized&&(t=l1(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Mt(t,this.array)),t}setZ(e,t){return this.normalized&&(t=l1(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Mt(t,this.array)),t}setW(e,t){return this.normalized&&(t=l1(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=l1(t,this.array),i=l1(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,r){return e*=this.itemSize,this.normalized&&(t=l1(t,this.array),i=l1(i,this.array),r=l1(r,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this}setXYZW(e,t,i,r,n){return e*=this.itemSize,this.normalized&&(t=l1(t,this.array),i=l1(i,this.array),r=l1(r,this.array),n=l1(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==j3&&(e.usage=this.usage),e}},gs=class extends W1{constructor(e,t,i){super(new Uint16Array(e),t,i)}},_s=class extends W1{constructor(e,t,i){super(new Uint32Array(e),t,i)}},it=class extends W1{constructor(e,t,i){super(new Float32Array(e),t,i)}},Kh=0,ft=new Fe,dn=new I1,Ei=new I,ct=new Qt,zr=new Qt,O1=new I,Ut=class N4 extends ui{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Kh++}),this.uuid=St(),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(t){return Array.isArray(t)?this.index=new(Ko(t)?_s:gs)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,r=0){this.groups.push({start:t,count:i,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){let i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);let r=this.attributes.normal;if(r!==void 0){let o=new je().getNormalMatrix(t);r.applyNormalMatrix(o),r.needsUpdate=!0}let n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ft.makeRotationFromQuaternion(t),this.applyMatrix4(ft),this}rotateX(t){return ft.makeRotationX(t),this.applyMatrix4(ft),this}rotateY(t){return ft.makeRotationY(t),this.applyMatrix4(ft),this}rotateZ(t){return ft.makeRotationZ(t),this.applyMatrix4(ft),this}translate(t,i,r){return ft.makeTranslation(t,i,r),this.applyMatrix4(ft),this}scale(t,i,r){return ft.makeScale(t,i,r),this.applyMatrix4(ft),this}lookAt(t){return dn.lookAt(t),dn.updateMatrix(),this.applyMatrix4(dn.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ei).negate(),this.translate(Ei.x,Ei.y,Ei.z),this}setFromPoints(t){let i=[];for(let r=0,n=t.length;r<n;r++){let o=t[r];i.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new it(i,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Qt);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new I(-1/0,-1/0,-1/0),new I(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let r=0,n=i.length;r<n;r++){let o=i[r];ct.setFromBufferAttribute(o),this.morphTargetsRelative?(O1.addVectors(this.boundingBox.min,ct.min),this.boundingBox.expandByPoint(O1),O1.addVectors(this.boundingBox.max,ct.max),this.boundingBox.expandByPoint(O1)):(this.boundingBox.expandByPoint(ct.min),this.boundingBox.expandByPoint(ct.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dt);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new I,1/0);return}if(t){let r=this.boundingSphere.center;if(ct.setFromBufferAttribute(t),i)for(let o=0,s=i.length;o<s;o++){let l=i[o];zr.setFromBufferAttribute(l),this.morphTargetsRelative?(O1.addVectors(ct.min,zr.min),ct.expandByPoint(O1),O1.addVectors(ct.max,zr.max),ct.expandByPoint(O1)):(ct.expandByPoint(zr.min),ct.expandByPoint(zr.max))}ct.getCenter(r);let n=0;for(let o=0,s=t.count;o<s;o++)O1.fromBufferAttribute(t,o),n=Math.max(n,r.distanceToSquared(O1));if(i)for(let o=0,s=i.length;o<s;o++){let l=i[o],d=this.morphTargetsRelative;for(let c=0,h=l.count;c<h;c++)O1.fromBufferAttribute(l,c),d&&(Ei.fromBufferAttribute(t,c),O1.add(Ei)),n=Math.max(n,r.distanceToSquared(O1))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let r=i.position,n=i.normal,o=i.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new W1(new Float32Array(4*r.count),4));let s=this.getAttribute("tangent"),l=[],d=[];for(let U=0;U<r.count;U++)l[U]=new I,d[U]=new I;let c=new I,h=new I,u=new I,m=new ye,f=new ye,v=new ye,_=new I,g=new I;function p(U,S,M){c.fromBufferAttribute(r,U),h.fromBufferAttribute(r,S),u.fromBufferAttribute(r,M),m.fromBufferAttribute(o,U),f.fromBufferAttribute(o,S),v.fromBufferAttribute(o,M),h.sub(c),u.sub(c),f.sub(m),v.sub(m);let k=1/(f.x*v.y-v.x*f.y);isFinite(k)&&(_.copy(h).multiplyScalar(v.y).addScaledVector(u,-f.y).multiplyScalar(k),g.copy(u).multiplyScalar(f.x).addScaledVector(h,-v.x).multiplyScalar(k),l[U].add(_),l[S].add(_),l[M].add(_),d[U].add(g),d[S].add(g),d[M].add(g))}let y=this.groups;y.length===0&&(y=[{start:0,count:t.count}]);for(let U=0,S=y.length;U<S;++U){let M=y[U],k=M.start,R=M.count;for(let D=k,B=k+R;D<B;D+=3)p(t.getX(D+0),t.getX(D+1),t.getX(D+2))}let x=new I,b=new I,N=new I,A=new I;function C(U){N.fromBufferAttribute(n,U),A.copy(N);let S=l[U];x.copy(S),x.sub(N.multiplyScalar(N.dot(S))).normalize(),b.crossVectors(A,S);let M=b.dot(d[U])<0?-1:1;s.setXYZW(U,x.x,x.y,x.z,M)}for(let U=0,S=y.length;U<S;++U){let M=y[U],k=M.start,R=M.count;for(let D=k,B=k+R;D<B;D+=3)C(t.getX(D+0)),C(t.getX(D+1)),C(t.getX(D+2))}}computeVertexNormals(){let t=this.index,i=this.getAttribute("position");if(i!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new W1(new Float32Array(i.count*3),3),this.setAttribute("normal",r);else for(let m=0,f=r.count;m<f;m++)r.setXYZ(m,0,0,0);let n=new I,o=new I,s=new I,l=new I,d=new I,c=new I,h=new I,u=new I;if(t)for(let m=0,f=t.count;m<f;m+=3){let v=t.getX(m+0),_=t.getX(m+1),g=t.getX(m+2);n.fromBufferAttribute(i,v),o.fromBufferAttribute(i,_),s.fromBufferAttribute(i,g),h.subVectors(s,o),u.subVectors(n,o),h.cross(u),l.fromBufferAttribute(r,v),d.fromBufferAttribute(r,_),c.fromBufferAttribute(r,g),l.add(h),d.add(h),c.add(h),r.setXYZ(v,l.x,l.y,l.z),r.setXYZ(_,d.x,d.y,d.z),r.setXYZ(g,c.x,c.y,c.z)}else for(let m=0,f=i.count;m<f;m+=3)n.fromBufferAttribute(i,m+0),o.fromBufferAttribute(i,m+1),s.fromBufferAttribute(i,m+2),h.subVectors(s,o),u.subVectors(n,o),h.cross(u),r.setXYZ(m+0,h.x,h.y,h.z),r.setXYZ(m+1,h.x,h.y,h.z),r.setXYZ(m+2,h.x,h.y,h.z);this.normalizeNormals(),r.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let i=0,r=t.count;i<r;i++)O1.fromBufferAttribute(t,i),O1.normalize(),t.setXYZ(i,O1.x,O1.y,O1.z)}toNonIndexed(){function t(l,d){let c=l.array,h=l.itemSize,u=l.normalized,m=new c.constructor(d.length*h),f=0,v=0;for(let _=0,g=d.length;_<g;_++){l.isInterleavedBufferAttribute?f=d[_]*l.data.stride+l.offset:f=d[_]*h;for(let p=0;p<h;p++)m[v++]=c[f++]}return new W1(m,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let i=new N4,r=this.index.array,n=this.attributes;for(let l in n){let d=n[l],c=t(d,r);i.setAttribute(l,c)}let o=this.morphAttributes;for(let l in o){let d=[],c=o[l];for(let h=0,u=c.length;h<u;h++){let m=c[h],f=t(m,r);d.push(f)}i.morphAttributes[l]=d}i.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let l=0,d=s.length;l<d;l++){let c=s[l];i.addGroup(c.start,c.count,c.materialIndex)}return i}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let d=this.parameters;for(let c in d)d[c]!==void 0&&(t[c]=d[c]);return t}t.data={attributes:{}};let i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});let r=this.attributes;for(let d in r){let c=r[d];t.data.attributes[d]=c.toJSON(t.data)}let n={},o=!1;for(let d in this.morphAttributes){let c=this.morphAttributes[d],h=[];for(let u=0,m=c.length;u<m;u++){let f=c[u];h.push(f.toJSON(t.data))}h.length>0&&(n[d]=h,o=!0)}o&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));let l=this.boundingSphere;return l!==null&&(t.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let i={};this.name=t.name;let r=t.index;r!==null&&this.setIndex(r.clone(i));let n=t.attributes;for(let c in n){let h=n[c];this.setAttribute(c,h.clone(i))}let o=t.morphAttributes;for(let c in o){let h=[],u=o[c];for(let m=0,f=u.length;m<f;m++)h.push(u[m].clone(i));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let s=t.groups;for(let c=0,h=s.length;c<h;c++){let u=s[c];this.addGroup(u.start,u.count,u.materialIndex)}let l=t.boundingBox;l!==null&&(this.boundingBox=l.clone());let d=t.boundingSphere;return d!==null&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},vs=new Fe,B2=new kr,Ba=new Dt,xs=new I,bi=new I,Ci=new I,Ti=new I,hn=new I,Fa=new I,Ha=new ye,Ga=new ye,Wa=new ye,ys=new I,Ss=new I,Ms=new I,ja=new I,Xa=new I,v1=class extends I1{constructor(e=new Ut,t=new lt){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){let i=this.geometry,r=i.attributes.position,n=i.morphAttributes.position,o=i.morphTargetsRelative;t.fromBufferAttribute(r,e);let s=this.morphTargetInfluences;if(n&&s){Fa.set(0,0,0);for(let l=0,d=n.length;l<d;l++){let c=s[l],h=n[l];c!==0&&(hn.fromBufferAttribute(h,e),o?Fa.addScaledVector(hn,c):Fa.addScaledVector(hn.sub(t),c))}t.add(Fa)}return t}raycast(e,t){let i=this.geometry,r=this.material,n=this.matrixWorld;r!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),Ba.copy(i.boundingSphere),Ba.applyMatrix4(n),B2.copy(e.ray).recast(e.near),!(Ba.containsPoint(B2.origin)===!1&&(B2.intersectSphere(Ba,xs)===null||B2.origin.distanceToSquared(xs)>(e.far-e.near)**2))&&(vs.copy(n).invert(),B2.copy(e.ray).applyMatrix4(vs),!(i.boundingBox!==null&&B2.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,t,B2)))}_computeIntersections(e,t,i){let r,n=this.geometry,o=this.material,s=n.index,l=n.attributes.position,d=n.attributes.uv,c=n.attributes.uv1,h=n.attributes.normal,u=n.groups,m=n.drawRange;if(s!==null)if(Array.isArray(o))for(let f=0,v=u.length;f<v;f++){let _=u[f],g=o[_.materialIndex],p=Math.max(_.start,m.start),y=Math.min(s.count,Math.min(_.start+_.count,m.start+m.count));for(let x=p,b=y;x<b;x+=3){let N=s.getX(x),A=s.getX(x+1),C=s.getX(x+2);r=Ya(this,g,e,i,d,c,h,N,A,C),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{let f=Math.max(0,m.start),v=Math.min(s.count,m.start+m.count);for(let _=f,g=v;_<g;_+=3){let p=s.getX(_),y=s.getX(_+1),x=s.getX(_+2);r=Ya(this,o,e,i,d,c,h,p,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(o))for(let f=0,v=u.length;f<v;f++){let _=u[f],g=o[_.materialIndex],p=Math.max(_.start,m.start),y=Math.min(l.count,Math.min(_.start+_.count,m.start+m.count));for(let x=p,b=y;x<b;x+=3){let N=x,A=x+1,C=x+2;r=Ya(this,g,e,i,d,c,h,N,A,C),r&&(r.faceIndex=Math.floor(x/3),r.face.materialIndex=_.materialIndex,t.push(r))}}else{let f=Math.max(0,m.start),v=Math.min(l.count,m.start+m.count);for(let _=f,g=v;_<g;_+=3){let p=_,y=_+1,x=_+2;r=Ya(this,o,e,i,d,c,h,p,y,x),r&&(r.faceIndex=Math.floor(_/3),t.push(r))}}}};function $h(e,t,i,r,n,o,s,l){let d;if(t.side===et?d=r.intersectTriangle(s,o,n,!0,l):d=r.intersectTriangle(n,o,s,t.side===Nt,l),d===null)return null;Xa.copy(l),Xa.applyMatrix4(e.matrixWorld);let c=i.ray.origin.distanceTo(Xa);return c<i.near||c>i.far?null:{distance:c,point:Xa.clone(),object:e}}function Ya(e,t,i,r,n,o,s,l,d,c){e.getVertexPosition(l,bi),e.getVertexPosition(d,Ci),e.getVertexPosition(c,Ti);let h=$h(e,t,i,r,bi,Ci,Ti,ja);if(h){n&&(Ha.fromBufferAttribute(n,l),Ga.fromBufferAttribute(n,d),Wa.fromBufferAttribute(n,c),h.uv=Oa.getInterpolation(ja,bi,Ci,Ti,Ha,Ga,Wa,new ye)),o&&(Ha.fromBufferAttribute(o,l),Ga.fromBufferAttribute(o,d),Wa.fromBufferAttribute(o,c),h.uv1=Oa.getInterpolation(ja,bi,Ci,Ti,Ha,Ga,Wa,new ye)),s&&(ys.fromBufferAttribute(s,l),Ss.fromBufferAttribute(s,d),Ms.fromBufferAttribute(s,c),h.normal=Oa.getInterpolation(ja,bi,Ci,Ti,ys,Ss,Ms,new I),h.normal.dot(r.direction)>0&&h.normal.multiplyScalar(-1));let u={a:l,b:d,c,normal:new I,materialIndex:0};Oa.getNormal(bi,Ci,Ti,u.normal),h.face=u}return h}var un=class L4 extends Ut{constructor(t=1,i=1,r=1,n=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:r,widthSegments:n,heightSegments:o,depthSegments:s};let l=this;n=Math.floor(n),o=Math.floor(o),s=Math.floor(s);let d=[],c=[],h=[],u=[],m=0,f=0;v("z","y","x",-1,-1,r,i,t,s,o,0),v("z","y","x",1,-1,r,i,-t,s,o,1),v("x","z","y",1,1,t,r,i,n,s,2),v("x","z","y",1,-1,t,r,-i,n,s,3),v("x","y","z",1,-1,t,i,r,n,o,4),v("x","y","z",-1,-1,t,i,-r,n,o,5),this.setIndex(d),this.setAttribute("position",new it(c,3)),this.setAttribute("normal",new it(h,3)),this.setAttribute("uv",new it(u,2));function v(_,g,p,y,x,b,N,A,C,U,S){let M=b/C,k=N/U,R=b/2,D=N/2,B=A/2,Z=C+1,j=U+1,Q=0,V=0,J=new I;for(let Y=0;Y<j;Y++){let he=Y*k-D;for(let ne=0;ne<Z;ne++){let q=ne*M-R;J[_]=q*y,J[g]=he*x,J[p]=B,c.push(J.x,J.y,J.z),J[_]=0,J[g]=0,J[p]=A>0?1:-1,h.push(J.x,J.y,J.z),u.push(ne/C),u.push(1-Y/U),Q+=1}}for(let Y=0;Y<U;Y++)for(let he=0;he<C;he++){let ne=m+he+Z*Y,q=m+he+Z*(Y+1),K=m+(he+1)+Z*(Y+1),le=m+(he+1)+Z*Y;d.push(ne,q,le),d.push(q,K,le),V+=6}l.addGroup(f,V,S),f+=V,m+=Q}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new L4(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Ii(e){let t={};for(let i in e){t[i]={};for(let r in e[i]){let n=e[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture||n.isQuaternion)?n.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][r]=null):t[i][r]=n.clone():Array.isArray(n)?t[i][r]=n.slice():t[i][r]=n}}return t}function Q1(e){let t={};for(let i=0;i<e.length;i++){let r=Ii(e[i]);for(let n in r)t[n]=r[n]}return t}function eu(e){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}function ws(e){let t=e.getRenderTarget();return t===null?e.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:n1.workingColorSpace}var qa={clone:Ii,merge:Q1},tu=`void main() {
2
2
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3
3
  }`,iu=`void main() {
4
4
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
5
- }`,x1=class extends mt{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=tu,this.fragmentShader=iu,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Pi(e.uniforms),this.uniformsGroups=eu(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let r in this.uniforms){let n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},As=class extends N1{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fe,this.projectionMatrix=new Fe,this.projectionMatrixInverse=new Fe,this.coordinateSystem=Zt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}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)}},y2=new I,Es=new ye,bs=new ye,Y1=class extends As{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,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){let t=.5*this.getFilmHeight()/e;this.fov=fi*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Lr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return fi*2*Math.atan(Math.tan(Lr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){y2.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(y2.x,y2.y).multiplyScalar(-e/y2.z),y2.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(y2.x,y2.y).multiplyScalar(-e/y2.z)}getViewSize(e,t){return this.getViewBounds(e,Es,bs),t.subVectors(bs,Es)}setViewOffset(e,t,i,r,n,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=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Lr*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,n=-.5*r,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,d=o.fullHeight;n+=o.offsetX*r/l,t-=o.offsetY*i/d,r*=o.width/l,i*=o.height/d}let s=this.filmOffset;s!==0&&(n+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Ni=-90,Li=1,ru=class extends N1{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new Y1(Ni,Li,e,t);r.layers=this.layers,this.add(r);let n=new Y1(Ni,Li,e,t);n.layers=this.layers,this.add(n);let o=new Y1(Ni,Li,e,t);o.layers=this.layers,this.add(o);let s=new Y1(Ni,Li,e,t);s.layers=this.layers,this.add(s);let l=new Y1(Ni,Li,e,t);l.layers=this.layers,this.add(l);let d=new Y1(Ni,Li,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,r,n,o,s,l]=t;for(let d of t)this.remove(d);if(e===Zt)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ta)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let d of t)this.add(d),d.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[n,o,s,l,d,c]=this.children,h=e.getRenderTarget(),u=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,n),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,s),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,d),i.texture.generateMipmaps=v,e.setRenderTarget(i,5,r),e.render(t,c),e.setRenderTarget(h,u,m),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}},Cs=class extends it{constructor(e,t,i,r,n,o,s,l,d,c){e=e!==void 0?e:[],t=t!==void 0?t:si,super(e,t,i,r,n,o,s,l,d,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},au=class extends S1{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Cs(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:m1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
5
+ }`,x1=class extends mt{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=tu,this.fragmentShader=iu,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ii(e.uniforms),this.uniformsGroups=eu(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){let t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(let r in this.uniforms){let n=this.uniforms[r].value;n&&n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[r]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let i={};for(let r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}},As=class extends I1{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Fe,this.projectionMatrix=new Fe,this.projectionMatrixInverse=new Fe,this.coordinateSystem=Zt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}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)}},x2=new I,Es=new ye,bs=new ye,j1=class extends As{constructor(e=50,t=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,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){let t=.5*this.getFilmHeight()/e;this.fov=mi*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){let e=Math.tan(Nr*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return mi*2*Math.atan(Math.tan(Nr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){x2.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(x2.x,x2.y).multiplyScalar(-e/x2.z),x2.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(x2.x,x2.y).multiplyScalar(-e/x2.z)}getViewSize(e,t){return this.getViewBounds(e,Es,bs),t.subVectors(bs,Es)}setViewOffset(e,t,i,r,n,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=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=this.near,t=e*Math.tan(Nr*.5*this.fov)/this.zoom,i=2*t,r=this.aspect*i,n=-.5*r,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,d=o.fullHeight;n+=o.offsetX*r/l,t-=o.offsetY*i/d,r*=o.width/l,i*=o.height/d}let s=this.filmOffset;s!==0&&(n+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(n,n+r,t,t-i,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}},Pi=-90,Ni=1,ru=class extends I1{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new j1(Pi,Ni,e,t);r.layers=this.layers,this.add(r);let n=new j1(Pi,Ni,e,t);n.layers=this.layers,this.add(n);let o=new j1(Pi,Ni,e,t);o.layers=this.layers,this.add(o);let s=new j1(Pi,Ni,e,t);s.layers=this.layers,this.add(s);let l=new j1(Pi,Ni,e,t);l.layers=this.layers,this.add(l);let d=new j1(Pi,Ni,e,t);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[i,r,n,o,s,l]=t;for(let d of t)this.remove(d);if(e===Zt)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),n.up.set(0,0,-1),n.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ta)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),n.up.set(0,0,1),n.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(let d of t)this.add(d),d.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:i,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[n,o,s,l,d,c]=this.children,h=e.getRenderTarget(),u=e.getActiveCubeFace(),m=e.getActiveMipmapLevel(),f=e.xr.enabled;e.xr.enabled=!1;let v=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,r),e.render(t,n),e.setRenderTarget(i,1,r),e.render(t,o),e.setRenderTarget(i,2,r),e.render(t,s),e.setRenderTarget(i,3,r),e.render(t,l),e.setRenderTarget(i,4,r),e.render(t,d),i.texture.generateMipmaps=v,e.setRenderTarget(i,5,r),e.render(t,c),e.setRenderTarget(h,u,m),e.xr.enabled=f,i.texture.needsPMREMUpdate=!0}},Cs=class extends tt{constructor(e,t,i,r,n,o,s,l,d,c){e=e!==void 0?e:[],t=t!==void 0?t:oi,super(e,t,i,r,n,o,s,l,d,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},au=class extends S1{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let i={width:e,height:e,depth:1},r=[i,i,i,i,i,i];this.texture=new Cs(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:m1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let i={uniforms:{tEquirect:{value:null}},vertexShader:`
6
6
 
7
7
  varying vec3 vWorldDirection;
8
8
 
@@ -37,7 +37,7 @@
37
37
  gl_FragColor = texture2D( tEquirect, sampleUV );
38
38
 
39
39
  }
40
- `},r=new un(5,5,5),n=new x1({name:"CubemapFromEquirect",uniforms:Pi(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:tt,blending:Yt});n.uniforms.tEquirect.value=t;let o=new v1(r,n),s=t.minFilter;return t.minFilter===qt&&(t.minFilter=m1),new ru(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){let n=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(n)}},mn=new I,nu=new I,ou=new je,S2=class{constructor(e=new I(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,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){let r=mn.subVectors(i,t).cross(nu.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(mn),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let n=-(e.start.dot(this.normal)+this.constant)/r;return n<0||n>1?null:t.copy(e.start).addScaledVector(i,n)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||ou.getNormalMatrix(e),r=this.coplanarPoint(mn).applyMatrix4(e),n=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(n),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)}},F2=new Dt,Za=new I,fn=class{constructor(e=new S2,t=new S2,i=new S2,r=new S2,n=new S2,o=new S2){this.planes=[e,t,i,r,n,o]}set(e,t,i,r,n,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(r),s[4].copy(n),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Zt){let i=this.planes,r=e.elements,n=r[0],o=r[1],s=r[2],l=r[3],d=r[4],c=r[5],h=r[6],u=r[7],m=r[8],f=r[9],v=r[10],_=r[11],g=r[12],p=r[13],y=r[14],x=r[15];if(i[0].setComponents(l-n,u-d,_-m,x-g).normalize(),i[1].setComponents(l+n,u+d,_+m,x+g).normalize(),i[2].setComponents(l+o,u+c,_+f,x+p).normalize(),i[3].setComponents(l-o,u-c,_-f,x-p).normalize(),i[4].setComponents(l-s,u-h,_-v,x-y).normalize(),t===Zt)i[5].setComponents(l+s,u+h,_+v,x+y).normalize();else if(t===Ta)i[5].setComponents(s,h,v,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),F2.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),F2.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(F2)}intersectsSprite(e){return F2.center.set(0,0,0),F2.radius=.7071067811865476,F2.applyMatrix4(e.matrixWorld),this.intersectsSphere(F2)}intersectsSphere(e){let t=this.planes,i=e.center,r=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let r=t[i];if(Za.x=r.normal.x>0?e.max.x:e.min.x,Za.y=r.normal.y>0?e.max.y:e.min.y,Za.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Za)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Ts(){let e=null,t=!1,i=null,r=null;function n(o,s){i(o,s),r=e.requestAnimationFrame(n)}return{start:function(){t!==!0&&i!==null&&(r=e.requestAnimationFrame(n),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(o){i=o},setContext:function(o){e=o}}}function su(e){let t=new WeakMap;function i(l,d){let c=l.array,h=l.usage,u=c.byteLength,m=e.createBuffer();e.bindBuffer(d,m),e.bufferData(d,c,h),l.onUploadCallback();let f;if(c instanceof Float32Array)f=e.FLOAT;else if(c instanceof Uint16Array)l.isFloat16BufferAttribute?f=e.HALF_FLOAT:f=e.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=e.SHORT;else if(c instanceof Uint32Array)f=e.UNSIGNED_INT;else if(c instanceof Int32Array)f=e.INT;else if(c instanceof Int8Array)f=e.BYTE;else if(c instanceof Uint8Array)f=e.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=e.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:m,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:l.version,size:u}}function r(l,d,c){let h=d.array,u=d._updateRange,m=d.updateRanges;if(e.bindBuffer(c,l),u.count===-1&&m.length===0&&e.bufferSubData(c,0,h),m.length!==0){for(let f=0,v=m.length;f<v;f++){let _=m[f];e.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}d.clearUpdateRanges()}u.count!==-1&&(e.bufferSubData(c,u.offset*h.BYTES_PER_ELEMENT,h,u.offset,u.count),u.count=-1),d.onUploadCallback()}function n(l){return l.isInterleavedBufferAttribute&&(l=l.data),t.get(l)}function o(l){l.isInterleavedBufferAttribute&&(l=l.data);let d=t.get(l);d&&(e.deleteBuffer(d.buffer),t.delete(l))}function s(l,d){if(l.isGLBufferAttribute){let h=t.get(l);(!h||h.version<l.version)&&t.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);let c=t.get(l);if(c===void 0)t.set(l,i(l,d));else if(c.version<l.version){if(c.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(c.buffer,l,d),c.version=l.version}}return{get:n,remove:o,update:s}}var kt=class R4 extends Ut{constructor(t=1,i=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:r,heightSegments:n};let o=t/2,s=i/2,l=Math.floor(r),d=Math.floor(n),c=l+1,h=d+1,u=t/l,m=i/d,f=[],v=[],_=[],g=[];for(let p=0;p<h;p++){let y=p*m-s;for(let x=0;x<c;x++){let b=x*u-o;v.push(b,-y,0),_.push(0,0,1),g.push(x/l),g.push(1-p/d)}}for(let p=0;p<d;p++)for(let y=0;y<l;y++){let x=y+c*p,b=y+c*(p+1),N=y+1+c*(p+1),A=y+1+c*p;f.push(x,b,A),f.push(b,N,A)}this.setIndex(f),this.setAttribute("position",new rt(v,3)),this.setAttribute("normal",new rt(_,3)),this.setAttribute("uv",new rt(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new R4(t.width,t.height,t.widthSegments,t.heightSegments)}},lu=`#ifdef USE_ALPHAHASH
40
+ `},r=new un(5,5,5),n=new x1({name:"CubemapFromEquirect",uniforms:Ii(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:et,blending:Yt});n.uniforms.tEquirect.value=t;let o=new v1(r,n),s=t.minFilter;return t.minFilter===qt&&(t.minFilter=m1),new ru(1,10,this).update(e,o),t.minFilter=s,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,i,r){let n=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,i,r);e.setRenderTarget(n)}},mn=new I,nu=new I,ou=new je,y2=class{constructor(e=new I(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,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){let r=mn.subVectors(i,t).cross(nu.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){let e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){let i=e.delta(mn),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;let n=-(e.start.dot(this.normal)+this.constant)/r;return n<0||n>1?null:t.copy(e.start).addScaledVector(i,n)}intersectsLine(e){let t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){let i=t||ou.getNormalMatrix(e),r=this.coplanarPoint(mn).applyMatrix4(e),n=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(n),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)}},F2=new Dt,Za=new I,fn=class{constructor(e=new y2,t=new y2,i=new y2,r=new y2,n=new y2,o=new y2){this.planes=[e,t,i,r,n,o]}set(e,t,i,r,n,o){let s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(r),s[4].copy(n),s[5].copy(o),this}copy(e){let t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=Zt){let i=this.planes,r=e.elements,n=r[0],o=r[1],s=r[2],l=r[3],d=r[4],c=r[5],h=r[6],u=r[7],m=r[8],f=r[9],v=r[10],_=r[11],g=r[12],p=r[13],y=r[14],x=r[15];if(i[0].setComponents(l-n,u-d,_-m,x-g).normalize(),i[1].setComponents(l+n,u+d,_+m,x+g).normalize(),i[2].setComponents(l+o,u+c,_+f,x+p).normalize(),i[3].setComponents(l-o,u-c,_-f,x-p).normalize(),i[4].setComponents(l-s,u-h,_-v,x-y).normalize(),t===Zt)i[5].setComponents(l+s,u+h,_+v,x+y).normalize();else if(t===Ta)i[5].setComponents(s,h,v,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),F2.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),F2.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(F2)}intersectsSprite(e){return F2.center.set(0,0,0),F2.radius=.7071067811865476,F2.applyMatrix4(e.matrixWorld),this.intersectsSphere(F2)}intersectsSphere(e){let t=this.planes,i=e.center,r=-e.radius;for(let n=0;n<6;n++)if(t[n].distanceToPoint(i)<r)return!1;return!0}intersectsBox(e){let t=this.planes;for(let i=0;i<6;i++){let r=t[i];if(Za.x=r.normal.x>0?e.max.x:e.min.x,Za.y=r.normal.y>0?e.max.y:e.min.y,Za.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Za)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function Ts(){let e=null,t=!1,i=null,r=null;function n(o,s){i(o,s),r=e.requestAnimationFrame(n)}return{start:function(){t!==!0&&i!==null&&(r=e.requestAnimationFrame(n),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(o){i=o},setContext:function(o){e=o}}}function su(e){let t=new WeakMap;function i(l,d){let c=l.array,h=l.usage,u=c.byteLength,m=e.createBuffer();e.bindBuffer(d,m),e.bufferData(d,c,h),l.onUploadCallback();let f;if(c instanceof Float32Array)f=e.FLOAT;else if(c instanceof Uint16Array)l.isFloat16BufferAttribute?f=e.HALF_FLOAT:f=e.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=e.SHORT;else if(c instanceof Uint32Array)f=e.UNSIGNED_INT;else if(c instanceof Int32Array)f=e.INT;else if(c instanceof Int8Array)f=e.BYTE;else if(c instanceof Uint8Array)f=e.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=e.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:m,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:l.version,size:u}}function r(l,d,c){let h=d.array,u=d._updateRange,m=d.updateRanges;if(e.bindBuffer(c,l),u.count===-1&&m.length===0&&e.bufferSubData(c,0,h),m.length!==0){for(let f=0,v=m.length;f<v;f++){let _=m[f];e.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}d.clearUpdateRanges()}u.count!==-1&&(e.bufferSubData(c,u.offset*h.BYTES_PER_ELEMENT,h,u.offset,u.count),u.count=-1),d.onUploadCallback()}function n(l){return l.isInterleavedBufferAttribute&&(l=l.data),t.get(l)}function o(l){l.isInterleavedBufferAttribute&&(l=l.data);let d=t.get(l);d&&(e.deleteBuffer(d.buffer),t.delete(l))}function s(l,d){if(l.isGLBufferAttribute){let h=t.get(l);(!h||h.version<l.version)&&t.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);let c=t.get(l);if(c===void 0)t.set(l,i(l,d));else if(c.version<l.version){if(c.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");r(c.buffer,l,d),c.version=l.version}}return{get:n,remove:o,update:s}}var kt=class R4 extends Ut{constructor(t=1,i=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:r,heightSegments:n};let o=t/2,s=i/2,l=Math.floor(r),d=Math.floor(n),c=l+1,h=d+1,u=t/l,m=i/d,f=[],v=[],_=[],g=[];for(let p=0;p<h;p++){let y=p*m-s;for(let x=0;x<c;x++){let b=x*u-o;v.push(b,-y,0),_.push(0,0,1),g.push(x/l),g.push(1-p/d)}}for(let p=0;p<d;p++)for(let y=0;y<l;y++){let x=y+c*p,b=y+c*(p+1),N=y+1+c*(p+1),A=y+1+c*p;f.push(x,b,A),f.push(b,N,A)}this.setIndex(f),this.setAttribute("position",new it(v,3)),this.setAttribute("normal",new it(_,3)),this.setAttribute("uv",new it(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new R4(t.width,t.height,t.widthSegments,t.heightSegments)}},lu=`#ifdef USE_ALPHAHASH
41
41
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
42
42
  #endif`,cu=`#ifdef USE_ALPHAHASH
43
43
  const float ALPHA_HASH_SCALE = 0.05;
@@ -3539,7 +3539,7 @@ void main() {
3539
3539
  #include <tonemapping_fragment>
3540
3540
  #include <colorspace_fragment>
3541
3541
  #include <fog_fragment>
3542
- }`,We={alphahash_fragment:lu,alphahash_pars_fragment:cu,alphamap_fragment:du,alphamap_pars_fragment:hu,alphatest_fragment:uu,alphatest_pars_fragment:mu,aomap_fragment:fu,aomap_pars_fragment:pu,batching_pars_vertex:gu,batching_vertex:_u,begin_vertex:vu,beginnormal_vertex:xu,bsdfs:yu,iridescence_fragment:Su,bumpmap_pars_fragment:Mu,clipping_planes_fragment:wu,clipping_planes_pars_fragment:Au,clipping_planes_pars_vertex:Eu,clipping_planes_vertex:bu,color_fragment:Cu,color_pars_fragment:Tu,color_pars_vertex:Iu,color_vertex:Pu,common:Nu,cube_uv_reflection_fragment:Lu,defaultnormal_vertex:Ru,displacementmap_pars_vertex:Du,displacementmap_vertex:Uu,emissivemap_fragment:ku,emissivemap_pars_fragment:Ou,colorspace_fragment:zu,colorspace_pars_fragment:Vu,envmap_fragment:Bu,envmap_common_pars_fragment:Fu,envmap_pars_fragment:Hu,envmap_pars_vertex:Gu,envmap_physical_pars_fragment:tm,envmap_vertex:Wu,fog_vertex:ju,fog_pars_vertex:Xu,fog_fragment:Yu,fog_pars_fragment:qu,gradientmap_pars_fragment:Zu,lightmap_fragment:Qu,lightmap_pars_fragment:Ju,lights_lambert_fragment:Ku,lights_lambert_pars_fragment:$u,lights_pars_begin:em,lights_toon_fragment:im,lights_toon_pars_fragment:rm,lights_phong_fragment:am,lights_phong_pars_fragment:nm,lights_physical_fragment:om,lights_physical_pars_fragment:sm,lights_fragment_begin:lm,lights_fragment_maps:cm,lights_fragment_end:dm,logdepthbuf_fragment:hm,logdepthbuf_pars_fragment:um,logdepthbuf_pars_vertex:mm,logdepthbuf_vertex:fm,map_fragment:pm,map_pars_fragment:gm,map_particle_fragment:_m,map_particle_pars_fragment:vm,metalnessmap_fragment:xm,metalnessmap_pars_fragment:ym,morphinstance_vertex:Sm,morphcolor_vertex:Mm,morphnormal_vertex:wm,morphtarget_pars_vertex:Am,morphtarget_vertex:Em,normal_fragment_begin:bm,normal_fragment_maps:Cm,normal_pars_fragment:Tm,normal_pars_vertex:Im,normal_vertex:Pm,normalmap_pars_fragment:Nm,clearcoat_normal_fragment_begin:Lm,clearcoat_normal_fragment_maps:Rm,clearcoat_pars_fragment:Dm,iridescence_pars_fragment:Um,opaque_fragment:km,packing:Om,premultiplied_alpha_fragment:zm,project_vertex:Vm,dithering_fragment:Bm,dithering_pars_fragment:Fm,roughnessmap_fragment:Hm,roughnessmap_pars_fragment:Gm,shadowmap_pars_fragment:Wm,shadowmap_pars_vertex:jm,shadowmap_vertex:Xm,shadowmask_pars_fragment:Ym,skinbase_vertex:qm,skinning_pars_vertex:Zm,skinning_vertex:Qm,skinnormal_vertex:Jm,specularmap_fragment:Km,specularmap_pars_fragment:$m,tonemapping_fragment:ef,tonemapping_pars_fragment:tf,transmission_fragment:rf,transmission_pars_fragment:af,uv_pars_fragment:nf,uv_pars_vertex:of,uv_vertex:sf,worldpos_vertex:lf,background_vert:cf,background_frag:df,backgroundCube_vert:hf,backgroundCube_frag:uf,cube_vert:mf,cube_frag:ff,depth_vert:pf,depth_frag:gf,distanceRGBA_vert:_f,distanceRGBA_frag:vf,equirect_vert:xf,equirect_frag:yf,linedashed_vert:Sf,linedashed_frag:Mf,meshbasic_vert:wf,meshbasic_frag:Af,meshlambert_vert:Ef,meshlambert_frag:bf,meshmatcap_vert:Cf,meshmatcap_frag:Tf,meshnormal_vert:If,meshnormal_frag:Pf,meshphong_vert:Nf,meshphong_frag:Lf,meshphysical_vert:Rf,meshphysical_frag:Df,meshtoon_vert:Uf,meshtoon_frag:kf,points_vert:Of,points_frag:zf,shadow_vert:Vf,shadow_frag:Bf,sprite_vert:Ff,sprite_frag:Hf},_e={common:{diffuse:{value:new Ue(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new je}},envmap:{envMap:{value:null},envMapRotation:{value:new je},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new je},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ue(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ue(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0},uvTransform:{value:new je}},sprite:{diffuse:{value:new Ue(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}}},Ot={basic:{uniforms:K1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.fog]),vertexShader:We.meshbasic_vert,fragmentShader:We.meshbasic_frag},lambert:{uniforms:K1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)}}]),vertexShader:We.meshlambert_vert,fragmentShader:We.meshlambert_frag},phong:{uniforms:K1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)},specular:{value:new Ue(1118481)},shininess:{value:30}}]),vertexShader:We.meshphong_vert,fragmentShader:We.meshphong_frag},standard:{uniforms:K1([_e.common,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.roughnessmap,_e.metalnessmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag},toon:{uniforms:K1([_e.common,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.gradientmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)}}]),vertexShader:We.meshtoon_vert,fragmentShader:We.meshtoon_frag},matcap:{uniforms:K1([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,{matcap:{value:null}}]),vertexShader:We.meshmatcap_vert,fragmentShader:We.meshmatcap_frag},points:{uniforms:K1([_e.points,_e.fog]),vertexShader:We.points_vert,fragmentShader:We.points_frag},dashed:{uniforms:K1([_e.common,_e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:We.linedashed_vert,fragmentShader:We.linedashed_frag},depth:{uniforms:K1([_e.common,_e.displacementmap]),vertexShader:We.depth_vert,fragmentShader:We.depth_frag},normal:{uniforms:K1([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,{opacity:{value:1}}]),vertexShader:We.meshnormal_vert,fragmentShader:We.meshnormal_frag},sprite:{uniforms:K1([_e.sprite,_e.fog]),vertexShader:We.sprite_vert,fragmentShader:We.sprite_frag},background:{uniforms:{uvTransform:{value:new je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:We.background_vert,fragmentShader:We.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new je}},vertexShader:We.backgroundCube_vert,fragmentShader:We.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:We.cube_vert,fragmentShader:We.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:We.equirect_vert,fragmentShader:We.equirect_frag},distanceRGBA:{uniforms:K1([_e.common,_e.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:We.distanceRGBA_vert,fragmentShader:We.distanceRGBA_frag},shadow:{uniforms:K1([_e.lights,_e.fog,{color:{value:new Ue(0)},opacity:{value:1}}]),vertexShader:We.shadow_vert,fragmentShader:We.shadow_frag}};Ot.physical={uniforms:K1([Ot.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new je},clearcoatNormalScale:{value:new ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new je},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new je},sheen:{value:0},sheenColor:{value:new Ue(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new je},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new je},attenuationDistance:{value:0},attenuationColor:{value:new Ue(0)},specularColor:{value:new Ue(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new je},anisotropyVector:{value:new ye},anisotropyMap:{value:null},anisotropyMapTransform:{value:new je}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag};var Qa={r:0,b:0,g:0},H2=new O1,Gf=new Fe;function Wf(e,t,i,r,n,o,s){let l=new Ue(0),d=o===!0?0:1,c,h,u=null,m=0,f=null;function v(g,p){let y=!1,x=p.isScene===!0?p.background:null;x&&x.isTexture&&(x=(p.backgroundBlurriness>0?i:t).get(x)),x===null?_(l,d):x&&x.isColor&&(_(x,1),y=!0);let b=e.xr.getEnvironmentBlendMode();b==="additive"?r.buffers.color.setClear(0,0,0,1,s):b==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(e.autoClear||y)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Sa)?(h===void 0&&(h=new v1(new un(1,1,1),new x1({name:"BackgroundCubeMaterial",uniforms:Pi(Ot.backgroundCube.uniforms),vertexShader:Ot.backgroundCube.vertexShader,fragmentShader:Ot.backgroundCube.fragmentShader,side:tt,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(N,A,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(h)),H2.copy(p.backgroundRotation),H2.x*=-1,H2.y*=-1,H2.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(H2.y*=-1,H2.z*=-1),h.material.uniforms.envMap.value=x,h.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Gf.makeRotationFromEuler(H2)),h.material.toneMapped=n1.getTransfer(x.colorSpace)!==g1,(u!==x||m!==x.version||f!==e.toneMapping)&&(h.material.needsUpdate=!0,u=x,m=x.version,f=e.toneMapping),h.layers.enableAll(),g.unshift(h,h.geometry,h.material,0,0,null)):x&&x.isTexture&&(c===void 0&&(c=new v1(new kt(2,2),new x1({name:"BackgroundMaterial",uniforms:Pi(Ot.background.uniforms),vertexShader:Ot.background.vertexShader,fragmentShader:Ot.background.fragmentShader,side:Nt,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(c)),c.material.uniforms.t2D.value=x,c.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,c.material.toneMapped=n1.getTransfer(x.colorSpace)!==g1,x.matrixAutoUpdate===!0&&x.updateMatrix(),c.material.uniforms.uvTransform.value.copy(x.matrix),(u!==x||m!==x.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=x,m=x.version,f=e.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null))}function _(g,p){g.getRGB(Qa,ws(e)),r.buffers.color.setClear(Qa.r,Qa.g,Qa.b,p,s)}return{getClearColor:function(){return l},setClearColor:function(g,p=1){l.set(g),d=p,_(l,d)},getClearAlpha:function(){return d},setClearAlpha:function(g){d=g,_(l,d)},render:v}}function jf(e,t){let i=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},n=m(null),o=n,s=!1;function l(M,k,R,D,V){let q=!1,W=u(D,R,k);o!==W&&(o=W,c(o.object)),q=f(M,D,R,V),q&&v(M,D,R,V),V!==null&&t.update(V,e.ELEMENT_ARRAY_BUFFER),(q||s)&&(s=!1,b(M,k,R,D),V!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function d(){return e.createVertexArray()}function c(M){return e.bindVertexArray(M)}function h(M){return e.deleteVertexArray(M)}function u(M,k,R){let D=R.wireframe===!0,V=r[M.id];V===void 0&&(V={},r[M.id]=V);let q=V[k.id];q===void 0&&(q={},V[k.id]=q);let W=q[D];return W===void 0&&(W=m(d()),q[D]=W),W}function m(M){let k=[],R=[],D=[];for(let V=0;V<i;V++)k[V]=0,R[V]=0,D[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:R,attributeDivisors:D,object:M,attributes:{},index:null}}function f(M,k,R,D){let V=o.attributes,q=k.attributes,W=0,Q=R.getAttributes();for(let z in Q)if(Q[z].location>=0){let J=V[z],j=q[z];if(j===void 0&&(z==="instanceMatrix"&&M.instanceMatrix&&(j=M.instanceMatrix),z==="instanceColor"&&M.instanceColor&&(j=M.instanceColor)),J===void 0||J.attribute!==j||j&&J.data!==j.data)return!0;W++}return o.attributesNum!==W||o.index!==D}function v(M,k,R,D){let V={},q=k.attributes,W=0,Q=R.getAttributes();for(let z in Q)if(Q[z].location>=0){let J=q[z];J===void 0&&(z==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),z==="instanceColor"&&M.instanceColor&&(J=M.instanceColor));let j={};j.attribute=J,J&&J.data&&(j.data=J.data),V[z]=j,W++}o.attributes=V,o.attributesNum=W,o.index=D}function _(){let M=o.newAttributes;for(let k=0,R=M.length;k<R;k++)M[k]=0}function g(M){p(M,0)}function p(M,k){let R=o.newAttributes,D=o.enabledAttributes,V=o.attributeDivisors;R[M]=1,D[M]===0&&(e.enableVertexAttribArray(M),D[M]=1),V[M]!==k&&(e.vertexAttribDivisor(M,k),V[M]=k)}function y(){let M=o.newAttributes,k=o.enabledAttributes;for(let R=0,D=k.length;R<D;R++)k[R]!==M[R]&&(e.disableVertexAttribArray(R),k[R]=0)}function x(M,k,R,D,V,q,W){W===!0?e.vertexAttribIPointer(M,k,R,V,q):e.vertexAttribPointer(M,k,R,D,V,q)}function b(M,k,R,D){_();let V=D.attributes,q=R.getAttributes(),W=k.defaultAttributeValues;for(let Q in q){let z=q[Q];if(z.location>=0){let J=V[Q];if(J===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(J=M.instanceColor)),J!==void 0){let j=J.normalized,de=J.itemSize,oe=t.get(J);if(oe===void 0)continue;let X=oe.buffer,K=oe.type,le=oe.bytesPerElement,ce=K===e.INT||K===e.UNSIGNED_INT||J.gpuType===ho;if(J.isInterleavedBufferAttribute){let ae=J.data,Me=ae.stride,Be=J.offset;if(ae.isInstancedInterleavedBuffer){for(let O=0;O<z.locationSize;O++)p(z.location+O,ae.meshPerAttribute);M.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let O=0;O<z.locationSize;O++)g(z.location+O);e.bindBuffer(e.ARRAY_BUFFER,X);for(let O=0;O<z.locationSize;O++)x(z.location+O,de/z.locationSize,K,j,Me*le,(Be+de/z.locationSize*O)*le,ce)}else{if(J.isInstancedBufferAttribute){for(let ae=0;ae<z.locationSize;ae++)p(z.location+ae,J.meshPerAttribute);M.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let ae=0;ae<z.locationSize;ae++)g(z.location+ae);e.bindBuffer(e.ARRAY_BUFFER,X);for(let ae=0;ae<z.locationSize;ae++)x(z.location+ae,de/z.locationSize,K,j,de*le,de/z.locationSize*ae*le,ce)}}else if(W!==void 0){let j=W[Q];if(j!==void 0)switch(j.length){case 2:e.vertexAttrib2fv(z.location,j);break;case 3:e.vertexAttrib3fv(z.location,j);break;case 4:e.vertexAttrib4fv(z.location,j);break;default:e.vertexAttrib1fv(z.location,j)}}}}y()}function N(){U();for(let M in r){let k=r[M];for(let R in k){let D=k[R];for(let V in D)h(D[V].object),delete D[V];delete k[R]}delete r[M]}}function A(M){if(r[M.id]===void 0)return;let k=r[M.id];for(let R in k){let D=k[R];for(let V in D)h(D[V].object),delete D[V];delete k[R]}delete r[M.id]}function C(M){for(let k in r){let R=r[k];if(R[M.id]===void 0)continue;let D=R[M.id];for(let V in D)h(D[V].object),delete D[V];delete R[M.id]}}function U(){S(),s=!0,o!==n&&(o=n,c(o.object))}function S(){n.geometry=null,n.program=null,n.wireframe=!1}return{setup:l,reset:U,resetDefaultState:S,dispose:N,releaseStatesOfGeometry:A,releaseStatesOfProgram:C,initAttributes:_,enableAttribute:g,disableUnusedAttributes:y}}function Xf(e,t,i){let r;function n(d){r=d}function o(d,c){e.drawArrays(r,d,c),i.update(c,r,1)}function s(d,c,h){h!==0&&(e.drawArraysInstanced(r,d,c,h),i.update(c,r,h))}function l(d,c,h){if(h===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let m=0;m<h;m++)this.render(d[m],c[m]);else{u.multiDrawArraysWEBGL(r,d,0,c,0,h);let m=0;for(let f=0;f<h;f++)m+=c[f];i.update(m,r,1)}}this.setMode=n,this.render=o,this.renderInstances=s,this.renderMultiDraw=l}function Yf(e,t,i){let r;function n(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){let x=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(x){if(x==="highp"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=i.precision!==void 0?i.precision:"highp",l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let d=i.logarithmicDepthBuffer===!0,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),_=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),p=h>0,y=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:n,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:d,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:m,maxAttributes:f,maxVertexUniforms:v,maxVaryings:_,maxFragmentUniforms:g,vertexTextures:p,maxSamples:y}}function qf(e){let t=this,i=null,r=0,n=!1,o=!1,s=new S2,l=new je,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(u,m){let f=u.length!==0||m||r!==0||n;return n=m,r=u.length,f},this.beginShadows=function(){o=!0,h(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(u,m){i=h(u,m,0)},this.setState=function(u,m,f){let v=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=e.get(u);if(!n||v===null||v.length===0||o&&!g)o?h(null):c();else{let y=o?0:r,x=y*4,b=p.clippingState||null;d.value=b,b=h(v,m,x,f);for(let N=0;N!==x;++N)b[N]=i[N];p.clippingState=b,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){d.value!==i&&(d.value=i,d.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function h(u,m,f,v){let _=u!==null?u.length:0,g=null;if(_!==0){if(g=d.value,v!==!0||g===null){let p=f+_*4,y=m.matrixWorldInverse;l.getNormalMatrix(y),(g===null||g.length<p)&&(g=new Float32Array(p));for(let x=0,b=f;x!==_;++x,b+=4)s.copy(u[x]).applyMatrix4(y,l),s.normal.toArray(g,b),g[b+3]=s.constant}d.value=g,d.needsUpdate=!0}return t.numPlanes=_,t.numIntersection=0,g}}function Zf(e){let t=new WeakMap;function i(s,l){return l===D3?s.mapping=si:l===U3&&(s.mapping=li),s}function r(s){if(s&&s.isTexture){let l=s.mapping;if(l===D3||l===U3)if(t.has(s)){let d=t.get(s).texture;return i(d,s.mapping)}else{let d=s.image;if(d&&d.height>0){let c=new au(d.height);return c.fromEquirectangularTexture(e,s),t.set(s,c),s.addEventListener("dispose",n),i(c.texture,s.mapping)}else return null}}return s}function n(s){let l=s.target;l.removeEventListener("dispose",n);let d=t.get(l);d!==void 0&&(t.delete(l),d.dispose())}function o(){t=new WeakMap}return{get:r,dispose:o}}var zt=class extends As{constructor(e=-1,t=1,i=1,r=-1,n=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=n,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,n,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-e,o=i+e,s=r+t,l=r-t;if(this.view!==null&&this.view.enabled){let d=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=d*this.view.offsetX,o=n+d*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(n,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},Ri=4,Is=[.125,.215,.35,.446,.526,.582],G2=20,pn=new zt,Ps=new Ue,gn=null,_n=0,vn=0,xn=!1,W2=(1+Math.sqrt(5))/2,Di=1/W2,Ns=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,W2,Di),new I(0,W2,-Di),new I(Di,0,W2),new I(-Di,0,W2),new I(W2,Di,0),new I(-W2,Di,0)],Ls=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(e,i,r,n),t>0&&this._blur(n,0,0,t),this._applyPMREM(n),this._cleanup(n),n}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Us(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Ds(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(gn,_n,vn),this._renderer.xr.enabled=xn,e.scissorTest=!1,Ja(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===si||e.mapping===li?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:m1,minFilter:m1,generateMipmaps:!1,type:ot,format:U1,colorSpace:k1,depthBuffer:!1},r=Rs(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Rs(e,t,i);let{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Qf(n)),this._blurMaterial=Jf(n,e,t)}return r}_compileMaterial(e){let t=new v1(this._lodPlanes[0],e);this._renderer.compile(t,pn)}_sceneToCubeUV(e,t,i,r){let n=new Y1(90,1,t,i),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],l=this._renderer,d=l.autoClear,c=l.toneMapping;l.getClearColor(Ps),l.toneMapping=u2,l.autoClear=!1;let h=new lt({name:"PMREM.Background",side:tt,depthWrite:!1,depthTest:!1}),u=new v1(new un,h),m=!1,f=e.background;f?f.isColor&&(h.color.copy(f),e.background=null,m=!0):(h.color.copy(Ps),m=!0);for(let v=0;v<6;v++){let _=v%3;_===0?(n.up.set(0,o[v],0),n.lookAt(s[v],0,0)):_===1?(n.up.set(0,0,o[v]),n.lookAt(0,s[v],0)):(n.up.set(0,o[v],0),n.lookAt(0,0,s[v]));let g=this._cubeSize;Ja(r,_*g,v>2?g:0,g,g),l.setRenderTarget(r),m&&l.render(u,n),l.render(e,n)}u.geometry.dispose(),u.material.dispose(),l.toneMapping=c,l.autoClear=d,e.background=f}_textureToCubeUV(e,t){let i=this._renderer,r=e.mapping===si||e.mapping===li;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Us()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Ds());let n=r?this._cubemapMaterial:this._equirectMaterial,o=new v1(this._lodPlanes[0],n),s=n.uniforms;s.envMap.value=e;let l=this._cubeSize;Ja(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,pn)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){let n=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Ns[(r-1)%Ns.length];this._blur(e,r-1,r,n,o)}t.autoClear=i}_blur(e,t,i,r,n){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",n),this._halfBlur(o,e,i,i,r,"longitudinal",n)}_halfBlur(e,t,i,r,n,o,s){let l=this._renderer,d=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let c=3,h=new v1(this._lodPlanes[r],d),u=d.uniforms,m=this._sizeLods[i]-1,f=isFinite(n)?Math.PI/(2*m):2*Math.PI/(2*G2-1),v=n/f,_=isFinite(n)?1+Math.floor(c*v):G2;_>G2&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${G2}`);let g=[],p=0;for(let A=0;A<G2;++A){let C=A/v,U=Math.exp(-C*C/2);g.push(U),A===0?p+=U:A<_&&(p+=2*U)}for(let A=0;A<g.length;A++)g[A]=g[A]/p;u.envMap.value=e.texture,u.samples.value=_,u.weights.value=g,u.latitudinal.value=o==="latitudinal",s&&(u.poleAxis.value=s);let{_lodMax:y}=this;u.dTheta.value=f,u.mipInt.value=y-i;let x=this._sizeLods[r],b=3*x*(r>y-Ri?r-y+Ri:0),N=4*(this._cubeSize-x);Ja(t,b,N,3*x,2*x),l.setRenderTarget(t),l.render(h,pn)}};function Qf(e){let t=[],i=[],r=[],n=e,o=e-Ri+1+Is.length;for(let s=0;s<o;s++){let l=Math.pow(2,n);i.push(l);let d=1/l;s>e-Ri?d=Is[s-e+Ri-1]:s===0&&(d=0),r.push(d);let c=1/(l-2),h=-c,u=1+c,m=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,v=6,_=3,g=2,p=1,y=new Float32Array(_*v*f),x=new Float32Array(g*v*f),b=new Float32Array(p*v*f);for(let A=0;A<f;A++){let C=A%3*2/3-1,U=A>2?0:-1,S=[C,U,0,C+2/3,U,0,C+2/3,U+1,0,C,U,0,C+2/3,U+1,0,C,U+1,0];y.set(S,_*v*A),x.set(m,g*v*A);let M=[A,A,A,A,A,A];b.set(M,p*v*A)}let N=new Ut;N.setAttribute("position",new X1(y,_)),N.setAttribute("uv",new X1(x,g)),N.setAttribute("faceIndex",new X1(b,p)),t.push(N),n>Ri&&n--}return{lodPlanes:t,sizeLods:i,sigmas:r}}function Rs(e,t,i){let r=new S1(e,t,i);return r.texture.mapping=Sa,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Ja(e,t,i,r,n){e.viewport.set(t,i,r,n),e.scissor.set(t,i,r,n)}function Jf(e,t,i){let r=new Float32Array(G2),n=new I(0,1,0);return new x1({name:"SphericalGaussianBlur",defines:{n:G2,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:yn(),fragmentShader:`
3542
+ }`,We={alphahash_fragment:lu,alphahash_pars_fragment:cu,alphamap_fragment:du,alphamap_pars_fragment:hu,alphatest_fragment:uu,alphatest_pars_fragment:mu,aomap_fragment:fu,aomap_pars_fragment:pu,batching_pars_vertex:gu,batching_vertex:_u,begin_vertex:vu,beginnormal_vertex:xu,bsdfs:yu,iridescence_fragment:Su,bumpmap_pars_fragment:Mu,clipping_planes_fragment:wu,clipping_planes_pars_fragment:Au,clipping_planes_pars_vertex:Eu,clipping_planes_vertex:bu,color_fragment:Cu,color_pars_fragment:Tu,color_pars_vertex:Iu,color_vertex:Pu,common:Nu,cube_uv_reflection_fragment:Lu,defaultnormal_vertex:Ru,displacementmap_pars_vertex:Du,displacementmap_vertex:Uu,emissivemap_fragment:ku,emissivemap_pars_fragment:Ou,colorspace_fragment:zu,colorspace_pars_fragment:Vu,envmap_fragment:Bu,envmap_common_pars_fragment:Fu,envmap_pars_fragment:Hu,envmap_pars_vertex:Gu,envmap_physical_pars_fragment:tm,envmap_vertex:Wu,fog_vertex:ju,fog_pars_vertex:Xu,fog_fragment:Yu,fog_pars_fragment:qu,gradientmap_pars_fragment:Zu,lightmap_fragment:Qu,lightmap_pars_fragment:Ju,lights_lambert_fragment:Ku,lights_lambert_pars_fragment:$u,lights_pars_begin:em,lights_toon_fragment:im,lights_toon_pars_fragment:rm,lights_phong_fragment:am,lights_phong_pars_fragment:nm,lights_physical_fragment:om,lights_physical_pars_fragment:sm,lights_fragment_begin:lm,lights_fragment_maps:cm,lights_fragment_end:dm,logdepthbuf_fragment:hm,logdepthbuf_pars_fragment:um,logdepthbuf_pars_vertex:mm,logdepthbuf_vertex:fm,map_fragment:pm,map_pars_fragment:gm,map_particle_fragment:_m,map_particle_pars_fragment:vm,metalnessmap_fragment:xm,metalnessmap_pars_fragment:ym,morphinstance_vertex:Sm,morphcolor_vertex:Mm,morphnormal_vertex:wm,morphtarget_pars_vertex:Am,morphtarget_vertex:Em,normal_fragment_begin:bm,normal_fragment_maps:Cm,normal_pars_fragment:Tm,normal_pars_vertex:Im,normal_vertex:Pm,normalmap_pars_fragment:Nm,clearcoat_normal_fragment_begin:Lm,clearcoat_normal_fragment_maps:Rm,clearcoat_pars_fragment:Dm,iridescence_pars_fragment:Um,opaque_fragment:km,packing:Om,premultiplied_alpha_fragment:zm,project_vertex:Vm,dithering_fragment:Bm,dithering_pars_fragment:Fm,roughnessmap_fragment:Hm,roughnessmap_pars_fragment:Gm,shadowmap_pars_fragment:Wm,shadowmap_pars_vertex:jm,shadowmap_vertex:Xm,shadowmask_pars_fragment:Ym,skinbase_vertex:qm,skinning_pars_vertex:Zm,skinning_vertex:Qm,skinnormal_vertex:Jm,specularmap_fragment:Km,specularmap_pars_fragment:$m,tonemapping_fragment:ef,tonemapping_pars_fragment:tf,transmission_fragment:rf,transmission_pars_fragment:af,uv_pars_fragment:nf,uv_pars_vertex:of,uv_vertex:sf,worldpos_vertex:lf,background_vert:cf,background_frag:df,backgroundCube_vert:hf,backgroundCube_frag:uf,cube_vert:mf,cube_frag:ff,depth_vert:pf,depth_frag:gf,distanceRGBA_vert:_f,distanceRGBA_frag:vf,equirect_vert:xf,equirect_frag:yf,linedashed_vert:Sf,linedashed_frag:Mf,meshbasic_vert:wf,meshbasic_frag:Af,meshlambert_vert:Ef,meshlambert_frag:bf,meshmatcap_vert:Cf,meshmatcap_frag:Tf,meshnormal_vert:If,meshnormal_frag:Pf,meshphong_vert:Nf,meshphong_frag:Lf,meshphysical_vert:Rf,meshphysical_frag:Df,meshtoon_vert:Uf,meshtoon_frag:kf,points_vert:Of,points_frag:zf,shadow_vert:Vf,shadow_frag:Bf,sprite_vert:Ff,sprite_frag:Hf},_e={common:{diffuse:{value:new Ue(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new je}},envmap:{envMap:{value:null},envMapRotation:{value:new je},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new je}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new je}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new je},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new je},normalScale:{value:new ye(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new je},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new je}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new je}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new je}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ue(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ue(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0},uvTransform:{value:new je}},sprite:{diffuse:{value:new Ue(16777215)},opacity:{value:1},center:{value:new ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new je},alphaMap:{value:null},alphaMapTransform:{value:new je},alphaTest:{value:0}}},Ot={basic:{uniforms:Q1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.fog]),vertexShader:We.meshbasic_vert,fragmentShader:We.meshbasic_frag},lambert:{uniforms:Q1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)}}]),vertexShader:We.meshlambert_vert,fragmentShader:We.meshlambert_frag},phong:{uniforms:Q1([_e.common,_e.specularmap,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)},specular:{value:new Ue(1118481)},shininess:{value:30}}]),vertexShader:We.meshphong_vert,fragmentShader:We.meshphong_frag},standard:{uniforms:Q1([_e.common,_e.envmap,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.roughnessmap,_e.metalnessmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag},toon:{uniforms:Q1([_e.common,_e.aomap,_e.lightmap,_e.emissivemap,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.gradientmap,_e.fog,_e.lights,{emissive:{value:new Ue(0)}}]),vertexShader:We.meshtoon_vert,fragmentShader:We.meshtoon_frag},matcap:{uniforms:Q1([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,_e.fog,{matcap:{value:null}}]),vertexShader:We.meshmatcap_vert,fragmentShader:We.meshmatcap_frag},points:{uniforms:Q1([_e.points,_e.fog]),vertexShader:We.points_vert,fragmentShader:We.points_frag},dashed:{uniforms:Q1([_e.common,_e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:We.linedashed_vert,fragmentShader:We.linedashed_frag},depth:{uniforms:Q1([_e.common,_e.displacementmap]),vertexShader:We.depth_vert,fragmentShader:We.depth_frag},normal:{uniforms:Q1([_e.common,_e.bumpmap,_e.normalmap,_e.displacementmap,{opacity:{value:1}}]),vertexShader:We.meshnormal_vert,fragmentShader:We.meshnormal_frag},sprite:{uniforms:Q1([_e.sprite,_e.fog]),vertexShader:We.sprite_vert,fragmentShader:We.sprite_frag},background:{uniforms:{uvTransform:{value:new je},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:We.background_vert,fragmentShader:We.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new je}},vertexShader:We.backgroundCube_vert,fragmentShader:We.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:We.cube_vert,fragmentShader:We.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:We.equirect_vert,fragmentShader:We.equirect_frag},distanceRGBA:{uniforms:Q1([_e.common,_e.displacementmap,{referencePosition:{value:new I},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:We.distanceRGBA_vert,fragmentShader:We.distanceRGBA_frag},shadow:{uniforms:Q1([_e.lights,_e.fog,{color:{value:new Ue(0)},opacity:{value:1}}]),vertexShader:We.shadow_vert,fragmentShader:We.shadow_frag}};Ot.physical={uniforms:Q1([Ot.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new je},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new je},clearcoatNormalScale:{value:new ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new je},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new je},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new je},sheen:{value:0},sheenColor:{value:new Ue(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new je},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new je},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new je},transmissionSamplerSize:{value:new ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new je},attenuationDistance:{value:0},attenuationColor:{value:new Ue(0)},specularColor:{value:new Ue(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new je},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new je},anisotropyVector:{value:new ye},anisotropyMap:{value:null},anisotropyMapTransform:{value:new je}}]),vertexShader:We.meshphysical_vert,fragmentShader:We.meshphysical_frag};var Qa={r:0,b:0,g:0},H2=new k1,Gf=new Fe;function Wf(e,t,i,r,n,o,s){let l=new Ue(0),d=o===!0?0:1,c,h,u=null,m=0,f=null;function v(g,p){let y=!1,x=p.isScene===!0?p.background:null;x&&x.isTexture&&(x=(p.backgroundBlurriness>0?i:t).get(x)),x===null?_(l,d):x&&x.isColor&&(_(x,1),y=!0);let b=e.xr.getEnvironmentBlendMode();b==="additive"?r.buffers.color.setClear(0,0,0,1,s):b==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(e.autoClear||y)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Sa)?(h===void 0&&(h=new v1(new un(1,1,1),new x1({name:"BackgroundCubeMaterial",uniforms:Ii(Ot.backgroundCube.uniforms),vertexShader:Ot.backgroundCube.vertexShader,fragmentShader:Ot.backgroundCube.fragmentShader,side:et,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(N,A,C){this.matrixWorld.copyPosition(C.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(h)),H2.copy(p.backgroundRotation),H2.x*=-1,H2.y*=-1,H2.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(H2.y*=-1,H2.z*=-1),h.material.uniforms.envMap.value=x,h.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Gf.makeRotationFromEuler(H2)),h.material.toneMapped=n1.getTransfer(x.colorSpace)!==g1,(u!==x||m!==x.version||f!==e.toneMapping)&&(h.material.needsUpdate=!0,u=x,m=x.version,f=e.toneMapping),h.layers.enableAll(),g.unshift(h,h.geometry,h.material,0,0,null)):x&&x.isTexture&&(c===void 0&&(c=new v1(new kt(2,2),new x1({name:"BackgroundMaterial",uniforms:Ii(Ot.background.uniforms),vertexShader:Ot.background.vertexShader,fragmentShader:Ot.background.fragmentShader,side:Nt,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(c)),c.material.uniforms.t2D.value=x,c.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,c.material.toneMapped=n1.getTransfer(x.colorSpace)!==g1,x.matrixAutoUpdate===!0&&x.updateMatrix(),c.material.uniforms.uvTransform.value.copy(x.matrix),(u!==x||m!==x.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=x,m=x.version,f=e.toneMapping),c.layers.enableAll(),g.unshift(c,c.geometry,c.material,0,0,null))}function _(g,p){g.getRGB(Qa,ws(e)),r.buffers.color.setClear(Qa.r,Qa.g,Qa.b,p,s)}return{getClearColor:function(){return l},setClearColor:function(g,p=1){l.set(g),d=p,_(l,d)},getClearAlpha:function(){return d},setClearAlpha:function(g){d=g,_(l,d)},render:v}}function jf(e,t){let i=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},n=m(null),o=n,s=!1;function l(M,k,R,D,B){let Z=!1,j=u(D,R,k);o!==j&&(o=j,c(o.object)),Z=f(M,D,R,B),Z&&v(M,D,R,B),B!==null&&t.update(B,e.ELEMENT_ARRAY_BUFFER),(Z||s)&&(s=!1,b(M,k,R,D),B!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(B).buffer))}function d(){return e.createVertexArray()}function c(M){return e.bindVertexArray(M)}function h(M){return e.deleteVertexArray(M)}function u(M,k,R){let D=R.wireframe===!0,B=r[M.id];B===void 0&&(B={},r[M.id]=B);let Z=B[k.id];Z===void 0&&(Z={},B[k.id]=Z);let j=Z[D];return j===void 0&&(j=m(d()),Z[D]=j),j}function m(M){let k=[],R=[],D=[];for(let B=0;B<i;B++)k[B]=0,R[B]=0,D[B]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:R,attributeDivisors:D,object:M,attributes:{},index:null}}function f(M,k,R,D){let B=o.attributes,Z=k.attributes,j=0,Q=R.getAttributes();for(let V in Q)if(Q[V].location>=0){let J=B[V],Y=Z[V];if(Y===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(Y=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(Y=M.instanceColor)),J===void 0||J.attribute!==Y||Y&&J.data!==Y.data)return!0;j++}return o.attributesNum!==j||o.index!==D}function v(M,k,R,D){let B={},Z=k.attributes,j=0,Q=R.getAttributes();for(let V in Q)if(Q[V].location>=0){let J=Z[V];J===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(J=M.instanceColor));let Y={};Y.attribute=J,J&&J.data&&(Y.data=J.data),B[V]=Y,j++}o.attributes=B,o.attributesNum=j,o.index=D}function _(){let M=o.newAttributes;for(let k=0,R=M.length;k<R;k++)M[k]=0}function g(M){p(M,0)}function p(M,k){let R=o.newAttributes,D=o.enabledAttributes,B=o.attributeDivisors;R[M]=1,D[M]===0&&(e.enableVertexAttribArray(M),D[M]=1),B[M]!==k&&(e.vertexAttribDivisor(M,k),B[M]=k)}function y(){let M=o.newAttributes,k=o.enabledAttributes;for(let R=0,D=k.length;R<D;R++)k[R]!==M[R]&&(e.disableVertexAttribArray(R),k[R]=0)}function x(M,k,R,D,B,Z,j){j===!0?e.vertexAttribIPointer(M,k,R,B,Z):e.vertexAttribPointer(M,k,R,D,B,Z)}function b(M,k,R,D){_();let B=D.attributes,Z=R.getAttributes(),j=k.defaultAttributeValues;for(let Q in Z){let V=Z[Q];if(V.location>=0){let J=B[Q];if(J===void 0&&(Q==="instanceMatrix"&&M.instanceMatrix&&(J=M.instanceMatrix),Q==="instanceColor"&&M.instanceColor&&(J=M.instanceColor)),J!==void 0){let Y=J.normalized,he=J.itemSize,ne=t.get(J);if(ne===void 0)continue;let q=ne.buffer,K=ne.type,le=ne.bytesPerElement,de=K===e.INT||K===e.UNSIGNED_INT||J.gpuType===ho;if(J.isInterleavedBufferAttribute){let ae=J.data,Me=ae.stride,Be=J.offset;if(ae.isInstancedInterleavedBuffer){for(let z=0;z<V.locationSize;z++)p(V.location+z,ae.meshPerAttribute);M.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let z=0;z<V.locationSize;z++)g(V.location+z);e.bindBuffer(e.ARRAY_BUFFER,q);for(let z=0;z<V.locationSize;z++)x(V.location+z,he/V.locationSize,K,Y,Me*le,(Be+he/V.locationSize*z)*le,de)}else{if(J.isInstancedBufferAttribute){for(let ae=0;ae<V.locationSize;ae++)p(V.location+ae,J.meshPerAttribute);M.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let ae=0;ae<V.locationSize;ae++)g(V.location+ae);e.bindBuffer(e.ARRAY_BUFFER,q);for(let ae=0;ae<V.locationSize;ae++)x(V.location+ae,he/V.locationSize,K,Y,he*le,he/V.locationSize*ae*le,de)}}else if(j!==void 0){let Y=j[Q];if(Y!==void 0)switch(Y.length){case 2:e.vertexAttrib2fv(V.location,Y);break;case 3:e.vertexAttrib3fv(V.location,Y);break;case 4:e.vertexAttrib4fv(V.location,Y);break;default:e.vertexAttrib1fv(V.location,Y)}}}}y()}function N(){U();for(let M in r){let k=r[M];for(let R in k){let D=k[R];for(let B in D)h(D[B].object),delete D[B];delete k[R]}delete r[M]}}function A(M){if(r[M.id]===void 0)return;let k=r[M.id];for(let R in k){let D=k[R];for(let B in D)h(D[B].object),delete D[B];delete k[R]}delete r[M.id]}function C(M){for(let k in r){let R=r[k];if(R[M.id]===void 0)continue;let D=R[M.id];for(let B in D)h(D[B].object),delete D[B];delete R[M.id]}}function U(){S(),s=!0,o!==n&&(o=n,c(o.object))}function S(){n.geometry=null,n.program=null,n.wireframe=!1}return{setup:l,reset:U,resetDefaultState:S,dispose:N,releaseStatesOfGeometry:A,releaseStatesOfProgram:C,initAttributes:_,enableAttribute:g,disableUnusedAttributes:y}}function Xf(e,t,i){let r;function n(d){r=d}function o(d,c){e.drawArrays(r,d,c),i.update(c,r,1)}function s(d,c,h){h!==0&&(e.drawArraysInstanced(r,d,c,h),i.update(c,r,h))}function l(d,c,h){if(h===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let m=0;m<h;m++)this.render(d[m],c[m]);else{u.multiDrawArraysWEBGL(r,d,0,c,0,h);let m=0;for(let f=0;f<h;f++)m+=c[f];i.update(m,r,1)}}this.setMode=n,this.render=o,this.renderInstances=s,this.renderMultiDraw=l}function Yf(e,t,i){let r;function n(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){let x=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function o(x){if(x==="highp"){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let s=i.precision!==void 0?i.precision:"highp",l=o(s);l!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",l,"instead."),s=l);let d=i.logarithmicDepthBuffer===!0,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),m=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),_=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),p=h>0,y=e.getParameter(e.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:n,getMaxPrecision:o,precision:s,logarithmicDepthBuffer:d,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:m,maxAttributes:f,maxVertexUniforms:v,maxVaryings:_,maxFragmentUniforms:g,vertexTextures:p,maxSamples:y}}function qf(e){let t=this,i=null,r=0,n=!1,o=!1,s=new y2,l=new je,d={value:null,needsUpdate:!1};this.uniform=d,this.numPlanes=0,this.numIntersection=0,this.init=function(u,m){let f=u.length!==0||m||r!==0||n;return n=m,r=u.length,f},this.beginShadows=function(){o=!0,h(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(u,m){i=h(u,m,0)},this.setState=function(u,m,f){let v=u.clippingPlanes,_=u.clipIntersection,g=u.clipShadows,p=e.get(u);if(!n||v===null||v.length===0||o&&!g)o?h(null):c();else{let y=o?0:r,x=y*4,b=p.clippingState||null;d.value=b,b=h(v,m,x,f);for(let N=0;N!==x;++N)b[N]=i[N];p.clippingState=b,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=y}};function c(){d.value!==i&&(d.value=i,d.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function h(u,m,f,v){let _=u!==null?u.length:0,g=null;if(_!==0){if(g=d.value,v!==!0||g===null){let p=f+_*4,y=m.matrixWorldInverse;l.getNormalMatrix(y),(g===null||g.length<p)&&(g=new Float32Array(p));for(let x=0,b=f;x!==_;++x,b+=4)s.copy(u[x]).applyMatrix4(y,l),s.normal.toArray(g,b),g[b+3]=s.constant}d.value=g,d.needsUpdate=!0}return t.numPlanes=_,t.numIntersection=0,g}}function Zf(e){let t=new WeakMap;function i(s,l){return l===D3?s.mapping=oi:l===U3&&(s.mapping=si),s}function r(s){if(s&&s.isTexture){let l=s.mapping;if(l===D3||l===U3)if(t.has(s)){let d=t.get(s).texture;return i(d,s.mapping)}else{let d=s.image;if(d&&d.height>0){let c=new au(d.height);return c.fromEquirectangularTexture(e,s),t.set(s,c),s.addEventListener("dispose",n),i(c.texture,s.mapping)}else return null}}return s}function n(s){let l=s.target;l.removeEventListener("dispose",n);let d=t.get(l);d!==void 0&&(t.delete(l),d.dispose())}function o(){t=new WeakMap}return{get:r,dispose:o}}var zt=class extends As{constructor(e=-1,t=1,i=1,r=-1,n=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=n,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,n,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=r,this.view.width=n,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-e,o=i+e,s=r+t,l=r-t;if(this.view!==null&&this.view.enabled){let d=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;n+=d*this.view.offsetX,o=n+d*this.view.width,s-=c*this.view.offsetY,l=s-c*this.view.height}this.projectionMatrix.makeOrthographic(n,o,s,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){let t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}},Li=4,Is=[.125,.215,.35,.446,.526,.582],G2=20,pn=new zt,Ps=new Ue,gn=null,_n=0,vn=0,xn=!1,W2=(1+Math.sqrt(5))/2,Ri=1/W2,Ns=[new I(1,1,1),new I(-1,1,1),new I(1,1,-1),new I(-1,1,-1),new I(0,W2,Ri),new I(0,W2,-Ri),new I(Ri,0,W2),new I(-Ri,0,W2),new I(W2,Ri,0),new I(-W2,Ri,0)],Ls=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let n=this._allocateTargets();return n.depthBuffer=!0,this._sceneToCubeUV(e,i,r,n),t>0&&this._blur(n,0,0,t),this._applyPMREM(n),this._cleanup(n),n}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Us(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Ds(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(gn,_n,vn),this._renderer.xr.enabled=xn,e.scissorTest=!1,Ja(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===oi||e.mapping===si?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),gn=this._renderer.getRenderTarget(),_n=this._renderer.getActiveCubeFace(),vn=this._renderer.getActiveMipmapLevel(),xn=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let i=t||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){let e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,i={magFilter:m1,minFilter:m1,generateMipmaps:!1,type:ot,format:D1,colorSpace:U1,depthBuffer:!1},r=Rs(e,t,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Rs(e,t,i);let{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Qf(n)),this._blurMaterial=Jf(n,e,t)}return r}_compileMaterial(e){let t=new v1(this._lodPlanes[0],e);this._renderer.compile(t,pn)}_sceneToCubeUV(e,t,i,r){let n=new j1(90,1,t,i),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],l=this._renderer,d=l.autoClear,c=l.toneMapping;l.getClearColor(Ps),l.toneMapping=h2,l.autoClear=!1;let h=new lt({name:"PMREM.Background",side:et,depthWrite:!1,depthTest:!1}),u=new v1(new un,h),m=!1,f=e.background;f?f.isColor&&(h.color.copy(f),e.background=null,m=!0):(h.color.copy(Ps),m=!0);for(let v=0;v<6;v++){let _=v%3;_===0?(n.up.set(0,o[v],0),n.lookAt(s[v],0,0)):_===1?(n.up.set(0,0,o[v]),n.lookAt(0,s[v],0)):(n.up.set(0,o[v],0),n.lookAt(0,0,s[v]));let g=this._cubeSize;Ja(r,_*g,v>2?g:0,g,g),l.setRenderTarget(r),m&&l.render(u,n),l.render(e,n)}u.geometry.dispose(),u.material.dispose(),l.toneMapping=c,l.autoClear=d,e.background=f}_textureToCubeUV(e,t){let i=this._renderer,r=e.mapping===oi||e.mapping===si;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Us()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Ds());let n=r?this._cubemapMaterial:this._equirectMaterial,o=new v1(this._lodPlanes[0],n),s=n.uniforms;s.envMap.value=e;let l=this._cubeSize;Ja(t,0,0,3*l,2*l),i.setRenderTarget(t),i.render(o,pn)}_applyPMREM(e){let t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<this._lodPlanes.length;r++){let n=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Ns[(r-1)%Ns.length];this._blur(e,r-1,r,n,o)}t.autoClear=i}_blur(e,t,i,r,n){let o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",n),this._halfBlur(o,e,i,i,r,"longitudinal",n)}_halfBlur(e,t,i,r,n,o,s){let l=this._renderer,d=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let c=3,h=new v1(this._lodPlanes[r],d),u=d.uniforms,m=this._sizeLods[i]-1,f=isFinite(n)?Math.PI/(2*m):2*Math.PI/(2*G2-1),v=n/f,_=isFinite(n)?1+Math.floor(c*v):G2;_>G2&&console.warn(`sigmaRadians, ${n}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${G2}`);let g=[],p=0;for(let A=0;A<G2;++A){let C=A/v,U=Math.exp(-C*C/2);g.push(U),A===0?p+=U:A<_&&(p+=2*U)}for(let A=0;A<g.length;A++)g[A]=g[A]/p;u.envMap.value=e.texture,u.samples.value=_,u.weights.value=g,u.latitudinal.value=o==="latitudinal",s&&(u.poleAxis.value=s);let{_lodMax:y}=this;u.dTheta.value=f,u.mipInt.value=y-i;let x=this._sizeLods[r],b=3*x*(r>y-Li?r-y+Li:0),N=4*(this._cubeSize-x);Ja(t,b,N,3*x,2*x),l.setRenderTarget(t),l.render(h,pn)}};function Qf(e){let t=[],i=[],r=[],n=e,o=e-Li+1+Is.length;for(let s=0;s<o;s++){let l=Math.pow(2,n);i.push(l);let d=1/l;s>e-Li?d=Is[s-e+Li-1]:s===0&&(d=0),r.push(d);let c=1/(l-2),h=-c,u=1+c,m=[h,h,u,h,u,u,h,h,u,u,h,u],f=6,v=6,_=3,g=2,p=1,y=new Float32Array(_*v*f),x=new Float32Array(g*v*f),b=new Float32Array(p*v*f);for(let A=0;A<f;A++){let C=A%3*2/3-1,U=A>2?0:-1,S=[C,U,0,C+2/3,U,0,C+2/3,U+1,0,C,U,0,C+2/3,U+1,0,C,U+1,0];y.set(S,_*v*A),x.set(m,g*v*A);let M=[A,A,A,A,A,A];b.set(M,p*v*A)}let N=new Ut;N.setAttribute("position",new W1(y,_)),N.setAttribute("uv",new W1(x,g)),N.setAttribute("faceIndex",new W1(b,p)),t.push(N),n>Li&&n--}return{lodPlanes:t,sizeLods:i,sigmas:r}}function Rs(e,t,i){let r=new S1(e,t,i);return r.texture.mapping=Sa,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Ja(e,t,i,r,n){e.viewport.set(t,i,r,n),e.scissor.set(t,i,r,n)}function Jf(e,t,i){let r=new Float32Array(G2),n=new I(0,1,0);return new x1({name:"SphericalGaussianBlur",defines:{n:G2,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n}},vertexShader:yn(),fragmentShader:`
3543
3543
 
3544
3544
  precision mediump float;
3545
3545
  precision mediump int;
@@ -3689,15 +3689,15 @@ void main() {
3689
3689
  gl_Position = vec4( position, 1.0 );
3690
3690
 
3691
3691
  }
3692
- `}function Kf(e){let t=new WeakMap,i=null;function r(l){if(l&&l.isTexture){let d=l.mapping,c=d===D3||d===U3,h=d===si||d===li;if(c||h){let u=t.get(l),m=u!==void 0?u.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==m)return i===null&&(i=new Ls(e)),u=c?i.fromEquirectangular(l,u):i.fromCubemap(l,u),u.texture.pmremVersion=l.pmremVersion,t.set(l,u),u.texture;if(u!==void 0)return u.texture;{let f=l.image;return c&&f&&f.height>0||h&&f&&n(f)?(i===null&&(i=new Ls(e)),u=c?i.fromEquirectangular(l):i.fromCubemap(l),u.texture.pmremVersion=l.pmremVersion,t.set(l,u),l.addEventListener("dispose",o),u.texture):null}}}return l}function n(l){let d=0,c=6;for(let h=0;h<c;h++)l[h]!==void 0&&d++;return d===c}function o(l){let d=l.target;d.removeEventListener("dispose",o);let c=t.get(d);c!==void 0&&(t.delete(d),c.dispose())}function s(){t=new WeakMap,i!==null&&(i.dispose(),i=null)}return{get:r,dispose:s}}function $f(e){let t={};function i(r){if(t[r]!==void 0)return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(r){return i(r)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(r){let n=i(r);return n===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),n}}}function ep(e,t,i,r){let n={},o=new WeakMap;function s(u){let m=u.target;m.index!==null&&t.remove(m.index);for(let v in m.attributes)t.remove(m.attributes[v]);for(let v in m.morphAttributes){let _=m.morphAttributes[v];for(let g=0,p=_.length;g<p;g++)t.remove(_[g])}m.removeEventListener("dispose",s),delete n[m.id];let f=o.get(m);f&&(t.remove(f),o.delete(m)),r.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,i.memory.geometries--}function l(u,m){return n[m.id]===!0||(m.addEventListener("dispose",s),n[m.id]=!0,i.memory.geometries++),m}function d(u){let m=u.attributes;for(let v in m)t.update(m[v],e.ARRAY_BUFFER);let f=u.morphAttributes;for(let v in f){let _=f[v];for(let g=0,p=_.length;g<p;g++)t.update(_[g],e.ARRAY_BUFFER)}}function c(u){let m=[],f=u.index,v=u.attributes.position,_=0;if(f!==null){let y=f.array;_=f.version;for(let x=0,b=y.length;x<b;x+=3){let N=y[x+0],A=y[x+1],C=y[x+2];m.push(N,A,A,C,C,N)}}else if(v!==void 0){let y=v.array;_=v.version;for(let x=0,b=y.length/3-1;x<b;x+=3){let N=x+0,A=x+1,C=x+2;m.push(N,A,A,C,C,N)}}else return;let g=new(Ko(m)?_s:gs)(m,1);g.version=_;let p=o.get(u);p&&t.remove(p),o.set(u,g)}function h(u){let m=o.get(u);if(m){let f=u.index;f!==null&&m.version<f.version&&c(u)}else c(u);return o.get(u)}return{get:l,update:d,getWireframeAttribute:h}}function tp(e,t,i){let r;function n(u){r=u}let o,s;function l(u){o=u.type,s=u.bytesPerElement}function d(u,m){e.drawElements(r,m,o,u*s),i.update(m,r,1)}function c(u,m,f){f!==0&&(e.drawElementsInstanced(r,m,o,u*s,f),i.update(m,r,f))}function h(u,m,f){if(f===0)return;let v=t.get("WEBGL_multi_draw");if(v===null)for(let _=0;_<f;_++)this.render(u[_]/s,m[_]);else{v.multiDrawElementsWEBGL(r,m,0,o,u,0,f);let _=0;for(let g=0;g<f;g++)_+=m[g];i.update(_,r,1)}}this.setMode=n,this.setIndex=l,this.render=d,this.renderInstances=c,this.renderMultiDraw=h}function ip(e){let t={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function r(o,s,l){switch(i.calls++,s){case e.TRIANGLES:i.triangles+=l*(o/3);break;case e.LINES:i.lines+=l*(o/2);break;case e.LINE_STRIP:i.lines+=l*(o-1);break;case e.LINE_LOOP:i.lines+=l*o;break;case e.POINTS:i.points+=l*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function n(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:t,render:i,programs:null,autoReset:!0,reset:n,update:r}}function rp(e,t,i){let r=new WeakMap,n=new f1;function o(s,l,d){let c=s.morphTargetInfluences,h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,u=h!==void 0?h.length:0,m=r.get(l);if(m===void 0||m.count!==u){let f=function(){U.dispose(),r.delete(l),l.removeEventListener("dispose",f)};m!==void 0&&m.texture.dispose();let v=l.morphAttributes.position!==void 0,_=l.morphAttributes.normal!==void 0,g=l.morphAttributes.color!==void 0,p=l.morphAttributes.position||[],y=l.morphAttributes.normal||[],x=l.morphAttributes.color||[],b=0;v===!0&&(b=1),_===!0&&(b=2),g===!0&&(b=3);let N=l.attributes.position.count*b,A=1;N>t.maxTextureSize&&(A=Math.ceil(N/t.maxTextureSize),N=t.maxTextureSize);let C=new Float32Array(N*A*4*u),U=new as(C,N,A,u);U.type=Q1,U.needsUpdate=!0;let S=b*4;for(let M=0;M<u;M++){let k=p[M],R=y[M],D=x[M],V=N*A*4*M;for(let q=0;q<k.count;q++){let W=q*S;v===!0&&(n.fromBufferAttribute(k,q),C[V+W+0]=n.x,C[V+W+1]=n.y,C[V+W+2]=n.z,C[V+W+3]=0),_===!0&&(n.fromBufferAttribute(R,q),C[V+W+4]=n.x,C[V+W+5]=n.y,C[V+W+6]=n.z,C[V+W+7]=0),g===!0&&(n.fromBufferAttribute(D,q),C[V+W+8]=n.x,C[V+W+9]=n.y,C[V+W+10]=n.z,C[V+W+11]=D.itemSize===4?n.w:1)}}m={count:u,texture:U,size:new ye(N,A)},r.set(l,m),l.addEventListener("dispose",f)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)d.getUniforms().setValue(e,"morphTexture",s.morphTexture,i);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];let v=l.morphTargetsRelative?1:1-f;d.getUniforms().setValue(e,"morphTargetBaseInfluence",v),d.getUniforms().setValue(e,"morphTargetInfluences",c)}d.getUniforms().setValue(e,"morphTargetsTexture",m.texture,i),d.getUniforms().setValue(e,"morphTargetsTextureSize",m.size)}return{update:o}}function ap(e,t,i,r){let n=new WeakMap;function o(d){let c=r.render.frame,h=d.geometry,u=t.get(d,h);if(n.get(u)!==c&&(t.update(u),n.set(u,c)),d.isInstancedMesh&&(d.hasEventListener("dispose",l)===!1&&d.addEventListener("dispose",l),n.get(d)!==c&&(i.update(d.instanceMatrix,e.ARRAY_BUFFER),d.instanceColor!==null&&i.update(d.instanceColor,e.ARRAY_BUFFER),n.set(d,c))),d.isSkinnedMesh){let m=d.skeleton;n.get(m)!==c&&(m.update(),n.set(m,c))}return u}function s(){n=new WeakMap}function l(d){let c=d.target;c.removeEventListener("dispose",l),i.remove(c.instanceMatrix),c.instanceColor!==null&&i.remove(c.instanceColor)}return{update:o,dispose:s}}var ks=class extends it{constructor(e,t,i,r,n,o,s,l,d,c){if(c=c!==void 0?c:di,c!==di&&c!==Pr)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&c===di&&(i=ci),i===void 0&&c===Pr&&(i=Ir),super(null,r,n,o,s,l,c,i,d),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:u1,this.minFilter=l!==void 0?l:u1,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Os=new it,zs=new ks(1,1);zs.compareFunction=Zo;var Vs=new as,Bs=new ns,Fs=new Cs,Hs=[],Gs=[],Ws=new Float32Array(16),js=new Float32Array(9),Xs=new Float32Array(4);function Ui(e,t,i){let r=e[0];if(r<=0||r>0)return e;let n=t*i,o=Hs[n];if(o===void 0&&(o=new Float32Array(n),Hs[n]=o),t!==0){r.toArray(o,0);for(let s=1,l=0;s!==t;++s)l+=i,e[s].toArray(o,l)}return o}function L1(e,t){if(e.length!==t.length)return!1;for(let i=0,r=e.length;i<r;i++)if(e[i]!==t[i])return!1;return!0}function R1(e,t){for(let i=0,r=t.length;i<r;i++)e[i]=t[i]}function Ka(e,t){let i=Gs[t];i===void 0&&(i=new Int32Array(t),Gs[t]=i);for(let r=0;r!==t;++r)i[r]=e.allocateTextureUnit();return i}function np(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function op(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(L1(i,t))return;e.uniform2fv(this.addr,t),R1(i,t)}}function sp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(t.r!==void 0)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(L1(i,t))return;e.uniform3fv(this.addr,t),R1(i,t)}}function lp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(L1(i,t))return;e.uniform4fv(this.addr,t),R1(i,t)}}function cp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(L1(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),R1(i,t)}else{if(L1(i,r))return;Xs.set(r),e.uniformMatrix2fv(this.addr,!1,Xs),R1(i,r)}}function dp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(L1(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),R1(i,t)}else{if(L1(i,r))return;js.set(r),e.uniformMatrix3fv(this.addr,!1,js),R1(i,r)}}function hp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(L1(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),R1(i,t)}else{if(L1(i,r))return;Ws.set(r),e.uniformMatrix4fv(this.addr,!1,Ws),R1(i,r)}}function up(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function mp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(L1(i,t))return;e.uniform2iv(this.addr,t),R1(i,t)}}function fp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(L1(i,t))return;e.uniform3iv(this.addr,t),R1(i,t)}}function pp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(L1(i,t))return;e.uniform4iv(this.addr,t),R1(i,t)}}function gp(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function _p(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(L1(i,t))return;e.uniform2uiv(this.addr,t),R1(i,t)}}function vp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(L1(i,t))return;e.uniform3uiv(this.addr,t),R1(i,t)}}function xp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(L1(i,t))return;e.uniform4uiv(this.addr,t),R1(i,t)}}function yp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n);let o=this.type===e.SAMPLER_2D_SHADOW?zs:Os;i.setTexture2D(t||o,n)}function Sp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture3D(t||Bs,n)}function Mp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTextureCube(t||Fs,n)}function wp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture2DArray(t||Vs,n)}function Ap(e){switch(e){case 5126:return np;case 35664:return op;case 35665:return sp;case 35666:return lp;case 35674:return cp;case 35675:return dp;case 35676:return hp;case 5124:case 35670:return up;case 35667:case 35671:return mp;case 35668:case 35672:return fp;case 35669:case 35673:return pp;case 5125:return gp;case 36294:return _p;case 36295:return vp;case 36296:return xp;case 35678:case 36198:case 36298:case 36306:case 35682:return yp;case 35679:case 36299:case 36307:return Sp;case 35680:case 36300:case 36308:case 36293:return Mp;case 36289:case 36303:case 36311:case 36292:return wp}}function Ep(e,t){e.uniform1fv(this.addr,t)}function bp(e,t){let i=Ui(t,this.size,2);e.uniform2fv(this.addr,i)}function Cp(e,t){let i=Ui(t,this.size,3);e.uniform3fv(this.addr,i)}function Tp(e,t){let i=Ui(t,this.size,4);e.uniform4fv(this.addr,i)}function Ip(e,t){let i=Ui(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function Pp(e,t){let i=Ui(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function Np(e,t){let i=Ui(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function Lp(e,t){e.uniform1iv(this.addr,t)}function Rp(e,t){e.uniform2iv(this.addr,t)}function Dp(e,t){e.uniform3iv(this.addr,t)}function Up(e,t){e.uniform4iv(this.addr,t)}function kp(e,t){e.uniform1uiv(this.addr,t)}function Op(e,t){e.uniform2uiv(this.addr,t)}function zp(e,t){e.uniform3uiv(this.addr,t)}function Vp(e,t){e.uniform4uiv(this.addr,t)}function Bp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);L1(r,o)||(e.uniform1iv(this.addr,o),R1(r,o));for(let s=0;s!==n;++s)i.setTexture2D(t[s]||Os,o[s])}function Fp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);L1(r,o)||(e.uniform1iv(this.addr,o),R1(r,o));for(let s=0;s!==n;++s)i.setTexture3D(t[s]||Bs,o[s])}function Hp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);L1(r,o)||(e.uniform1iv(this.addr,o),R1(r,o));for(let s=0;s!==n;++s)i.setTextureCube(t[s]||Fs,o[s])}function Gp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);L1(r,o)||(e.uniform1iv(this.addr,o),R1(r,o));for(let s=0;s!==n;++s)i.setTexture2DArray(t[s]||Vs,o[s])}function Wp(e){switch(e){case 5126:return Ep;case 35664:return bp;case 35665:return Cp;case 35666:return Tp;case 35674:return Ip;case 35675:return Pp;case 35676:return Np;case 5124:case 35670:return Lp;case 35667:case 35671:return Rp;case 35668:case 35672:return Dp;case 35669:case 35673:return Up;case 5125:return kp;case 36294:return Op;case 36295:return zp;case 36296:return Vp;case 35678:case 36198:case 36298:case 36306:case 35682:return Bp;case 35679:case 36299:case 36307:return Fp;case 35680:case 36300:case 36308:case 36293:return Hp;case 36289:case 36303:case 36311:case 36292:return Gp}}var jp=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=Ap(t.type)}},Xp=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Wp(t.type)}},Yp=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let r=this.seq;for(let n=0,o=r.length;n!==o;++n){let s=r[n];s.setValue(e,t[s.id],i)}}},Sn=/(\w+)(\])?(\[|\.)?/g;function Ys(e,t){e.seq.push(t),e.map[t.id]=t}function qp(e,t,i){let r=e.name,n=r.length;for(Sn.lastIndex=0;;){let o=Sn.exec(r),s=Sn.lastIndex,l=o[1],d=o[2]==="]",c=o[3];if(d&&(l=l|0),c===void 0||c==="["&&s+2===n){Ys(i,c===void 0?new jp(l,e,t):new Xp(l,e,t));break}else{let h=i.map[l];h===void 0&&(h=new Yp(l),Ys(i,h)),i=h}}}var $a=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){let n=e.getActiveUniform(t,r),o=e.getUniformLocation(t,n.name);qp(n,o,this)}}setValue(e,t,i,r){let n=this.map[t];n!==void 0&&n.setValue(e,i,r)}setOptional(e,t,i){let r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let n=0,o=t.length;n!==o;++n){let s=t[n],l=i[s.id];l.needsUpdate!==!1&&s.setValue(e,l.value,r)}}static seqWithValue(e,t){let i=[];for(let r=0,n=e.length;r!==n;++r){let o=e[r];o.id in t&&i.push(o)}return i}};function qs(e,t,i){let r=e.createShader(t);return e.shaderSource(r,i),e.compileShader(r),r}var Zp=37297,Qp=0;function Jp(e,t){let i=e.split(`
3692
+ `}function Kf(e){let t=new WeakMap,i=null;function r(l){if(l&&l.isTexture){let d=l.mapping,c=d===D3||d===U3,h=d===oi||d===si;if(c||h){let u=t.get(l),m=u!==void 0?u.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==m)return i===null&&(i=new Ls(e)),u=c?i.fromEquirectangular(l,u):i.fromCubemap(l,u),u.texture.pmremVersion=l.pmremVersion,t.set(l,u),u.texture;if(u!==void 0)return u.texture;{let f=l.image;return c&&f&&f.height>0||h&&f&&n(f)?(i===null&&(i=new Ls(e)),u=c?i.fromEquirectangular(l):i.fromCubemap(l),u.texture.pmremVersion=l.pmremVersion,t.set(l,u),l.addEventListener("dispose",o),u.texture):null}}}return l}function n(l){let d=0,c=6;for(let h=0;h<c;h++)l[h]!==void 0&&d++;return d===c}function o(l){let d=l.target;d.removeEventListener("dispose",o);let c=t.get(d);c!==void 0&&(t.delete(d),c.dispose())}function s(){t=new WeakMap,i!==null&&(i.dispose(),i=null)}return{get:r,dispose:s}}function $f(e){let t={};function i(r){if(t[r]!==void 0)return t[r];let n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return t[r]=n,n}return{has:function(r){return i(r)!==null},init:function(){i("EXT_color_buffer_float"),i("WEBGL_clip_cull_distance"),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float"),i("WEBGL_multisampled_render_to_texture"),i("WEBGL_render_shared_exponent")},get:function(r){let n=i(r);return n===null&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),n}}}function ep(e,t,i,r){let n={},o=new WeakMap;function s(u){let m=u.target;m.index!==null&&t.remove(m.index);for(let v in m.attributes)t.remove(m.attributes[v]);for(let v in m.morphAttributes){let _=m.morphAttributes[v];for(let g=0,p=_.length;g<p;g++)t.remove(_[g])}m.removeEventListener("dispose",s),delete n[m.id];let f=o.get(m);f&&(t.remove(f),o.delete(m)),r.releaseStatesOfGeometry(m),m.isInstancedBufferGeometry===!0&&delete m._maxInstanceCount,i.memory.geometries--}function l(u,m){return n[m.id]===!0||(m.addEventListener("dispose",s),n[m.id]=!0,i.memory.geometries++),m}function d(u){let m=u.attributes;for(let v in m)t.update(m[v],e.ARRAY_BUFFER);let f=u.morphAttributes;for(let v in f){let _=f[v];for(let g=0,p=_.length;g<p;g++)t.update(_[g],e.ARRAY_BUFFER)}}function c(u){let m=[],f=u.index,v=u.attributes.position,_=0;if(f!==null){let y=f.array;_=f.version;for(let x=0,b=y.length;x<b;x+=3){let N=y[x+0],A=y[x+1],C=y[x+2];m.push(N,A,A,C,C,N)}}else if(v!==void 0){let y=v.array;_=v.version;for(let x=0,b=y.length/3-1;x<b;x+=3){let N=x+0,A=x+1,C=x+2;m.push(N,A,A,C,C,N)}}else return;let g=new(Ko(m)?_s:gs)(m,1);g.version=_;let p=o.get(u);p&&t.remove(p),o.set(u,g)}function h(u){let m=o.get(u);if(m){let f=u.index;f!==null&&m.version<f.version&&c(u)}else c(u);return o.get(u)}return{get:l,update:d,getWireframeAttribute:h}}function tp(e,t,i){let r;function n(u){r=u}let o,s;function l(u){o=u.type,s=u.bytesPerElement}function d(u,m){e.drawElements(r,m,o,u*s),i.update(m,r,1)}function c(u,m,f){f!==0&&(e.drawElementsInstanced(r,m,o,u*s,f),i.update(m,r,f))}function h(u,m,f){if(f===0)return;let v=t.get("WEBGL_multi_draw");if(v===null)for(let _=0;_<f;_++)this.render(u[_]/s,m[_]);else{v.multiDrawElementsWEBGL(r,m,0,o,u,0,f);let _=0;for(let g=0;g<f;g++)_+=m[g];i.update(_,r,1)}}this.setMode=n,this.setIndex=l,this.render=d,this.renderInstances=c,this.renderMultiDraw=h}function ip(e){let t={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function r(o,s,l){switch(i.calls++,s){case e.TRIANGLES:i.triangles+=l*(o/3);break;case e.LINES:i.lines+=l*(o/2);break;case e.LINE_STRIP:i.lines+=l*(o-1);break;case e.LINE_LOOP:i.lines+=l*o;break;case e.POINTS:i.points+=l*o;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",s);break}}function n(){i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:t,render:i,programs:null,autoReset:!0,reset:n,update:r}}function rp(e,t,i){let r=new WeakMap,n=new f1;function o(s,l,d){let c=s.morphTargetInfluences,h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,u=h!==void 0?h.length:0,m=r.get(l);if(m===void 0||m.count!==u){let f=function(){U.dispose(),r.delete(l),l.removeEventListener("dispose",f)};m!==void 0&&m.texture.dispose();let v=l.morphAttributes.position!==void 0,_=l.morphAttributes.normal!==void 0,g=l.morphAttributes.color!==void 0,p=l.morphAttributes.position||[],y=l.morphAttributes.normal||[],x=l.morphAttributes.color||[],b=0;v===!0&&(b=1),_===!0&&(b=2),g===!0&&(b=3);let N=l.attributes.position.count*b,A=1;N>t.maxTextureSize&&(A=Math.ceil(N/t.maxTextureSize),N=t.maxTextureSize);let C=new Float32Array(N*A*4*u),U=new as(C,N,A,u);U.type=q1,U.needsUpdate=!0;let S=b*4;for(let M=0;M<u;M++){let k=p[M],R=y[M],D=x[M],B=N*A*4*M;for(let Z=0;Z<k.count;Z++){let j=Z*S;v===!0&&(n.fromBufferAttribute(k,Z),C[B+j+0]=n.x,C[B+j+1]=n.y,C[B+j+2]=n.z,C[B+j+3]=0),_===!0&&(n.fromBufferAttribute(R,Z),C[B+j+4]=n.x,C[B+j+5]=n.y,C[B+j+6]=n.z,C[B+j+7]=0),g===!0&&(n.fromBufferAttribute(D,Z),C[B+j+8]=n.x,C[B+j+9]=n.y,C[B+j+10]=n.z,C[B+j+11]=D.itemSize===4?n.w:1)}}m={count:u,texture:U,size:new ye(N,A)},r.set(l,m),l.addEventListener("dispose",f)}if(s.isInstancedMesh===!0&&s.morphTexture!==null)d.getUniforms().setValue(e,"morphTexture",s.morphTexture,i);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];let v=l.morphTargetsRelative?1:1-f;d.getUniforms().setValue(e,"morphTargetBaseInfluence",v),d.getUniforms().setValue(e,"morphTargetInfluences",c)}d.getUniforms().setValue(e,"morphTargetsTexture",m.texture,i),d.getUniforms().setValue(e,"morphTargetsTextureSize",m.size)}return{update:o}}function ap(e,t,i,r){let n=new WeakMap;function o(d){let c=r.render.frame,h=d.geometry,u=t.get(d,h);if(n.get(u)!==c&&(t.update(u),n.set(u,c)),d.isInstancedMesh&&(d.hasEventListener("dispose",l)===!1&&d.addEventListener("dispose",l),n.get(d)!==c&&(i.update(d.instanceMatrix,e.ARRAY_BUFFER),d.instanceColor!==null&&i.update(d.instanceColor,e.ARRAY_BUFFER),n.set(d,c))),d.isSkinnedMesh){let m=d.skeleton;n.get(m)!==c&&(m.update(),n.set(m,c))}return u}function s(){n=new WeakMap}function l(d){let c=d.target;c.removeEventListener("dispose",l),i.remove(c.instanceMatrix),c.instanceColor!==null&&i.remove(c.instanceColor)}return{update:o,dispose:s}}var ks=class extends tt{constructor(e,t,i,r,n,o,s,l,d,c){if(c=c!==void 0?c:ci,c!==ci&&c!==Ir)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&c===ci&&(i=li),i===void 0&&c===Ir&&(i=Tr),super(null,r,n,o,s,l,c,i,d),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=s!==void 0?s:u1,this.minFilter=l!==void 0?l:u1,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Os=new tt,zs=new ks(1,1);zs.compareFunction=Zo;var Vs=new as,Bs=new ns,Fs=new Cs,Hs=[],Gs=[],Ws=new Float32Array(16),js=new Float32Array(9),Xs=new Float32Array(4);function Di(e,t,i){let r=e[0];if(r<=0||r>0)return e;let n=t*i,o=Hs[n];if(o===void 0&&(o=new Float32Array(n),Hs[n]=o),t!==0){r.toArray(o,0);for(let s=1,l=0;s!==t;++s)l+=i,e[s].toArray(o,l)}return o}function P1(e,t){if(e.length!==t.length)return!1;for(let i=0,r=e.length;i<r;i++)if(e[i]!==t[i])return!1;return!0}function N1(e,t){for(let i=0,r=t.length;i<r;i++)e[i]=t[i]}function Ka(e,t){let i=Gs[t];i===void 0&&(i=new Int32Array(t),Gs[t]=i);for(let r=0;r!==t;++r)i[r]=e.allocateTextureUnit();return i}function np(e,t){let i=this.cache;i[0]!==t&&(e.uniform1f(this.addr,t),i[0]=t)}function op(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2f(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(P1(i,t))return;e.uniform2fv(this.addr,t),N1(i,t)}}function sp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3f(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else if(t.r!==void 0)(i[0]!==t.r||i[1]!==t.g||i[2]!==t.b)&&(e.uniform3f(this.addr,t.r,t.g,t.b),i[0]=t.r,i[1]=t.g,i[2]=t.b);else{if(P1(i,t))return;e.uniform3fv(this.addr,t),N1(i,t)}}function lp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(P1(i,t))return;e.uniform4fv(this.addr,t),N1(i,t)}}function cp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(P1(i,t))return;e.uniformMatrix2fv(this.addr,!1,t),N1(i,t)}else{if(P1(i,r))return;Xs.set(r),e.uniformMatrix2fv(this.addr,!1,Xs),N1(i,r)}}function dp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(P1(i,t))return;e.uniformMatrix3fv(this.addr,!1,t),N1(i,t)}else{if(P1(i,r))return;js.set(r),e.uniformMatrix3fv(this.addr,!1,js),N1(i,r)}}function hp(e,t){let i=this.cache,r=t.elements;if(r===void 0){if(P1(i,t))return;e.uniformMatrix4fv(this.addr,!1,t),N1(i,t)}else{if(P1(i,r))return;Ws.set(r),e.uniformMatrix4fv(this.addr,!1,Ws),N1(i,r)}}function up(e,t){let i=this.cache;i[0]!==t&&(e.uniform1i(this.addr,t),i[0]=t)}function mp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2i(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(P1(i,t))return;e.uniform2iv(this.addr,t),N1(i,t)}}function fp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3i(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(P1(i,t))return;e.uniform3iv(this.addr,t),N1(i,t)}}function pp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(P1(i,t))return;e.uniform4iv(this.addr,t),N1(i,t)}}function gp(e,t){let i=this.cache;i[0]!==t&&(e.uniform1ui(this.addr,t),i[0]=t)}function _p(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y)&&(e.uniform2ui(this.addr,t.x,t.y),i[0]=t.x,i[1]=t.y);else{if(P1(i,t))return;e.uniform2uiv(this.addr,t),N1(i,t)}}function vp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z)&&(e.uniform3ui(this.addr,t.x,t.y,t.z),i[0]=t.x,i[1]=t.y,i[2]=t.z);else{if(P1(i,t))return;e.uniform3uiv(this.addr,t),N1(i,t)}}function xp(e,t){let i=this.cache;if(t.x!==void 0)(i[0]!==t.x||i[1]!==t.y||i[2]!==t.z||i[3]!==t.w)&&(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w);else{if(P1(i,t))return;e.uniform4uiv(this.addr,t),N1(i,t)}}function yp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n);let o=this.type===e.SAMPLER_2D_SHADOW?zs:Os;i.setTexture2D(t||o,n)}function Sp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture3D(t||Bs,n)}function Mp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTextureCube(t||Fs,n)}function wp(e,t,i){let r=this.cache,n=i.allocateTextureUnit();r[0]!==n&&(e.uniform1i(this.addr,n),r[0]=n),i.setTexture2DArray(t||Vs,n)}function Ap(e){switch(e){case 5126:return np;case 35664:return op;case 35665:return sp;case 35666:return lp;case 35674:return cp;case 35675:return dp;case 35676:return hp;case 5124:case 35670:return up;case 35667:case 35671:return mp;case 35668:case 35672:return fp;case 35669:case 35673:return pp;case 5125:return gp;case 36294:return _p;case 36295:return vp;case 36296:return xp;case 35678:case 36198:case 36298:case 36306:case 35682:return yp;case 35679:case 36299:case 36307:return Sp;case 35680:case 36300:case 36308:case 36293:return Mp;case 36289:case 36303:case 36311:case 36292:return wp}}function Ep(e,t){e.uniform1fv(this.addr,t)}function bp(e,t){let i=Di(t,this.size,2);e.uniform2fv(this.addr,i)}function Cp(e,t){let i=Di(t,this.size,3);e.uniform3fv(this.addr,i)}function Tp(e,t){let i=Di(t,this.size,4);e.uniform4fv(this.addr,i)}function Ip(e,t){let i=Di(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,i)}function Pp(e,t){let i=Di(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,i)}function Np(e,t){let i=Di(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,i)}function Lp(e,t){e.uniform1iv(this.addr,t)}function Rp(e,t){e.uniform2iv(this.addr,t)}function Dp(e,t){e.uniform3iv(this.addr,t)}function Up(e,t){e.uniform4iv(this.addr,t)}function kp(e,t){e.uniform1uiv(this.addr,t)}function Op(e,t){e.uniform2uiv(this.addr,t)}function zp(e,t){e.uniform3uiv(this.addr,t)}function Vp(e,t){e.uniform4uiv(this.addr,t)}function Bp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);P1(r,o)||(e.uniform1iv(this.addr,o),N1(r,o));for(let s=0;s!==n;++s)i.setTexture2D(t[s]||Os,o[s])}function Fp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);P1(r,o)||(e.uniform1iv(this.addr,o),N1(r,o));for(let s=0;s!==n;++s)i.setTexture3D(t[s]||Bs,o[s])}function Hp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);P1(r,o)||(e.uniform1iv(this.addr,o),N1(r,o));for(let s=0;s!==n;++s)i.setTextureCube(t[s]||Fs,o[s])}function Gp(e,t,i){let r=this.cache,n=t.length,o=Ka(i,n);P1(r,o)||(e.uniform1iv(this.addr,o),N1(r,o));for(let s=0;s!==n;++s)i.setTexture2DArray(t[s]||Vs,o[s])}function Wp(e){switch(e){case 5126:return Ep;case 35664:return bp;case 35665:return Cp;case 35666:return Tp;case 35674:return Ip;case 35675:return Pp;case 35676:return Np;case 5124:case 35670:return Lp;case 35667:case 35671:return Rp;case 35668:case 35672:return Dp;case 35669:case 35673:return Up;case 5125:return kp;case 36294:return Op;case 36295:return zp;case 36296:return Vp;case 35678:case 36198:case 36298:case 36306:case 35682:return Bp;case 35679:case 36299:case 36307:return Fp;case 35680:case 36300:case 36308:case 36293:return Hp;case 36289:case 36303:case 36311:case 36292:return Gp}}var jp=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.setValue=Ap(t.type)}},Xp=class{constructor(e,t,i){this.id=e,this.addr=i,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=Wp(t.type)}},Yp=class{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,i){let r=this.seq;for(let n=0,o=r.length;n!==o;++n){let s=r[n];s.setValue(e,t[s.id],i)}}},Sn=/(\w+)(\])?(\[|\.)?/g;function Ys(e,t){e.seq.push(t),e.map[t.id]=t}function qp(e,t,i){let r=e.name,n=r.length;for(Sn.lastIndex=0;;){let o=Sn.exec(r),s=Sn.lastIndex,l=o[1],d=o[2]==="]",c=o[3];if(d&&(l=l|0),c===void 0||c==="["&&s+2===n){Ys(i,c===void 0?new jp(l,e,t):new Xp(l,e,t));break}else{let h=i.map[l];h===void 0&&(h=new Yp(l),Ys(i,h)),i=h}}}var $a=class{constructor(e,t){this.seq=[],this.map={};let i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<i;++r){let n=e.getActiveUniform(t,r),o=e.getUniformLocation(t,n.name);qp(n,o,this)}}setValue(e,t,i,r){let n=this.map[t];n!==void 0&&n.setValue(e,i,r)}setOptional(e,t,i){let r=t[i];r!==void 0&&this.setValue(e,i,r)}static upload(e,t,i,r){for(let n=0,o=t.length;n!==o;++n){let s=t[n],l=i[s.id];l.needsUpdate!==!1&&s.setValue(e,l.value,r)}}static seqWithValue(e,t){let i=[];for(let r=0,n=e.length;r!==n;++r){let o=e[r];o.id in t&&i.push(o)}return i}};function qs(e,t,i){let r=e.createShader(t);return e.shaderSource(r,i),e.compileShader(r),r}var Zp=37297,Qp=0;function Jp(e,t){let i=e.split(`
3693
3693
  `),r=[],n=Math.max(t-6,0),o=Math.min(t+6,i.length);for(let s=n;s<o;s++){let l=s+1;r.push(`${l===t?">":" "} ${l}: ${i[s]}`)}return r.join(`
3694
- `)}function Kp(e){let t=n1.getPrimaries(n1.workingColorSpace),i=n1.getPrimaries(e),r;switch(t===i?r="":t===Ca&&i===ba?r="LinearDisplayP3ToLinearSRGB":t===ba&&i===Ca&&(r="LinearSRGBToLinearDisplayP3"),e){case k1:case Aa:return[r,"LinearTransferOETF"];case J1:case W3:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}function Zs(e,t,i){let r=e.getShaderParameter(t,e.COMPILE_STATUS),n=e.getShaderInfoLog(t).trim();if(r&&n==="")return"";let o=/ERROR: 0:(\d+)/.exec(n);if(o){let s=parseInt(o[1]);return i.toUpperCase()+`
3694
+ `)}function Kp(e){let t=n1.getPrimaries(n1.workingColorSpace),i=n1.getPrimaries(e),r;switch(t===i?r="":t===Ca&&i===ba?r="LinearDisplayP3ToLinearSRGB":t===ba&&i===Ca&&(r="LinearSRGBToLinearDisplayP3"),e){case U1:case Aa:return[r,"LinearTransferOETF"];case Z1:case W3:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",e),[r,"LinearTransferOETF"]}}function Zs(e,t,i){let r=e.getShaderParameter(t,e.COMPILE_STATUS),n=e.getShaderInfoLog(t).trim();if(r&&n==="")return"";let o=/ERROR: 0:(\d+)/.exec(n);if(o){let s=parseInt(o[1]);return i.toUpperCase()+`
3695
3695
 
3696
3696
  `+n+`
3697
3697
 
3698
- `+Jp(e.getShaderSource(t),s)}else return n}function $p(e,t){let i=Kp(t);return`vec4 ${e}( vec4 value ) { return ${i[0]}( ${i[1]}( value ) ); }`}function eg(e,t){let i;switch(t){case Yd:i="Linear";break;case qd:i="Reinhard";break;case Zd:i="OptimizedCineon";break;case Qd:i="ACESFilmic";break;case Kd:i="AgX";break;case $d:i="Neutral";break;case Jd:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function tg(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Br).join(`
3698
+ `+Jp(e.getShaderSource(t),s)}else return n}function $p(e,t){let i=Kp(t);return`vec4 ${e}( vec4 value ) { return ${i[0]}( ${i[1]}( value ) ); }`}function eg(e,t){let i;switch(t){case Yd:i="Linear";break;case qd:i="Reinhard";break;case Zd:i="OptimizedCineon";break;case Qd:i="ACESFilmic";break;case Kd:i="AgX";break;case $d:i="Neutral";break;case Jd:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function tg(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Vr).join(`
3699
3699
  `)}function ig(e){let t=[];for(let i in e){let r=e[i];r!==!1&&t.push("#define "+i+" "+r)}return t.join(`
3700
- `)}function rg(e,t){let i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<r;n++){let o=e.getActiveAttrib(t,n),s=o.name,l=1;o.type===e.FLOAT_MAT2&&(l=2),o.type===e.FLOAT_MAT3&&(l=3),o.type===e.FLOAT_MAT4&&(l=4),i[s]={type:o.type,location:e.getAttribLocation(t,s),locationSize:l}}return i}function Br(e){return e!==""}function Qs(e,t){let i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Js(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var ag=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mn(e){return e.replace(ag,og)}var ng=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function og(e,t){let i=We[t];if(i===void 0){let r=ng.get(t);if(r!==void 0)i=We[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,r);else throw new Error("Can not resolve #include <"+t+">")}return Mn(i)}var sg=/#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 Ks(e){return e.replace(sg,lg)}function lg(e,t,i,r){let n="";for(let o=parseInt(t);o<parseInt(i);o++)n+=r.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return n}function $s(e){let t=`precision ${e.precision} float;
3700
+ `)}function rg(e,t){let i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let n=0;n<r;n++){let o=e.getActiveAttrib(t,n),s=o.name,l=1;o.type===e.FLOAT_MAT2&&(l=2),o.type===e.FLOAT_MAT3&&(l=3),o.type===e.FLOAT_MAT4&&(l=4),i[s]={type:o.type,location:e.getAttribLocation(t,s),locationSize:l}}return i}function Vr(e){return e!==""}function Qs(e,t){let i=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,i).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function Js(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var ag=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mn(e){return e.replace(ag,og)}var ng=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function og(e,t){let i=We[t];if(i===void 0){let r=ng.get(t);if(r!==void 0)i=We[r],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,r);else throw new Error("Can not resolve #include <"+t+">")}return Mn(i)}var sg=/#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 Ks(e){return e.replace(sg,lg)}function lg(e,t,i,r){let n="";for(let o=parseInt(t);o<parseInt(i);o++)n+=r.replace(/\[\s*i\s*\]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return n}function $s(e){let t=`precision ${e.precision} float;
3701
3701
  precision ${e.precision} int;
3702
3702
  precision ${e.precision} sampler2D;
3703
3703
  precision ${e.precision} samplerCube;
@@ -3717,28 +3717,28 @@ void main() {
3717
3717
  `;return e.precision==="highp"?t+=`
3718
3718
  #define HIGH_PRECISION`:e.precision==="mediump"?t+=`
3719
3719
  #define MEDIUM_PRECISION`:e.precision==="lowp"&&(t+=`
3720
- #define LOW_PRECISION`),t}function cg(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===io?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===xd?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Xt&&(t="SHADOWMAP_TYPE_VSM"),t}function dg(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case si:case li:t="ENVMAP_TYPE_CUBE";break;case Sa:t="ENVMAP_TYPE_CUBE_UV";break}return t}function hg(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case li:t="ENVMAP_MODE_REFRACTION";break}return t}function ug(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case no:t="ENVMAP_BLENDING_MULTIPLY";break;case jd:t="ENVMAP_BLENDING_MIX";break;case Xd:t="ENVMAP_BLENDING_ADD";break}return t}function mg(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let i=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:r,maxMip:i}}function fg(e,t,i,r){let n=e.getContext(),o=i.defines,s=i.vertexShader,l=i.fragmentShader,d=cg(i),c=dg(i),h=hg(i),u=ug(i),m=mg(i),f=tg(i),v=ig(o),_=n.createProgram(),g,p,y=i.glslVersion?"#version "+i.glslVersion+`
3721
- `:"";i.isRawShaderMaterial?(g=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v].filter(Br).join(`
3720
+ #define LOW_PRECISION`),t}function cg(e){let t="SHADOWMAP_TYPE_BASIC";return e.shadowMapType===io?t="SHADOWMAP_TYPE_PCF":e.shadowMapType===xd?t="SHADOWMAP_TYPE_PCF_SOFT":e.shadowMapType===Xt&&(t="SHADOWMAP_TYPE_VSM"),t}function dg(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case oi:case si:t="ENVMAP_TYPE_CUBE";break;case Sa:t="ENVMAP_TYPE_CUBE_UV";break}return t}function hg(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case si:t="ENVMAP_MODE_REFRACTION";break}return t}function ug(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case no:t="ENVMAP_BLENDING_MULTIPLY";break;case jd:t="ENVMAP_BLENDING_MIX";break;case Xd:t="ENVMAP_BLENDING_ADD";break}return t}function mg(e){let t=e.envMapCubeUVHeight;if(t===null)return null;let i=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:r,maxMip:i}}function fg(e,t,i,r){let n=e.getContext(),o=i.defines,s=i.vertexShader,l=i.fragmentShader,d=cg(i),c=dg(i),h=hg(i),u=ug(i),m=mg(i),f=tg(i),v=ig(o),_=n.createProgram(),g,p,y=i.glslVersion?"#version "+i.glslVersion+`
3721
+ `:"";i.isRawShaderMaterial?(g=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v].filter(Vr).join(`
3722
3722
  `),g.length>0&&(g+=`
3723
- `),p=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v].filter(Br).join(`
3723
+ `),p=["#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v].filter(Vr).join(`
3724
3724
  `),p.length>0&&(p+=`
3725
3725
  `)):(g=[$s(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.instancingMorph?"#define USE_INSTANCING_MORPH":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","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","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," 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",`
3726
- `].filter(Br).join(`
3727
- `),p=[$s(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+u:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==u2?"#define TONE_MAPPING":"",i.toneMapping!==u2?We.tonemapping_pars_fragment:"",i.toneMapping!==u2?eg("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",We.colorspace_pars_fragment,$p("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
3728
- `].filter(Br).join(`
3726
+ `].filter(Vr).join(`
3727
+ `),p=[$s(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,v,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+u:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+d:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==h2?"#define TONE_MAPPING":"",i.toneMapping!==h2?We.tonemapping_pars_fragment:"",i.toneMapping!==h2?eg("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",We.colorspace_pars_fragment,$p("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",`
3728
+ `].filter(Vr).join(`
3729
3729
  `)),s=Mn(s),s=Qs(s,i),s=Js(s,i),l=Mn(l),l=Qs(l,i),l=Js(l,i),s=Ks(s),l=Ks(l),i.isRawShaderMaterial!==!0&&(y=`#version 300 es
3730
3730
  `,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3731
3731
  `)+`
3732
3732
  `+g,p=["#define varying in",i.glslVersion===Qo?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===Qo?"":"#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(`
3733
3733
  `)+`
3734
- `+p);let x=y+g+s,b=y+p+l,N=qs(n,n.VERTEX_SHADER,x),A=qs(n,n.FRAGMENT_SHADER,b);n.attachShader(_,N),n.attachShader(_,A),i.index0AttributeName!==void 0?n.bindAttribLocation(_,0,i.index0AttributeName):i.morphTargets===!0&&n.bindAttribLocation(_,0,"position"),n.linkProgram(_);function C(k){if(e.debug.checkShaderErrors){let R=n.getProgramInfoLog(_).trim(),D=n.getShaderInfoLog(N).trim(),V=n.getShaderInfoLog(A).trim(),q=!0,W=!0;if(n.getProgramParameter(_,n.LINK_STATUS)===!1)if(q=!1,typeof e.debug.onShaderError=="function")e.debug.onShaderError(n,_,N,A);else{let Q=Zs(n,N,"vertex"),z=Zs(n,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(_,n.VALIDATE_STATUS)+`
3734
+ `+p);let x=y+g+s,b=y+p+l,N=qs(n,n.VERTEX_SHADER,x),A=qs(n,n.FRAGMENT_SHADER,b);n.attachShader(_,N),n.attachShader(_,A),i.index0AttributeName!==void 0?n.bindAttribLocation(_,0,i.index0AttributeName):i.morphTargets===!0&&n.bindAttribLocation(_,0,"position"),n.linkProgram(_);function C(k){if(e.debug.checkShaderErrors){let R=n.getProgramInfoLog(_).trim(),D=n.getShaderInfoLog(N).trim(),B=n.getShaderInfoLog(A).trim(),Z=!0,j=!0;if(n.getProgramParameter(_,n.LINK_STATUS)===!1)if(Z=!1,typeof e.debug.onShaderError=="function")e.debug.onShaderError(n,_,N,A);else{let Q=Zs(n,N,"vertex"),V=Zs(n,A,"fragment");console.error("THREE.WebGLProgram: Shader Error "+n.getError()+" - VALIDATE_STATUS "+n.getProgramParameter(_,n.VALIDATE_STATUS)+`
3735
3735
 
3736
3736
  Material Name: `+k.name+`
3737
3737
  Material Type: `+k.type+`
3738
3738
 
3739
3739
  Program Info Log: `+R+`
3740
3740
  `+Q+`
3741
- `+z)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||V==="")&&(W=!1);W&&(k.diagnostics={runnable:q,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:V,prefix:p}})}n.deleteShader(N),n.deleteShader(A),U=new $a(n,_),S=rg(n,_)}let U;this.getUniforms=function(){return U===void 0&&C(this),U};let S;this.getAttributes=function(){return S===void 0&&C(this),S};let M=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=n.getProgramParameter(_,Zp)),M},this.destroy=function(){r.releaseStatesOfProgram(this),n.deleteProgram(_),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=Qp++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=N,this.fragmentShader=A,this}var pg=0,gg=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),n=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(n)===!1&&(o.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new _g(e),t.set(e,i)),i}},_g=class{constructor(e){this.id=pg++,this.code=e,this.usedTimes=0}};function vg(e,t,i,r,n,o,s){let l=new rn,d=new gg,c=new Set,h=[],u=n.logarithmicDepthBuffer,m=n.vertexTextures,f=n.precision,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"};function _(S){return c.add(S),S===0?"uv":`uv${S}`}function g(S,M,k,R,D){let V=R.fog,q=D.geometry,W=S.isMeshStandardMaterial?R.environment:null,Q=(S.isMeshStandardMaterial?i:t).get(S.envMap||W),z=Q&&Q.mapping===Sa?Q.image.height:null,J=v[S.type];S.precision!==null&&(f=n.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));let j=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,de=j!==void 0?j.length:0,oe=0;q.morphAttributes.position!==void 0&&(oe=1),q.morphAttributes.normal!==void 0&&(oe=2),q.morphAttributes.color!==void 0&&(oe=3);let X,K,le,ce;if(J){let A1=Ot[J];X=A1.vertexShader,K=A1.fragmentShader}else X=S.vertexShader,K=S.fragmentShader,d.update(S),le=d.getVertexShaderID(S),ce=d.getFragmentShaderID(S);let ae=e.getRenderTarget(),Me=D.isInstancedMesh===!0,Be=D.isBatchedMesh===!0,O=!!S.map,Ee=!!S.matcap,ve=!!Q,Re=!!S.aoMap,we=!!S.lightMap,Je=!!S.bumpMap,Te=!!S.normalMap,T=!!S.displacementMap,w=!!S.emissiveMap,G=!!S.metalnessMap,$=!!S.roughnessMap,re=S.anisotropy>0,L=S.clearcoat>0,ie=S.iridescence>0,ee=S.sheen>0,he=S.transmission>0,fe=re&&!!S.anisotropyMap,ne=L&&!!S.clearcoatMap,Se=L&&!!S.clearcoatNormalMap,be=L&&!!S.clearcoatRoughnessMap,Ie=ie&&!!S.iridescenceMap,Ae=ie&&!!S.iridescenceThicknessMap,Xe=ee&&!!S.sheenColorMap,ze=ee&&!!S.sheenRoughnessMap,e1=!!S.specularMap,i1=!!S.specularColorMap,p1=!!S.specularIntensityMap,xe=he&&!!S.transmissionMap,P=he&&!!S.thicknessMap,pe=!!S.gradientMap,se=!!S.alphaMap,Oe=S.alphaTest>0,Pe=!!S.alphaHash,Ke=!!S.extensions,r1=u2;S.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(r1=e.toneMapping);let o1={shaderID:J,shaderType:S.type,shaderName:S.name,vertexShader:X,fragmentShader:K,defines:S.defines,customVertexShaderID:le,customFragmentShaderID:ce,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,batching:Be,instancing:Me,instancingColor:Me&&D.instanceColor!==null,instancingMorph:Me&&D.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:ae===null?e.outputColorSpace:ae.isXRRenderTarget===!0?ae.texture.colorSpace:k1,alphaToCoverage:!!S.alphaToCoverage,map:O,matcap:Ee,envMap:ve,envMapMode:ve&&Q.mapping,envMapCubeUVHeight:z,aoMap:Re,lightMap:we,bumpMap:Je,normalMap:Te,displacementMap:m&&T,emissiveMap:w,normalMapObjectSpace:Te&&S.normalMapType===fh,normalMapTangentSpace:Te&&S.normalMapType===Yo,metalnessMap:G,roughnessMap:$,anisotropy:re,anisotropyMap:fe,clearcoat:L,clearcoatMap:ne,clearcoatNormalMap:Se,clearcoatRoughnessMap:be,iridescence:ie,iridescenceMap:Ie,iridescenceThicknessMap:Ae,sheen:ee,sheenColorMap:Xe,sheenRoughnessMap:ze,specularMap:e1,specularColorMap:i1,specularIntensityMap:p1,transmission:he,transmissionMap:xe,thicknessMap:P,gradientMap:pe,opaque:S.transparent===!1&&S.blending===oi&&S.alphaToCoverage===!1,alphaMap:se,alphaTest:Oe,alphaHash:Pe,combine:S.combine,mapUv:O&&_(S.map.channel),aoMapUv:Re&&_(S.aoMap.channel),lightMapUv:we&&_(S.lightMap.channel),bumpMapUv:Je&&_(S.bumpMap.channel),normalMapUv:Te&&_(S.normalMap.channel),displacementMapUv:T&&_(S.displacementMap.channel),emissiveMapUv:w&&_(S.emissiveMap.channel),metalnessMapUv:G&&_(S.metalnessMap.channel),roughnessMapUv:$&&_(S.roughnessMap.channel),anisotropyMapUv:fe&&_(S.anisotropyMap.channel),clearcoatMapUv:ne&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:Se&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:be&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:Ae&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Xe&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:ze&&_(S.sheenRoughnessMap.channel),specularMapUv:e1&&_(S.specularMap.channel),specularColorMapUv:i1&&_(S.specularColorMap.channel),specularIntensityMapUv:p1&&_(S.specularIntensityMap.channel),transmissionMapUv:xe&&_(S.transmissionMap.channel),thicknessMapUv:P&&_(S.thicknessMap.channel),alphaMapUv:se&&_(S.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(Te||re),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!q.attributes.uv&&(O||se),fog:!!V,useFog:S.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:D.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:de,morphTextureStride:oe,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:S.dithering,shadowMapEnabled:e.shadowMap.enabled&&k.length>0,shadowMapType:e.shadowMap.type,toneMapping:r1,useLegacyLights:e._useLegacyLights,decodeVideoTexture:O&&S.map.isVideoTexture===!0&&n1.getTransfer(S.map.colorSpace)===g1,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===ut,flipSided:S.side===tt,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ke&&S.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ke&&S.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return o1.vertexUv1s=c.has(1),o1.vertexUv2s=c.has(2),o1.vertexUv3s=c.has(3),c.clear(),o1}function p(S){let M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(let k in S.defines)M.push(k),M.push(S.defines[k]);return S.isRawShaderMaterial===!1&&(y(M,S),x(M,S),M.push(e.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function y(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function x(S,M){l.disableAll(),M.supportsVertexTextures&&l.enable(0),M.instancing&&l.enable(1),M.instancingColor&&l.enable(2),M.instancingMorph&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),M.batching&&l.enable(19),S.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.skinning&&l.enable(4),M.morphTargets&&l.enable(5),M.morphNormals&&l.enable(6),M.morphColors&&l.enable(7),M.premultipliedAlpha&&l.enable(8),M.shadowMapEnabled&&l.enable(9),M.useLegacyLights&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),M.alphaToCoverage&&l.enable(20),S.push(l.mask)}function b(S){let M=v[S.type],k;if(M){let R=Ot[M];k=qa.clone(R.uniforms)}else k=S.uniforms;return k}function N(S,M){let k;for(let R=0,D=h.length;R<D;R++){let V=h[R];if(V.cacheKey===M){k=V,++k.usedTimes;break}}return k===void 0&&(k=new fg(e,M,S,o),h.push(k)),k}function A(S){if(--S.usedTimes===0){let M=h.indexOf(S);h[M]=h[h.length-1],h.pop(),S.destroy()}}function C(S){d.remove(S)}function U(){d.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:b,acquireProgram:N,releaseProgram:A,releaseShaderCache:C,programs:h,dispose:U}}function xg(){let e=new WeakMap;function t(o){let s=e.get(o);return s===void 0&&(s={},e.set(o,s)),s}function i(o){e.delete(o)}function r(o,s,l){e.get(o)[s]=l}function n(){e=new WeakMap}return{get:t,remove:i,update:r,dispose:n}}function yg(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function el(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function tl(){let e=[],t=0,i=[],r=[],n=[];function o(){t=0,i.length=0,r.length=0,n.length=0}function s(u,m,f,v,_,g){let p=e[t];return p===void 0?(p={id:u.id,object:u,geometry:m,material:f,groupOrder:v,renderOrder:u.renderOrder,z:_,group:g},e[t]=p):(p.id=u.id,p.object=u,p.geometry=m,p.material=f,p.groupOrder=v,p.renderOrder=u.renderOrder,p.z=_,p.group=g),t++,p}function l(u,m,f,v,_,g){let p=s(u,m,f,v,_,g);f.transmission>0?r.push(p):f.transparent===!0?n.push(p):i.push(p)}function d(u,m,f,v,_,g){let p=s(u,m,f,v,_,g);f.transmission>0?r.unshift(p):f.transparent===!0?n.unshift(p):i.unshift(p)}function c(u,m){i.length>1&&i.sort(u||yg),r.length>1&&r.sort(m||el),n.length>1&&n.sort(m||el)}function h(){for(let u=t,m=e.length;u<m;u++){let f=e[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:i,transmissive:r,transparent:n,init:o,push:l,unshift:d,finish:h,sort:c}}function Sg(){let e=new WeakMap;function t(r,n){let o=e.get(r),s;return o===void 0?(s=new tl,e.set(r,[s])):n>=o.length?(s=new tl,o.push(s)):s=o[n],s}function i(){e=new WeakMap}return{get:t,dispose:i}}function Mg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new I,color:new Ue};break;case"SpotLight":i={position:new I,direction:new I,color:new Ue,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new I,color:new Ue,distance:0,decay:0};break;case"HemisphereLight":i={direction:new I,skyColor:new Ue,groundColor:new Ue};break;case"RectAreaLight":i={color:new Ue,position:new I,halfWidth:new I,halfHeight:new I};break}return e[t.id]=i,i}}}function wg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=i,i}}}var Ag=0;function Eg(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function bg(e){let t=new Mg,i=wg(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new I);let n=new I,o=new Fe,s=new Fe;function l(c,h){let u=0,m=0,f=0;for(let k=0;k<9;k++)r.probe[k].set(0,0,0);let v=0,_=0,g=0,p=0,y=0,x=0,b=0,N=0,A=0,C=0,U=0;c.sort(Eg);let S=h===!0?Math.PI:1;for(let k=0,R=c.length;k<R;k++){let D=c[k],V=D.color,q=D.intensity,W=D.distance,Q=D.shadow&&D.shadow.map?D.shadow.map.texture:null;if(D.isAmbientLight)u+=V.r*q*S,m+=V.g*q*S,f+=V.b*q*S;else if(D.isLightProbe){for(let z=0;z<9;z++)r.probe[z].addScaledVector(D.sh.coefficients[z],q);U++}else if(D.isDirectionalLight){let z=t.get(D);if(z.color.copy(D.color).multiplyScalar(D.intensity*S),D.castShadow){let J=D.shadow,j=i.get(D);j.shadowBias=J.bias,j.shadowNormalBias=J.normalBias,j.shadowRadius=J.radius,j.shadowMapSize=J.mapSize,r.directionalShadow[v]=j,r.directionalShadowMap[v]=Q,r.directionalShadowMatrix[v]=D.shadow.matrix,x++}r.directional[v]=z,v++}else if(D.isSpotLight){let z=t.get(D);z.position.setFromMatrixPosition(D.matrixWorld),z.color.copy(V).multiplyScalar(q*S),z.distance=W,z.coneCos=Math.cos(D.angle),z.penumbraCos=Math.cos(D.angle*(1-D.penumbra)),z.decay=D.decay,r.spot[g]=z;let J=D.shadow;if(D.map&&(r.spotLightMap[A]=D.map,A++,J.updateMatrices(D),D.castShadow&&C++),r.spotLightMatrix[g]=J.matrix,D.castShadow){let j=i.get(D);j.shadowBias=J.bias,j.shadowNormalBias=J.normalBias,j.shadowRadius=J.radius,j.shadowMapSize=J.mapSize,r.spotShadow[g]=j,r.spotShadowMap[g]=Q,N++}g++}else if(D.isRectAreaLight){let z=t.get(D);z.color.copy(V).multiplyScalar(q),z.halfWidth.set(D.width*.5,0,0),z.halfHeight.set(0,D.height*.5,0),r.rectArea[p]=z,p++}else if(D.isPointLight){let z=t.get(D);if(z.color.copy(D.color).multiplyScalar(D.intensity*S),z.distance=D.distance,z.decay=D.decay,D.castShadow){let J=D.shadow,j=i.get(D);j.shadowBias=J.bias,j.shadowNormalBias=J.normalBias,j.shadowRadius=J.radius,j.shadowMapSize=J.mapSize,j.shadowCameraNear=J.camera.near,j.shadowCameraFar=J.camera.far,r.pointShadow[_]=j,r.pointShadowMap[_]=Q,r.pointShadowMatrix[_]=D.shadow.matrix,b++}r.point[_]=z,_++}else if(D.isHemisphereLight){let z=t.get(D);z.skyColor.copy(D.color).multiplyScalar(q*S),z.groundColor.copy(D.groundColor).multiplyScalar(q*S),r.hemi[y]=z,y++}}p>0&&(e.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=_e.LTC_FLOAT_1,r.rectAreaLTC2=_e.LTC_FLOAT_2):(r.rectAreaLTC1=_e.LTC_HALF_1,r.rectAreaLTC2=_e.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=m,r.ambient[2]=f;let M=r.hash;(M.directionalLength!==v||M.pointLength!==_||M.spotLength!==g||M.rectAreaLength!==p||M.hemiLength!==y||M.numDirectionalShadows!==x||M.numPointShadows!==b||M.numSpotShadows!==N||M.numSpotMaps!==A||M.numLightProbes!==U)&&(r.directional.length=v,r.spot.length=g,r.rectArea.length=p,r.point.length=_,r.hemi.length=y,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=N,r.spotShadowMap.length=N,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=N+A-C,r.spotLightMap.length=A,r.numSpotLightShadowsWithMaps=C,r.numLightProbes=U,M.directionalLength=v,M.pointLength=_,M.spotLength=g,M.rectAreaLength=p,M.hemiLength=y,M.numDirectionalShadows=x,M.numPointShadows=b,M.numSpotShadows=N,M.numSpotMaps=A,M.numLightProbes=U,r.version=Ag++)}function d(c,h){let u=0,m=0,f=0,v=0,_=0,g=h.matrixWorldInverse;for(let p=0,y=c.length;p<y;p++){let x=c[p];if(x.isDirectionalLight){let b=r.directional[u];b.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(n),b.direction.transformDirection(g),u++}else if(x.isSpotLight){let b=r.spot[f];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),b.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(n),b.direction.transformDirection(g),f++}else if(x.isRectAreaLight){let b=r.rectArea[v];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),s.identity(),o.copy(x.matrixWorld),o.premultiply(g),s.extractRotation(o),b.halfWidth.set(x.width*.5,0,0),b.halfHeight.set(0,x.height*.5,0),b.halfWidth.applyMatrix4(s),b.halfHeight.applyMatrix4(s),v++}else if(x.isPointLight){let b=r.point[m];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),m++}else if(x.isHemisphereLight){let b=r.hemi[_];b.direction.setFromMatrixPosition(x.matrixWorld),b.direction.transformDirection(g),_++}}}return{setup:l,setupView:d,state:r}}function il(e){let t=new bg(e),i=[],r=[];function n(){i.length=0,r.length=0}function o(c){i.push(c)}function s(c){r.push(c)}function l(c){t.setup(i,c)}function d(c){t.setupView(i,c)}return{init:n,state:{lightsArray:i,shadowsArray:r,lights:t,transmissionRenderTarget:null},setupLights:l,setupLightsView:d,pushLight:o,pushShadow:s}}function Cg(e){let t=new WeakMap;function i(n,o=0){let s=t.get(n),l;return s===void 0?(l=new il(e),t.set(n,[l])):o>=s.length?(l=new il(e),s.push(l)):l=s[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}var Tg=class extends mt{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uh,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Ig=class extends mt{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Pg=`void main() {
3741
+ `+V)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(D===""||B==="")&&(j=!1);j&&(k.diagnostics={runnable:Z,programLog:R,vertexShader:{log:D,prefix:g},fragmentShader:{log:B,prefix:p}})}n.deleteShader(N),n.deleteShader(A),U=new $a(n,_),S=rg(n,_)}let U;this.getUniforms=function(){return U===void 0&&C(this),U};let S;this.getAttributes=function(){return S===void 0&&C(this),S};let M=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=n.getProgramParameter(_,Zp)),M},this.destroy=function(){r.releaseStatesOfProgram(this),n.deleteProgram(_),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=Qp++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=N,this.fragmentShader=A,this}var pg=0,gg=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){let t=e.vertexShader,i=e.fragmentShader,r=this._getShaderStage(t),n=this._getShaderStage(i),o=this._getShaderCacheForMaterial(e);return o.has(r)===!1&&(o.add(r),r.usedTimes++),o.has(n)===!1&&(o.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let i of t)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,i=t.get(e);return i===void 0&&(i=new Set,t.set(e,i)),i}_getShaderStage(e){let t=this.shaderCache,i=t.get(e);return i===void 0&&(i=new _g(e),t.set(e,i)),i}},_g=class{constructor(e){this.id=pg++,this.code=e,this.usedTimes=0}};function vg(e,t,i,r,n,o,s){let l=new rn,d=new gg,c=new Set,h=[],u=n.logarithmicDepthBuffer,m=n.vertexTextures,f=n.precision,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"};function _(S){return c.add(S),S===0?"uv":`uv${S}`}function g(S,M,k,R,D){let B=R.fog,Z=D.geometry,j=S.isMeshStandardMaterial?R.environment:null,Q=(S.isMeshStandardMaterial?i:t).get(S.envMap||j),V=Q&&Q.mapping===Sa?Q.image.height:null,J=v[S.type];S.precision!==null&&(f=n.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));let Y=Z.morphAttributes.position||Z.morphAttributes.normal||Z.morphAttributes.color,he=Y!==void 0?Y.length:0,ne=0;Z.morphAttributes.position!==void 0&&(ne=1),Z.morphAttributes.normal!==void 0&&(ne=2),Z.morphAttributes.color!==void 0&&(ne=3);let q,K,le,de;if(J){let A1=Ot[J];q=A1.vertexShader,K=A1.fragmentShader}else q=S.vertexShader,K=S.fragmentShader,d.update(S),le=d.getVertexShaderID(S),de=d.getFragmentShaderID(S);let ae=e.getRenderTarget(),Me=D.isInstancedMesh===!0,Be=D.isBatchedMesh===!0,z=!!S.map,Ee=!!S.matcap,ve=!!Q,Le=!!S.aoMap,we=!!S.lightMap,Qe=!!S.bumpMap,Ce=!!S.normalMap,T=!!S.displacementMap,w=!!S.emissiveMap,W=!!S.metalnessMap,$=!!S.roughnessMap,re=S.anisotropy>0,L=S.clearcoat>0,ie=S.iridescence>0,ee=S.sheen>0,me=S.transmission>0,fe=re&&!!S.anisotropyMap,oe=L&&!!S.clearcoatMap,Se=L&&!!S.clearcoatNormalMap,be=L&&!!S.clearcoatRoughnessMap,Ie=ie&&!!S.iridescenceMap,Ae=ie&&!!S.iridescenceThicknessMap,Xe=ee&&!!S.sheenColorMap,ze=ee&&!!S.sheenRoughnessMap,e1=!!S.specularMap,i1=!!S.specularColorMap,p1=!!S.specularIntensityMap,xe=me&&!!S.transmissionMap,P=me&&!!S.thicknessMap,pe=!!S.gradientMap,se=!!S.alphaMap,Oe=S.alphaTest>0,Pe=!!S.alphaHash,Ke=!!S.extensions,r1=h2;S.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(r1=e.toneMapping);let o1={shaderID:J,shaderType:S.type,shaderName:S.name,vertexShader:q,fragmentShader:K,defines:S.defines,customVertexShaderID:le,customFragmentShaderID:de,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,batching:Be,instancing:Me,instancingColor:Me&&D.instanceColor!==null,instancingMorph:Me&&D.morphTexture!==null,supportsVertexTextures:m,outputColorSpace:ae===null?e.outputColorSpace:ae.isXRRenderTarget===!0?ae.texture.colorSpace:U1,alphaToCoverage:!!S.alphaToCoverage,map:z,matcap:Ee,envMap:ve,envMapMode:ve&&Q.mapping,envMapCubeUVHeight:V,aoMap:Le,lightMap:we,bumpMap:Qe,normalMap:Ce,displacementMap:m&&T,emissiveMap:w,normalMapObjectSpace:Ce&&S.normalMapType===fh,normalMapTangentSpace:Ce&&S.normalMapType===Yo,metalnessMap:W,roughnessMap:$,anisotropy:re,anisotropyMap:fe,clearcoat:L,clearcoatMap:oe,clearcoatNormalMap:Se,clearcoatRoughnessMap:be,iridescence:ie,iridescenceMap:Ie,iridescenceThicknessMap:Ae,sheen:ee,sheenColorMap:Xe,sheenRoughnessMap:ze,specularMap:e1,specularColorMap:i1,specularIntensityMap:p1,transmission:me,transmissionMap:xe,thicknessMap:P,gradientMap:pe,opaque:S.transparent===!1&&S.blending===ni&&S.alphaToCoverage===!1,alphaMap:se,alphaTest:Oe,alphaHash:Pe,combine:S.combine,mapUv:z&&_(S.map.channel),aoMapUv:Le&&_(S.aoMap.channel),lightMapUv:we&&_(S.lightMap.channel),bumpMapUv:Qe&&_(S.bumpMap.channel),normalMapUv:Ce&&_(S.normalMap.channel),displacementMapUv:T&&_(S.displacementMap.channel),emissiveMapUv:w&&_(S.emissiveMap.channel),metalnessMapUv:W&&_(S.metalnessMap.channel),roughnessMapUv:$&&_(S.roughnessMap.channel),anisotropyMapUv:fe&&_(S.anisotropyMap.channel),clearcoatMapUv:oe&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:Se&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:be&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:Ie&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:Ae&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Xe&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:ze&&_(S.sheenRoughnessMap.channel),specularMapUv:e1&&_(S.specularMap.channel),specularColorMapUv:i1&&_(S.specularColorMap.channel),specularIntensityMapUv:p1&&_(S.specularIntensityMap.channel),transmissionMapUv:xe&&_(S.transmissionMap.channel),thicknessMapUv:P&&_(S.thicknessMap.channel),alphaMapUv:se&&_(S.alphaMap.channel),vertexTangents:!!Z.attributes.tangent&&(Ce||re),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!Z.attributes.color&&Z.attributes.color.itemSize===4,pointsUvs:D.isPoints===!0&&!!Z.attributes.uv&&(z||se),fog:!!B,useFog:S.fog===!0,fogExp2:!!B&&B.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:u,skinning:D.isSkinnedMesh===!0,morphTargets:Z.morphAttributes.position!==void 0,morphNormals:Z.morphAttributes.normal!==void 0,morphColors:Z.morphAttributes.color!==void 0,morphTargetsCount:he,morphTextureStride:ne,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:S.dithering,shadowMapEnabled:e.shadowMap.enabled&&k.length>0,shadowMapType:e.shadowMap.type,toneMapping:r1,useLegacyLights:e._useLegacyLights,decodeVideoTexture:z&&S.map.isVideoTexture===!0&&n1.getTransfer(S.map.colorSpace)===g1,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===ut,flipSided:S.side===et,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:Ke&&S.extensions.clipCullDistance===!0&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ke&&S.extensions.multiDraw===!0&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return o1.vertexUv1s=c.has(1),o1.vertexUv2s=c.has(2),o1.vertexUv3s=c.has(3),c.clear(),o1}function p(S){let M=[];if(S.shaderID?M.push(S.shaderID):(M.push(S.customVertexShaderID),M.push(S.customFragmentShaderID)),S.defines!==void 0)for(let k in S.defines)M.push(k),M.push(S.defines[k]);return S.isRawShaderMaterial===!1&&(y(M,S),x(M,S),M.push(e.outputColorSpace)),M.push(S.customProgramCacheKey),M.join()}function y(S,M){S.push(M.precision),S.push(M.outputColorSpace),S.push(M.envMapMode),S.push(M.envMapCubeUVHeight),S.push(M.mapUv),S.push(M.alphaMapUv),S.push(M.lightMapUv),S.push(M.aoMapUv),S.push(M.bumpMapUv),S.push(M.normalMapUv),S.push(M.displacementMapUv),S.push(M.emissiveMapUv),S.push(M.metalnessMapUv),S.push(M.roughnessMapUv),S.push(M.anisotropyMapUv),S.push(M.clearcoatMapUv),S.push(M.clearcoatNormalMapUv),S.push(M.clearcoatRoughnessMapUv),S.push(M.iridescenceMapUv),S.push(M.iridescenceThicknessMapUv),S.push(M.sheenColorMapUv),S.push(M.sheenRoughnessMapUv),S.push(M.specularMapUv),S.push(M.specularColorMapUv),S.push(M.specularIntensityMapUv),S.push(M.transmissionMapUv),S.push(M.thicknessMapUv),S.push(M.combine),S.push(M.fogExp2),S.push(M.sizeAttenuation),S.push(M.morphTargetsCount),S.push(M.morphAttributeCount),S.push(M.numDirLights),S.push(M.numPointLights),S.push(M.numSpotLights),S.push(M.numSpotLightMaps),S.push(M.numHemiLights),S.push(M.numRectAreaLights),S.push(M.numDirLightShadows),S.push(M.numPointLightShadows),S.push(M.numSpotLightShadows),S.push(M.numSpotLightShadowsWithMaps),S.push(M.numLightProbes),S.push(M.shadowMapType),S.push(M.toneMapping),S.push(M.numClippingPlanes),S.push(M.numClipIntersection),S.push(M.depthPacking)}function x(S,M){l.disableAll(),M.supportsVertexTextures&&l.enable(0),M.instancing&&l.enable(1),M.instancingColor&&l.enable(2),M.instancingMorph&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),M.batching&&l.enable(19),S.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.skinning&&l.enable(4),M.morphTargets&&l.enable(5),M.morphNormals&&l.enable(6),M.morphColors&&l.enable(7),M.premultipliedAlpha&&l.enable(8),M.shadowMapEnabled&&l.enable(9),M.useLegacyLights&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),M.alphaToCoverage&&l.enable(20),S.push(l.mask)}function b(S){let M=v[S.type],k;if(M){let R=Ot[M];k=qa.clone(R.uniforms)}else k=S.uniforms;return k}function N(S,M){let k;for(let R=0,D=h.length;R<D;R++){let B=h[R];if(B.cacheKey===M){k=B,++k.usedTimes;break}}return k===void 0&&(k=new fg(e,M,S,o),h.push(k)),k}function A(S){if(--S.usedTimes===0){let M=h.indexOf(S);h[M]=h[h.length-1],h.pop(),S.destroy()}}function C(S){d.remove(S)}function U(){d.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:b,acquireProgram:N,releaseProgram:A,releaseShaderCache:C,programs:h,dispose:U}}function xg(){let e=new WeakMap;function t(o){let s=e.get(o);return s===void 0&&(s={},e.set(o,s)),s}function i(o){e.delete(o)}function r(o,s,l){e.get(o)[s]=l}function n(){e=new WeakMap}return{get:t,remove:i,update:r,dispose:n}}function yg(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function el(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function tl(){let e=[],t=0,i=[],r=[],n=[];function o(){t=0,i.length=0,r.length=0,n.length=0}function s(u,m,f,v,_,g){let p=e[t];return p===void 0?(p={id:u.id,object:u,geometry:m,material:f,groupOrder:v,renderOrder:u.renderOrder,z:_,group:g},e[t]=p):(p.id=u.id,p.object=u,p.geometry=m,p.material=f,p.groupOrder=v,p.renderOrder=u.renderOrder,p.z=_,p.group=g),t++,p}function l(u,m,f,v,_,g){let p=s(u,m,f,v,_,g);f.transmission>0?r.push(p):f.transparent===!0?n.push(p):i.push(p)}function d(u,m,f,v,_,g){let p=s(u,m,f,v,_,g);f.transmission>0?r.unshift(p):f.transparent===!0?n.unshift(p):i.unshift(p)}function c(u,m){i.length>1&&i.sort(u||yg),r.length>1&&r.sort(m||el),n.length>1&&n.sort(m||el)}function h(){for(let u=t,m=e.length;u<m;u++){let f=e[u];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:i,transmissive:r,transparent:n,init:o,push:l,unshift:d,finish:h,sort:c}}function Sg(){let e=new WeakMap;function t(r,n){let o=e.get(r),s;return o===void 0?(s=new tl,e.set(r,[s])):n>=o.length?(s=new tl,o.push(s)):s=o[n],s}function i(){e=new WeakMap}return{get:t,dispose:i}}function Mg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new I,color:new Ue};break;case"SpotLight":i={position:new I,direction:new I,color:new Ue,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new I,color:new Ue,distance:0,decay:0};break;case"HemisphereLight":i={direction:new I,skyColor:new Ue,groundColor:new Ue};break;case"RectAreaLight":i={color:new Ue,position:new I,halfWidth:new I,halfHeight:new I};break}return e[t.id]=i,i}}}function wg(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ye,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=i,i}}}var Ag=0;function Eg(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function bg(e){let t=new Mg,i=wg(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)r.probe.push(new I);let n=new I,o=new Fe,s=new Fe;function l(c,h){let u=0,m=0,f=0;for(let k=0;k<9;k++)r.probe[k].set(0,0,0);let v=0,_=0,g=0,p=0,y=0,x=0,b=0,N=0,A=0,C=0,U=0;c.sort(Eg);let S=h===!0?Math.PI:1;for(let k=0,R=c.length;k<R;k++){let D=c[k],B=D.color,Z=D.intensity,j=D.distance,Q=D.shadow&&D.shadow.map?D.shadow.map.texture:null;if(D.isAmbientLight)u+=B.r*Z*S,m+=B.g*Z*S,f+=B.b*Z*S;else if(D.isLightProbe){for(let V=0;V<9;V++)r.probe[V].addScaledVector(D.sh.coefficients[V],Z);U++}else if(D.isDirectionalLight){let V=t.get(D);if(V.color.copy(D.color).multiplyScalar(D.intensity*S),D.castShadow){let J=D.shadow,Y=i.get(D);Y.shadowBias=J.bias,Y.shadowNormalBias=J.normalBias,Y.shadowRadius=J.radius,Y.shadowMapSize=J.mapSize,r.directionalShadow[v]=Y,r.directionalShadowMap[v]=Q,r.directionalShadowMatrix[v]=D.shadow.matrix,x++}r.directional[v]=V,v++}else if(D.isSpotLight){let V=t.get(D);V.position.setFromMatrixPosition(D.matrixWorld),V.color.copy(B).multiplyScalar(Z*S),V.distance=j,V.coneCos=Math.cos(D.angle),V.penumbraCos=Math.cos(D.angle*(1-D.penumbra)),V.decay=D.decay,r.spot[g]=V;let J=D.shadow;if(D.map&&(r.spotLightMap[A]=D.map,A++,J.updateMatrices(D),D.castShadow&&C++),r.spotLightMatrix[g]=J.matrix,D.castShadow){let Y=i.get(D);Y.shadowBias=J.bias,Y.shadowNormalBias=J.normalBias,Y.shadowRadius=J.radius,Y.shadowMapSize=J.mapSize,r.spotShadow[g]=Y,r.spotShadowMap[g]=Q,N++}g++}else if(D.isRectAreaLight){let V=t.get(D);V.color.copy(B).multiplyScalar(Z),V.halfWidth.set(D.width*.5,0,0),V.halfHeight.set(0,D.height*.5,0),r.rectArea[p]=V,p++}else if(D.isPointLight){let V=t.get(D);if(V.color.copy(D.color).multiplyScalar(D.intensity*S),V.distance=D.distance,V.decay=D.decay,D.castShadow){let J=D.shadow,Y=i.get(D);Y.shadowBias=J.bias,Y.shadowNormalBias=J.normalBias,Y.shadowRadius=J.radius,Y.shadowMapSize=J.mapSize,Y.shadowCameraNear=J.camera.near,Y.shadowCameraFar=J.camera.far,r.pointShadow[_]=Y,r.pointShadowMap[_]=Q,r.pointShadowMatrix[_]=D.shadow.matrix,b++}r.point[_]=V,_++}else if(D.isHemisphereLight){let V=t.get(D);V.skyColor.copy(D.color).multiplyScalar(Z*S),V.groundColor.copy(D.groundColor).multiplyScalar(Z*S),r.hemi[y]=V,y++}}p>0&&(e.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=_e.LTC_FLOAT_1,r.rectAreaLTC2=_e.LTC_FLOAT_2):(r.rectAreaLTC1=_e.LTC_HALF_1,r.rectAreaLTC2=_e.LTC_HALF_2)),r.ambient[0]=u,r.ambient[1]=m,r.ambient[2]=f;let M=r.hash;(M.directionalLength!==v||M.pointLength!==_||M.spotLength!==g||M.rectAreaLength!==p||M.hemiLength!==y||M.numDirectionalShadows!==x||M.numPointShadows!==b||M.numSpotShadows!==N||M.numSpotMaps!==A||M.numLightProbes!==U)&&(r.directional.length=v,r.spot.length=g,r.rectArea.length=p,r.point.length=_,r.hemi.length=y,r.directionalShadow.length=x,r.directionalShadowMap.length=x,r.pointShadow.length=b,r.pointShadowMap.length=b,r.spotShadow.length=N,r.spotShadowMap.length=N,r.directionalShadowMatrix.length=x,r.pointShadowMatrix.length=b,r.spotLightMatrix.length=N+A-C,r.spotLightMap.length=A,r.numSpotLightShadowsWithMaps=C,r.numLightProbes=U,M.directionalLength=v,M.pointLength=_,M.spotLength=g,M.rectAreaLength=p,M.hemiLength=y,M.numDirectionalShadows=x,M.numPointShadows=b,M.numSpotShadows=N,M.numSpotMaps=A,M.numLightProbes=U,r.version=Ag++)}function d(c,h){let u=0,m=0,f=0,v=0,_=0,g=h.matrixWorldInverse;for(let p=0,y=c.length;p<y;p++){let x=c[p];if(x.isDirectionalLight){let b=r.directional[u];b.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(n),b.direction.transformDirection(g),u++}else if(x.isSpotLight){let b=r.spot[f];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),b.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),b.direction.sub(n),b.direction.transformDirection(g),f++}else if(x.isRectAreaLight){let b=r.rectArea[v];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),s.identity(),o.copy(x.matrixWorld),o.premultiply(g),s.extractRotation(o),b.halfWidth.set(x.width*.5,0,0),b.halfHeight.set(0,x.height*.5,0),b.halfWidth.applyMatrix4(s),b.halfHeight.applyMatrix4(s),v++}else if(x.isPointLight){let b=r.point[m];b.position.setFromMatrixPosition(x.matrixWorld),b.position.applyMatrix4(g),m++}else if(x.isHemisphereLight){let b=r.hemi[_];b.direction.setFromMatrixPosition(x.matrixWorld),b.direction.transformDirection(g),_++}}}return{setup:l,setupView:d,state:r}}function il(e){let t=new bg(e),i=[],r=[];function n(){i.length=0,r.length=0}function o(c){i.push(c)}function s(c){r.push(c)}function l(c){t.setup(i,c)}function d(c){t.setupView(i,c)}return{init:n,state:{lightsArray:i,shadowsArray:r,lights:t,transmissionRenderTarget:null},setupLights:l,setupLightsView:d,pushLight:o,pushShadow:s}}function Cg(e){let t=new WeakMap;function i(n,o=0){let s=t.get(n),l;return s===void 0?(l=new il(e),t.set(n,[l])):o>=s.length?(l=new il(e),s.push(l)):l=s[o],l}function r(){t=new WeakMap}return{get:i,dispose:r}}var Tg=class extends mt{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=uh,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}},Ig=class extends mt{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}},Pg=`void main() {
3742
3742
  gl_Position = vec4( position, 1.0 );
3743
3743
  }`,Ng=`uniform sampler2D shadow_pass;
3744
3744
  uniform vec2 resolution;
@@ -3766,7 +3766,7 @@ void main() {
3766
3766
  squared_mean = squared_mean / samples;
3767
3767
  float std_dev = sqrt( squared_mean - mean * mean );
3768
3768
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3769
- }`;function Lg(e,t,i){let r=new fn,n=new ye,o=new ye,s=new f1,l=new Tg({depthPacking:mh}),d=new Ig,c={},h=i.maxTextureSize,u={[Nt]:tt,[tt]:Nt,[ut]:ut},m=new x1({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},radius:{value:4}},vertexShader:Pg,fragmentShader:Ng}),f=m.clone();f.defines.HORIZONTAL_PASS=1;let v=new Ut;v.setAttribute("position",new X1(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let _=new v1(v,m),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=io;let p=this.type;this.render=function(A,C,U){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||A.length===0)return;let S=e.getRenderTarget(),M=e.getActiveCubeFace(),k=e.getActiveMipmapLevel(),R=e.state;R.setBlending(Yt),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);let D=p!==Xt&&this.type===Xt,V=p===Xt&&this.type!==Xt;for(let q=0,W=A.length;q<W;q++){let Q=A[q],z=Q.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;n.copy(z.mapSize);let J=z.getFrameExtents();if(n.multiply(J),o.copy(z.mapSize),(n.x>h||n.y>h)&&(n.x>h&&(o.x=Math.floor(h/J.x),n.x=o.x*J.x,z.mapSize.x=o.x),n.y>h&&(o.y=Math.floor(h/J.y),n.y=o.y*J.y,z.mapSize.y=o.y)),z.map===null||D===!0||V===!0){let de=this.type!==Xt?{minFilter:u1,magFilter:u1}:{};z.map!==null&&z.map.dispose(),z.map=new S1(n.x,n.y,de),z.map.texture.name=Q.name+".shadowMap",z.camera.updateProjectionMatrix()}e.setRenderTarget(z.map),e.clear();let j=z.getViewportCount();for(let de=0;de<j;de++){let oe=z.getViewport(de);s.set(o.x*oe.x,o.y*oe.y,o.x*oe.z,o.y*oe.w),R.viewport(s),z.updateMatrices(Q,de),r=z.getFrustum(),b(C,U,z.camera,Q,this.type)}z.isPointLightShadow!==!0&&this.type===Xt&&y(z,U),z.needsUpdate=!1}p=this.type,g.needsUpdate=!1,e.setRenderTarget(S,M,k)};function y(A,C){let U=t.update(_);m.defines.VSM_SAMPLES!==A.blurSamples&&(m.defines.VSM_SAMPLES=A.blurSamples,f.defines.VSM_SAMPLES=A.blurSamples,m.needsUpdate=!0,f.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new S1(n.x,n.y)),m.uniforms.shadow_pass.value=A.map.texture,m.uniforms.resolution.value=A.mapSize,m.uniforms.radius.value=A.radius,e.setRenderTarget(A.mapPass),e.clear(),e.renderBufferDirect(C,null,U,m,_,null),f.uniforms.shadow_pass.value=A.mapPass.texture,f.uniforms.resolution.value=A.mapSize,f.uniforms.radius.value=A.radius,e.setRenderTarget(A.map),e.clear(),e.renderBufferDirect(C,null,U,f,_,null)}function x(A,C,U,S){let M=null,k=U.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(k!==void 0)M=k;else if(M=U.isPointLight===!0?d:l,e.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0||C.map&&C.alphaTest>0){let R=M.uuid,D=C.uuid,V=c[R];V===void 0&&(V={},c[R]=V);let q=V[D];q===void 0&&(q=M.clone(),V[D]=q,C.addEventListener("dispose",N)),M=q}if(M.visible=C.visible,M.wireframe=C.wireframe,S===Xt?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:u[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,U.isPointLight===!0&&M.isMeshDistanceMaterial===!0){let R=e.properties.get(M);R.light=U}return M}function b(A,C,U,S,M){if(A.visible===!1)return;if(A.layers.test(C.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&M===Xt)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,A.matrixWorld);let R=t.update(A),D=A.material;if(Array.isArray(D)){let V=R.groups;for(let q=0,W=V.length;q<W;q++){let Q=V[q],z=D[Q.materialIndex];if(z&&z.visible){let J=x(A,z,S,M);A.onBeforeShadow(e,A,C,U,R,J,Q),e.renderBufferDirect(U,null,R,J,A,Q),A.onAfterShadow(e,A,C,U,R,J,Q)}}}else if(D.visible){let V=x(A,D,S,M);A.onBeforeShadow(e,A,C,U,R,V,null),e.renderBufferDirect(U,null,R,V,A,null),A.onAfterShadow(e,A,C,U,R,V,null)}}let k=A.children;for(let R=0,D=k.length;R<D;R++)b(k[R],C,U,S,M)}function N(A){A.target.removeEventListener("dispose",N);for(let C in c){let U=c[C],S=A.target.uuid;S in U&&(U[S].dispose(),delete U[S])}}}function Rg(e){function t(){let P=!1,pe=new f1,se=null,Oe=new f1(0,0,0,0);return{setMask:function(Pe){se!==Pe&&!P&&(e.colorMask(Pe,Pe,Pe,Pe),se=Pe)},setLocked:function(Pe){P=Pe},setClear:function(Pe,Ke,r1,o1,A1){A1===!0&&(Pe*=o1,Ke*=o1,r1*=o1),pe.set(Pe,Ke,r1,o1),Oe.equals(pe)===!1&&(e.clearColor(Pe,Ke,r1,o1),Oe.copy(pe))},reset:function(){P=!1,se=null,Oe.set(-1,0,0,0)}}}function i(){let P=!1,pe=null,se=null,Oe=null;return{setTest:function(Pe){Pe?ce(e.DEPTH_TEST):ae(e.DEPTH_TEST)},setMask:function(Pe){pe!==Pe&&!P&&(e.depthMask(Pe),pe=Pe)},setFunc:function(Pe){if(se!==Pe){switch(Pe){case zd:e.depthFunc(e.NEVER);break;case Vd:e.depthFunc(e.ALWAYS);break;case Bd:e.depthFunc(e.LESS);break;case ya:e.depthFunc(e.LEQUAL);break;case Fd:e.depthFunc(e.EQUAL);break;case Hd:e.depthFunc(e.GEQUAL);break;case Gd:e.depthFunc(e.GREATER);break;case Wd:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}se=Pe}},setLocked:function(Pe){P=Pe},setClear:function(Pe){Oe!==Pe&&(e.clearDepth(Pe),Oe=Pe)},reset:function(){P=!1,pe=null,se=null,Oe=null}}}function r(){let P=!1,pe=null,se=null,Oe=null,Pe=null,Ke=null,r1=null,o1=null,A1=null;return{setTest:function(a1){P||(a1?ce(e.STENCIL_TEST):ae(e.STENCIL_TEST))},setMask:function(a1){pe!==a1&&!P&&(e.stencilMask(a1),pe=a1)},setFunc:function(a1,ue,me){(se!==a1||Oe!==ue||Pe!==me)&&(e.stencilFunc(a1,ue,me),se=a1,Oe=ue,Pe=me)},setOp:function(a1,ue,me){(Ke!==a1||r1!==ue||o1!==me)&&(e.stencilOp(a1,ue,me),Ke=a1,r1=ue,o1=me)},setLocked:function(a1){P=a1},setClear:function(a1){A1!==a1&&(e.clearStencil(a1),A1=a1)},reset:function(){P=!1,pe=null,se=null,Oe=null,Pe=null,Ke=null,r1=null,o1=null,A1=null}}}let n=new t,o=new i,s=new r,l=new WeakMap,d=new WeakMap,c={},h={},u=new WeakMap,m=[],f=null,v=!1,_=null,g=null,p=null,y=null,x=null,b=null,N=null,A=new Ue(0,0,0),C=0,U=!1,S=null,M=null,k=null,R=null,D=null,V=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),q=!1,W=0,Q=e.getParameter(e.VERSION);Q.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Q)[1]),q=W>=1):Q.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),q=W>=2);let z=null,J={},j=e.getParameter(e.SCISSOR_BOX),de=e.getParameter(e.VIEWPORT),oe=new f1().fromArray(j),X=new f1().fromArray(de);function K(P,pe,se,Oe){let Pe=new Uint8Array(4),Ke=e.createTexture();e.bindTexture(P,Ke),e.texParameteri(P,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(P,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let r1=0;r1<se;r1++)P===e.TEXTURE_3D||P===e.TEXTURE_2D_ARRAY?e.texImage3D(pe,0,e.RGBA,1,1,Oe,0,e.RGBA,e.UNSIGNED_BYTE,Pe):e.texImage2D(pe+r1,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,Pe);return Ke}let le={};le[e.TEXTURE_2D]=K(e.TEXTURE_2D,e.TEXTURE_2D,1),le[e.TEXTURE_CUBE_MAP]=K(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[e.TEXTURE_2D_ARRAY]=K(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),le[e.TEXTURE_3D]=K(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),o.setClear(1),s.setClear(0),ce(e.DEPTH_TEST),o.setFunc(ya),Je(!1),Te(to),ce(e.CULL_FACE),Re(Yt);function ce(P){c[P]!==!0&&(e.enable(P),c[P]=!0)}function ae(P){c[P]!==!1&&(e.disable(P),c[P]=!1)}function Me(P,pe){return h[P]!==pe?(e.bindFramebuffer(P,pe),h[P]=pe,P===e.DRAW_FRAMEBUFFER&&(h[e.FRAMEBUFFER]=pe),P===e.FRAMEBUFFER&&(h[e.DRAW_FRAMEBUFFER]=pe),!0):!1}function Be(P,pe){let se=m,Oe=!1;if(P){se=u.get(pe),se===void 0&&(se=[],u.set(pe,se));let Pe=P.textures;if(se.length!==Pe.length||se[0]!==e.COLOR_ATTACHMENT0){for(let Ke=0,r1=Pe.length;Ke<r1;Ke++)se[Ke]=e.COLOR_ATTACHMENT0+Ke;se.length=Pe.length,Oe=!0}}else se[0]!==e.BACK&&(se[0]=e.BACK,Oe=!0);Oe&&e.drawBuffers(se)}function O(P){return f!==P?(e.useProgram(P),f=P,!0):!1}let Ee={[O2]:e.FUNC_ADD,[Sd]:e.FUNC_SUBTRACT,[Md]:e.FUNC_REVERSE_SUBTRACT};Ee[wd]=e.MIN,Ee[Ad]=e.MAX;let ve={[Ed]:e.ZERO,[bd]:e.ONE,[Cd]:e.SRC_COLOR,[L3]:e.SRC_ALPHA,[Rd]:e.SRC_ALPHA_SATURATE,[Nd]:e.DST_COLOR,[Id]:e.DST_ALPHA,[Td]:e.ONE_MINUS_SRC_COLOR,[R3]:e.ONE_MINUS_SRC_ALPHA,[Ld]:e.ONE_MINUS_DST_COLOR,[Pd]:e.ONE_MINUS_DST_ALPHA,[Dd]:e.CONSTANT_COLOR,[Ud]:e.ONE_MINUS_CONSTANT_COLOR,[kd]:e.CONSTANT_ALPHA,[Od]:e.ONE_MINUS_CONSTANT_ALPHA};function Re(P,pe,se,Oe,Pe,Ke,r1,o1,A1,a1){if(P===Yt){v===!0&&(ae(e.BLEND),v=!1);return}if(v===!1&&(ce(e.BLEND),v=!0),P!==yd){if(P!==_||a1!==U){if((g!==O2||x!==O2)&&(e.blendEquation(e.FUNC_ADD),g=O2,x=O2),a1)switch(P){case oi:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case N3:e.blendFunc(e.ONE,e.ONE);break;case ro:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case ao:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",P);break}else switch(P){case oi:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case N3:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case ro:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case ao:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",P);break}p=null,y=null,b=null,N=null,A.set(0,0,0),C=0,_=P,U=a1}return}Pe=Pe||pe,Ke=Ke||se,r1=r1||Oe,(pe!==g||Pe!==x)&&(e.blendEquationSeparate(Ee[pe],Ee[Pe]),g=pe,x=Pe),(se!==p||Oe!==y||Ke!==b||r1!==N)&&(e.blendFuncSeparate(ve[se],ve[Oe],ve[Ke],ve[r1]),p=se,y=Oe,b=Ke,N=r1),(o1.equals(A)===!1||A1!==C)&&(e.blendColor(o1.r,o1.g,o1.b,A1),A.copy(o1),C=A1),_=P,U=!1}function we(P,pe){P.side===ut?ae(e.CULL_FACE):ce(e.CULL_FACE);let se=P.side===tt;pe&&(se=!se),Je(se),P.blending===oi&&P.transparent===!1?Re(Yt):Re(P.blending,P.blendEquation,P.blendSrc,P.blendDst,P.blendEquationAlpha,P.blendSrcAlpha,P.blendDstAlpha,P.blendColor,P.blendAlpha,P.premultipliedAlpha),o.setFunc(P.depthFunc),o.setTest(P.depthTest),o.setMask(P.depthWrite),n.setMask(P.colorWrite);let Oe=P.stencilWrite;s.setTest(Oe),Oe&&(s.setMask(P.stencilWriteMask),s.setFunc(P.stencilFunc,P.stencilRef,P.stencilFuncMask),s.setOp(P.stencilFail,P.stencilZFail,P.stencilZPass)),w(P.polygonOffset,P.polygonOffsetFactor,P.polygonOffsetUnits),P.alphaToCoverage===!0?ce(e.SAMPLE_ALPHA_TO_COVERAGE):ae(e.SAMPLE_ALPHA_TO_COVERAGE)}function Je(P){S!==P&&(P?e.frontFace(e.CW):e.frontFace(e.CCW),S=P)}function Te(P){P!==_d?(ce(e.CULL_FACE),P!==M&&(P===to?e.cullFace(e.BACK):P===vd?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):ae(e.CULL_FACE),M=P}function T(P){P!==k&&(q&&e.lineWidth(P),k=P)}function w(P,pe,se){P?(ce(e.POLYGON_OFFSET_FILL),(R!==pe||D!==se)&&(e.polygonOffset(pe,se),R=pe,D=se)):ae(e.POLYGON_OFFSET_FILL)}function G(P){P?ce(e.SCISSOR_TEST):ae(e.SCISSOR_TEST)}function $(P){P===void 0&&(P=e.TEXTURE0+V-1),z!==P&&(e.activeTexture(P),z=P)}function re(P,pe,se){se===void 0&&(z===null?se=e.TEXTURE0+V-1:se=z);let Oe=J[se];Oe===void 0&&(Oe={type:void 0,texture:void 0},J[se]=Oe),(Oe.type!==P||Oe.texture!==pe)&&(z!==se&&(e.activeTexture(se),z=se),e.bindTexture(P,pe||le[P]),Oe.type=P,Oe.texture=pe)}function L(){let P=J[z];P!==void 0&&P.type!==void 0&&(e.bindTexture(P.type,null),P.type=void 0,P.texture=void 0)}function ie(){try{e.compressedTexImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function ee(){try{e.compressedTexImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function he(){try{e.texSubImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function fe(){try{e.texSubImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function ne(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Se(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function be(){try{e.texStorage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Ie(){try{e.texStorage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Ae(){try{e.texImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Xe(){try{e.texImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function ze(P){oe.equals(P)===!1&&(e.scissor(P.x,P.y,P.z,P.w),oe.copy(P))}function e1(P){X.equals(P)===!1&&(e.viewport(P.x,P.y,P.z,P.w),X.copy(P))}function i1(P,pe){let se=d.get(pe);se===void 0&&(se=new WeakMap,d.set(pe,se));let Oe=se.get(P);Oe===void 0&&(Oe=e.getUniformBlockIndex(pe,P.name),se.set(P,Oe))}function p1(P,pe){let se=d.get(pe).get(P);l.get(pe)!==se&&(e.uniformBlockBinding(pe,se,P.__bindingPointIndex),l.set(pe,se))}function xe(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},z=null,J={},h={},u=new WeakMap,m=[],f=null,v=!1,_=null,g=null,p=null,y=null,x=null,b=null,N=null,A=new Ue(0,0,0),C=0,U=!1,S=null,M=null,k=null,R=null,D=null,oe.set(0,0,e.canvas.width,e.canvas.height),X.set(0,0,e.canvas.width,e.canvas.height),n.reset(),o.reset(),s.reset()}return{buffers:{color:n,depth:o,stencil:s},enable:ce,disable:ae,bindFramebuffer:Me,drawBuffers:Be,useProgram:O,setBlending:Re,setMaterial:we,setFlipSided:Je,setCullFace:Te,setLineWidth:T,setPolygonOffset:w,setScissorTest:G,activeTexture:$,bindTexture:re,unbindTexture:L,compressedTexImage2D:ie,compressedTexImage3D:ee,texImage2D:Ae,texImage3D:Xe,updateUBOMapping:i1,uniformBlockBinding:p1,texStorage2D:be,texStorage3D:Ie,texSubImage2D:he,texSubImage3D:fe,compressedTexSubImage2D:ne,compressedTexSubImage3D:Se,scissor:ze,viewport:e1,reset:xe}}function Dg(e,t,i,r,n,o,s){let l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ye,h=new WeakMap,u,m=new WeakMap,f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(T,w){return f?new OffscreenCanvas(T,w):Dr("canvas")}function _(T,w,G){let $=1,re=Te(T);if((re.width>G||re.height>G)&&($=G/Math.max(re.width,re.height)),$<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){let L=Math.floor($*re.width),ie=Math.floor($*re.height);u===void 0&&(u=v(L,ie));let ee=w?v(L,ie):u;return ee.width=L,ee.height=ie,ee.getContext("2d").drawImage(T,0,0,L,ie),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+re.width+"x"+re.height+") to ("+L+"x"+ie+")."),ee}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+re.width+"x"+re.height+")."),T;return T}function g(T){return T.generateMipmaps&&T.minFilter!==u1&&T.minFilter!==m1}function p(T){e.generateMipmap(T)}function y(T,w,G,$,re=!1){if(T!==null){if(e[T]!==void 0)return e[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let L=w;if(w===e.RED&&(G===e.FLOAT&&(L=e.R32F),G===e.HALF_FLOAT&&(L=e.R16F),G===e.UNSIGNED_BYTE&&(L=e.R8)),w===e.RED_INTEGER&&(G===e.UNSIGNED_BYTE&&(L=e.R8UI),G===e.UNSIGNED_SHORT&&(L=e.R16UI),G===e.UNSIGNED_INT&&(L=e.R32UI),G===e.BYTE&&(L=e.R8I),G===e.SHORT&&(L=e.R16I),G===e.INT&&(L=e.R32I)),w===e.RG&&(G===e.FLOAT&&(L=e.RG32F),G===e.HALF_FLOAT&&(L=e.RG16F),G===e.UNSIGNED_BYTE&&(L=e.RG8)),w===e.RG_INTEGER&&(G===e.UNSIGNED_BYTE&&(L=e.RG8UI),G===e.UNSIGNED_SHORT&&(L=e.RG16UI),G===e.UNSIGNED_INT&&(L=e.RG32UI),G===e.BYTE&&(L=e.RG8I),G===e.SHORT&&(L=e.RG16I),G===e.INT&&(L=e.RG32I)),w===e.RGB&&G===e.UNSIGNED_INT_5_9_9_9_REV&&(L=e.RGB9_E5),w===e.RGBA){let ie=re?Ea:n1.getTransfer($);G===e.FLOAT&&(L=e.RGBA32F),G===e.HALF_FLOAT&&(L=e.RGBA16F),G===e.UNSIGNED_BYTE&&(L=ie===g1?e.SRGB8_ALPHA8:e.RGBA8),G===e.UNSIGNED_SHORT_4_4_4_4&&(L=e.RGBA4),G===e.UNSIGNED_SHORT_5_5_5_1&&(L=e.RGB5_A1)}return(L===e.R16F||L===e.R32F||L===e.RG16F||L===e.RG32F||L===e.RGBA16F||L===e.RGBA32F)&&t.get("EXT_color_buffer_float"),L}function x(T,w){return g(T)===!0||T.isFramebufferTexture&&T.minFilter!==u1&&T.minFilter!==m1?Math.log2(Math.max(w.width,w.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?w.mipmaps.length:1}function b(T){let w=T.target;w.removeEventListener("dispose",b),A(w),w.isVideoTexture&&h.delete(w)}function N(T){let w=T.target;w.removeEventListener("dispose",N),U(w)}function A(T){let w=r.get(T);if(w.__webglInit===void 0)return;let G=T.source,$=m.get(G);if($){let re=$[w.__cacheKey];re.usedTimes--,re.usedTimes===0&&C(T),Object.keys($).length===0&&m.delete(G)}r.remove(T)}function C(T){let w=r.get(T);e.deleteTexture(w.__webglTexture);let G=T.source,$=m.get(G);delete $[w.__cacheKey],s.memory.textures--}function U(T){let w=r.get(T);if(T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let $=0;$<6;$++){if(Array.isArray(w.__webglFramebuffer[$]))for(let re=0;re<w.__webglFramebuffer[$].length;re++)e.deleteFramebuffer(w.__webglFramebuffer[$][re]);else e.deleteFramebuffer(w.__webglFramebuffer[$]);w.__webglDepthbuffer&&e.deleteRenderbuffer(w.__webglDepthbuffer[$])}else{if(Array.isArray(w.__webglFramebuffer))for(let $=0;$<w.__webglFramebuffer.length;$++)e.deleteFramebuffer(w.__webglFramebuffer[$]);else e.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&e.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&e.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let $=0;$<w.__webglColorRenderbuffer.length;$++)w.__webglColorRenderbuffer[$]&&e.deleteRenderbuffer(w.__webglColorRenderbuffer[$]);w.__webglDepthRenderbuffer&&e.deleteRenderbuffer(w.__webglDepthRenderbuffer)}let G=T.textures;for(let $=0,re=G.length;$<re;$++){let L=r.get(G[$]);L.__webglTexture&&(e.deleteTexture(L.__webglTexture),s.memory.textures--),r.remove(G[$])}r.remove(T)}let S=0;function M(){S=0}function k(){let T=S;return T>=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+n.maxTextures),S+=1,T}function R(T){let w=[];return w.push(T.wrapS),w.push(T.wrapT),w.push(T.wrapR||0),w.push(T.magFilter),w.push(T.minFilter),w.push(T.anisotropy),w.push(T.internalFormat),w.push(T.format),w.push(T.type),w.push(T.generateMipmaps),w.push(T.premultiplyAlpha),w.push(T.flipY),w.push(T.unpackAlignment),w.push(T.colorSpace),w.join()}function D(T,w){let G=r.get(T);if(T.isVideoTexture&&we(T),T.isRenderTargetTexture===!1&&T.version>0&&G.__version!==T.version){let $=T.image;if($===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{oe(G,T,w);return}}i.bindTexture(e.TEXTURE_2D,G.__webglTexture,e.TEXTURE0+w)}function V(T,w){let G=r.get(T);if(T.version>0&&G.__version!==T.version){oe(G,T,w);return}i.bindTexture(e.TEXTURE_2D_ARRAY,G.__webglTexture,e.TEXTURE0+w)}function q(T,w){let G=r.get(T);if(T.version>0&&G.__version!==T.version){oe(G,T,w);return}i.bindTexture(e.TEXTURE_3D,G.__webglTexture,e.TEXTURE0+w)}function W(T,w){let G=r.get(T);if(T.version>0&&G.__version!==T.version){X(G,T,w);return}i.bindTexture(e.TEXTURE_CUBE_MAP,G.__webglTexture,e.TEXTURE0+w)}let Q={[D1]:e.REPEAT,[Lt]:e.CLAMP_TO_EDGE,[Ma]:e.MIRRORED_REPEAT},z={[u1]:e.NEAREST,[lo]:e.NEAREST_MIPMAP_NEAREST,[Tr]:e.NEAREST_MIPMAP_LINEAR,[m1]:e.LINEAR,[wa]:e.LINEAR_MIPMAP_NEAREST,[qt]:e.LINEAR_MIPMAP_LINEAR},J={[ph]:e.NEVER,[Sh]:e.ALWAYS,[gh]:e.LESS,[Zo]:e.LEQUAL,[_h]:e.EQUAL,[yh]:e.GEQUAL,[vh]:e.GREATER,[xh]:e.NOTEQUAL};function j(T,w){if(w.type===Q1&&t.has("OES_texture_float_linear")===!1&&(w.magFilter===m1||w.magFilter===wa||w.magFilter===Tr||w.magFilter===qt||w.minFilter===m1||w.minFilter===wa||w.minFilter===Tr||w.minFilter===qt)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(T,e.TEXTURE_WRAP_S,Q[w.wrapS]),e.texParameteri(T,e.TEXTURE_WRAP_T,Q[w.wrapT]),(T===e.TEXTURE_3D||T===e.TEXTURE_2D_ARRAY)&&e.texParameteri(T,e.TEXTURE_WRAP_R,Q[w.wrapR]),e.texParameteri(T,e.TEXTURE_MAG_FILTER,z[w.magFilter]),e.texParameteri(T,e.TEXTURE_MIN_FILTER,z[w.minFilter]),w.compareFunction&&(e.texParameteri(T,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(T,e.TEXTURE_COMPARE_FUNC,J[w.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===u1||w.minFilter!==Tr&&w.minFilter!==qt||w.type===Q1&&t.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||r.get(w).__currentAnisotropy){let G=t.get("EXT_texture_filter_anisotropic");e.texParameterf(T,G.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,n.getMaxAnisotropy())),r.get(w).__currentAnisotropy=w.anisotropy}}}function de(T,w){let G=!1;T.__webglInit===void 0&&(T.__webglInit=!0,w.addEventListener("dispose",b));let $=w.source,re=m.get($);re===void 0&&(re={},m.set($,re));let L=R(w);if(L!==T.__cacheKey){re[L]===void 0&&(re[L]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,G=!0),re[L].usedTimes++;let ie=re[T.__cacheKey];ie!==void 0&&(re[T.__cacheKey].usedTimes--,ie.usedTimes===0&&C(w)),T.__cacheKey=L,T.__webglTexture=re[L].texture}return G}function oe(T,w,G){let $=e.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&($=e.TEXTURE_2D_ARRAY),w.isData3DTexture&&($=e.TEXTURE_3D);let re=de(T,w),L=w.source;i.bindTexture($,T.__webglTexture,e.TEXTURE0+G);let ie=r.get(L);if(L.version!==ie.__version||re===!0){i.activeTexture(e.TEXTURE0+G);let ee=n1.getPrimaries(n1.workingColorSpace),he=w.colorSpace===m2?null:n1.getPrimaries(w.colorSpace),fe=w.colorSpace===m2||ee===he?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,w.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,fe);let ne=_(w.image,!1,n.maxTextureSize);ne=Je(w,ne);let Se=o.convert(w.format,w.colorSpace),be=o.convert(w.type),Ie=y(w.internalFormat,Se,be,w.colorSpace,w.isVideoTexture);j($,w);let Ae,Xe=w.mipmaps,ze=w.isVideoTexture!==!0&&Ie!==So,e1=ie.__version===void 0||re===!0,i1=L.dataReady,p1=x(w,ne);if(w.isDepthTexture)Ie=e.DEPTH_COMPONENT16,w.type===Q1?Ie=e.DEPTH_COMPONENT32F:w.type===ci?Ie=e.DEPTH_COMPONENT24:w.type===Ir&&(Ie=e.DEPTH24_STENCIL8),e1&&(ze?i.texStorage2D(e.TEXTURE_2D,1,Ie,ne.width,ne.height):i.texImage2D(e.TEXTURE_2D,0,Ie,ne.width,ne.height,0,Se,be,null));else if(w.isDataTexture)if(Xe.length>0){ze&&e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,Xe[0].width,Xe[0].height);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,be,Ae.data):i.texImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Se,be,Ae.data);w.generateMipmaps=!1}else ze?(e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,ne.width,ne.height),i1&&i.texSubImage2D(e.TEXTURE_2D,0,0,0,ne.width,ne.height,Se,be,ne.data)):i.texImage2D(e.TEXTURE_2D,0,Ie,ne.width,ne.height,0,Se,be,ne.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){ze&&e1&&i.texStorage3D(e.TEXTURE_2D_ARRAY,p1,Ie,Xe[0].width,Xe[0].height,ne.depth);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],w.format!==U1?Se!==null?ze?i1&&i.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,xe,0,0,0,Ae.width,Ae.height,ne.depth,Se,Ae.data,0,0):i.compressedTexImage3D(e.TEXTURE_2D_ARRAY,xe,Ie,Ae.width,Ae.height,ne.depth,0,Ae.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze?i1&&i.texSubImage3D(e.TEXTURE_2D_ARRAY,xe,0,0,0,Ae.width,Ae.height,ne.depth,Se,be,Ae.data):i.texImage3D(e.TEXTURE_2D_ARRAY,xe,Ie,Ae.width,Ae.height,ne.depth,0,Se,be,Ae.data)}else{ze&&e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,Xe[0].width,Xe[0].height);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],w.format!==U1?Se!==null?ze?i1&&i.compressedTexSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,Ae.data):i.compressedTexImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,be,Ae.data):i.texImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Se,be,Ae.data)}else if(w.isDataArrayTexture)ze?(e1&&i.texStorage3D(e.TEXTURE_2D_ARRAY,p1,Ie,ne.width,ne.height,ne.depth),i1&&i.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,ne.width,ne.height,ne.depth,Se,be,ne.data)):i.texImage3D(e.TEXTURE_2D_ARRAY,0,Ie,ne.width,ne.height,ne.depth,0,Se,be,ne.data);else if(w.isData3DTexture)ze?(e1&&i.texStorage3D(e.TEXTURE_3D,p1,Ie,ne.width,ne.height,ne.depth),i1&&i.texSubImage3D(e.TEXTURE_3D,0,0,0,0,ne.width,ne.height,ne.depth,Se,be,ne.data)):i.texImage3D(e.TEXTURE_3D,0,Ie,ne.width,ne.height,ne.depth,0,Se,be,ne.data);else if(w.isFramebufferTexture){if(e1)if(ze)i.texStorage2D(e.TEXTURE_2D,p1,Ie,ne.width,ne.height);else{let xe=ne.width,P=ne.height;for(let pe=0;pe<p1;pe++)i.texImage2D(e.TEXTURE_2D,pe,Ie,xe,P,0,Se,be,null),xe>>=1,P>>=1}}else if(Xe.length>0){if(ze&&e1){let xe=Te(Xe[0]);i.texStorage2D(e.TEXTURE_2D,p1,Ie,xe.width,xe.height)}for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Se,be,Ae):i.texImage2D(e.TEXTURE_2D,xe,Ie,Se,be,Ae);w.generateMipmaps=!1}else if(ze){if(e1){let xe=Te(ne);i.texStorage2D(e.TEXTURE_2D,p1,Ie,xe.width,xe.height)}i1&&i.texSubImage2D(e.TEXTURE_2D,0,0,0,Se,be,ne)}else i.texImage2D(e.TEXTURE_2D,0,Ie,Se,be,ne);g(w)&&p($),ie.__version=L.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function X(T,w,G){if(w.image.length!==6)return;let $=de(T,w),re=w.source;i.bindTexture(e.TEXTURE_CUBE_MAP,T.__webglTexture,e.TEXTURE0+G);let L=r.get(re);if(re.version!==L.__version||$===!0){i.activeTexture(e.TEXTURE0+G);let ie=n1.getPrimaries(n1.workingColorSpace),ee=w.colorSpace===m2?null:n1.getPrimaries(w.colorSpace),he=w.colorSpace===m2||ie===ee?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,w.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,he);let fe=w.isCompressedTexture||w.image[0].isCompressedTexture,ne=w.image[0]&&w.image[0].isDataTexture,Se=[];for(let P=0;P<6;P++)!fe&&!ne?Se[P]=_(w.image[P],!0,n.maxCubemapSize):Se[P]=ne?w.image[P].image:w.image[P],Se[P]=Je(w,Se[P]);let be=Se[0],Ie=o.convert(w.format,w.colorSpace),Ae=o.convert(w.type),Xe=y(w.internalFormat,Ie,Ae,w.colorSpace),ze=w.isVideoTexture!==!0,e1=L.__version===void 0||$===!0,i1=re.dataReady,p1=x(w,be);j(e.TEXTURE_CUBE_MAP,w);let xe;if(fe){ze&&e1&&i.texStorage2D(e.TEXTURE_CUBE_MAP,p1,Xe,be.width,be.height);for(let P=0;P<6;P++){xe=Se[P].mipmaps;for(let pe=0;pe<xe.length;pe++){let se=xe[pe];w.format!==U1?Ie!==null?ze?i1&&i.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,0,0,se.width,se.height,Ie,se.data):i.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,Xe,se.width,se.height,0,se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,0,0,se.width,se.height,Ie,Ae,se.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,Xe,se.width,se.height,0,Ie,Ae,se.data)}}}else{if(xe=w.mipmaps,ze&&e1){xe.length>0&&p1++;let P=Te(Se[0]);i.texStorage2D(e.TEXTURE_CUBE_MAP,p1,Xe,P.width,P.height)}for(let P=0;P<6;P++)if(ne){ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,0,0,Se[P].width,Se[P].height,Ie,Ae,Se[P].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,Xe,Se[P].width,Se[P].height,0,Ie,Ae,Se[P].data);for(let pe=0;pe<xe.length;pe++){let se=xe[pe].image[P].image;ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,0,0,se.width,se.height,Ie,Ae,se.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,Xe,se.width,se.height,0,Ie,Ae,se.data)}}else{ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,0,0,Ie,Ae,Se[P]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,Xe,Ie,Ae,Se[P]);for(let pe=0;pe<xe.length;pe++){let se=xe[pe];ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,0,0,Ie,Ae,se.image[P]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,Xe,Ie,Ae,se.image[P])}}}g(w)&&p(e.TEXTURE_CUBE_MAP),L.__version=re.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function K(T,w,G,$,re,L){let ie=o.convert(G.format,G.colorSpace),ee=o.convert(G.type),he=y(G.internalFormat,ie,ee,G.colorSpace);if(!r.get(w).__hasExternalTextures){let fe=Math.max(1,w.width>>L),ne=Math.max(1,w.height>>L);re===e.TEXTURE_3D||re===e.TEXTURE_2D_ARRAY?i.texImage3D(re,L,he,fe,ne,w.depth,0,ie,ee,null):i.texImage2D(re,L,he,fe,ne,0,ie,ee,null)}i.bindFramebuffer(e.FRAMEBUFFER,T),Re(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,$,re,r.get(G).__webglTexture,0,ve(w)):(re===e.TEXTURE_2D||re>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&re<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,$,re,r.get(G).__webglTexture,L),i.bindFramebuffer(e.FRAMEBUFFER,null)}function le(T,w,G){if(e.bindRenderbuffer(e.RENDERBUFFER,T),w.depthBuffer&&!w.stencilBuffer){let $=e.DEPTH_COMPONENT24;if(G||Re(w)){let re=w.depthTexture;re&&re.isDepthTexture&&(re.type===Q1?$=e.DEPTH_COMPONENT32F:re.type===ci&&($=e.DEPTH_COMPONENT24));let L=ve(w);Re(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,L,$,w.width,w.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,L,$,w.width,w.height)}else e.renderbufferStorage(e.RENDERBUFFER,$,w.width,w.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,T)}else if(w.depthBuffer&&w.stencilBuffer){let $=ve(w);G&&Re(w)===!1?e.renderbufferStorageMultisample(e.RENDERBUFFER,$,e.DEPTH24_STENCIL8,w.width,w.height):Re(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,$,e.DEPTH24_STENCIL8,w.width,w.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,w.width,w.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,T)}else{let $=w.textures;for(let re=0;re<$.length;re++){let L=$[re],ie=o.convert(L.format,L.colorSpace),ee=o.convert(L.type),he=y(L.internalFormat,ie,ee,L.colorSpace),fe=ve(w);G&&Re(w)===!1?e.renderbufferStorageMultisample(e.RENDERBUFFER,fe,he,w.width,w.height):Re(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,fe,he,w.width,w.height):e.renderbufferStorage(e.RENDERBUFFER,he,w.width,w.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function ce(T,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(e.FRAMEBUFFER,T),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(w.depthTexture).__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),D(w.depthTexture,0);let G=r.get(w.depthTexture).__webglTexture,$=ve(w);if(w.depthTexture.format===di)Re(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,G,0,$):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,G,0);else if(w.depthTexture.format===Pr)Re(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,G,0,$):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,G,0);else throw new Error("Unknown depthTexture format")}function ae(T){let w=r.get(T),G=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!w.__autoAllocateDepthBuffer){if(G)throw new Error("target.depthTexture not supported in Cube render targets");ce(w.__webglFramebuffer,T)}else if(G){w.__webglDepthbuffer=[];for(let $=0;$<6;$++)i.bindFramebuffer(e.FRAMEBUFFER,w.__webglFramebuffer[$]),w.__webglDepthbuffer[$]=e.createRenderbuffer(),le(w.__webglDepthbuffer[$],T,!1)}else i.bindFramebuffer(e.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer=e.createRenderbuffer(),le(w.__webglDepthbuffer,T,!1);i.bindFramebuffer(e.FRAMEBUFFER,null)}function Me(T,w,G){let $=r.get(T);w!==void 0&&K($.__webglFramebuffer,T,T.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),G!==void 0&&ae(T)}function Be(T){let w=T.texture,G=r.get(T),$=r.get(w);T.addEventListener("dispose",N);let re=T.textures,L=T.isWebGLCubeRenderTarget===!0,ie=re.length>1;if(ie||($.__webglTexture===void 0&&($.__webglTexture=e.createTexture()),$.__version=w.version,s.memory.textures++),L){G.__webglFramebuffer=[];for(let ee=0;ee<6;ee++)if(w.mipmaps&&w.mipmaps.length>0){G.__webglFramebuffer[ee]=[];for(let he=0;he<w.mipmaps.length;he++)G.__webglFramebuffer[ee][he]=e.createFramebuffer()}else G.__webglFramebuffer[ee]=e.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){G.__webglFramebuffer=[];for(let ee=0;ee<w.mipmaps.length;ee++)G.__webglFramebuffer[ee]=e.createFramebuffer()}else G.__webglFramebuffer=e.createFramebuffer();if(ie)for(let ee=0,he=re.length;ee<he;ee++){let fe=r.get(re[ee]);fe.__webglTexture===void 0&&(fe.__webglTexture=e.createTexture(),s.memory.textures++)}if(T.samples>0&&Re(T)===!1){G.__webglMultisampledFramebuffer=e.createFramebuffer(),G.__webglColorRenderbuffer=[],i.bindFramebuffer(e.FRAMEBUFFER,G.__webglMultisampledFramebuffer);for(let ee=0;ee<re.length;ee++){let he=re[ee];G.__webglColorRenderbuffer[ee]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,G.__webglColorRenderbuffer[ee]);let fe=o.convert(he.format,he.colorSpace),ne=o.convert(he.type),Se=y(he.internalFormat,fe,ne,he.colorSpace,T.isXRRenderTarget===!0),be=ve(T);e.renderbufferStorageMultisample(e.RENDERBUFFER,be,Se,T.width,T.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+ee,e.RENDERBUFFER,G.__webglColorRenderbuffer[ee])}e.bindRenderbuffer(e.RENDERBUFFER,null),T.depthBuffer&&(G.__webglDepthRenderbuffer=e.createRenderbuffer(),le(G.__webglDepthRenderbuffer,T,!0)),i.bindFramebuffer(e.FRAMEBUFFER,null)}}if(L){i.bindTexture(e.TEXTURE_CUBE_MAP,$.__webglTexture),j(e.TEXTURE_CUBE_MAP,w);for(let ee=0;ee<6;ee++)if(w.mipmaps&&w.mipmaps.length>0)for(let he=0;he<w.mipmaps.length;he++)K(G.__webglFramebuffer[ee][he],T,w,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ee,he);else K(G.__webglFramebuffer[ee],T,w,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0);g(w)&&p(e.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(ie){for(let ee=0,he=re.length;ee<he;ee++){let fe=re[ee],ne=r.get(fe);i.bindTexture(e.TEXTURE_2D,ne.__webglTexture),j(e.TEXTURE_2D,fe),K(G.__webglFramebuffer,T,fe,e.COLOR_ATTACHMENT0+ee,e.TEXTURE_2D,0),g(fe)&&p(e.TEXTURE_2D)}i.unbindTexture()}else{let ee=e.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(ee=T.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),i.bindTexture(ee,$.__webglTexture),j(ee,w),w.mipmaps&&w.mipmaps.length>0)for(let he=0;he<w.mipmaps.length;he++)K(G.__webglFramebuffer[he],T,w,e.COLOR_ATTACHMENT0,ee,he);else K(G.__webglFramebuffer,T,w,e.COLOR_ATTACHMENT0,ee,0);g(w)&&p(ee),i.unbindTexture()}T.depthBuffer&&ae(T)}function O(T){let w=T.textures;for(let G=0,$=w.length;G<$;G++){let re=w[G];if(g(re)){let L=T.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,ie=r.get(re).__webglTexture;i.bindTexture(L,ie),p(L),i.unbindTexture()}}}function Ee(T){if(T.samples>0&&Re(T)===!1){let w=T.textures,G=T.width,$=T.height,re=e.COLOR_BUFFER_BIT,L=[],ie=T.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,ee=r.get(T),he=w.length>1;if(he)for(let fe=0;fe<w.length;fe++)i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.RENDERBUFFER,null),i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.TEXTURE_2D,null,0);i.bindFramebuffer(e.READ_FRAMEBUFFER,ee.__webglMultisampledFramebuffer),i.bindFramebuffer(e.DRAW_FRAMEBUFFER,ee.__webglFramebuffer);for(let fe=0;fe<w.length;fe++){L.push(e.COLOR_ATTACHMENT0+fe),T.depthBuffer&&L.push(ie);let ne=ee.__ignoreDepthValues!==void 0?ee.__ignoreDepthValues:!1;if(ne===!1&&(T.depthBuffer&&(re|=e.DEPTH_BUFFER_BIT),T.stencilBuffer&&ee.__isTransmissionRenderTarget!==!0&&(re|=e.STENCIL_BUFFER_BIT)),he&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,ee.__webglColorRenderbuffer[fe]),ne===!0&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[ie]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[ie])),he){let Se=r.get(w[fe]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,Se,0)}e.blitFramebuffer(0,0,G,$,0,0,G,$,re,e.NEAREST),d&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,L)}if(i.bindFramebuffer(e.READ_FRAMEBUFFER,null),i.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),he)for(let fe=0;fe<w.length;fe++){i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.RENDERBUFFER,ee.__webglColorRenderbuffer[fe]);let ne=r.get(w[fe]).__webglTexture;i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.TEXTURE_2D,ne,0)}i.bindFramebuffer(e.DRAW_FRAMEBUFFER,ee.__webglMultisampledFramebuffer)}}function ve(T){return Math.min(n.maxSamples,T.samples)}function Re(T){let w=r.get(T);return T.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function we(T){let w=s.render.frame;h.get(T)!==w&&(h.set(T,w),T.update())}function Je(T,w){let G=T.colorSpace,$=T.format,re=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||G!==k1&&G!==m2&&(n1.getTransfer(G)===g1?($!==U1||re!==Rt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",G)),w}function Te(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=k,this.resetTextureUnits=M,this.setTexture2D=D,this.setTexture2DArray=V,this.setTexture3D=q,this.setTextureCube=W,this.rebindTextures=Me,this.setupRenderTarget=Be,this.updateRenderTargetMipmap=O,this.updateMultisampleRenderTarget=Ee,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=K,this.useMultisampledRTT=Re}function Ug(e,t){function i(r,n=m2){let o,s=n1.getTransfer(n);if(r===Rt)return e.UNSIGNED_BYTE;if(r===uo)return e.UNSIGNED_SHORT_4_4_4_4;if(r===mo)return e.UNSIGNED_SHORT_5_5_5_1;if(r===rh)return e.UNSIGNED_INT_5_9_9_9_REV;if(r===th)return e.BYTE;if(r===ih)return e.SHORT;if(r===co)return e.UNSIGNED_SHORT;if(r===ho)return e.INT;if(r===ci)return e.UNSIGNED_INT;if(r===Q1)return e.FLOAT;if(r===ot)return e.HALF_FLOAT;if(r===ah)return e.ALPHA;if(r===nh)return e.RGB;if(r===U1)return e.RGBA;if(r===oh)return e.LUMINANCE;if(r===sh)return e.LUMINANCE_ALPHA;if(r===di)return e.DEPTH_COMPONENT;if(r===Pr)return e.DEPTH_STENCIL;if(r===k3)return e.RED;if(r===fo)return e.RED_INTEGER;if(r===lh)return e.RG;if(r===po)return e.RG_INTEGER;if(r===go)return e.RGBA_INTEGER;if(r===O3||r===z3||r===V3||r===B3)if(s===g1)if(o=t.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===O3)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===z3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===V3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===B3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===O3)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===z3)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===V3)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===B3)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===_o||r===vo||r===xo||r===yo)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===_o)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===vo)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===xo)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===yo)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===So)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===Mo||r===wo)if(o=t.get("WEBGL_compressed_texture_etc"),o!==null){if(r===Mo)return s===g1?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===wo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===Ao||r===Eo||r===bo||r===Co||r===To||r===Io||r===Po||r===No||r===Lo||r===Ro||r===Do||r===Uo||r===ko||r===Oo)if(o=t.get("WEBGL_compressed_texture_astc"),o!==null){if(r===Ao)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===Eo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===bo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Co)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===To)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Io)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Po)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===No)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Lo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Ro)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Do)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===Uo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ko)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Oo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===F3||r===zo||r===Vo)if(o=t.get("EXT_texture_compression_bptc"),o!==null){if(r===F3)return s===g1?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===zo)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Vo)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===ch||r===Bo||r===Fo||r===Ho)if(o=t.get("EXT_texture_compression_rgtc"),o!==null){if(r===F3)return o.COMPRESSED_RED_RGTC1_EXT;if(r===Bo)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Fo)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Ho)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Ir?e.UNSIGNED_INT_24_8:e[r]!==void 0?e[r]:null}return{convert:i}}var kg=class extends Y1{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},j2=class extends N1{constructor(){super(),this.isGroup=!0,this.type="Group"}},Og={type:"move"},wn=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new j2,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new j2,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new j2,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,n=null,o=null,s=this._targetRay,l=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(let v of e.hand.values()){let _=t.getJointPose(v,i),g=this._getHandJoint(d,v);_!==null&&(g.matrix.fromArray(_.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=_.radius),g.visible=_!==null}let c=d.joints["index-finger-tip"],h=d.joints["thumb-tip"],u=c.position.distanceTo(h.position),m=.02,f=.005;d.inputState.pinching&&u>m+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&u<=m-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(n=t.getPose(e.gripSpace,i),n!==null&&(l.matrix.fromArray(n.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,n.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(n.linearVelocity)):l.hasLinearVelocity=!1,n.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(n.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&n!==null&&(r=n),r!==null&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Og)))}return s!==null&&(s.visible=r!==null),l!==null&&(l.visible=n!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new j2;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},zg=`
3769
+ }`;function Lg(e,t,i){let r=new fn,n=new ye,o=new ye,s=new f1,l=new Tg({depthPacking:mh}),d=new Ig,c={},h=i.maxTextureSize,u={[Nt]:et,[et]:Nt,[ut]:ut},m=new x1({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ye},radius:{value:4}},vertexShader:Pg,fragmentShader:Ng}),f=m.clone();f.defines.HORIZONTAL_PASS=1;let v=new Ut;v.setAttribute("position",new W1(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let _=new v1(v,m),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=io;let p=this.type;this.render=function(A,C,U){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||A.length===0)return;let S=e.getRenderTarget(),M=e.getActiveCubeFace(),k=e.getActiveMipmapLevel(),R=e.state;R.setBlending(Yt),R.buffers.color.setClear(1,1,1,1),R.buffers.depth.setTest(!0),R.setScissorTest(!1);let D=p!==Xt&&this.type===Xt,B=p===Xt&&this.type!==Xt;for(let Z=0,j=A.length;Z<j;Z++){let Q=A[Z],V=Q.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",Q,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;n.copy(V.mapSize);let J=V.getFrameExtents();if(n.multiply(J),o.copy(V.mapSize),(n.x>h||n.y>h)&&(n.x>h&&(o.x=Math.floor(h/J.x),n.x=o.x*J.x,V.mapSize.x=o.x),n.y>h&&(o.y=Math.floor(h/J.y),n.y=o.y*J.y,V.mapSize.y=o.y)),V.map===null||D===!0||B===!0){let he=this.type!==Xt?{minFilter:u1,magFilter:u1}:{};V.map!==null&&V.map.dispose(),V.map=new S1(n.x,n.y,he),V.map.texture.name=Q.name+".shadowMap",V.camera.updateProjectionMatrix()}e.setRenderTarget(V.map),e.clear();let Y=V.getViewportCount();for(let he=0;he<Y;he++){let ne=V.getViewport(he);s.set(o.x*ne.x,o.y*ne.y,o.x*ne.z,o.y*ne.w),R.viewport(s),V.updateMatrices(Q,he),r=V.getFrustum(),b(C,U,V.camera,Q,this.type)}V.isPointLightShadow!==!0&&this.type===Xt&&y(V,U),V.needsUpdate=!1}p=this.type,g.needsUpdate=!1,e.setRenderTarget(S,M,k)};function y(A,C){let U=t.update(_);m.defines.VSM_SAMPLES!==A.blurSamples&&(m.defines.VSM_SAMPLES=A.blurSamples,f.defines.VSM_SAMPLES=A.blurSamples,m.needsUpdate=!0,f.needsUpdate=!0),A.mapPass===null&&(A.mapPass=new S1(n.x,n.y)),m.uniforms.shadow_pass.value=A.map.texture,m.uniforms.resolution.value=A.mapSize,m.uniforms.radius.value=A.radius,e.setRenderTarget(A.mapPass),e.clear(),e.renderBufferDirect(C,null,U,m,_,null),f.uniforms.shadow_pass.value=A.mapPass.texture,f.uniforms.resolution.value=A.mapSize,f.uniforms.radius.value=A.radius,e.setRenderTarget(A.map),e.clear(),e.renderBufferDirect(C,null,U,f,_,null)}function x(A,C,U,S){let M=null,k=U.isPointLight===!0?A.customDistanceMaterial:A.customDepthMaterial;if(k!==void 0)M=k;else if(M=U.isPointLight===!0?d:l,e.localClippingEnabled&&C.clipShadows===!0&&Array.isArray(C.clippingPlanes)&&C.clippingPlanes.length!==0||C.displacementMap&&C.displacementScale!==0||C.alphaMap&&C.alphaTest>0||C.map&&C.alphaTest>0){let R=M.uuid,D=C.uuid,B=c[R];B===void 0&&(B={},c[R]=B);let Z=B[D];Z===void 0&&(Z=M.clone(),B[D]=Z,C.addEventListener("dispose",N)),M=Z}if(M.visible=C.visible,M.wireframe=C.wireframe,S===Xt?M.side=C.shadowSide!==null?C.shadowSide:C.side:M.side=C.shadowSide!==null?C.shadowSide:u[C.side],M.alphaMap=C.alphaMap,M.alphaTest=C.alphaTest,M.map=C.map,M.clipShadows=C.clipShadows,M.clippingPlanes=C.clippingPlanes,M.clipIntersection=C.clipIntersection,M.displacementMap=C.displacementMap,M.displacementScale=C.displacementScale,M.displacementBias=C.displacementBias,M.wireframeLinewidth=C.wireframeLinewidth,M.linewidth=C.linewidth,U.isPointLight===!0&&M.isMeshDistanceMaterial===!0){let R=e.properties.get(M);R.light=U}return M}function b(A,C,U,S,M){if(A.visible===!1)return;if(A.layers.test(C.layers)&&(A.isMesh||A.isLine||A.isPoints)&&(A.castShadow||A.receiveShadow&&M===Xt)&&(!A.frustumCulled||r.intersectsObject(A))){A.modelViewMatrix.multiplyMatrices(U.matrixWorldInverse,A.matrixWorld);let R=t.update(A),D=A.material;if(Array.isArray(D)){let B=R.groups;for(let Z=0,j=B.length;Z<j;Z++){let Q=B[Z],V=D[Q.materialIndex];if(V&&V.visible){let J=x(A,V,S,M);A.onBeforeShadow(e,A,C,U,R,J,Q),e.renderBufferDirect(U,null,R,J,A,Q),A.onAfterShadow(e,A,C,U,R,J,Q)}}}else if(D.visible){let B=x(A,D,S,M);A.onBeforeShadow(e,A,C,U,R,B,null),e.renderBufferDirect(U,null,R,B,A,null),A.onAfterShadow(e,A,C,U,R,B,null)}}let k=A.children;for(let R=0,D=k.length;R<D;R++)b(k[R],C,U,S,M)}function N(A){A.target.removeEventListener("dispose",N);for(let C in c){let U=c[C],S=A.target.uuid;S in U&&(U[S].dispose(),delete U[S])}}}function Rg(e){function t(){let P=!1,pe=new f1,se=null,Oe=new f1(0,0,0,0);return{setMask:function(Pe){se!==Pe&&!P&&(e.colorMask(Pe,Pe,Pe,Pe),se=Pe)},setLocked:function(Pe){P=Pe},setClear:function(Pe,Ke,r1,o1,A1){A1===!0&&(Pe*=o1,Ke*=o1,r1*=o1),pe.set(Pe,Ke,r1,o1),Oe.equals(pe)===!1&&(e.clearColor(Pe,Ke,r1,o1),Oe.copy(pe))},reset:function(){P=!1,se=null,Oe.set(-1,0,0,0)}}}function i(){let P=!1,pe=null,se=null,Oe=null;return{setTest:function(Pe){Pe?de(e.DEPTH_TEST):ae(e.DEPTH_TEST)},setMask:function(Pe){pe!==Pe&&!P&&(e.depthMask(Pe),pe=Pe)},setFunc:function(Pe){if(se!==Pe){switch(Pe){case zd:e.depthFunc(e.NEVER);break;case Vd:e.depthFunc(e.ALWAYS);break;case Bd:e.depthFunc(e.LESS);break;case ya:e.depthFunc(e.LEQUAL);break;case Fd:e.depthFunc(e.EQUAL);break;case Hd:e.depthFunc(e.GEQUAL);break;case Gd:e.depthFunc(e.GREATER);break;case Wd:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}se=Pe}},setLocked:function(Pe){P=Pe},setClear:function(Pe){Oe!==Pe&&(e.clearDepth(Pe),Oe=Pe)},reset:function(){P=!1,pe=null,se=null,Oe=null}}}function r(){let P=!1,pe=null,se=null,Oe=null,Pe=null,Ke=null,r1=null,o1=null,A1=null;return{setTest:function(a1){P||(a1?de(e.STENCIL_TEST):ae(e.STENCIL_TEST))},setMask:function(a1){pe!==a1&&!P&&(e.stencilMask(a1),pe=a1)},setFunc:function(a1,at,L1){(se!==a1||Oe!==at||Pe!==L1)&&(e.stencilFunc(a1,at,L1),se=a1,Oe=at,Pe=L1)},setOp:function(a1,at,L1){(Ke!==a1||r1!==at||o1!==L1)&&(e.stencilOp(a1,at,L1),Ke=a1,r1=at,o1=L1)},setLocked:function(a1){P=a1},setClear:function(a1){A1!==a1&&(e.clearStencil(a1),A1=a1)},reset:function(){P=!1,pe=null,se=null,Oe=null,Pe=null,Ke=null,r1=null,o1=null,A1=null}}}let n=new t,o=new i,s=new r,l=new WeakMap,d=new WeakMap,c={},h={},u=new WeakMap,m=[],f=null,v=!1,_=null,g=null,p=null,y=null,x=null,b=null,N=null,A=new Ue(0,0,0),C=0,U=!1,S=null,M=null,k=null,R=null,D=null,B=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Z=!1,j=0,Q=e.getParameter(e.VERSION);Q.indexOf("WebGL")!==-1?(j=parseFloat(/^WebGL (\d)/.exec(Q)[1]),Z=j>=1):Q.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(Q)[1]),Z=j>=2);let V=null,J={},Y=e.getParameter(e.SCISSOR_BOX),he=e.getParameter(e.VIEWPORT),ne=new f1().fromArray(Y),q=new f1().fromArray(he);function K(P,pe,se,Oe){let Pe=new Uint8Array(4),Ke=e.createTexture();e.bindTexture(P,Ke),e.texParameteri(P,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(P,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let r1=0;r1<se;r1++)P===e.TEXTURE_3D||P===e.TEXTURE_2D_ARRAY?e.texImage3D(pe,0,e.RGBA,1,1,Oe,0,e.RGBA,e.UNSIGNED_BYTE,Pe):e.texImage2D(pe+r1,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,Pe);return Ke}let le={};le[e.TEXTURE_2D]=K(e.TEXTURE_2D,e.TEXTURE_2D,1),le[e.TEXTURE_CUBE_MAP]=K(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),le[e.TEXTURE_2D_ARRAY]=K(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),le[e.TEXTURE_3D]=K(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),o.setClear(1),s.setClear(0),de(e.DEPTH_TEST),o.setFunc(ya),Qe(!1),Ce(to),de(e.CULL_FACE),Le(Yt);function de(P){c[P]!==!0&&(e.enable(P),c[P]=!0)}function ae(P){c[P]!==!1&&(e.disable(P),c[P]=!1)}function Me(P,pe){return h[P]!==pe?(e.bindFramebuffer(P,pe),h[P]=pe,P===e.DRAW_FRAMEBUFFER&&(h[e.FRAMEBUFFER]=pe),P===e.FRAMEBUFFER&&(h[e.DRAW_FRAMEBUFFER]=pe),!0):!1}function Be(P,pe){let se=m,Oe=!1;if(P){se=u.get(pe),se===void 0&&(se=[],u.set(pe,se));let Pe=P.textures;if(se.length!==Pe.length||se[0]!==e.COLOR_ATTACHMENT0){for(let Ke=0,r1=Pe.length;Ke<r1;Ke++)se[Ke]=e.COLOR_ATTACHMENT0+Ke;se.length=Pe.length,Oe=!0}}else se[0]!==e.BACK&&(se[0]=e.BACK,Oe=!0);Oe&&e.drawBuffers(se)}function z(P){return f!==P?(e.useProgram(P),f=P,!0):!1}let Ee={[O2]:e.FUNC_ADD,[Sd]:e.FUNC_SUBTRACT,[Md]:e.FUNC_REVERSE_SUBTRACT};Ee[wd]=e.MIN,Ee[Ad]=e.MAX;let ve={[Ed]:e.ZERO,[bd]:e.ONE,[Cd]:e.SRC_COLOR,[L3]:e.SRC_ALPHA,[Rd]:e.SRC_ALPHA_SATURATE,[Nd]:e.DST_COLOR,[Id]:e.DST_ALPHA,[Td]:e.ONE_MINUS_SRC_COLOR,[R3]:e.ONE_MINUS_SRC_ALPHA,[Ld]:e.ONE_MINUS_DST_COLOR,[Pd]:e.ONE_MINUS_DST_ALPHA,[Dd]:e.CONSTANT_COLOR,[Ud]:e.ONE_MINUS_CONSTANT_COLOR,[kd]:e.CONSTANT_ALPHA,[Od]:e.ONE_MINUS_CONSTANT_ALPHA};function Le(P,pe,se,Oe,Pe,Ke,r1,o1,A1,a1){if(P===Yt){v===!0&&(ae(e.BLEND),v=!1);return}if(v===!1&&(de(e.BLEND),v=!0),P!==yd){if(P!==_||a1!==U){if((g!==O2||x!==O2)&&(e.blendEquation(e.FUNC_ADD),g=O2,x=O2),a1)switch(P){case ni:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case N3:e.blendFunc(e.ONE,e.ONE);break;case ro:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case ao:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",P);break}else switch(P){case ni:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case N3:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case ro:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case ao:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",P);break}p=null,y=null,b=null,N=null,A.set(0,0,0),C=0,_=P,U=a1}return}Pe=Pe||pe,Ke=Ke||se,r1=r1||Oe,(pe!==g||Pe!==x)&&(e.blendEquationSeparate(Ee[pe],Ee[Pe]),g=pe,x=Pe),(se!==p||Oe!==y||Ke!==b||r1!==N)&&(e.blendFuncSeparate(ve[se],ve[Oe],ve[Ke],ve[r1]),p=se,y=Oe,b=Ke,N=r1),(o1.equals(A)===!1||A1!==C)&&(e.blendColor(o1.r,o1.g,o1.b,A1),A.copy(o1),C=A1),_=P,U=!1}function we(P,pe){P.side===ut?ae(e.CULL_FACE):de(e.CULL_FACE);let se=P.side===et;pe&&(se=!se),Qe(se),P.blending===ni&&P.transparent===!1?Le(Yt):Le(P.blending,P.blendEquation,P.blendSrc,P.blendDst,P.blendEquationAlpha,P.blendSrcAlpha,P.blendDstAlpha,P.blendColor,P.blendAlpha,P.premultipliedAlpha),o.setFunc(P.depthFunc),o.setTest(P.depthTest),o.setMask(P.depthWrite),n.setMask(P.colorWrite);let Oe=P.stencilWrite;s.setTest(Oe),Oe&&(s.setMask(P.stencilWriteMask),s.setFunc(P.stencilFunc,P.stencilRef,P.stencilFuncMask),s.setOp(P.stencilFail,P.stencilZFail,P.stencilZPass)),w(P.polygonOffset,P.polygonOffsetFactor,P.polygonOffsetUnits),P.alphaToCoverage===!0?de(e.SAMPLE_ALPHA_TO_COVERAGE):ae(e.SAMPLE_ALPHA_TO_COVERAGE)}function Qe(P){S!==P&&(P?e.frontFace(e.CW):e.frontFace(e.CCW),S=P)}function Ce(P){P!==_d?(de(e.CULL_FACE),P!==M&&(P===to?e.cullFace(e.BACK):P===vd?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):ae(e.CULL_FACE),M=P}function T(P){P!==k&&(Z&&e.lineWidth(P),k=P)}function w(P,pe,se){P?(de(e.POLYGON_OFFSET_FILL),(R!==pe||D!==se)&&(e.polygonOffset(pe,se),R=pe,D=se)):ae(e.POLYGON_OFFSET_FILL)}function W(P){P?de(e.SCISSOR_TEST):ae(e.SCISSOR_TEST)}function $(P){P===void 0&&(P=e.TEXTURE0+B-1),V!==P&&(e.activeTexture(P),V=P)}function re(P,pe,se){se===void 0&&(V===null?se=e.TEXTURE0+B-1:se=V);let Oe=J[se];Oe===void 0&&(Oe={type:void 0,texture:void 0},J[se]=Oe),(Oe.type!==P||Oe.texture!==pe)&&(V!==se&&(e.activeTexture(se),V=se),e.bindTexture(P,pe||le[P]),Oe.type=P,Oe.texture=pe)}function L(){let P=J[V];P!==void 0&&P.type!==void 0&&(e.bindTexture(P.type,null),P.type=void 0,P.texture=void 0)}function ie(){try{e.compressedTexImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function ee(){try{e.compressedTexImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function me(){try{e.texSubImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function fe(){try{e.texSubImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function oe(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Se(){try{e.compressedTexSubImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function be(){try{e.texStorage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Ie(){try{e.texStorage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Ae(){try{e.texImage2D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function Xe(){try{e.texImage3D.apply(e,arguments)}catch(P){console.error("THREE.WebGLState:",P)}}function ze(P){ne.equals(P)===!1&&(e.scissor(P.x,P.y,P.z,P.w),ne.copy(P))}function e1(P){q.equals(P)===!1&&(e.viewport(P.x,P.y,P.z,P.w),q.copy(P))}function i1(P,pe){let se=d.get(pe);se===void 0&&(se=new WeakMap,d.set(pe,se));let Oe=se.get(P);Oe===void 0&&(Oe=e.getUniformBlockIndex(pe,P.name),se.set(P,Oe))}function p1(P,pe){let se=d.get(pe).get(P);l.get(pe)!==se&&(e.uniformBlockBinding(pe,se,P.__bindingPointIndex),l.set(pe,se))}function xe(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),c={},V=null,J={},h={},u=new WeakMap,m=[],f=null,v=!1,_=null,g=null,p=null,y=null,x=null,b=null,N=null,A=new Ue(0,0,0),C=0,U=!1,S=null,M=null,k=null,R=null,D=null,ne.set(0,0,e.canvas.width,e.canvas.height),q.set(0,0,e.canvas.width,e.canvas.height),n.reset(),o.reset(),s.reset()}return{buffers:{color:n,depth:o,stencil:s},enable:de,disable:ae,bindFramebuffer:Me,drawBuffers:Be,useProgram:z,setBlending:Le,setMaterial:we,setFlipSided:Qe,setCullFace:Ce,setLineWidth:T,setPolygonOffset:w,setScissorTest:W,activeTexture:$,bindTexture:re,unbindTexture:L,compressedTexImage2D:ie,compressedTexImage3D:ee,texImage2D:Ae,texImage3D:Xe,updateUBOMapping:i1,uniformBlockBinding:p1,texStorage2D:be,texStorage3D:Ie,texSubImage2D:me,texSubImage3D:fe,compressedTexSubImage2D:oe,compressedTexSubImage3D:Se,scissor:ze,viewport:e1,reset:xe}}function Dg(e,t,i,r,n,o,s){let l=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,d=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new ye,h=new WeakMap,u,m=new WeakMap,f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function v(T,w){return f?new OffscreenCanvas(T,w):Rr("canvas")}function _(T,w,W){let $=1,re=Ce(T);if((re.width>W||re.height>W)&&($=W/Math.max(re.width,re.height)),$<1)if(typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&T instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&T instanceof ImageBitmap||typeof VideoFrame<"u"&&T instanceof VideoFrame){let L=Math.floor($*re.width),ie=Math.floor($*re.height);u===void 0&&(u=v(L,ie));let ee=w?v(L,ie):u;return ee.width=L,ee.height=ie,ee.getContext("2d").drawImage(T,0,0,L,ie),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+re.width+"x"+re.height+") to ("+L+"x"+ie+")."),ee}else return"data"in T&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+re.width+"x"+re.height+")."),T;return T}function g(T){return T.generateMipmaps&&T.minFilter!==u1&&T.minFilter!==m1}function p(T){e.generateMipmap(T)}function y(T,w,W,$,re=!1){if(T!==null){if(e[T]!==void 0)return e[T];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+T+"'")}let L=w;if(w===e.RED&&(W===e.FLOAT&&(L=e.R32F),W===e.HALF_FLOAT&&(L=e.R16F),W===e.UNSIGNED_BYTE&&(L=e.R8)),w===e.RED_INTEGER&&(W===e.UNSIGNED_BYTE&&(L=e.R8UI),W===e.UNSIGNED_SHORT&&(L=e.R16UI),W===e.UNSIGNED_INT&&(L=e.R32UI),W===e.BYTE&&(L=e.R8I),W===e.SHORT&&(L=e.R16I),W===e.INT&&(L=e.R32I)),w===e.RG&&(W===e.FLOAT&&(L=e.RG32F),W===e.HALF_FLOAT&&(L=e.RG16F),W===e.UNSIGNED_BYTE&&(L=e.RG8)),w===e.RG_INTEGER&&(W===e.UNSIGNED_BYTE&&(L=e.RG8UI),W===e.UNSIGNED_SHORT&&(L=e.RG16UI),W===e.UNSIGNED_INT&&(L=e.RG32UI),W===e.BYTE&&(L=e.RG8I),W===e.SHORT&&(L=e.RG16I),W===e.INT&&(L=e.RG32I)),w===e.RGB&&W===e.UNSIGNED_INT_5_9_9_9_REV&&(L=e.RGB9_E5),w===e.RGBA){let ie=re?Ea:n1.getTransfer($);W===e.FLOAT&&(L=e.RGBA32F),W===e.HALF_FLOAT&&(L=e.RGBA16F),W===e.UNSIGNED_BYTE&&(L=ie===g1?e.SRGB8_ALPHA8:e.RGBA8),W===e.UNSIGNED_SHORT_4_4_4_4&&(L=e.RGBA4),W===e.UNSIGNED_SHORT_5_5_5_1&&(L=e.RGB5_A1)}return(L===e.R16F||L===e.R32F||L===e.RG16F||L===e.RG32F||L===e.RGBA16F||L===e.RGBA32F)&&t.get("EXT_color_buffer_float"),L}function x(T,w){return g(T)===!0||T.isFramebufferTexture&&T.minFilter!==u1&&T.minFilter!==m1?Math.log2(Math.max(w.width,w.height))+1:T.mipmaps!==void 0&&T.mipmaps.length>0?T.mipmaps.length:T.isCompressedTexture&&Array.isArray(T.image)?w.mipmaps.length:1}function b(T){let w=T.target;w.removeEventListener("dispose",b),A(w),w.isVideoTexture&&h.delete(w)}function N(T){let w=T.target;w.removeEventListener("dispose",N),U(w)}function A(T){let w=r.get(T);if(w.__webglInit===void 0)return;let W=T.source,$=m.get(W);if($){let re=$[w.__cacheKey];re.usedTimes--,re.usedTimes===0&&C(T),Object.keys($).length===0&&m.delete(W)}r.remove(T)}function C(T){let w=r.get(T);e.deleteTexture(w.__webglTexture);let W=T.source,$=m.get(W);delete $[w.__cacheKey],s.memory.textures--}function U(T){let w=r.get(T);if(T.depthTexture&&T.depthTexture.dispose(),T.isWebGLCubeRenderTarget)for(let $=0;$<6;$++){if(Array.isArray(w.__webglFramebuffer[$]))for(let re=0;re<w.__webglFramebuffer[$].length;re++)e.deleteFramebuffer(w.__webglFramebuffer[$][re]);else e.deleteFramebuffer(w.__webglFramebuffer[$]);w.__webglDepthbuffer&&e.deleteRenderbuffer(w.__webglDepthbuffer[$])}else{if(Array.isArray(w.__webglFramebuffer))for(let $=0;$<w.__webglFramebuffer.length;$++)e.deleteFramebuffer(w.__webglFramebuffer[$]);else e.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&e.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&e.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let $=0;$<w.__webglColorRenderbuffer.length;$++)w.__webglColorRenderbuffer[$]&&e.deleteRenderbuffer(w.__webglColorRenderbuffer[$]);w.__webglDepthRenderbuffer&&e.deleteRenderbuffer(w.__webglDepthRenderbuffer)}let W=T.textures;for(let $=0,re=W.length;$<re;$++){let L=r.get(W[$]);L.__webglTexture&&(e.deleteTexture(L.__webglTexture),s.memory.textures--),r.remove(W[$])}r.remove(T)}let S=0;function M(){S=0}function k(){let T=S;return T>=n.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+T+" texture units while this GPU supports only "+n.maxTextures),S+=1,T}function R(T){let w=[];return w.push(T.wrapS),w.push(T.wrapT),w.push(T.wrapR||0),w.push(T.magFilter),w.push(T.minFilter),w.push(T.anisotropy),w.push(T.internalFormat),w.push(T.format),w.push(T.type),w.push(T.generateMipmaps),w.push(T.premultiplyAlpha),w.push(T.flipY),w.push(T.unpackAlignment),w.push(T.colorSpace),w.join()}function D(T,w){let W=r.get(T);if(T.isVideoTexture&&we(T),T.isRenderTargetTexture===!1&&T.version>0&&W.__version!==T.version){let $=T.image;if($===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if($.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ne(W,T,w);return}}i.bindTexture(e.TEXTURE_2D,W.__webglTexture,e.TEXTURE0+w)}function B(T,w){let W=r.get(T);if(T.version>0&&W.__version!==T.version){ne(W,T,w);return}i.bindTexture(e.TEXTURE_2D_ARRAY,W.__webglTexture,e.TEXTURE0+w)}function Z(T,w){let W=r.get(T);if(T.version>0&&W.__version!==T.version){ne(W,T,w);return}i.bindTexture(e.TEXTURE_3D,W.__webglTexture,e.TEXTURE0+w)}function j(T,w){let W=r.get(T);if(T.version>0&&W.__version!==T.version){q(W,T,w);return}i.bindTexture(e.TEXTURE_CUBE_MAP,W.__webglTexture,e.TEXTURE0+w)}let Q={[R1]:e.REPEAT,[Lt]:e.CLAMP_TO_EDGE,[Ma]:e.MIRRORED_REPEAT},V={[u1]:e.NEAREST,[lo]:e.NEAREST_MIPMAP_NEAREST,[Cr]:e.NEAREST_MIPMAP_LINEAR,[m1]:e.LINEAR,[wa]:e.LINEAR_MIPMAP_NEAREST,[qt]:e.LINEAR_MIPMAP_LINEAR},J={[ph]:e.NEVER,[Sh]:e.ALWAYS,[gh]:e.LESS,[Zo]:e.LEQUAL,[_h]:e.EQUAL,[yh]:e.GEQUAL,[vh]:e.GREATER,[xh]:e.NOTEQUAL};function Y(T,w){if(w.type===q1&&t.has("OES_texture_float_linear")===!1&&(w.magFilter===m1||w.magFilter===wa||w.magFilter===Cr||w.magFilter===qt||w.minFilter===m1||w.minFilter===wa||w.minFilter===Cr||w.minFilter===qt)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),e.texParameteri(T,e.TEXTURE_WRAP_S,Q[w.wrapS]),e.texParameteri(T,e.TEXTURE_WRAP_T,Q[w.wrapT]),(T===e.TEXTURE_3D||T===e.TEXTURE_2D_ARRAY)&&e.texParameteri(T,e.TEXTURE_WRAP_R,Q[w.wrapR]),e.texParameteri(T,e.TEXTURE_MAG_FILTER,V[w.magFilter]),e.texParameteri(T,e.TEXTURE_MIN_FILTER,V[w.minFilter]),w.compareFunction&&(e.texParameteri(T,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(T,e.TEXTURE_COMPARE_FUNC,J[w.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===u1||w.minFilter!==Cr&&w.minFilter!==qt||w.type===q1&&t.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||r.get(w).__currentAnisotropy){let W=t.get("EXT_texture_filter_anisotropic");e.texParameterf(T,W.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,n.getMaxAnisotropy())),r.get(w).__currentAnisotropy=w.anisotropy}}}function he(T,w){let W=!1;T.__webglInit===void 0&&(T.__webglInit=!0,w.addEventListener("dispose",b));let $=w.source,re=m.get($);re===void 0&&(re={},m.set($,re));let L=R(w);if(L!==T.__cacheKey){re[L]===void 0&&(re[L]={texture:e.createTexture(),usedTimes:0},s.memory.textures++,W=!0),re[L].usedTimes++;let ie=re[T.__cacheKey];ie!==void 0&&(re[T.__cacheKey].usedTimes--,ie.usedTimes===0&&C(w)),T.__cacheKey=L,T.__webglTexture=re[L].texture}return W}function ne(T,w,W){let $=e.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&($=e.TEXTURE_2D_ARRAY),w.isData3DTexture&&($=e.TEXTURE_3D);let re=he(T,w),L=w.source;i.bindTexture($,T.__webglTexture,e.TEXTURE0+W);let ie=r.get(L);if(L.version!==ie.__version||re===!0){i.activeTexture(e.TEXTURE0+W);let ee=n1.getPrimaries(n1.workingColorSpace),me=w.colorSpace===u2?null:n1.getPrimaries(w.colorSpace),fe=w.colorSpace===u2||ee===me?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,w.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,fe);let oe=_(w.image,!1,n.maxTextureSize);oe=Qe(w,oe);let Se=o.convert(w.format,w.colorSpace),be=o.convert(w.type),Ie=y(w.internalFormat,Se,be,w.colorSpace,w.isVideoTexture);Y($,w);let Ae,Xe=w.mipmaps,ze=w.isVideoTexture!==!0&&Ie!==So,e1=ie.__version===void 0||re===!0,i1=L.dataReady,p1=x(w,oe);if(w.isDepthTexture)Ie=e.DEPTH_COMPONENT16,w.type===q1?Ie=e.DEPTH_COMPONENT32F:w.type===li?Ie=e.DEPTH_COMPONENT24:w.type===Tr&&(Ie=e.DEPTH24_STENCIL8),e1&&(ze?i.texStorage2D(e.TEXTURE_2D,1,Ie,oe.width,oe.height):i.texImage2D(e.TEXTURE_2D,0,Ie,oe.width,oe.height,0,Se,be,null));else if(w.isDataTexture)if(Xe.length>0){ze&&e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,Xe[0].width,Xe[0].height);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,be,Ae.data):i.texImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Se,be,Ae.data);w.generateMipmaps=!1}else ze?(e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,oe.width,oe.height),i1&&i.texSubImage2D(e.TEXTURE_2D,0,0,0,oe.width,oe.height,Se,be,oe.data)):i.texImage2D(e.TEXTURE_2D,0,Ie,oe.width,oe.height,0,Se,be,oe.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){ze&&e1&&i.texStorage3D(e.TEXTURE_2D_ARRAY,p1,Ie,Xe[0].width,Xe[0].height,oe.depth);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],w.format!==D1?Se!==null?ze?i1&&i.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,xe,0,0,0,Ae.width,Ae.height,oe.depth,Se,Ae.data,0,0):i.compressedTexImage3D(e.TEXTURE_2D_ARRAY,xe,Ie,Ae.width,Ae.height,oe.depth,0,Ae.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze?i1&&i.texSubImage3D(e.TEXTURE_2D_ARRAY,xe,0,0,0,Ae.width,Ae.height,oe.depth,Se,be,Ae.data):i.texImage3D(e.TEXTURE_2D_ARRAY,xe,Ie,Ae.width,Ae.height,oe.depth,0,Se,be,Ae.data)}else{ze&&e1&&i.texStorage2D(e.TEXTURE_2D,p1,Ie,Xe[0].width,Xe[0].height);for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],w.format!==D1?Se!==null?ze?i1&&i.compressedTexSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,Ae.data):i.compressedTexImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Ae.width,Ae.height,Se,be,Ae.data):i.texImage2D(e.TEXTURE_2D,xe,Ie,Ae.width,Ae.height,0,Se,be,Ae.data)}else if(w.isDataArrayTexture)ze?(e1&&i.texStorage3D(e.TEXTURE_2D_ARRAY,p1,Ie,oe.width,oe.height,oe.depth),i1&&i.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,oe.width,oe.height,oe.depth,Se,be,oe.data)):i.texImage3D(e.TEXTURE_2D_ARRAY,0,Ie,oe.width,oe.height,oe.depth,0,Se,be,oe.data);else if(w.isData3DTexture)ze?(e1&&i.texStorage3D(e.TEXTURE_3D,p1,Ie,oe.width,oe.height,oe.depth),i1&&i.texSubImage3D(e.TEXTURE_3D,0,0,0,0,oe.width,oe.height,oe.depth,Se,be,oe.data)):i.texImage3D(e.TEXTURE_3D,0,Ie,oe.width,oe.height,oe.depth,0,Se,be,oe.data);else if(w.isFramebufferTexture){if(e1)if(ze)i.texStorage2D(e.TEXTURE_2D,p1,Ie,oe.width,oe.height);else{let xe=oe.width,P=oe.height;for(let pe=0;pe<p1;pe++)i.texImage2D(e.TEXTURE_2D,pe,Ie,xe,P,0,Se,be,null),xe>>=1,P>>=1}}else if(Xe.length>0){if(ze&&e1){let xe=Ce(Xe[0]);i.texStorage2D(e.TEXTURE_2D,p1,Ie,xe.width,xe.height)}for(let xe=0,P=Xe.length;xe<P;xe++)Ae=Xe[xe],ze?i1&&i.texSubImage2D(e.TEXTURE_2D,xe,0,0,Se,be,Ae):i.texImage2D(e.TEXTURE_2D,xe,Ie,Se,be,Ae);w.generateMipmaps=!1}else if(ze){if(e1){let xe=Ce(oe);i.texStorage2D(e.TEXTURE_2D,p1,Ie,xe.width,xe.height)}i1&&i.texSubImage2D(e.TEXTURE_2D,0,0,0,Se,be,oe)}else i.texImage2D(e.TEXTURE_2D,0,Ie,Se,be,oe);g(w)&&p($),ie.__version=L.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function q(T,w,W){if(w.image.length!==6)return;let $=he(T,w),re=w.source;i.bindTexture(e.TEXTURE_CUBE_MAP,T.__webglTexture,e.TEXTURE0+W);let L=r.get(re);if(re.version!==L.__version||$===!0){i.activeTexture(e.TEXTURE0+W);let ie=n1.getPrimaries(n1.workingColorSpace),ee=w.colorSpace===u2?null:n1.getPrimaries(w.colorSpace),me=w.colorSpace===u2||ie===ee?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,w.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,w.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,me);let fe=w.isCompressedTexture||w.image[0].isCompressedTexture,oe=w.image[0]&&w.image[0].isDataTexture,Se=[];for(let P=0;P<6;P++)!fe&&!oe?Se[P]=_(w.image[P],!0,n.maxCubemapSize):Se[P]=oe?w.image[P].image:w.image[P],Se[P]=Qe(w,Se[P]);let be=Se[0],Ie=o.convert(w.format,w.colorSpace),Ae=o.convert(w.type),Xe=y(w.internalFormat,Ie,Ae,w.colorSpace),ze=w.isVideoTexture!==!0,e1=L.__version===void 0||$===!0,i1=re.dataReady,p1=x(w,be);Y(e.TEXTURE_CUBE_MAP,w);let xe;if(fe){ze&&e1&&i.texStorage2D(e.TEXTURE_CUBE_MAP,p1,Xe,be.width,be.height);for(let P=0;P<6;P++){xe=Se[P].mipmaps;for(let pe=0;pe<xe.length;pe++){let se=xe[pe];w.format!==D1?Ie!==null?ze?i1&&i.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,0,0,se.width,se.height,Ie,se.data):i.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,Xe,se.width,se.height,0,se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,0,0,se.width,se.height,Ie,Ae,se.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe,Xe,se.width,se.height,0,Ie,Ae,se.data)}}}else{if(xe=w.mipmaps,ze&&e1){xe.length>0&&p1++;let P=Ce(Se[0]);i.texStorage2D(e.TEXTURE_CUBE_MAP,p1,Xe,P.width,P.height)}for(let P=0;P<6;P++)if(oe){ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,0,0,Se[P].width,Se[P].height,Ie,Ae,Se[P].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,Xe,Se[P].width,Se[P].height,0,Ie,Ae,Se[P].data);for(let pe=0;pe<xe.length;pe++){let se=xe[pe].image[P].image;ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,0,0,se.width,se.height,Ie,Ae,se.data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,Xe,se.width,se.height,0,Ie,Ae,se.data)}}else{ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,0,0,Ie,Ae,Se[P]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,0,Xe,Ie,Ae,Se[P]);for(let pe=0;pe<xe.length;pe++){let se=xe[pe];ze?i1&&i.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,0,0,Ie,Ae,se.image[P]):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+P,pe+1,Xe,Ie,Ae,se.image[P])}}}g(w)&&p(e.TEXTURE_CUBE_MAP),L.__version=re.version,w.onUpdate&&w.onUpdate(w)}T.__version=w.version}function K(T,w,W,$,re,L){let ie=o.convert(W.format,W.colorSpace),ee=o.convert(W.type),me=y(W.internalFormat,ie,ee,W.colorSpace);if(!r.get(w).__hasExternalTextures){let fe=Math.max(1,w.width>>L),oe=Math.max(1,w.height>>L);re===e.TEXTURE_3D||re===e.TEXTURE_2D_ARRAY?i.texImage3D(re,L,me,fe,oe,w.depth,0,ie,ee,null):i.texImage2D(re,L,me,fe,oe,0,ie,ee,null)}i.bindFramebuffer(e.FRAMEBUFFER,T),Le(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,$,re,r.get(W).__webglTexture,0,ve(w)):(re===e.TEXTURE_2D||re>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&re<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,$,re,r.get(W).__webglTexture,L),i.bindFramebuffer(e.FRAMEBUFFER,null)}function le(T,w,W){if(e.bindRenderbuffer(e.RENDERBUFFER,T),w.depthBuffer&&!w.stencilBuffer){let $=e.DEPTH_COMPONENT24;if(W||Le(w)){let re=w.depthTexture;re&&re.isDepthTexture&&(re.type===q1?$=e.DEPTH_COMPONENT32F:re.type===li&&($=e.DEPTH_COMPONENT24));let L=ve(w);Le(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,L,$,w.width,w.height):e.renderbufferStorageMultisample(e.RENDERBUFFER,L,$,w.width,w.height)}else e.renderbufferStorage(e.RENDERBUFFER,$,w.width,w.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,T)}else if(w.depthBuffer&&w.stencilBuffer){let $=ve(w);W&&Le(w)===!1?e.renderbufferStorageMultisample(e.RENDERBUFFER,$,e.DEPTH24_STENCIL8,w.width,w.height):Le(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,$,e.DEPTH24_STENCIL8,w.width,w.height):e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,w.width,w.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,T)}else{let $=w.textures;for(let re=0;re<$.length;re++){let L=$[re],ie=o.convert(L.format,L.colorSpace),ee=o.convert(L.type),me=y(L.internalFormat,ie,ee,L.colorSpace),fe=ve(w);W&&Le(w)===!1?e.renderbufferStorageMultisample(e.RENDERBUFFER,fe,me,w.width,w.height):Le(w)?l.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,fe,me,w.width,w.height):e.renderbufferStorage(e.RENDERBUFFER,me,w.width,w.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function de(T,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(e.FRAMEBUFFER,T),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!r.get(w.depthTexture).__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),D(w.depthTexture,0);let W=r.get(w.depthTexture).__webglTexture,$=ve(w);if(w.depthTexture.format===ci)Le(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,W,0,$):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,W,0);else if(w.depthTexture.format===Ir)Le(w)?l.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,W,0,$):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,W,0);else throw new Error("Unknown depthTexture format")}function ae(T){let w=r.get(T),W=T.isWebGLCubeRenderTarget===!0;if(T.depthTexture&&!w.__autoAllocateDepthBuffer){if(W)throw new Error("target.depthTexture not supported in Cube render targets");de(w.__webglFramebuffer,T)}else if(W){w.__webglDepthbuffer=[];for(let $=0;$<6;$++)i.bindFramebuffer(e.FRAMEBUFFER,w.__webglFramebuffer[$]),w.__webglDepthbuffer[$]=e.createRenderbuffer(),le(w.__webglDepthbuffer[$],T,!1)}else i.bindFramebuffer(e.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer=e.createRenderbuffer(),le(w.__webglDepthbuffer,T,!1);i.bindFramebuffer(e.FRAMEBUFFER,null)}function Me(T,w,W){let $=r.get(T);w!==void 0&&K($.__webglFramebuffer,T,T.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),W!==void 0&&ae(T)}function Be(T){let w=T.texture,W=r.get(T),$=r.get(w);T.addEventListener("dispose",N);let re=T.textures,L=T.isWebGLCubeRenderTarget===!0,ie=re.length>1;if(ie||($.__webglTexture===void 0&&($.__webglTexture=e.createTexture()),$.__version=w.version,s.memory.textures++),L){W.__webglFramebuffer=[];for(let ee=0;ee<6;ee++)if(w.mipmaps&&w.mipmaps.length>0){W.__webglFramebuffer[ee]=[];for(let me=0;me<w.mipmaps.length;me++)W.__webglFramebuffer[ee][me]=e.createFramebuffer()}else W.__webglFramebuffer[ee]=e.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){W.__webglFramebuffer=[];for(let ee=0;ee<w.mipmaps.length;ee++)W.__webglFramebuffer[ee]=e.createFramebuffer()}else W.__webglFramebuffer=e.createFramebuffer();if(ie)for(let ee=0,me=re.length;ee<me;ee++){let fe=r.get(re[ee]);fe.__webglTexture===void 0&&(fe.__webglTexture=e.createTexture(),s.memory.textures++)}if(T.samples>0&&Le(T)===!1){W.__webglMultisampledFramebuffer=e.createFramebuffer(),W.__webglColorRenderbuffer=[],i.bindFramebuffer(e.FRAMEBUFFER,W.__webglMultisampledFramebuffer);for(let ee=0;ee<re.length;ee++){let me=re[ee];W.__webglColorRenderbuffer[ee]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,W.__webglColorRenderbuffer[ee]);let fe=o.convert(me.format,me.colorSpace),oe=o.convert(me.type),Se=y(me.internalFormat,fe,oe,me.colorSpace,T.isXRRenderTarget===!0),be=ve(T);e.renderbufferStorageMultisample(e.RENDERBUFFER,be,Se,T.width,T.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+ee,e.RENDERBUFFER,W.__webglColorRenderbuffer[ee])}e.bindRenderbuffer(e.RENDERBUFFER,null),T.depthBuffer&&(W.__webglDepthRenderbuffer=e.createRenderbuffer(),le(W.__webglDepthRenderbuffer,T,!0)),i.bindFramebuffer(e.FRAMEBUFFER,null)}}if(L){i.bindTexture(e.TEXTURE_CUBE_MAP,$.__webglTexture),Y(e.TEXTURE_CUBE_MAP,w);for(let ee=0;ee<6;ee++)if(w.mipmaps&&w.mipmaps.length>0)for(let me=0;me<w.mipmaps.length;me++)K(W.__webglFramebuffer[ee][me],T,w,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ee,me);else K(W.__webglFramebuffer[ee],T,w,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+ee,0);g(w)&&p(e.TEXTURE_CUBE_MAP),i.unbindTexture()}else if(ie){for(let ee=0,me=re.length;ee<me;ee++){let fe=re[ee],oe=r.get(fe);i.bindTexture(e.TEXTURE_2D,oe.__webglTexture),Y(e.TEXTURE_2D,fe),K(W.__webglFramebuffer,T,fe,e.COLOR_ATTACHMENT0+ee,e.TEXTURE_2D,0),g(fe)&&p(e.TEXTURE_2D)}i.unbindTexture()}else{let ee=e.TEXTURE_2D;if((T.isWebGL3DRenderTarget||T.isWebGLArrayRenderTarget)&&(ee=T.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),i.bindTexture(ee,$.__webglTexture),Y(ee,w),w.mipmaps&&w.mipmaps.length>0)for(let me=0;me<w.mipmaps.length;me++)K(W.__webglFramebuffer[me],T,w,e.COLOR_ATTACHMENT0,ee,me);else K(W.__webglFramebuffer,T,w,e.COLOR_ATTACHMENT0,ee,0);g(w)&&p(ee),i.unbindTexture()}T.depthBuffer&&ae(T)}function z(T){let w=T.textures;for(let W=0,$=w.length;W<$;W++){let re=w[W];if(g(re)){let L=T.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,ie=r.get(re).__webglTexture;i.bindTexture(L,ie),p(L),i.unbindTexture()}}}function Ee(T){if(T.samples>0&&Le(T)===!1){let w=T.textures,W=T.width,$=T.height,re=e.COLOR_BUFFER_BIT,L=[],ie=T.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,ee=r.get(T),me=w.length>1;if(me)for(let fe=0;fe<w.length;fe++)i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.RENDERBUFFER,null),i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.TEXTURE_2D,null,0);i.bindFramebuffer(e.READ_FRAMEBUFFER,ee.__webglMultisampledFramebuffer),i.bindFramebuffer(e.DRAW_FRAMEBUFFER,ee.__webglFramebuffer);for(let fe=0;fe<w.length;fe++){L.push(e.COLOR_ATTACHMENT0+fe),T.depthBuffer&&L.push(ie);let oe=ee.__ignoreDepthValues!==void 0?ee.__ignoreDepthValues:!1;if(oe===!1&&(T.depthBuffer&&(re|=e.DEPTH_BUFFER_BIT),T.stencilBuffer&&ee.__isTransmissionRenderTarget!==!0&&(re|=e.STENCIL_BUFFER_BIT)),me&&e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,ee.__webglColorRenderbuffer[fe]),oe===!0&&(e.invalidateFramebuffer(e.READ_FRAMEBUFFER,[ie]),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[ie])),me){let Se=r.get(w[fe]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,Se,0)}e.blitFramebuffer(0,0,W,$,0,0,W,$,re,e.NEAREST),d&&e.invalidateFramebuffer(e.READ_FRAMEBUFFER,L)}if(i.bindFramebuffer(e.READ_FRAMEBUFFER,null),i.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),me)for(let fe=0;fe<w.length;fe++){i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.RENDERBUFFER,ee.__webglColorRenderbuffer[fe]);let oe=r.get(w[fe]).__webglTexture;i.bindFramebuffer(e.FRAMEBUFFER,ee.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+fe,e.TEXTURE_2D,oe,0)}i.bindFramebuffer(e.DRAW_FRAMEBUFFER,ee.__webglMultisampledFramebuffer)}}function ve(T){return Math.min(n.maxSamples,T.samples)}function Le(T){let w=r.get(T);return T.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function we(T){let w=s.render.frame;h.get(T)!==w&&(h.set(T,w),T.update())}function Qe(T,w){let W=T.colorSpace,$=T.format,re=T.type;return T.isCompressedTexture===!0||T.isVideoTexture===!0||W!==U1&&W!==u2&&(n1.getTransfer(W)===g1?($!==D1||re!==Rt)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",W)),w}function Ce(T){return typeof HTMLImageElement<"u"&&T instanceof HTMLImageElement?(c.width=T.naturalWidth||T.width,c.height=T.naturalHeight||T.height):typeof VideoFrame<"u"&&T instanceof VideoFrame?(c.width=T.displayWidth,c.height=T.displayHeight):(c.width=T.width,c.height=T.height),c}this.allocateTextureUnit=k,this.resetTextureUnits=M,this.setTexture2D=D,this.setTexture2DArray=B,this.setTexture3D=Z,this.setTextureCube=j,this.rebindTextures=Me,this.setupRenderTarget=Be,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=Ee,this.setupDepthRenderbuffer=ae,this.setupFrameBufferTexture=K,this.useMultisampledRTT=Le}function Ug(e,t){function i(r,n=u2){let o,s=n1.getTransfer(n);if(r===Rt)return e.UNSIGNED_BYTE;if(r===uo)return e.UNSIGNED_SHORT_4_4_4_4;if(r===mo)return e.UNSIGNED_SHORT_5_5_5_1;if(r===rh)return e.UNSIGNED_INT_5_9_9_9_REV;if(r===th)return e.BYTE;if(r===ih)return e.SHORT;if(r===co)return e.UNSIGNED_SHORT;if(r===ho)return e.INT;if(r===li)return e.UNSIGNED_INT;if(r===q1)return e.FLOAT;if(r===ot)return e.HALF_FLOAT;if(r===ah)return e.ALPHA;if(r===nh)return e.RGB;if(r===D1)return e.RGBA;if(r===oh)return e.LUMINANCE;if(r===sh)return e.LUMINANCE_ALPHA;if(r===ci)return e.DEPTH_COMPONENT;if(r===Ir)return e.DEPTH_STENCIL;if(r===k3)return e.RED;if(r===fo)return e.RED_INTEGER;if(r===lh)return e.RG;if(r===po)return e.RG_INTEGER;if(r===go)return e.RGBA_INTEGER;if(r===O3||r===z3||r===V3||r===B3)if(s===g1)if(o=t.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(r===O3)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(r===z3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(r===V3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(r===B3)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(r===O3)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===z3)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===V3)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===B3)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(r===_o||r===vo||r===xo||r===yo)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(r===_o)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===vo)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===xo)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===yo)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(r===So)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(r===Mo||r===wo)if(o=t.get("WEBGL_compressed_texture_etc"),o!==null){if(r===Mo)return s===g1?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(r===wo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(r===Ao||r===Eo||r===bo||r===Co||r===To||r===Io||r===Po||r===No||r===Lo||r===Ro||r===Do||r===Uo||r===ko||r===Oo)if(o=t.get("WEBGL_compressed_texture_astc"),o!==null){if(r===Ao)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(r===Eo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(r===bo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(r===Co)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(r===To)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(r===Io)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(r===Po)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(r===No)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(r===Lo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(r===Ro)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(r===Do)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(r===Uo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(r===ko)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(r===Oo)return s===g1?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(r===F3||r===zo||r===Vo)if(o=t.get("EXT_texture_compression_bptc"),o!==null){if(r===F3)return s===g1?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(r===zo)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(r===Vo)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(r===ch||r===Bo||r===Fo||r===Ho)if(o=t.get("EXT_texture_compression_rgtc"),o!==null){if(r===F3)return o.COMPRESSED_RED_RGTC1_EXT;if(r===Bo)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(r===Fo)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(r===Ho)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return r===Tr?e.UNSIGNED_INT_24_8:e[r]!==void 0?e[r]:null}return{convert:i}}var kg=class extends j1{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}},j2=class extends I1{constructor(){super(),this.isGroup=!0,this.type="Group"}},Og={type:"move"},wn=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new j2,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new j2,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new I,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new I),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new j2,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new I,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new I),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){let t=this._hand;if(t)for(let i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,i){let r=null,n=null,o=null,s=this._targetRay,l=this._grip,d=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(d&&e.hand){o=!0;for(let v of e.hand.values()){let _=t.getJointPose(v,i),g=this._getHandJoint(d,v);_!==null&&(g.matrix.fromArray(_.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=_.radius),g.visible=_!==null}let c=d.joints["index-finger-tip"],h=d.joints["thumb-tip"],u=c.position.distanceTo(h.position),m=.02,f=.005;d.inputState.pinching&&u>m+f?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!d.inputState.pinching&&u<=m-f&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(n=t.getPose(e.gripSpace,i),n!==null&&(l.matrix.fromArray(n.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,n.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(n.linearVelocity)):l.hasLinearVelocity=!1,n.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(n.angularVelocity)):l.hasAngularVelocity=!1));s!==null&&(r=t.getPose(e.targetRaySpace,i),r===null&&n!==null&&(r=n),r!==null&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,r.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(r.linearVelocity)):s.hasLinearVelocity=!1,r.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(r.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(Og)))}return s!==null&&(s.visible=r!==null),l!==null&&(l.visible=n!==null),d!==null&&(d.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let i=new j2;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}},zg=`
3770
3770
  void main() {
3771
3771
 
3772
3772
  gl_Position = vec4( position, 1.0 );
@@ -3790,7 +3790,7 @@ void main() {
3790
3790
 
3791
3791
  }
3792
3792
 
3793
- }`,Bg=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let r=new it,n=e.properties.get(r);n.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,r=new x1({vertexShader:zg,fragmentShader:Vg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new v1(new kt(20,20),r)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},Fg=class extends mi{constructor(e,t){super();let i=this,r=null,n=1,o=null,s="local-floor",l=1,d=null,c=null,h=null,u=null,m=null,f=null,v=new Bg,_=t.getContextAttributes(),g=null,p=null,y=[],x=[],b=new ye,N=null,A=new Y1;A.layers.enable(1),A.viewport=new f1;let C=new Y1;C.layers.enable(2),C.viewport=new f1;let U=[A,C],S=new kg;S.layers.enable(1),S.layers.enable(2);let M=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let K=y[X];return K===void 0&&(K=new wn,y[X]=K),K.getTargetRaySpace()},this.getControllerGrip=function(X){let K=y[X];return K===void 0&&(K=new wn,y[X]=K),K.getGripSpace()},this.getHand=function(X){let K=y[X];return K===void 0&&(K=new wn,y[X]=K),K.getHandSpace()};function R(X){let K=x.indexOf(X.inputSource);if(K===-1)return;let le=y[K];le!==void 0&&(le.update(X.inputSource,X.frame,d||o),le.dispatchEvent({type:X.type,data:X.inputSource}))}function D(){r.removeEventListener("select",R),r.removeEventListener("selectstart",R),r.removeEventListener("selectend",R),r.removeEventListener("squeeze",R),r.removeEventListener("squeezestart",R),r.removeEventListener("squeezeend",R),r.removeEventListener("end",D),r.removeEventListener("inputsourceschange",V);for(let X=0;X<y.length;X++){let K=x[X];K!==null&&(x[X]=null,y[X].disconnect(K))}M=null,k=null,v.reset(),e.setRenderTarget(g),m=null,u=null,h=null,r=null,p=null,oe.stop(),i.isPresenting=!1,e.setPixelRatio(N),e.setSize(b.width,b.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){n=X,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){s=X,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||o},this.setReferenceSpace=function(X){d=X},this.getBaseLayer=function(){return u!==null?u:m},this.getBinding=function(){return h},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(X){if(r=X,r!==null){if(g=e.getRenderTarget(),r.addEventListener("select",R),r.addEventListener("selectstart",R),r.addEventListener("selectend",R),r.addEventListener("squeeze",R),r.addEventListener("squeezestart",R),r.addEventListener("squeezeend",R),r.addEventListener("end",D),r.addEventListener("inputsourceschange",V),_.xrCompatible!==!0&&await t.makeXRCompatible(),N=e.getPixelRatio(),e.getSize(b),r.renderState.layers===void 0){let K={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:n};m=new XRWebGLLayer(r,t,K),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),p=new S1(m.framebufferWidth,m.framebufferHeight,{format:U1,type:Rt,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil})}else{let K=null,le=null,ce=null;_.depth&&(ce=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,K=_.stencil?Pr:di,le=_.stencil?Ir:ci);let ae={colorFormat:t.RGBA8,depthFormat:ce,scaleFactor:n};h=new XRWebGLBinding(r,t),u=h.createProjectionLayer(ae),r.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),p=new S1(u.textureWidth,u.textureHeight,{format:U1,type:Rt,depthTexture:new ks(u.textureWidth,u.textureHeight,le,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0});let Me=e.properties.get(p);Me.__ignoreDepthValues=u.ignoreDepthValues}p.isXRRenderTarget=!0,this.setFoveation(l),d=null,o=await r.requestReferenceSpace(s),oe.setContext(r),oe.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function V(X){for(let K=0;K<X.removed.length;K++){let le=X.removed[K],ce=x.indexOf(le);ce>=0&&(x[ce]=null,y[ce].disconnect(le))}for(let K=0;K<X.added.length;K++){let le=X.added[K],ce=x.indexOf(le);if(ce===-1){for(let Me=0;Me<y.length;Me++)if(Me>=x.length){x.push(le),ce=Me;break}else if(x[Me]===null){x[Me]=le,ce=Me;break}if(ce===-1)break}let ae=y[ce];ae&&ae.connect(le)}}let q=new I,W=new I;function Q(X,K,le){q.setFromMatrixPosition(K.matrixWorld),W.setFromMatrixPosition(le.matrixWorld);let ce=q.distanceTo(W),ae=K.projectionMatrix.elements,Me=le.projectionMatrix.elements,Be=ae[14]/(ae[10]-1),O=ae[14]/(ae[10]+1),Ee=(ae[9]+1)/ae[5],ve=(ae[9]-1)/ae[5],Re=(ae[8]-1)/ae[0],we=(Me[8]+1)/Me[0],Je=Be*Re,Te=Be*we,T=ce/(-Re+we),w=T*-Re;K.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(w),X.translateZ(T),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let G=Be+T,$=O+T,re=Je-w,L=Te+(ce-w),ie=Ee*O/$*G,ee=ve*O/$*G;X.projectionMatrix.makePerspective(re,L,ie,ee,G,$),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function z(X,K){K===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(K.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(r===null)return;v.texture!==null&&(X.near=v.depthNear,X.far=v.depthFar),S.near=C.near=A.near=X.near,S.far=C.far=A.far=X.far,(M!==S.near||k!==S.far)&&(r.updateRenderState({depthNear:S.near,depthFar:S.far}),M=S.near,k=S.far,A.near=M,A.far=k,C.near=M,C.far=k,A.updateProjectionMatrix(),C.updateProjectionMatrix(),X.updateProjectionMatrix());let K=X.parent,le=S.cameras;z(S,K);for(let ce=0;ce<le.length;ce++)z(le[ce],K);le.length===2?Q(S,A,C):S.projectionMatrix.copy(A.projectionMatrix),J(X,S,K)};function J(X,K,le){le===null?X.matrix.copy(K.matrixWorld):(X.matrix.copy(le.matrixWorld),X.matrix.invert(),X.matrix.multiply(K.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(K.projectionMatrix),X.projectionMatrixInverse.copy(K.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=fi*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(u===null&&m===null))return l},this.setFoveation=function(X){l=X,u!==null&&(u.fixedFoveation=X),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=X)},this.hasDepthSensing=function(){return v.texture!==null};let j=null;function de(X,K){if(c=K.getViewerPose(d||o),f=K,c!==null){let le=c.views;m!==null&&(e.setRenderTargetFramebuffer(p,m.framebuffer),e.setRenderTarget(p));let ce=!1;le.length!==S.cameras.length&&(S.cameras.length=0,ce=!0);for(let Me=0;Me<le.length;Me++){let Be=le[Me],O=null;if(m!==null)O=m.getViewport(Be);else{let ve=h.getViewSubImage(u,Be);O=ve.viewport,Me===0&&(e.setRenderTargetTextures(p,ve.colorTexture,u.ignoreDepthValues?void 0:ve.depthStencilTexture),e.setRenderTarget(p))}let Ee=U[Me];Ee===void 0&&(Ee=new Y1,Ee.layers.enable(Me),Ee.viewport=new f1,U[Me]=Ee),Ee.matrix.fromArray(Be.transform.matrix),Ee.matrix.decompose(Ee.position,Ee.quaternion,Ee.scale),Ee.projectionMatrix.fromArray(Be.projectionMatrix),Ee.projectionMatrixInverse.copy(Ee.projectionMatrix).invert(),Ee.viewport.set(O.x,O.y,O.width,O.height),Me===0&&(S.matrix.copy(Ee.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),ce===!0&&S.cameras.push(Ee)}let ae=r.enabledFeatures;if(ae&&ae.includes("depth-sensing")){let Me=h.getDepthInformation(le[0]);Me&&Me.isValid&&Me.texture&&v.init(e,Me,r.renderState)}}for(let le=0;le<y.length;le++){let ce=x[le],ae=y[le];ce!==null&&ae!==void 0&&ae.update(ce,K,d||o)}v.render(e,S),j&&j(X,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),f=null}let oe=new Ts;oe.setAnimationLoop(de),this.setAnimationLoop=function(X){j=X},this.dispose=function(){}}},X2=new O1,Hg=new Fe;function Gg(e,t){function i(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function r(g,p){p.color.getRGB(g.fogColor.value,ws(e)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function n(g,p,y,x,b){p.isMeshBasicMaterial||p.isMeshLambertMaterial?o(g,p):p.isMeshToonMaterial?(o(g,p),u(g,p)):p.isMeshPhongMaterial?(o(g,p),h(g,p)):p.isMeshStandardMaterial?(o(g,p),m(g,p),p.isMeshPhysicalMaterial&&f(g,p,b)):p.isMeshMatcapMaterial?(o(g,p),v(g,p)):p.isMeshDepthMaterial?o(g,p):p.isMeshDistanceMaterial?(o(g,p),_(g,p)):p.isMeshNormalMaterial?o(g,p):p.isLineBasicMaterial?(s(g,p),p.isLineDashedMaterial&&l(g,p)):p.isPointsMaterial?d(g,p,y,x):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function o(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,i(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,i(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===tt&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,i(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===tt&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,i(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,i(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,i(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);let y=t.get(p),x=y.envMap,b=y.envMapRotation;if(x&&(g.envMap.value=x,X2.copy(b),X2.x*=-1,X2.y*=-1,X2.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(X2.y*=-1,X2.z*=-1),g.envMapRotation.value.setFromMatrix4(Hg.makeRotationFromEuler(X2)),g.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap){g.lightMap.value=p.lightMap;let N=e._useLegacyLights===!0?Math.PI:1;g.lightMapIntensity.value=p.lightMapIntensity*N,i(p.lightMap,g.lightMapTransform)}p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,i(p.aoMap,g.aoMapTransform))}function s(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,i(p.map,g.mapTransform))}function l(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function d(g,p,y,x){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=x*.5,p.map&&(g.map.value=p.map,i(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,i(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function m(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,i(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,i(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,i(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,i(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,i(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,i(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,i(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===tt&&g.clearcoatNormalScale.value.negate())),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,i(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,i(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,i(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,i(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,i(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,i(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,i(p.specularIntensityMap,g.specularIntensityMapTransform))}function v(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){let y=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:n}}function Wg(e,t,i,r){let n={},o={},s=[],l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function d(y,x){let b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=n[y.id];b===void 0&&(v(y),b=h(y),n[y.id]=b,y.addEventListener("dispose",g));let N=x.program;r.updateUBOMapping(y,N);let A=t.render.frame;o[y.id]!==A&&(m(y),o[y.id]=A)}function h(y){let x=u();y.__bindingPointIndex=x;let b=e.createBuffer(),N=y.__size,A=y.usage;return e.bindBuffer(e.UNIFORM_BUFFER,b),e.bufferData(e.UNIFORM_BUFFER,N,A),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,x,b),b}function u(){for(let y=0;y<l;y++)if(s.indexOf(y)===-1)return s.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(y){let x=n[y.id],b=y.uniforms,N=y.__cache;e.bindBuffer(e.UNIFORM_BUFFER,x);for(let A=0,C=b.length;A<C;A++){let U=Array.isArray(b[A])?b[A]:[b[A]];for(let S=0,M=U.length;S<M;S++){let k=U[S];if(f(k,A,S,N)===!0){let R=k.__offset,D=Array.isArray(k.value)?k.value:[k.value],V=0;for(let q=0;q<D.length;q++){let W=D[q],Q=_(W);typeof W=="number"||typeof W=="boolean"?(k.__data[0]=W,e.bufferSubData(e.UNIFORM_BUFFER,R+V,k.__data)):W.isMatrix3?(k.__data[0]=W.elements[0],k.__data[1]=W.elements[1],k.__data[2]=W.elements[2],k.__data[3]=0,k.__data[4]=W.elements[3],k.__data[5]=W.elements[4],k.__data[6]=W.elements[5],k.__data[7]=0,k.__data[8]=W.elements[6],k.__data[9]=W.elements[7],k.__data[10]=W.elements[8],k.__data[11]=0):(W.toArray(k.__data,V),V+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,R,k.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function f(y,x,b,N){let A=y.value,C=x+"_"+b;if(N[C]===void 0)return typeof A=="number"||typeof A=="boolean"?N[C]=A:N[C]=A.clone(),!0;{let U=N[C];if(typeof A=="number"||typeof A=="boolean"){if(U!==A)return N[C]=A,!0}else if(U.equals(A)===!1)return U.copy(A),!0}return!1}function v(y){let x=y.uniforms,b=0,N=16;for(let C=0,U=x.length;C<U;C++){let S=Array.isArray(x[C])?x[C]:[x[C]];for(let M=0,k=S.length;M<k;M++){let R=S[M],D=Array.isArray(R.value)?R.value:[R.value];for(let V=0,q=D.length;V<q;V++){let W=D[V],Q=_(W),z=b%N;z!==0&&N-z<Q.boundary&&(b+=N-z),R.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=b,b+=Q.storage}}}let A=b%N;return A>0&&(b+=N-A),y.__size=b,y.__cache={},this}function _(y){let x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){let x=y.target;x.removeEventListener("dispose",g);let b=s.indexOf(x.__bindingPointIndex);s.splice(b,1),e.deleteBuffer(n[x.id]),delete n[x.id],delete o[x.id]}function p(){for(let y in n)e.deleteBuffer(n[y]);s=[],n={},o={}}return{bind:d,update:c,dispose:p}}var jg=class{constructor(e={}){let{canvas:t=zh(),context:i=null,depth:r=!0,stencil:n=!1,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:d=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let u;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");u=i.getContextAttributes().alpha}else u=o;let m=new Uint32Array(4),f=new Int32Array(4),v=null,_=null,g=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=J1,this._useLegacyLights=!1,this.toneMapping=u2,this.toneMappingExposure=1;let y=this,x=!1,b=0,N=0,A=null,C=-1,U=null,S=new f1,M=new f1,k=null,R=new Ue(0),D=0,V=t.width,q=t.height,W=1,Q=null,z=null,J=new f1(0,0,V,q),j=new f1(0,0,V,q),de=!1,oe=new fn,X=!1,K=!1,le=new Fe,ce=new ye,ae=new I,Me={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Be(){return A===null?W:1}let O=i;function Ee(E,B){let Y=t.getContext(E,B);return Y!==null?Y:null}try{let E={alpha:!0,depth:r,stencil:n,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:d,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r163"),t.addEventListener("webglcontextlost",P,!1),t.addEventListener("webglcontextrestored",pe,!1),t.addEventListener("webglcontextcreationerror",se,!1),O===null){let B="webgl2";if(O=Ee(B,E),O===null)throw Ee(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let ve,Re,we,Je,Te,T,w,G,$,re,L,ie,ee,he,fe,ne,Se,be,Ie,Ae,Xe,ze,e1,i1;function p1(){ve=new $f(O),ve.init(),Re=new Yf(O,ve,e),ze=new Ug(O,ve),we=new Rg(O),Je=new ip(O),Te=new xg,T=new Dg(O,ve,we,Te,Re,ze,Je),w=new Zf(y),G=new Kf(y),$=new su(O),e1=new jf(O,$),re=new ep(O,$,Je,e1),L=new ap(O,re,$,Je),Ie=new rp(O,Re,T),ne=new qf(Te),ie=new vg(y,w,G,ve,Re,e1,ne),ee=new Gg(y,Te),he=new Sg,fe=new Cg(ve),be=new Wf(y,w,G,we,L,u,l),Se=new Lg(y,L,Re),i1=new Wg(O,Je,Re,we),Ae=new Xf(O,ve,Je),Xe=new tp(O,ve,Je),Je.programs=ie.programs,y.capabilities=Re,y.extensions=ve,y.properties=Te,y.renderLists=he,y.shadowMap=Se,y.state=we,y.info=Je}p1();let xe=new Fg(y,O);this.xr=xe,this.getContext=function(){return O},this.getContextAttributes=function(){return O.getContextAttributes()},this.forceContextLoss=function(){let E=ve.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=ve.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(E){E!==void 0&&(W=E,this.setSize(V,q,!1))},this.getSize=function(E){return E.set(V,q)},this.setSize=function(E,B,Y=!0){if(xe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}V=E,q=B,t.width=Math.floor(E*W),t.height=Math.floor(B*W),Y===!0&&(t.style.width=E+"px",t.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set(V*W,q*W).floor()},this.setDrawingBufferSize=function(E,B,Y){V=E,q=B,W=Y,t.width=Math.floor(E*Y),t.height=Math.floor(B*Y),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(S)},this.getViewport=function(E){return E.copy(J)},this.setViewport=function(E,B,Y,Z){E.isVector4?J.set(E.x,E.y,E.z,E.w):J.set(E,B,Y,Z),we.viewport(S.copy(J).multiplyScalar(W).round())},this.getScissor=function(E){return E.copy(j)},this.setScissor=function(E,B,Y,Z){E.isVector4?j.set(E.x,E.y,E.z,E.w):j.set(E,B,Y,Z),we.scissor(M.copy(j).multiplyScalar(W).round())},this.getScissorTest=function(){return de},this.setScissorTest=function(E){we.setScissorTest(de=E)},this.setOpaqueSort=function(E){Q=E},this.setTransparentSort=function(E){z=E},this.getClearColor=function(E){return E.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(E=!0,B=!0,Y=!0){let Z=0;if(E){let H=!1;if(A!==null){let ge=A.texture.format;H=ge===go||ge===po||ge===fo}if(H){let ge=A.texture.type,Ce=ge===Rt||ge===ci||ge===co||ge===Ir||ge===uo||ge===mo,Ne=be.getClearColor(),Le=be.getClearAlpha(),qe=Ne.r,He=Ne.g,Ge=Ne.b;Ce?(m[0]=qe,m[1]=He,m[2]=Ge,m[3]=Le,O.clearBufferuiv(O.COLOR,0,m)):(f[0]=qe,f[1]=He,f[2]=Ge,f[3]=Le,O.clearBufferiv(O.COLOR,0,f))}else Z|=O.COLOR_BUFFER_BIT}B&&(Z|=O.DEPTH_BUFFER_BIT),Y&&(Z|=O.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),O.clear(Z)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",P,!1),t.removeEventListener("webglcontextrestored",pe,!1),t.removeEventListener("webglcontextcreationerror",se,!1),he.dispose(),fe.dispose(),Te.dispose(),w.dispose(),G.dispose(),L.dispose(),e1.dispose(),i1.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",a1),xe.removeEventListener("sessionend",ue),me.stop()};function P(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function pe(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let E=Je.autoReset,B=Se.enabled,Y=Se.autoUpdate,Z=Se.needsUpdate,H=Se.type;p1(),Je.autoReset=E,Se.enabled=B,Se.autoUpdate=Y,Se.needsUpdate=Z,Se.type=H}function se(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function Oe(E){let B=E.target;B.removeEventListener("dispose",Oe),Pe(B)}function Pe(E){Ke(E),Te.remove(E)}function Ke(E){let B=Te.get(E).programs;B!==void 0&&(B.forEach(function(Y){ie.releaseProgram(Y)}),E.isShaderMaterial&&ie.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,Y,Z,H,ge){B===null&&(B=Me);let Ce=H.isMesh&&H.matrixWorld.determinant()<0,Ne=ri(E,B,Y,Z,H);we.setMaterial(Z,Ce);let Le=Y.index,qe=1;if(Z.wireframe===!0){if(Le=re.getWireframeAttribute(Y),Le===void 0)return;qe=2}let He=Y.drawRange,Ge=Y.attributes.position,_1=He.start*qe,T1=(He.start+He.count)*qe;ge!==null&&(_1=Math.max(_1,ge.start*qe),T1=Math.min(T1,(ge.start+ge.count)*qe)),Le!==null?(_1=Math.max(_1,0),T1=Math.min(T1,Le.count)):Ge!=null&&(_1=Math.max(_1,0),T1=Math.min(T1,Ge.count));let q1=T1-_1;if(q1<0||q1===1/0)return;e1.setup(H,Z,Ne,Y,Le);let yt,F=Ae;if(Le!==null&&(yt=$.get(Le),F=Xe,F.setIndex(yt)),H.isMesh)Z.wireframe===!0?(we.setLineWidth(Z.wireframeLinewidth*Be()),F.setMode(O.LINES)):F.setMode(O.TRIANGLES);else if(H.isLine){let te=Z.linewidth;te===void 0&&(te=1),we.setLineWidth(te*Be()),H.isLineSegments?F.setMode(O.LINES):H.isLineLoop?F.setMode(O.LINE_LOOP):F.setMode(O.LINE_STRIP)}else H.isPoints?F.setMode(O.POINTS):H.isSprite&&F.setMode(O.TRIANGLES);if(H.isBatchedMesh)F.renderMultiDraw(H._multiDrawStarts,H._multiDrawCounts,H._multiDrawCount);else if(H.isInstancedMesh)F.renderInstances(_1,q1,H.count);else if(Y.isInstancedBufferGeometry){let te=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,De=Math.min(Y.instanceCount,te);F.renderInstances(_1,q1,De)}else F.render(_1,q1)};function r1(E,B,Y){E.transparent===!0&&E.side===ut&&E.forceSinglePass===!1?(E.side=tt,E.needsUpdate=!0,vt(E,B,Y),E.side=Nt,E.needsUpdate=!0,vt(E,B,Y),E.side=ut):vt(E,B,Y)}this.compile=function(E,B,Y=null){Y===null&&(Y=E),_=fe.get(Y),_.init(),p.push(_),Y.traverseVisible(function(H){H.isLight&&H.layers.test(B.layers)&&(_.pushLight(H),H.castShadow&&_.pushShadow(H))}),E!==Y&&E.traverseVisible(function(H){H.isLight&&H.layers.test(B.layers)&&(_.pushLight(H),H.castShadow&&_.pushShadow(H))}),_.setupLights(y._useLegacyLights);let Z=new Set;return E.traverse(function(H){let ge=H.material;if(ge)if(Array.isArray(ge))for(let Ce=0;Ce<ge.length;Ce++){let Ne=ge[Ce];r1(Ne,Y,H),Z.add(Ne)}else r1(ge,Y,H),Z.add(ge)}),p.pop(),_=null,Z},this.compileAsync=function(E,B,Y=null){let Z=this.compile(E,B,Y);return new Promise(H=>{function ge(){if(Z.forEach(function(Ce){Te.get(Ce).currentProgram.isReady()&&Z.delete(Ce)}),Z.size===0){H(E);return}setTimeout(ge,10)}ve.get("KHR_parallel_shader_compile")!==null?ge():setTimeout(ge,10)})};let o1=null;function A1(E){o1&&o1(E)}function a1(){me.stop()}function ue(){me.start()}let me=new Ts;me.setAnimationLoop(A1),typeof self<"u"&&me.setContext(self),this.setAnimationLoop=function(E){o1=E,xe.setAnimationLoop(E),E===null?me.stop():me.start()},xe.addEventListener("sessionstart",a1),xe.addEventListener("sessionend",ue),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),xe.enabled===!0&&xe.isPresenting===!0&&(xe.cameraAutoUpdate===!0&&xe.updateCamera(B),B=xe.getCamera()),E.isScene===!0&&E.onBeforeRender(y,E,B,A),_=fe.get(E,p.length),_.init(),p.push(_),le.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),oe.setFromProjectionMatrix(le),K=this.localClippingEnabled,X=ne.init(this.clippingPlanes,K),v=he.get(E,g.length),v.init(),g.push(v),s1(E,B,0,y.sortObjects),v.finish(),y.sortObjects===!0&&v.sort(Q,z),this.info.render.frame++,X===!0&&ne.beginShadows();let Y=_.state.shadowsArray;if(Se.render(Y,E,B),X===!0&&ne.endShadows(),this.info.autoReset===!0&&this.info.reset(),(xe.enabled===!1||xe.isPresenting===!1||xe.hasDepthSensing()===!1)&&be.render(v,E),_.setupLights(y._useLegacyLights),B.isArrayCamera){let Z=B.cameras;for(let H=0,ge=Z.length;H<ge;H++){let Ce=Z[H];P1(v,E,Ce,Ce.viewport)}}else P1(v,E,B);A!==null&&(T.updateMultisampleRenderTarget(A),T.updateRenderTargetMipmap(A)),E.isScene===!0&&E.onAfterRender(y,E,B),e1.resetDefaultState(),C=-1,U=null,p.pop(),p.length>0?_=p[p.length-1]:_=null,g.pop(),g.length>0?v=g[g.length-1]:v=null};function s1(E,B,Y,Z){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)Y=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)_.pushLight(E),E.castShadow&&_.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||oe.intersectsSprite(E)){Z&&ae.setFromMatrixPosition(E.matrixWorld).applyMatrix4(le);let ge=L.update(E),Ce=E.material;Ce.visible&&v.push(E,ge,Ce,Y,ae.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||oe.intersectsObject(E))){let ge=L.update(E),Ce=E.material;if(Z&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ae.copy(E.boundingSphere.center)):(ge.boundingSphere===null&&ge.computeBoundingSphere(),ae.copy(ge.boundingSphere.center)),ae.applyMatrix4(E.matrixWorld).applyMatrix4(le)),Array.isArray(Ce)){let Ne=ge.groups;for(let Le=0,qe=Ne.length;Le<qe;Le++){let He=Ne[Le],Ge=Ce[He.materialIndex];Ge&&Ge.visible&&v.push(E,ge,Ge,Y,ae.z,He)}}else Ce.visible&&v.push(E,ge,Ce,Y,ae.z,null)}}let H=E.children;for(let ge=0,Ce=H.length;ge<Ce;ge++)s1(H[ge],B,Y,Z)}function P1(E,B,Y,Z){let H=E.opaque,ge=E.transmissive,Ce=E.transparent;_.setupLightsView(Y),X===!0&&ne.setGlobalState(y.clippingPlanes,Y),ge.length>0&&$e(H,ge,B,Y),Z&&we.viewport(S.copy(Z)),H.length>0&&Ye(H,B,Y),ge.length>0&&Ye(ge,B,Y),Ce.length>0&&Ye(Ce,B,Y),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function $e(E,B,Y,Z){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;if(_.state.transmissionRenderTarget===null){_.state.transmissionRenderTarget=new S1(1,1,{generateMipmaps:!0,type:ve.has("EXT_color_buffer_half_float")||ve.has("EXT_color_buffer_float")?ot:Rt,minFilter:qt,samples:4,stencilBuffer:n});let Le=Te.get(_.state.transmissionRenderTarget);Le.__isTransmissionRenderTarget=!0}let H=_.state.transmissionRenderTarget;y.getDrawingBufferSize(ce),H.setSize(ce.x,ce.y);let ge=y.getRenderTarget();y.setRenderTarget(H),y.getClearColor(R),D=y.getClearAlpha(),D<1&&y.setClearColor(16777215,.5),y.clear();let Ce=y.toneMapping;y.toneMapping=u2,Ye(E,Y,Z),T.updateMultisampleRenderTarget(H),T.updateRenderTargetMipmap(H);let Ne=!1;for(let Le=0,qe=B.length;Le<qe;Le++){let He=B[Le],Ge=He.object,_1=He.geometry,T1=He.material,q1=He.group;if(T1.side===ut&&Ge.layers.test(Z.layers)){let yt=T1.side;T1.side=tt,T1.needsUpdate=!0,c2(Ge,Y,Z,_1,T1,q1),T1.side=yt,T1.needsUpdate=!0,Ne=!0}}Ne===!0&&(T.updateMultisampleRenderTarget(H),T.updateRenderTargetMipmap(H)),y.setRenderTarget(ge),y.setClearColor(R,D),y.toneMapping=Ce}function Ye(E,B,Y){let Z=B.isScene===!0?B.overrideMaterial:null;for(let H=0,ge=E.length;H<ge;H++){let Ce=E[H],Ne=Ce.object,Le=Ce.geometry,qe=Z===null?Ce.material:Z,He=Ce.group;Ne.layers.test(Y.layers)&&c2(Ne,B,Y,Le,qe,He)}}function c2(E,B,Y,Z,H,ge){E.onBeforeRender(y,B,Y,Z,H,ge),E.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),H.onBeforeRender(y,B,Y,Z,E,ge),H.transparent===!0&&H.side===ut&&H.forceSinglePass===!1?(H.side=tt,H.needsUpdate=!0,y.renderBufferDirect(Y,B,Z,H,E,ge),H.side=Nt,H.needsUpdate=!0,y.renderBufferDirect(Y,B,Z,H,E,ge),H.side=ut):y.renderBufferDirect(Y,B,Z,H,E,ge),E.onAfterRender(y,B,Y,Z,H,ge)}function vt(E,B,Y){B.isScene!==!0&&(B=Me);let Z=Te.get(E),H=_.state.lights,ge=_.state.shadowsArray,Ce=H.state.version,Ne=ie.getParameters(E,H.state,ge,B,Y),Le=ie.getProgramCacheKey(Ne),qe=Z.programs;Z.environment=E.isMeshStandardMaterial?B.environment:null,Z.fog=B.fog,Z.envMap=(E.isMeshStandardMaterial?G:w).get(E.envMap||Z.environment),Z.envMapRotation=Z.environment!==null&&E.envMap===null?B.environmentRotation:E.envMapRotation,qe===void 0&&(E.addEventListener("dispose",Oe),qe=new Map,Z.programs=qe);let He=qe.get(Le);if(He!==void 0){if(Z.currentProgram===He&&Z.lightsStateVersion===Ce)return E1(E,Ne),He}else Ne.uniforms=ie.getUniforms(E),E.onBuild(Y,Ne,y),E.onBeforeCompile(Ne,y),He=ie.acquireProgram(Ne,Le),qe.set(Le,He),Z.uniforms=Ne.uniforms;let Ge=Z.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Ge.clippingPlanes=ne.uniform),E1(E,Ne),Z.needsLights=d2(E),Z.lightsStateVersion=Ce,Z.needsLights&&(Ge.ambientLightColor.value=H.state.ambient,Ge.lightProbe.value=H.state.probe,Ge.directionalLights.value=H.state.directional,Ge.directionalLightShadows.value=H.state.directionalShadow,Ge.spotLights.value=H.state.spot,Ge.spotLightShadows.value=H.state.spotShadow,Ge.rectAreaLights.value=H.state.rectArea,Ge.ltc_1.value=H.state.rectAreaLTC1,Ge.ltc_2.value=H.state.rectAreaLTC2,Ge.pointLights.value=H.state.point,Ge.pointLightShadows.value=H.state.pointShadow,Ge.hemisphereLights.value=H.state.hemi,Ge.directionalShadowMap.value=H.state.directionalShadowMap,Ge.directionalShadowMatrix.value=H.state.directionalShadowMatrix,Ge.spotShadowMap.value=H.state.spotShadowMap,Ge.spotLightMatrix.value=H.state.spotLightMatrix,Ge.spotLightMap.value=H.state.spotLightMap,Ge.pointShadowMap.value=H.state.pointShadowMap,Ge.pointShadowMatrix.value=H.state.pointShadowMatrix),Z.currentProgram=He,Z.uniformsList=null,He}function B1(E){if(E.uniformsList===null){let B=E.currentProgram.getUniforms();E.uniformsList=$a.seqWithValue(B.seq,E.uniforms)}return E.uniformsList}function E1(E,B){let Y=Te.get(E);Y.outputColorSpace=B.outputColorSpace,Y.batching=B.batching,Y.instancing=B.instancing,Y.instancingColor=B.instancingColor,Y.instancingMorph=B.instancingMorph,Y.skinning=B.skinning,Y.morphTargets=B.morphTargets,Y.morphNormals=B.morphNormals,Y.morphColors=B.morphColors,Y.morphTargetsCount=B.morphTargetsCount,Y.numClippingPlanes=B.numClippingPlanes,Y.numIntersection=B.numClipIntersection,Y.vertexAlphas=B.vertexAlphas,Y.vertexTangents=B.vertexTangents,Y.toneMapping=B.toneMapping}function ri(E,B,Y,Z,H){B.isScene!==!0&&(B=Me),T.resetTextureUnits();let ge=B.fog,Ce=Z.isMeshStandardMaterial?B.environment:null,Ne=A===null?y.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:k1,Le=(Z.isMeshStandardMaterial?G:w).get(Z.envMap||Ce),qe=Z.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,He=!!Y.attributes.tangent&&(!!Z.normalMap||Z.anisotropy>0),Ge=!!Y.morphAttributes.position,_1=!!Y.morphAttributes.normal,T1=!!Y.morphAttributes.color,q1=u2;Z.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(q1=y.toneMapping);let yt=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,F=yt!==void 0?yt.length:0,te=Te.get(Z),De=_.state.lights;if(X===!0&&(K===!0||E!==U)){let St=E===U&&Z.id===C;ne.setState(Z,E,St)}let b1=!1;Z.version===te.__version?(te.needsLights&&te.lightsStateVersion!==De.state.version||te.outputColorSpace!==Ne||H.isBatchedMesh&&te.batching===!1||!H.isBatchedMesh&&te.batching===!0||H.isInstancedMesh&&te.instancing===!1||!H.isInstancedMesh&&te.instancing===!0||H.isSkinnedMesh&&te.skinning===!1||!H.isSkinnedMesh&&te.skinning===!0||H.isInstancedMesh&&te.instancingColor===!0&&H.instanceColor===null||H.isInstancedMesh&&te.instancingColor===!1&&H.instanceColor!==null||H.isInstancedMesh&&te.instancingMorph===!0&&H.morphTexture===null||H.isInstancedMesh&&te.instancingMorph===!1&&H.morphTexture!==null||te.envMap!==Le||Z.fog===!0&&te.fog!==ge||te.numClippingPlanes!==void 0&&(te.numClippingPlanes!==ne.numPlanes||te.numIntersection!==ne.numIntersection)||te.vertexAlphas!==qe||te.vertexTangents!==He||te.morphTargets!==Ge||te.morphNormals!==_1||te.morphColors!==T1||te.toneMapping!==q1||te.morphTargetsCount!==F)&&(b1=!0):(b1=!0,te.__version=Z.version);let nt=te.currentProgram;b1===!0&&(nt=vt(Z,B,H));let S3=!1,ga=!1,U0=!1,Z1=nt.getUniforms(),R2=te.uniforms;if(we.useProgram(nt.program)&&(S3=!0,ga=!0,U0=!0),Z.id!==C&&(C=Z.id,ga=!0),S3||U!==E){Z1.setValue(O,"projectionMatrix",E.projectionMatrix),Z1.setValue(O,"viewMatrix",E.matrixWorldInverse);let St=Z1.map.cameraPosition;St!==void 0&&St.setValue(O,ae.setFromMatrixPosition(E.matrixWorld)),Re.logarithmicDepthBuffer&&Z1.setValue(O,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(Z.isMeshPhongMaterial||Z.isMeshToonMaterial||Z.isMeshLambertMaterial||Z.isMeshBasicMaterial||Z.isMeshStandardMaterial||Z.isShaderMaterial)&&Z1.setValue(O,"isOrthographic",E.isOrthographicCamera===!0),U!==E&&(U=E,ga=!0,U0=!0)}if(H.isSkinnedMesh){Z1.setOptional(O,H,"bindMatrix"),Z1.setOptional(O,H,"bindMatrixInverse");let St=H.skeleton;St&&(St.boneTexture===null&&St.computeBoneTexture(),Z1.setValue(O,"boneTexture",St.boneTexture,T))}H.isBatchedMesh&&(Z1.setOptional(O,H,"batchingTexture"),Z1.setValue(O,"batchingTexture",H._matricesTexture,T));let k0=Y.morphAttributes;if((k0.position!==void 0||k0.normal!==void 0||k0.color!==void 0)&&Ie.update(H,Y,nt),(ga||te.receiveShadow!==H.receiveShadow)&&(te.receiveShadow=H.receiveShadow,Z1.setValue(O,"receiveShadow",H.receiveShadow)),Z.isMeshGouraudMaterial&&Z.envMap!==null&&(R2.envMap.value=Le,R2.flipEnvMap.value=Le.isCubeTexture&&Le.isRenderTargetTexture===!1?-1:1),Z.isMeshStandardMaterial&&Z.envMap===null&&B.environment!==null&&(R2.envMapIntensity.value=B.environmentIntensity),ga&&(Z1.setValue(O,"toneMappingExposure",y.toneMappingExposure),te.needsLights&&xt(R2,U0),ge&&Z.fog===!0&&ee.refreshFogUniforms(R2,ge),ee.refreshMaterialUniforms(R2,Z,W,q,_.state.transmissionRenderTarget),$a.upload(O,B1(te),R2,T)),Z.isShaderMaterial&&Z.uniformsNeedUpdate===!0&&($a.upload(O,B1(te),R2,T),Z.uniformsNeedUpdate=!1),Z.isSpriteMaterial&&Z1.setValue(O,"center",H.center),Z1.setValue(O,"modelViewMatrix",H.modelViewMatrix),Z1.setValue(O,"normalMatrix",H.normalMatrix),Z1.setValue(O,"modelMatrix",H.matrixWorld),Z.isShaderMaterial||Z.isRawShaderMaterial){let St=Z.uniformsGroups;for(let O0=0,uM=St.length;O0<uM;O0++){let E4=St[O0];i1.update(E4,nt),i1.bind(E4,nt)}}return nt}function xt(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function d2(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(E,B,Y){Te.get(E.texture).__webglTexture=B,Te.get(E.depthTexture).__webglTexture=Y;let Z=Te.get(E);Z.__hasExternalTextures=!0,Z.__autoAllocateDepthBuffer=Y===void 0,Z.__autoAllocateDepthBuffer||ve.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Z.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,B){let Y=Te.get(E);Y.__webglFramebuffer=B,Y.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,Y=0){A=E,b=B,N=Y;let Z=!0,H=null,ge=!1,Ce=!1;if(E){let Ne=Te.get(E);Ne.__useDefaultFramebuffer!==void 0?(we.bindFramebuffer(O.FRAMEBUFFER,null),Z=!1):Ne.__webglFramebuffer===void 0?T.setupRenderTarget(E):Ne.__hasExternalTextures&&T.rebindTextures(E,Te.get(E.texture).__webglTexture,Te.get(E.depthTexture).__webglTexture);let Le=E.texture;(Le.isData3DTexture||Le.isDataArrayTexture||Le.isCompressedArrayTexture)&&(Ce=!0);let qe=Te.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(qe[B])?H=qe[B][Y]:H=qe[B],ge=!0):E.samples>0&&T.useMultisampledRTT(E)===!1?H=Te.get(E).__webglMultisampledFramebuffer:Array.isArray(qe)?H=qe[Y]:H=qe,S.copy(E.viewport),M.copy(E.scissor),k=E.scissorTest}else S.copy(J).multiplyScalar(W).floor(),M.copy(j).multiplyScalar(W).floor(),k=de;if(we.bindFramebuffer(O.FRAMEBUFFER,H)&&Z&&we.drawBuffers(E,H),we.viewport(S),we.scissor(M),we.setScissorTest(k),ge){let Ne=Te.get(E.texture);O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_CUBE_MAP_POSITIVE_X+B,Ne.__webglTexture,Y)}else if(Ce){let Ne=Te.get(E.texture),Le=B||0;O.framebufferTextureLayer(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,Ne.__webglTexture,Y||0,Le)}C=-1},this.readRenderTargetPixels=function(E,B,Y,Z,H,ge,Ce){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ne=Te.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Ce!==void 0&&(Ne=Ne[Ce]),Ne){we.bindFramebuffer(O.FRAMEBUFFER,Ne);try{let Le=E.texture,qe=Le.format,He=Le.type;if(qe!==U1&&ze.convert(qe)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Ge=He===ot&&(ve.has("EXT_color_buffer_half_float")||ve.has("EXT_color_buffer_float"));if(He!==Rt&&ze.convert(He)!==O.getParameter(O.IMPLEMENTATION_COLOR_READ_TYPE)&&He!==Q1&&!Ge){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-Z&&Y>=0&&Y<=E.height-H&&O.readPixels(B,Y,Z,H,ze.convert(qe),ze.convert(He),ge)}finally{let Le=A!==null?Te.get(A).__webglFramebuffer:null;we.bindFramebuffer(O.FRAMEBUFFER,Le)}}},this.copyFramebufferToTexture=function(E,B,Y=0){let Z=Math.pow(2,-Y),H=Math.floor(B.image.width*Z),ge=Math.floor(B.image.height*Z);T.setTexture2D(B,0),O.copyTexSubImage2D(O.TEXTURE_2D,Y,0,0,E.x,E.y,H,ge),we.unbindTexture()},this.copyTextureToTexture=function(E,B,Y,Z=0){let H=B.image.width,ge=B.image.height,Ce=ze.convert(Y.format),Ne=ze.convert(Y.type);T.setTexture2D(Y,0),O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,Y.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Y.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,Y.unpackAlignment),B.isDataTexture?O.texSubImage2D(O.TEXTURE_2D,Z,E.x,E.y,H,ge,Ce,Ne,B.image.data):B.isCompressedTexture?O.compressedTexSubImage2D(O.TEXTURE_2D,Z,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,Ce,B.mipmaps[0].data):O.texSubImage2D(O.TEXTURE_2D,Z,E.x,E.y,Ce,Ne,B.image),Z===0&&Y.generateMipmaps&&O.generateMipmap(O.TEXTURE_2D),we.unbindTexture()},this.copyTextureToTexture3D=function(E,B,Y,Z,H=0){let ge=Math.round(E.max.x-E.min.x),Ce=Math.round(E.max.y-E.min.y),Ne=E.max.z-E.min.z+1,Le=ze.convert(Z.format),qe=ze.convert(Z.type),He;if(Z.isData3DTexture)T.setTexture3D(Z,0),He=O.TEXTURE_3D;else if(Z.isDataArrayTexture||Z.isCompressedArrayTexture)T.setTexture2DArray(Z,0),He=O.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}O.pixelStorei(O.UNPACK_FLIP_Y_WEBGL,Z.flipY),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Z.premultiplyAlpha),O.pixelStorei(O.UNPACK_ALIGNMENT,Z.unpackAlignment);let Ge=O.getParameter(O.UNPACK_ROW_LENGTH),_1=O.getParameter(O.UNPACK_IMAGE_HEIGHT),T1=O.getParameter(O.UNPACK_SKIP_PIXELS),q1=O.getParameter(O.UNPACK_SKIP_ROWS),yt=O.getParameter(O.UNPACK_SKIP_IMAGES),F=Y.isCompressedTexture?Y.mipmaps[H]:Y.image;O.pixelStorei(O.UNPACK_ROW_LENGTH,F.width),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,F.height),O.pixelStorei(O.UNPACK_SKIP_PIXELS,E.min.x),O.pixelStorei(O.UNPACK_SKIP_ROWS,E.min.y),O.pixelStorei(O.UNPACK_SKIP_IMAGES,E.min.z),Y.isDataTexture||Y.isData3DTexture?O.texSubImage3D(He,H,B.x,B.y,B.z,ge,Ce,Ne,Le,qe,F.data):Z.isCompressedArrayTexture?O.compressedTexSubImage3D(He,H,B.x,B.y,B.z,ge,Ce,Ne,Le,F.data):O.texSubImage3D(He,H,B.x,B.y,B.z,ge,Ce,Ne,Le,qe,F),O.pixelStorei(O.UNPACK_ROW_LENGTH,Ge),O.pixelStorei(O.UNPACK_IMAGE_HEIGHT,_1),O.pixelStorei(O.UNPACK_SKIP_PIXELS,T1),O.pixelStorei(O.UNPACK_SKIP_ROWS,q1),O.pixelStorei(O.UNPACK_SKIP_IMAGES,yt),H===0&&Z.generateMipmaps&&O.generateMipmap(He),we.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?T.setTextureCube(E,0):E.isData3DTexture?T.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?T.setTexture2DArray(E,0):T.setTexture2D(E,0),we.unbindTexture()},this.resetState=function(){b=0,N=0,A=null,we.reset(),e1.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===W3?"display-p3":"srgb",t.unpackColorSpace=n1.workingColorSpace===Aa?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},M2=class extends N1{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new O1,this.environmentIntensity=1,this.environmentRotation=new O1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},Xg=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=j3,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Mt()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return es("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,n=this.stride;r<n;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Mt()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Mt()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},$1=new I,Yg=class D4{constructor(t,i,r,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=r,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,r=this.data.count;i<r;i++)$1.fromBufferAttribute(this,i),$1.applyMatrix4(t),this.setXYZ(i,$1.x,$1.y,$1.z);return this}applyNormalMatrix(t){for(let i=0,r=this.count;i<r;i++)$1.fromBufferAttribute(this,i),$1.applyNormalMatrix(t),this.setXYZ(i,$1.x,$1.y,$1.z);return this}transformDirection(t){for(let i=0,r=this.count;i<r;i++)$1.fromBufferAttribute(this,i),$1.transformDirection(t),this.setXYZ(i,$1.x,$1.y,$1.z);return this}getComponent(t,i){let r=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(r=wt(r,this.array)),r}setComponent(t,i,r){return this.normalized&&(r=c1(r,this.array)),this.data.array[t*this.data.stride+this.offset+i]=r,this}setX(t,i){return this.normalized&&(i=c1(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=c1(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=c1(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=c1(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=wt(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=wt(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=wt(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=wt(i,this.array)),i}setXY(t,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(i=c1(i,this.array),r=c1(r,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this}setXYZ(t,i,r,n){return t=t*this.data.stride+this.offset,this.normalized&&(i=c1(i,this.array),r=c1(r,this.array),n=c1(n,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this}setXYZW(t,i,r,n,o){return t=t*this.data.stride+this.offset,this.normalized&&(i=c1(i,this.array),r=c1(r,this.array),n=c1(n,this.array),o=c1(o,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this.data.array[t+3]=o,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)i.push(this.data.array[n+o])}return new X1(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new D4(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)i.push(this.data.array[n+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},rl=new I,al=new f1,nl=new f1,qg=new I,ol=new Fe,e3=new I,An=new Dt,sl=new Fe,En=new Or,Zg=class extends v1{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=oo,this.bindMatrix=new Fe,this.bindMatrixInverse=new Fe,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Qt),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,e3),this.boundingBox.expandByPoint(e3)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Dt),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,e3),this.boundingSphere.expandByPoint(e3)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),An.copy(this.boundingSphere),An.applyMatrix4(r),e.ray.intersectsSphere(An)!==!1&&(sl.copy(r).invert(),En.copy(e.ray).applyMatrix4(sl),!(this.boundingBox!==null&&En.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,En)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new f1,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);let n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===oo?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===eh?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let i=this.skeleton,r=this.geometry;al.fromBufferAttribute(r.attributes.skinIndex,e),nl.fromBufferAttribute(r.attributes.skinWeight,e),rl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){let o=nl.getComponent(n);if(o!==0){let s=al.getComponent(n);ol.multiplyMatrices(i.bones[s].matrixWorld,i.boneInverses[s]),t.addScaledVector(qg.copy(rl).applyMatrix4(ol),o)}}return t.applyMatrix4(this.bindMatrixInverse)}},ll=class extends N1{constructor(){super(),this.isBone=!0,this.type="Bone"}},w2=class extends it{constructor(e=null,t=1,i=1,r,n,o,s,l,d=u1,c=u1,h,u){super(null,o,s,l,d,c,r,n,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},cl=new Fe,Qg=new Fe,Jg=class U4{constructor(t=[],i=[]){this.uuid=Mt(),this.bones=t.slice(0),this.boneInverses=i,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,i=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),i.length===0)this.calculateInverses();else if(t.length!==i.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,n=this.bones.length;r<n;r++)this.boneInverses.push(new Fe)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,i=this.bones.length;t<i;t++){let r=new Fe;this.bones[t]&&r.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&r.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){let t=this.bones,i=this.boneInverses,r=this.boneMatrices,n=this.boneTexture;for(let o=0,s=t.length;o<s;o++){let l=t[o]?t[o].matrixWorld:Qg;cl.multiplyMatrices(l,i[o]),cl.toArray(r,o*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new U4(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=Math.ceil(t/4)*4,t=Math.max(t,4);let i=new Float32Array(t*t*4);i.set(this.boneMatrices);let r=new w2(i,t,t,U1,Q1);return r.needsUpdate=!0,this.boneMatrices=i,this.boneTexture=r,this}getBoneByName(t){for(let i=0,r=this.bones.length;i<r;i++){let n=this.bones[i];if(n.name===t)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,i){this.uuid=t.uuid;for(let r=0,n=t.bones.length;r<n;r++){let o=t.bones[r],s=i[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new ll),this.bones.push(s),this.boneInverses.push(new Fe().fromArray(t.boneInverses[r]))}return this.init(),this}toJSON(){let t={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let i=this.bones,r=this.boneInverses;for(let n=0,o=i.length;n<o;n++){let s=i[n];t.bones.push(s.uuid);let l=r[n];t.boneInverses.push(l.toArray())}return t}},bn=class extends X1{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},ki=new Fe,dl=new Fe,t3=[],hl=new Qt,Kg=new Fe,Fr=new v1,Hr=new Dt,$g=class extends v1{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new bn(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,Kg)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Qt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ki),hl.copy(e.boundingBox).applyMatrix4(ki),this.boundingBox.union(hl)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Dt),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,ki),Hr.copy(e.boundingSphere).applyMatrix4(ki),this.boundingSphere.union(Hr)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,n=i.length+1,o=e*n+1;for(let s=0;s<i.length;s++)i[s]=r[o+s]}raycast(e,t){let i=this.matrixWorld,r=this.count;if(Fr.geometry=this.geometry,Fr.material=this.material,Fr.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Hr.copy(this.boundingSphere),Hr.applyMatrix4(i),e.ray.intersectsSphere(Hr)!==!1))for(let n=0;n<r;n++){this.getMatrixAt(n,ki),dl.multiplyMatrices(i,ki),Fr.matrixWorld=dl,Fr.raycast(e,t3);for(let o=0,s=t3.length;o<s;o++){let l=t3[o];l.instanceId=n,l.object=this,t.push(l)}t3.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new bn(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new w2(new Float32Array(r*this.count),r,this.count,k3,Q1));let n=this.morphTexture.source.data.data,o=0;for(let d=0;d<i.length;d++)o+=i[d];let s=this.geometry.morphTargetsRelative?1:1-o,l=r*e;n[l]=s,n.set(i,l+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}},ul=class extends mt{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ue(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},ml=new I,fl=new I,pl=new Fe,Cn=new Or,i3=new Dt,Tn=class extends N1{constructor(e=new Ut,t=new ul){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[0];for(let r=1,n=t.count;r<n;r++)ml.fromBufferAttribute(t,r-1),fl.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=ml.distanceTo(fl);e.setAttribute("lineDistance",new rt(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),i3.copy(i.boundingSphere),i3.applyMatrix4(r),i3.radius+=n,e.ray.intersectsSphere(i3)===!1)return;pl.copy(r).invert(),Cn.copy(e.ray).applyMatrix4(pl);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,d=new I,c=new I,h=new I,u=new I,m=this.isLineSegments?2:1,f=i.index,v=i.attributes.position;if(f!==null){let _=Math.max(0,o.start),g=Math.min(f.count,o.start+o.count);for(let p=_,y=g-1;p<y;p+=m){let x=f.getX(p),b=f.getX(p+1);if(d.fromBufferAttribute(v,x),c.fromBufferAttribute(v,b),Cn.distanceSqToSegment(d,c,u,h)>l)continue;u.applyMatrix4(this.matrixWorld);let N=e.ray.origin.distanceTo(u);N<e.near||N>e.far||t.push({distance:N,point:h.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}else{let _=Math.max(0,o.start),g=Math.min(v.count,o.start+o.count);for(let p=_,y=g-1;p<y;p+=m){if(d.fromBufferAttribute(v,p),c.fromBufferAttribute(v,p+1),Cn.distanceSqToSegment(d,c,u,h)>l)continue;u.applyMatrix4(this.matrixWorld);let x=e.ray.origin.distanceTo(u);x<e.near||x>e.far||t.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}},gl=new I,_l=new I,e8=class extends Tn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[];for(let r=0,n=t.count;r<n;r+=2)gl.fromBufferAttribute(t,r),_l.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+gl.distanceTo(_l);e.setAttribute("lineDistance",new rt(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},t8=class extends Tn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}},vl=class extends mt{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ue(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},xl=new Fe,In=new Or,r3=new Dt,a3=new I,i8=class extends N1{constructor(e=new Ut,t=new vl){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),r3.copy(i.boundingSphere),r3.applyMatrix4(r),r3.radius+=n,e.ray.intersectsSphere(r3)===!1)return;xl.copy(r).invert(),In.copy(e.ray).applyMatrix4(xl);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,d=i.index,c=i.attributes.position;if(d!==null){let h=Math.max(0,o.start),u=Math.min(d.count,o.start+o.count);for(let m=h,f=u;m<f;m++){let v=d.getX(m);a3.fromBufferAttribute(c,v),yl(a3,v,l,r,e,t,this)}}else{let h=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let m=h,f=u;m<f;m++)a3.fromBufferAttribute(c,m),yl(a3,m,l,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}};function yl(e,t,i,r,n,o,s){let l=In.distanceSqToPoint(e);if(l<i){let d=new I;In.closestPointToPoint(e,d),d.applyMatrix4(r);let c=n.ray.origin.distanceTo(d);if(c<n.near||c>n.far)return;o.push({distance:c,distanceToRay:Math.sqrt(l),point:d,index:t,face:null,object:s})}}var r8=class k4 extends Ut{constructor(t=1,i=32,r=16,n=0,o=Math.PI*2,s=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:r,phiStart:n,phiLength:o,thetaStart:s,thetaLength:l},i=Math.max(3,Math.floor(i)),r=Math.max(2,Math.floor(r));let d=Math.min(s+l,Math.PI),c=0,h=[],u=new I,m=new I,f=[],v=[],_=[],g=[];for(let p=0;p<=r;p++){let y=[],x=p/r,b=0;p===0&&s===0?b=.5/i:p===r&&d===Math.PI&&(b=-.5/i);for(let N=0;N<=i;N++){let A=N/i;u.x=-t*Math.cos(n+A*o)*Math.sin(s+x*l),u.y=t*Math.cos(s+x*l),u.z=t*Math.sin(n+A*o)*Math.sin(s+x*l),v.push(u.x,u.y,u.z),m.copy(u).normalize(),_.push(m.x,m.y,m.z),g.push(A+b,1-x),y.push(c++)}h.push(y)}for(let p=0;p<r;p++)for(let y=0;y<i;y++){let x=h[p][y+1],b=h[p][y],N=h[p+1][y],A=h[p+1][y+1];(p!==0||s>0)&&f.push(x,b,A),(p!==r-1||d<Math.PI)&&f.push(b,N,A)}this.setIndex(f),this.setAttribute("position",new rt(v,3)),this.setAttribute("normal",new rt(_,3)),this.setAttribute("uv",new rt(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new k4(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},Pn=class extends mt{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ue(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Yo,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new O1,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},i2=class extends Pn{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ye(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return W1(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ue(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ue(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ue(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};function n3(e,t,i){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT=="number"?new t(e):Array.prototype.slice.call(e)}function a8(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function n8(e){function t(n,o){return e[n]-e[o]}let i=e.length,r=new Array(i);for(let n=0;n!==i;++n)r[n]=n;return r.sort(t),r}function Sl(e,t,i){let r=e.length,n=new e.constructor(r);for(let o=0,s=0;s!==r;++o){let l=i[o]*t;for(let d=0;d!==t;++d)n[s++]=e[l+d]}return n}function Ml(e,t,i,r){let n=1,o=e[0];for(;o!==void 0&&o[r]===void 0;)o=e[n++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(t.push(o.time),i.push.apply(i,s)),o=e[n++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(t.push(o.time),s.toArray(i,i.length)),o=e[n++];while(o!==void 0);else do s=o[r],s!==void 0&&(t.push(o.time),i.push(s)),o=e[n++];while(o!==void 0)}var Gr=class{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{let o;i:{r:if(!(e<r)){for(let s=i+2;;){if(r===void 0){if(e<n)break r;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(n=r,r=t[++i],e<r)break t}o=t.length;break i}if(!(e>=n)){let s=t[1];e<s&&(i=2,n=s);for(let l=i-2;;){if(n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=n,n=t[--i-1],e>=n)break t}o=i,i=0;break i}break e}for(;i<o;){let s=i+o>>>1;e<t[s]?o=s:i=s+1}if(r=t[i],n=t[i-1],n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r;for(let o=0;o!==r;++o)t[o]=i[n+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},o8=class extends Gr{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Go,endingEnd:Go}}intervalChanged_(e,t,i){let r=this.parameterPositions,n=e-2,o=e+1,s=r[n],l=r[o];if(s===void 0)switch(this.getSettings_().endingStart){case Wo:n=e,s=2*t-i;break;case jo:n=r.length-2,s=t+r[n]-r[n+1];break;default:n=e,s=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Wo:o=e,l=2*i-t;break;case jo:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}let d=(i-t)*.5,c=this.valueSize;this._weightPrev=d/(t-s),this._weightNext=d/(l-i),this._offsetPrev=n*c,this._offsetNext=o*c}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,d=l-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,m=this._weightNext,f=(i-t)/(r-t),v=f*f,_=v*f,g=-u*_+2*u*v-u*f,p=(1+u)*_+(-1.5-2*u)*v+(-.5+u)*f+1,y=(-1-m)*_+(1.5+m)*v+.5*f,x=m*_-m*v;for(let b=0;b!==s;++b)n[b]=g*o[c+b]+p*o[d+b]+y*o[l+b]+x*o[h+b];return n}},s8=class extends Gr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,d=l-s,c=(i-t)/(r-t),h=1-c;for(let u=0;u!==s;++u)n[u]=o[d+u]*h+o[l+u]*c;return n}},l8=class extends Gr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}},Vt=class{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=n3(t,this.TimeBufferType),this.values=n3(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:n3(e.times,Array),values:n3(e.values,Array)};let r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new l8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new o8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Nr:t=this.InterpolantFactoryMethodDiscrete;break;case hi:t=this.InterpolantFactoryMethodLinear;break;case H3:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Nr;case this.InterpolantFactoryMethodLinear:return hi;case this.InterpolantFactoryMethodSmooth:return H3}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){let i=this.times,r=i.length,n=0,o=r-1;for(;n!==r&&i[n]<e;)++n;for(;o!==-1&&i[o]>t;)--o;if(++o,n!==0||o!==r){n>=o&&(o=Math.max(o,1),n=o-1);let s=this.getValueSize();this.times=i.slice(n,o),this.values=this.values.slice(n*s,o*s)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,r=this.values,n=i.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==n;s++){let l=i[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(r!==void 0&&a8(r))for(let s=0,l=r.length;s!==l;++s){let d=r[s];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,d),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===H3,n=e.length-1,o=1;for(let s=1;s<n;++s){let l=!1,d=e[s],c=e[s+1];if(d!==c&&(s!==1||d!==e[0]))if(r)l=!0;else{let h=s*i,u=h-i,m=h+i;for(let f=0;f!==i;++f){let v=t[h+f];if(v!==t[u+f]||v!==t[m+f]){l=!0;break}}}if(l){if(s!==o){e[o]=e[s];let h=s*i,u=o*i;for(let m=0;m!==i;++m)t[u+m]=t[h+m]}++o}}if(n>0){e[o]=e[n];for(let s=n*i,l=o*i,d=0;d!==i;++d)t[l+d]=t[s+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Vt.prototype.TimeBufferType=Float32Array,Vt.prototype.ValueBufferType=Float32Array,Vt.prototype.DefaultInterpolation=hi;var Oi=class extends Vt{};Oi.prototype.ValueTypeName="bool",Oi.prototype.ValueBufferType=Array,Oi.prototype.DefaultInterpolation=Nr,Oi.prototype.InterpolantFactoryMethodLinear=void 0,Oi.prototype.InterpolantFactoryMethodSmooth=void 0;var wl=class extends Vt{};wl.prototype.ValueTypeName="color";var zi=class extends Vt{};zi.prototype.ValueTypeName="number";var c8=class extends Gr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(i-t)/(r-t),d=e*s;for(let c=d+s;d!==c;d+=4)f2.slerpFlat(n,0,o,d-s,o,d,l);return n}},Y2=class extends Vt{InterpolantFactoryMethodLinear(e){return new c8(this.times,this.values,this.getValueSize(),e)}};Y2.prototype.ValueTypeName="quaternion",Y2.prototype.DefaultInterpolation=hi,Y2.prototype.InterpolantFactoryMethodSmooth=void 0;var Vi=class extends Vt{};Vi.prototype.ValueTypeName="string",Vi.prototype.ValueBufferType=Array,Vi.prototype.DefaultInterpolation=Nr,Vi.prototype.InterpolantFactoryMethodLinear=void 0,Vi.prototype.InterpolantFactoryMethodSmooth=void 0;var Bi=class extends Vt{};Bi.prototype.ValueTypeName="vector";var d8=class{constructor(e="",t=-1,i=[],r=dh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=Mt(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,s=i.length;o!==s;++o)t.push(u8(i[o]).scale(r));let n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){let t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,o=i.length;n!==o;++n)t.push(Vt.toJSON(i[n]));return r}static CreateFromMorphTargetSequence(e,t,i,r){let n=t.length,o=[];for(let s=0;s<n;s++){let l=[],d=[];l.push((s+n-1)%n,s,(s+1)%n),d.push(0,1,0);let c=n8(l);l=Sl(l,1,c),d=Sl(d,1,c),!r&&l[0]===0&&(l.push(n),d.push(d[0])),o.push(new zi(".morphTargetInfluences["+t[s].name+"]",l,d).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let r={},n=/^([\w-]*?)([\d]+)$/;for(let s=0,l=e.length;s<l;s++){let d=e[s],c=d.name.match(n);if(c&&c.length>1){let h=c[1],u=r[h];u||(r[h]=u=[]),u.push(d)}}let o=[];for(let s in r)o.push(this.CreateFromMorphTargetSequence(s,r[s],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(c,h,u,m,f){if(u.length!==0){let v=[],_=[];Ml(u,v,_,m),v.length!==0&&f.push(new c(h,v,_))}},r=[],n=e.name||"default",o=e.fps||30,s=e.blendMode,l=e.length||-1,d=e.hierarchy||[];for(let c=0;c<d.length;c++){let h=d[c].keys;if(!(!h||h.length===0))if(h[0].morphTargets){let u={},m;for(m=0;m<h.length;m++)if(h[m].morphTargets)for(let f=0;f<h[m].morphTargets.length;f++)u[h[m].morphTargets[f]]=-1;for(let f in u){let v=[],_=[];for(let g=0;g!==h[m].morphTargets.length;++g){let p=h[m];v.push(p.time),_.push(p.morphTarget===f?1:0)}r.push(new zi(".morphTargetInfluence["+f+"]",v,_))}l=u.length*o}else{let u=".bones["+t[c].name+"]";i(Bi,u+".position",h,"pos",r),i(Y2,u+".quaternion",h,"rot",r),i(Bi,u+".scale",h,"scl",r)}}return r.length===0?null:new this(n,l,r,s)}resetDuration(){let e=this.tracks,t=0;for(let i=0,r=e.length;i!==r;++i){let n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function h8(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return zi;case"vector":case"vector2":case"vector3":case"vector4":return Bi;case"color":return wl;case"quaternion":return Y2;case"bool":case"boolean":return Oi;case"string":return Vi}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function u8(e){if(e.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=h8(e.type);if(e.times===void 0){let i=[],r=[];Ml(e.keys,i,r,"value"),e.times=i,e.values=r}return t.parse!==void 0?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}var A2={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},m8=class{constructor(e,t,i){let r=this,n=!1,o=0,s=0,l,d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(c){s++,n===!1&&r.onStart!==void 0&&r.onStart(c,o,s),n=!0},this.itemEnd=function(c){o++,r.onProgress!==void 0&&r.onProgress(c,o,s),o===s&&(n=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,h){return d.push(c,h),this},this.removeHandler=function(c){let h=d.indexOf(c);return h!==-1&&d.splice(h,2),this},this.getHandler=function(c){for(let h=0,u=d.length;h<u;h+=2){let m=d[h],f=d[h+1];if(m.global&&(m.lastIndex=0),m.test(c))return f}return null}}},f8=new m8,Fi=class{constructor(e){this.manager=e!==void 0?e:f8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise(function(r,n){i.load(e,r,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Fi.DEFAULT_MATERIAL_NAME="__DEFAULT";var r2={},p8=class extends Error{constructor(e,t){super(e),this.response=t}},Al=class extends Fi{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=A2.get(e);if(n!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(r2[e]!==void 0){r2[e].push({onLoad:t,onProgress:i,onError:r});return}r2[e]=[],r2[e].push({onLoad:t,onProgress:i,onError:r});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;let c=r2[e],h=d.body.getReader(),u=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),m=u?parseInt(u):0,f=m!==0,v=0,_=new ReadableStream({start(g){p();function p(){h.read().then(({done:y,value:x})=>{if(y)g.close();else{v+=x.byteLength;let b=new ProgressEvent("progress",{lengthComputable:f,loaded:v,total:m});for(let N=0,A=c.length;N<A;N++){let C=c[N];C.onProgress&&C.onProgress(b)}g.enqueue(x),p()}})}}});return new Response(_)}else throw new p8(`fetch for "${d.url}" responded with ${d.status}: ${d.statusText}`,d)}).then(d=>{switch(l){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return d.json();default:if(s===void 0)return d.text();{let c=/charset="?([^;"\s]*)"?/i.exec(s),h=c&&c[1]?c[1].toLowerCase():void 0,u=new TextDecoder(h);return d.arrayBuffer().then(m=>u.decode(m))}}}).then(d=>{A2.add(e,d);let c=r2[e];delete r2[e];for(let h=0,u=c.length;h<u;h++){let m=c[h];m.onLoad&&m.onLoad(d)}}).catch(d=>{let c=r2[e];if(c===void 0)throw this.manager.itemError(e),d;delete r2[e];for(let h=0,u=c.length;h<u;h++){let m=c[h];m.onError&&m.onError(d)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},g8=class extends Fi{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,o=A2.get(e);if(o!==void 0)return n.manager.itemStart(e),setTimeout(function(){t&&t(o),n.manager.itemEnd(e)},0),o;let s=Dr("img");function l(){c(),A2.add(e,this),t&&t(this),n.manager.itemEnd(e)}function d(h){c(),r&&r(h),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",d,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),n.manager.itemStart(e),s.src=e,s}},Nn=class extends Fi{constructor(e){super(e)}load(e,t,i,r){let n=new it,o=new g8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){n.image=s,n.needsUpdate=!0,t!==void 0&&t(n)},i,r),n}},Ln=class extends N1{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ue(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}},Rn=new Fe,El=new I,bl=new I,Dn=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ye(512,512),this.map=null,this.mapPass=null,this.matrix=new Fe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new fn,this._frameExtents=new ye(1,1),this._viewportCount=1,this._viewports=[new f1(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;El.setFromMatrixPosition(e.matrixWorld),t.position.copy(El),bl.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(bl),t.updateMatrixWorld(),Rn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Rn),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Rn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},_8=class extends Dn{constructor(){super(new Y1(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=fi*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(i!==t.fov||r!==t.aspect||n!==t.far)&&(t.fov=i,t.aspect=r,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},v8=class extends Ln{constructor(e,t,i=0,r=Math.PI/3,n=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(N1.DEFAULT_UP),this.updateMatrix(),this.target=new N1,this.distance=i,this.angle=r,this.penumbra=n,this.decay=o,this.map=null,this.shadow=new _8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Cl=new Fe,Wr=new I,Un=new I,x8=class extends Dn{constructor(){super(new Y1(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ye(4,2),this._viewportCount=6,this._viewports=[new f1(2,1,1,1),new f1(0,1,1,1),new f1(3,1,1,1),new f1(1,1,1,1),new f1(3,0,1,1),new f1(1,0,1,1)],this._cubeDirections=[new I(1,0,0),new I(-1,0,0),new I(0,0,1),new I(0,0,-1),new I(0,1,0),new I(0,-1,0)],this._cubeUps=[new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,0,1),new I(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,r=this.matrix,n=e.distance||i.far;n!==i.far&&(i.far=n,i.updateProjectionMatrix()),Wr.setFromMatrixPosition(e.matrixWorld),i.position.copy(Wr),Un.copy(i.position),Un.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Un),i.updateMatrixWorld(),r.makeTranslation(-Wr.x,-Wr.y,-Wr.z),Cl.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cl)}},y8=class extends Ln{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new x8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},S8=class extends Dn{constructor(){super(new zt(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},M8=class extends Ln{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(N1.DEFAULT_UP),this.updateMatrix(),this.target=new N1,this.shadow=new S8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},jr=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},w8=class extends Fi{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,o=A2.get(e);if(o!==void 0){if(n.manager.itemStart(e),o.then){o.then(d=>{t&&t(d),n.manager.itemEnd(e)}).catch(d=>{r&&r(d)});return}return setTimeout(function(){t&&t(o),n.manager.itemEnd(e)},0),o}let s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;let l=fetch(e,s).then(function(d){return d.blob()}).then(function(d){return createImageBitmap(d,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(d){return A2.add(e,d),t&&t(d),n.manager.itemEnd(e),d}).catch(function(d){r&&r(d),A2.remove(e),n.manager.itemError(e),n.manager.itemEnd(e)});A2.add(e,l),n.manager.itemStart(e)}},A8=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Tl(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=Tl();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Tl(){return(typeof performance>"u"?Date:performance).now()}var kn="\\[\\]\\.:\\/",E8=new RegExp("["+kn+"]","g"),On="[^"+kn+"]",b8="[^"+kn.replace("\\.","")+"]",C8=/((?:WC+[\/:])*)/.source.replace("WC",On),T8=/(WCOD+)?/.source.replace("WCOD",b8),I8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",On),P8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",On),N8=new RegExp("^"+C8+T8+I8+P8+"$"),L8=["material","materials","bones","map"],R8=class{constructor(e,t,i){let r=i||M1.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},M1=class br{constructor(t,i,r){this.path=i,this.parsedPath=r||br.parseTrackName(i),this.node=br.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,r){return t&&t.isAnimationObjectGroup?new br.Composite(t,i,r):new br(t,i,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(t){let i=N8.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let r={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let o=r.nodeName.substring(n+1);L8.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let r=t.skeleton.getBoneByName(i);if(r!==void 0)return r}if(t.children){let r=function(o){for(let s=0;s<o.length;s++){let l=o[s];if(l.name===i||l.uuid===i)return l;let d=r(l.children);if(d)return d}return null},n=r(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,i){t[i]=this.targetObject[this.propertyName]}_getValue_array(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)t[i++]=r[n]}_getValue_arrayElement(t,i){t[i]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,i){this.resolvedProperty.toArray(t,i)}_setValue_direct(t,i){this.targetObject[this.propertyName]=t[i]}_setValue_direct_setNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++]}_setValue_array_setNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,i){this.resolvedProperty[this.propertyIndex]=t[i]}_setValue_arrayElement_setNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,i){this.resolvedProperty.fromArray(t,i)}_setValue_fromArray_setNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,i){this.bind(),this.getValue(t,i)}_setValue_unbound(t,i){this.bind(),this.setValue(t,i)}bind(){let t=this.node,i=this.parsedPath,r=i.objectName,n=i.propertyName,o=i.propertyIndex;if(t||(t=br.findNode(this.rootNode,i.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let c=i.objectIndex;switch(r){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[r]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let s=t[n];if(s===void 0){let c=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",t);return}let l=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(o!==void 0){if(n==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[o]!==void 0&&(o=t.morphTargetDictionary[o])}d=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(d=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};M1.Composite=R8,M1.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},M1.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},M1.prototype.GetterByBindingType=[M1.prototype._getValue_direct,M1.prototype._getValue_array,M1.prototype._getValue_arrayElement,M1.prototype._getValue_toArray],M1.prototype.SetterByBindingTypeAndVersioning=[[M1.prototype._setValue_direct,M1.prototype._setValue_direct_setNeedsUpdate,M1.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_array,M1.prototype._setValue_array_setNeedsUpdate,M1.prototype._setValue_array_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_arrayElement,M1.prototype._setValue_arrayElement_setNeedsUpdate,M1.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_fromArray,M1.prototype._setValue_fromArray_setNeedsUpdate,M1.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Il=new Fe,Pl=class{constructor(e,t,i=0,r=1/0){this.ray=new Or(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new rn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Il.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Il),this}intersectObject(e,t=!0,i=[]){return zn(e,this,i,t),i.sort(Nl),i}intersectObjects(e,t=!0,i=[]){for(let r=0,n=e.length;r<n;r++)zn(e[r],this,i,t);return i.sort(Nl),i}};function Nl(e,t){return e.distance-t.distance}function zn(e,t,i,r){if(e.layers.test(t.layers)&&e.raycast(t,i),r===!0){let n=e.children;for(let o=0,s=n.length;o<s;o++)zn(n[o],t,i,!0)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"163"}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="163");var D8=`
3793
+ }`,Bg=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,i){if(this.texture===null){let r=new tt,n=e.properties.get(r);n.__webglTexture=t.texture,(t.depthNear!=i.depthNear||t.depthFar!=i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}render(e,t){if(this.texture!==null){if(this.mesh===null){let i=t.cameras[0].viewport,r=new x1({vertexShader:zg,fragmentShader:Vg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new v1(new kt(20,20),r)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}},Fg=class extends ui{constructor(e,t){super();let i=this,r=null,n=1,o=null,s="local-floor",l=1,d=null,c=null,h=null,u=null,m=null,f=null,v=new Bg,_=t.getContextAttributes(),g=null,p=null,y=[],x=[],b=new ye,N=null,A=new j1;A.layers.enable(1),A.viewport=new f1;let C=new j1;C.layers.enable(2),C.viewport=new f1;let U=[A,C],S=new kg;S.layers.enable(1),S.layers.enable(2);let M=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(q){let K=y[q];return K===void 0&&(K=new wn,y[q]=K),K.getTargetRaySpace()},this.getControllerGrip=function(q){let K=y[q];return K===void 0&&(K=new wn,y[q]=K),K.getGripSpace()},this.getHand=function(q){let K=y[q];return K===void 0&&(K=new wn,y[q]=K),K.getHandSpace()};function R(q){let K=x.indexOf(q.inputSource);if(K===-1)return;let le=y[K];le!==void 0&&(le.update(q.inputSource,q.frame,d||o),le.dispatchEvent({type:q.type,data:q.inputSource}))}function D(){r.removeEventListener("select",R),r.removeEventListener("selectstart",R),r.removeEventListener("selectend",R),r.removeEventListener("squeeze",R),r.removeEventListener("squeezestart",R),r.removeEventListener("squeezeend",R),r.removeEventListener("end",D),r.removeEventListener("inputsourceschange",B);for(let q=0;q<y.length;q++){let K=x[q];K!==null&&(x[q]=null,y[q].disconnect(K))}M=null,k=null,v.reset(),e.setRenderTarget(g),m=null,u=null,h=null,r=null,p=null,ne.stop(),i.isPresenting=!1,e.setPixelRatio(N),e.setSize(b.width,b.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(q){n=q,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(q){s=q,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||o},this.setReferenceSpace=function(q){d=q},this.getBaseLayer=function(){return u!==null?u:m},this.getBinding=function(){return h},this.getFrame=function(){return f},this.getSession=function(){return r},this.setSession=async function(q){if(r=q,r!==null){if(g=e.getRenderTarget(),r.addEventListener("select",R),r.addEventListener("selectstart",R),r.addEventListener("selectend",R),r.addEventListener("squeeze",R),r.addEventListener("squeezestart",R),r.addEventListener("squeezeend",R),r.addEventListener("end",D),r.addEventListener("inputsourceschange",B),_.xrCompatible!==!0&&await t.makeXRCompatible(),N=e.getPixelRatio(),e.getSize(b),r.renderState.layers===void 0){let K={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:n};m=new XRWebGLLayer(r,t,K),r.updateRenderState({baseLayer:m}),e.setPixelRatio(1),e.setSize(m.framebufferWidth,m.framebufferHeight,!1),p=new S1(m.framebufferWidth,m.framebufferHeight,{format:D1,type:Rt,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil})}else{let K=null,le=null,de=null;_.depth&&(de=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,K=_.stencil?Ir:ci,le=_.stencil?Tr:li);let ae={colorFormat:t.RGBA8,depthFormat:de,scaleFactor:n};h=new XRWebGLBinding(r,t),u=h.createProjectionLayer(ae),r.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),p=new S1(u.textureWidth,u.textureHeight,{format:D1,type:Rt,depthTexture:new ks(u.textureWidth,u.textureHeight,le,void 0,void 0,void 0,void 0,void 0,void 0,K),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0});let Me=e.properties.get(p);Me.__ignoreDepthValues=u.ignoreDepthValues}p.isXRRenderTarget=!0,this.setFoveation(l),d=null,o=await r.requestReferenceSpace(s),ne.setContext(r),ne.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode};function B(q){for(let K=0;K<q.removed.length;K++){let le=q.removed[K],de=x.indexOf(le);de>=0&&(x[de]=null,y[de].disconnect(le))}for(let K=0;K<q.added.length;K++){let le=q.added[K],de=x.indexOf(le);if(de===-1){for(let Me=0;Me<y.length;Me++)if(Me>=x.length){x.push(le),de=Me;break}else if(x[Me]===null){x[Me]=le,de=Me;break}if(de===-1)break}let ae=y[de];ae&&ae.connect(le)}}let Z=new I,j=new I;function Q(q,K,le){Z.setFromMatrixPosition(K.matrixWorld),j.setFromMatrixPosition(le.matrixWorld);let de=Z.distanceTo(j),ae=K.projectionMatrix.elements,Me=le.projectionMatrix.elements,Be=ae[14]/(ae[10]-1),z=ae[14]/(ae[10]+1),Ee=(ae[9]+1)/ae[5],ve=(ae[9]-1)/ae[5],Le=(ae[8]-1)/ae[0],we=(Me[8]+1)/Me[0],Qe=Be*Le,Ce=Be*we,T=de/(-Le+we),w=T*-Le;K.matrixWorld.decompose(q.position,q.quaternion,q.scale),q.translateX(w),q.translateZ(T),q.matrixWorld.compose(q.position,q.quaternion,q.scale),q.matrixWorldInverse.copy(q.matrixWorld).invert();let W=Be+T,$=z+T,re=Qe-w,L=Ce+(de-w),ie=Ee*z/$*W,ee=ve*z/$*W;q.projectionMatrix.makePerspective(re,L,ie,ee,W,$),q.projectionMatrixInverse.copy(q.projectionMatrix).invert()}function V(q,K){K===null?q.matrixWorld.copy(q.matrix):q.matrixWorld.multiplyMatrices(K.matrixWorld,q.matrix),q.matrixWorldInverse.copy(q.matrixWorld).invert()}this.updateCamera=function(q){if(r===null)return;v.texture!==null&&(q.near=v.depthNear,q.far=v.depthFar),S.near=C.near=A.near=q.near,S.far=C.far=A.far=q.far,(M!==S.near||k!==S.far)&&(r.updateRenderState({depthNear:S.near,depthFar:S.far}),M=S.near,k=S.far,A.near=M,A.far=k,C.near=M,C.far=k,A.updateProjectionMatrix(),C.updateProjectionMatrix(),q.updateProjectionMatrix());let K=q.parent,le=S.cameras;V(S,K);for(let de=0;de<le.length;de++)V(le[de],K);le.length===2?Q(S,A,C):S.projectionMatrix.copy(A.projectionMatrix),J(q,S,K)};function J(q,K,le){le===null?q.matrix.copy(K.matrixWorld):(q.matrix.copy(le.matrixWorld),q.matrix.invert(),q.matrix.multiply(K.matrixWorld)),q.matrix.decompose(q.position,q.quaternion,q.scale),q.updateMatrixWorld(!0),q.projectionMatrix.copy(K.projectionMatrix),q.projectionMatrixInverse.copy(K.projectionMatrixInverse),q.isPerspectiveCamera&&(q.fov=mi*2*Math.atan(1/q.projectionMatrix.elements[5]),q.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(u===null&&m===null))return l},this.setFoveation=function(q){l=q,u!==null&&(u.fixedFoveation=q),m!==null&&m.fixedFoveation!==void 0&&(m.fixedFoveation=q)},this.hasDepthSensing=function(){return v.texture!==null};let Y=null;function he(q,K){if(c=K.getViewerPose(d||o),f=K,c!==null){let le=c.views;m!==null&&(e.setRenderTargetFramebuffer(p,m.framebuffer),e.setRenderTarget(p));let de=!1;le.length!==S.cameras.length&&(S.cameras.length=0,de=!0);for(let Me=0;Me<le.length;Me++){let Be=le[Me],z=null;if(m!==null)z=m.getViewport(Be);else{let ve=h.getViewSubImage(u,Be);z=ve.viewport,Me===0&&(e.setRenderTargetTextures(p,ve.colorTexture,u.ignoreDepthValues?void 0:ve.depthStencilTexture),e.setRenderTarget(p))}let Ee=U[Me];Ee===void 0&&(Ee=new j1,Ee.layers.enable(Me),Ee.viewport=new f1,U[Me]=Ee),Ee.matrix.fromArray(Be.transform.matrix),Ee.matrix.decompose(Ee.position,Ee.quaternion,Ee.scale),Ee.projectionMatrix.fromArray(Be.projectionMatrix),Ee.projectionMatrixInverse.copy(Ee.projectionMatrix).invert(),Ee.viewport.set(z.x,z.y,z.width,z.height),Me===0&&(S.matrix.copy(Ee.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),de===!0&&S.cameras.push(Ee)}let ae=r.enabledFeatures;if(ae&&ae.includes("depth-sensing")){let Me=h.getDepthInformation(le[0]);Me&&Me.isValid&&Me.texture&&v.init(e,Me,r.renderState)}}for(let le=0;le<y.length;le++){let de=x[le],ae=y[le];de!==null&&ae!==void 0&&ae.update(de,K,d||o)}v.render(e,S),Y&&Y(q,K),K.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:K}),f=null}let ne=new Ts;ne.setAnimationLoop(he),this.setAnimationLoop=function(q){Y=q},this.dispose=function(){}}},X2=new k1,Hg=new Fe;function Gg(e,t){function i(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function r(g,p){p.color.getRGB(g.fogColor.value,ws(e)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function n(g,p,y,x,b){p.isMeshBasicMaterial||p.isMeshLambertMaterial?o(g,p):p.isMeshToonMaterial?(o(g,p),u(g,p)):p.isMeshPhongMaterial?(o(g,p),h(g,p)):p.isMeshStandardMaterial?(o(g,p),m(g,p),p.isMeshPhysicalMaterial&&f(g,p,b)):p.isMeshMatcapMaterial?(o(g,p),v(g,p)):p.isMeshDepthMaterial?o(g,p):p.isMeshDistanceMaterial?(o(g,p),_(g,p)):p.isMeshNormalMaterial?o(g,p):p.isLineBasicMaterial?(s(g,p),p.isLineDashedMaterial&&l(g,p)):p.isPointsMaterial?d(g,p,y,x):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function o(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map,i(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,i(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===et&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,i(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===et&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,i(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,i(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,i(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);let y=t.get(p),x=y.envMap,b=y.envMapRotation;if(x&&(g.envMap.value=x,X2.copy(b),X2.x*=-1,X2.y*=-1,X2.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(X2.y*=-1,X2.z*=-1),g.envMapRotation.value.setFromMatrix4(Hg.makeRotationFromEuler(X2)),g.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap){g.lightMap.value=p.lightMap;let N=e._useLegacyLights===!0?Math.PI:1;g.lightMapIntensity.value=p.lightMapIntensity*N,i(p.lightMap,g.lightMapTransform)}p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,i(p.aoMap,g.aoMapTransform))}function s(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,i(p.map,g.mapTransform))}function l(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function d(g,p,y,x){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*y,g.scale.value=x*.5,p.map&&(g.map.value=p.map,i(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map,i(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,i(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function m(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,i(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,i(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,y){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap,i(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,i(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,i(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,i(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,i(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===et&&g.clearcoatNormalScale.value.negate())),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap,i(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,i(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=y.texture,g.transmissionSamplerSize.value.set(y.width,y.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,i(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,i(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,i(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,i(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,i(p.specularIntensityMap,g.specularIntensityMapTransform))}function v(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){let y=t.get(p).light;g.referencePosition.value.setFromMatrixPosition(y.matrixWorld),g.nearDistance.value=y.shadow.camera.near,g.farDistance.value=y.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:n}}function Wg(e,t,i,r){let n={},o={},s=[],l=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function d(y,x){let b=x.program;r.uniformBlockBinding(y,b)}function c(y,x){let b=n[y.id];b===void 0&&(v(y),b=h(y),n[y.id]=b,y.addEventListener("dispose",g));let N=x.program;r.updateUBOMapping(y,N);let A=t.render.frame;o[y.id]!==A&&(m(y),o[y.id]=A)}function h(y){let x=u();y.__bindingPointIndex=x;let b=e.createBuffer(),N=y.__size,A=y.usage;return e.bindBuffer(e.UNIFORM_BUFFER,b),e.bufferData(e.UNIFORM_BUFFER,N,A),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,x,b),b}function u(){for(let y=0;y<l;y++)if(s.indexOf(y)===-1)return s.push(y),y;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function m(y){let x=n[y.id],b=y.uniforms,N=y.__cache;e.bindBuffer(e.UNIFORM_BUFFER,x);for(let A=0,C=b.length;A<C;A++){let U=Array.isArray(b[A])?b[A]:[b[A]];for(let S=0,M=U.length;S<M;S++){let k=U[S];if(f(k,A,S,N)===!0){let R=k.__offset,D=Array.isArray(k.value)?k.value:[k.value],B=0;for(let Z=0;Z<D.length;Z++){let j=D[Z],Q=_(j);typeof j=="number"||typeof j=="boolean"?(k.__data[0]=j,e.bufferSubData(e.UNIFORM_BUFFER,R+B,k.__data)):j.isMatrix3?(k.__data[0]=j.elements[0],k.__data[1]=j.elements[1],k.__data[2]=j.elements[2],k.__data[3]=0,k.__data[4]=j.elements[3],k.__data[5]=j.elements[4],k.__data[6]=j.elements[5],k.__data[7]=0,k.__data[8]=j.elements[6],k.__data[9]=j.elements[7],k.__data[10]=j.elements[8],k.__data[11]=0):(j.toArray(k.__data,B),B+=Q.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,R,k.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}function f(y,x,b,N){let A=y.value,C=x+"_"+b;if(N[C]===void 0)return typeof A=="number"||typeof A=="boolean"?N[C]=A:N[C]=A.clone(),!0;{let U=N[C];if(typeof A=="number"||typeof A=="boolean"){if(U!==A)return N[C]=A,!0}else if(U.equals(A)===!1)return U.copy(A),!0}return!1}function v(y){let x=y.uniforms,b=0,N=16;for(let C=0,U=x.length;C<U;C++){let S=Array.isArray(x[C])?x[C]:[x[C]];for(let M=0,k=S.length;M<k;M++){let R=S[M],D=Array.isArray(R.value)?R.value:[R.value];for(let B=0,Z=D.length;B<Z;B++){let j=D[B],Q=_(j),V=b%N;V!==0&&N-V<Q.boundary&&(b+=N-V),R.__data=new Float32Array(Q.storage/Float32Array.BYTES_PER_ELEMENT),R.__offset=b,b+=Q.storage}}}let A=b%N;return A>0&&(b+=N-A),y.__size=b,y.__cache={},this}function _(y){let x={boundary:0,storage:0};return typeof y=="number"||typeof y=="boolean"?(x.boundary=4,x.storage=4):y.isVector2?(x.boundary=8,x.storage=8):y.isVector3||y.isColor?(x.boundary=16,x.storage=12):y.isVector4?(x.boundary=16,x.storage=16):y.isMatrix3?(x.boundary=48,x.storage=48):y.isMatrix4?(x.boundary=64,x.storage=64):y.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",y),x}function g(y){let x=y.target;x.removeEventListener("dispose",g);let b=s.indexOf(x.__bindingPointIndex);s.splice(b,1),e.deleteBuffer(n[x.id]),delete n[x.id],delete o[x.id]}function p(){for(let y in n)e.deleteBuffer(n[y]);s=[],n={},o={}}return{bind:d,update:c,dispose:p}}var jg=class{constructor(e={}){let{canvas:t=zh(),context:i=null,depth:r=!0,stencil:n=!1,alpha:o=!1,antialias:s=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:d=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let u;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");u=i.getContextAttributes().alpha}else u=o;let m=new Uint32Array(4),f=new Int32Array(4),v=null,_=null,g=[],p=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Z1,this._useLegacyLights=!1,this.toneMapping=h2,this.toneMappingExposure=1;let y=this,x=!1,b=0,N=0,A=null,C=-1,U=null,S=new f1,M=new f1,k=null,R=new Ue(0),D=0,B=t.width,Z=t.height,j=1,Q=null,V=null,J=new f1(0,0,B,Z),Y=new f1(0,0,B,Z),he=!1,ne=new fn,q=!1,K=!1,le=new Fe,de=new ye,ae=new I,Me={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Be(){return A===null?j:1}let z=i;function Ee(E,O){let H=t.getContext(E,O);return H!==null?H:null}try{let E={alpha:!0,depth:r,stencil:n,antialias:s,premultipliedAlpha:l,preserveDrawingBuffer:d,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r163"),t.addEventListener("webglcontextlost",P,!1),t.addEventListener("webglcontextrestored",pe,!1),t.addEventListener("webglcontextcreationerror",se,!1),z===null){let O="webgl2";if(z=Ee(O,E),z===null)throw Ee(O)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let ve,Le,we,Qe,Ce,T,w,W,$,re,L,ie,ee,me,fe,oe,Se,be,Ie,Ae,Xe,ze,e1,i1;function p1(){ve=new $f(z),ve.init(),Le=new Yf(z,ve,e),ze=new Ug(z,ve),we=new Rg(z),Qe=new ip(z),Ce=new xg,T=new Dg(z,ve,we,Ce,Le,ze,Qe),w=new Zf(y),W=new Kf(y),$=new su(z),e1=new jf(z,$),re=new ep(z,$,Qe,e1),L=new ap(z,re,$,Qe),Ie=new rp(z,Le,T),oe=new qf(Ce),ie=new vg(y,w,W,ve,Le,e1,oe),ee=new Gg(y,Ce),me=new Sg,fe=new Cg(ve),be=new Wf(y,w,W,we,L,u,l),Se=new Lg(y,L,Le),i1=new Wg(z,Qe,Le,we),Ae=new Xf(z,ve,Qe),Xe=new tp(z,ve,Qe),Qe.programs=ie.programs,y.capabilities=Le,y.extensions=ve,y.properties=Ce,y.renderLists=me,y.shadowMap=Se,y.state=we,y.info=Qe}p1();let xe=new Fg(y,z);this.xr=xe,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){let E=ve.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=ve.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(E){E!==void 0&&(j=E,this.setSize(B,Z,!1))},this.getSize=function(E){return E.set(B,Z)},this.setSize=function(E,O,H=!0){if(xe.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}B=E,Z=O,t.width=Math.floor(E*j),t.height=Math.floor(O*j),H===!0&&(t.style.width=E+"px",t.style.height=O+"px"),this.setViewport(0,0,E,O)},this.getDrawingBufferSize=function(E){return E.set(B*j,Z*j).floor()},this.setDrawingBufferSize=function(E,O,H){B=E,Z=O,j=H,t.width=Math.floor(E*H),t.height=Math.floor(O*H),this.setViewport(0,0,E,O)},this.getCurrentViewport=function(E){return E.copy(S)},this.getViewport=function(E){return E.copy(J)},this.setViewport=function(E,O,H,X){E.isVector4?J.set(E.x,E.y,E.z,E.w):J.set(E,O,H,X),we.viewport(S.copy(J).multiplyScalar(j).round())},this.getScissor=function(E){return E.copy(Y)},this.setScissor=function(E,O,H,X){E.isVector4?Y.set(E.x,E.y,E.z,E.w):Y.set(E,O,H,X),we.scissor(M.copy(Y).multiplyScalar(j).round())},this.getScissorTest=function(){return he},this.setScissorTest=function(E){we.setScissorTest(he=E)},this.setOpaqueSort=function(E){Q=E},this.setTransparentSort=function(E){V=E},this.getClearColor=function(E){return E.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(E=!0,O=!0,H=!0){let X=0;if(E){let F=!1;if(A!==null){let ue=A.texture.format;F=ue===go||ue===po||ue===fo}if(F){let ue=A.texture.type,Te=ue===Rt||ue===li||ue===co||ue===Tr||ue===uo||ue===mo,Ne=be.getClearColor(),Re=be.getClearAlpha(),Ye=Ne.r,He=Ne.g,Ge=Ne.b;Te?(m[0]=Ye,m[1]=He,m[2]=Ge,m[3]=Re,z.clearBufferuiv(z.COLOR,0,m)):(f[0]=Ye,f[1]=He,f[2]=Ge,f[3]=Re,z.clearBufferiv(z.COLOR,0,f))}else X|=z.COLOR_BUFFER_BIT}O&&(X|=z.DEPTH_BUFFER_BIT),H&&(X|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(X)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",P,!1),t.removeEventListener("webglcontextrestored",pe,!1),t.removeEventListener("webglcontextcreationerror",se,!1),me.dispose(),fe.dispose(),Ce.dispose(),w.dispose(),W.dispose(),L.dispose(),e1.dispose(),i1.dispose(),ie.dispose(),xe.dispose(),xe.removeEventListener("sessionstart",a1),xe.removeEventListener("sessionend",at),L1.stop()};function P(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function pe(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;let E=Qe.autoReset,O=Se.enabled,H=Se.autoUpdate,X=Se.needsUpdate,F=Se.type;p1(),Qe.autoReset=E,Se.enabled=O,Se.autoUpdate=H,Se.needsUpdate=X,Se.type=F}function se(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function Oe(E){let O=E.target;O.removeEventListener("dispose",Oe),Pe(O)}function Pe(E){Ke(E),Ce.remove(E)}function Ke(E){let O=Ce.get(E).programs;O!==void 0&&(O.forEach(function(H){ie.releaseProgram(H)}),E.isShaderMaterial&&ie.releaseShaderCache(E))}this.renderBufferDirect=function(E,O,H,X,F,ue){O===null&&(O=Me);let Te=F.isMesh&&F.matrixWorld.determinant()<0,Ne=$e(E,O,H,X,F);we.setMaterial(X,Te);let Re=H.index,Ye=1;if(X.wireframe===!0){if(Re=re.getWireframeAttribute(H),Re===void 0)return;Ye=2}let He=H.drawRange,Ge=H.attributes.position,_1=He.start*Ye,C1=(He.start+He.count)*Ye;ue!==null&&(_1=Math.max(_1,ue.start*Ye),C1=Math.min(C1,(ue.start+ue.count)*Ye)),Re!==null?(_1=Math.max(_1,0),C1=Math.min(C1,Re.count)):Ge!=null&&(_1=Math.max(_1,0),C1=Math.min(C1,Ge.count));let X1=C1-_1;if(X1<0||X1===1/0)return;e1.setup(F,X,Ne,H,Re);let xt,G=Ae;if(Re!==null&&(xt=$.get(Re),G=Xe,G.setIndex(xt)),F.isMesh)X.wireframe===!0?(we.setLineWidth(X.wireframeLinewidth*Be()),G.setMode(z.LINES)):G.setMode(z.TRIANGLES);else if(F.isLine){let te=X.linewidth;te===void 0&&(te=1),we.setLineWidth(te*Be()),F.isLineSegments?G.setMode(z.LINES):F.isLineLoop?G.setMode(z.LINE_LOOP):G.setMode(z.LINE_STRIP)}else F.isPoints?G.setMode(z.POINTS):F.isSprite&&G.setMode(z.TRIANGLES);if(F.isBatchedMesh)G.renderMultiDraw(F._multiDrawStarts,F._multiDrawCounts,F._multiDrawCount);else if(F.isInstancedMesh)G.renderInstances(_1,X1,F.count);else if(H.isInstancedBufferGeometry){let te=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,De=Math.min(H.instanceCount,te);G.renderInstances(_1,X1,De)}else G.render(_1,X1)};function r1(E,O,H){E.transparent===!0&&E.side===ut&&E.forceSinglePass===!1?(E.side=et,E.needsUpdate=!0,ge(E,O,H),E.side=Nt,E.needsUpdate=!0,ge(E,O,H),E.side=ut):ge(E,O,H)}this.compile=function(E,O,H=null){H===null&&(H=E),_=fe.get(H),_.init(),p.push(_),H.traverseVisible(function(F){F.isLight&&F.layers.test(O.layers)&&(_.pushLight(F),F.castShadow&&_.pushShadow(F))}),E!==H&&E.traverseVisible(function(F){F.isLight&&F.layers.test(O.layers)&&(_.pushLight(F),F.castShadow&&_.pushShadow(F))}),_.setupLights(y._useLegacyLights);let X=new Set;return E.traverse(function(F){let ue=F.material;if(ue)if(Array.isArray(ue))for(let Te=0;Te<ue.length;Te++){let Ne=ue[Te];r1(Ne,H,F),X.add(Ne)}else r1(ue,H,F),X.add(ue)}),p.pop(),_=null,X},this.compileAsync=function(E,O,H=null){let X=this.compile(E,O,H);return new Promise(F=>{function ue(){if(X.forEach(function(Te){Ce.get(Te).currentProgram.isReady()&&X.delete(Te)}),X.size===0){F(E);return}setTimeout(ue,10)}ve.get("KHR_parallel_shader_compile")!==null?ue():setTimeout(ue,10)})};let o1=null;function A1(E){o1&&o1(E)}function a1(){L1.stop()}function at(){L1.start()}let L1=new Ts;L1.setAnimationLoop(A1),typeof self<"u"&&L1.setContext(self),this.setAnimationLoop=function(E){o1=E,xe.setAnimationLoop(E),E===null?L1.stop():L1.start()},xe.addEventListener("sessionstart",a1),xe.addEventListener("sessionend",at),this.render=function(E,O){if(O!==void 0&&O.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(x===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),O.parent===null&&O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),xe.enabled===!0&&xe.isPresenting===!0&&(xe.cameraAutoUpdate===!0&&xe.updateCamera(O),O=xe.getCamera()),E.isScene===!0&&E.onBeforeRender(y,E,O,A),_=fe.get(E,p.length),_.init(),p.push(_),le.multiplyMatrices(O.projectionMatrix,O.matrixWorldInverse),ne.setFromProjectionMatrix(le),K=this.localClippingEnabled,q=oe.init(this.clippingPlanes,K),v=me.get(E,g.length),v.init(),g.push(v),vt(E,O,0,y.sortObjects),v.finish(),y.sortObjects===!0&&v.sort(Q,V),this.info.render.frame++,q===!0&&oe.beginShadows();let H=_.state.shadowsArray;if(Se.render(H,E,O),q===!0&&oe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(xe.enabled===!1||xe.isPresenting===!1||xe.hasDepthSensing()===!1)&&be.render(v,E),_.setupLights(y._useLegacyLights),O.isArrayCamera){let X=O.cameras;for(let F=0,ue=X.length;F<ue;F++){let Te=X[F];It(v,E,Te,Te.viewport)}}else It(v,E,O);A!==null&&(T.updateMultisampleRenderTarget(A),T.updateRenderTargetMipmap(A)),E.isScene===!0&&E.onAfterRender(y,E,O),e1.resetDefaultState(),C=-1,U=null,p.pop(),p.length>0?_=p[p.length-1]:_=null,g.pop(),g.length>0?v=g[g.length-1]:v=null};function vt(E,O,H,X){if(E.visible===!1)return;if(E.layers.test(O.layers)){if(E.isGroup)H=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(O);else if(E.isLight)_.pushLight(E),E.castShadow&&_.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||ne.intersectsSprite(E)){X&&ae.setFromMatrixPosition(E.matrixWorld).applyMatrix4(le);let ue=L.update(E),Te=E.material;Te.visible&&v.push(E,ue,Te,H,ae.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||ne.intersectsObject(E))){let ue=L.update(E),Te=E.material;if(X&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ae.copy(E.boundingSphere.center)):(ue.boundingSphere===null&&ue.computeBoundingSphere(),ae.copy(ue.boundingSphere.center)),ae.applyMatrix4(E.matrixWorld).applyMatrix4(le)),Array.isArray(Te)){let Ne=ue.groups;for(let Re=0,Ye=Ne.length;Re<Ye;Re++){let He=Ne[Re],Ge=Te[He.materialIndex];Ge&&Ge.visible&&v.push(E,ue,Ge,H,ae.z,He)}}else Te.visible&&v.push(E,ue,Te,H,ae.z,null)}}let F=E.children;for(let ue=0,Te=F.length;ue<Te;ue++)vt(F[ue],O,H,X)}function It(E,O,H,X){let F=E.opaque,ue=E.transmissive,Te=E.transparent;_.setupLightsView(H),q===!0&&oe.setGlobalState(y.clippingPlanes,H),ue.length>0&&pa(F,ue,O,H),X&&we.viewport(S.copy(X)),F.length>0&&c2(F,O,H),ue.length>0&&c2(ue,O,H),Te.length>0&&c2(Te,O,H),we.buffers.depth.setTest(!0),we.buffers.depth.setMask(!0),we.buffers.color.setMask(!0),we.setPolygonOffset(!1)}function pa(E,O,H,X){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;if(_.state.transmissionRenderTarget===null){_.state.transmissionRenderTarget=new S1(1,1,{generateMipmaps:!0,type:ve.has("EXT_color_buffer_half_float")||ve.has("EXT_color_buffer_float")?ot:Rt,minFilter:qt,samples:4,stencilBuffer:n});let Re=Ce.get(_.state.transmissionRenderTarget);Re.__isTransmissionRenderTarget=!0}let F=_.state.transmissionRenderTarget;y.getDrawingBufferSize(de),F.setSize(de.x,de.y);let ue=y.getRenderTarget();y.setRenderTarget(F),y.getClearColor(R),D=y.getClearAlpha(),D<1&&y.setClearColor(16777215,.5),y.clear();let Te=y.toneMapping;y.toneMapping=h2,c2(E,H,X),T.updateMultisampleRenderTarget(F),T.updateRenderTargetMipmap(F);let Ne=!1;for(let Re=0,Ye=O.length;Re<Ye;Re++){let He=O[Re],Ge=He.object,_1=He.geometry,C1=He.material,X1=He.group;if(C1.side===ut&&Ge.layers.test(X.layers)){let xt=C1.side;C1.side=et,C1.needsUpdate=!0,ce(Ge,H,X,_1,C1,X1),C1.side=xt,C1.needsUpdate=!0,Ne=!0}}Ne===!0&&(T.updateMultisampleRenderTarget(F),T.updateRenderTargetMipmap(F)),y.setRenderTarget(ue),y.setClearColor(R,D),y.toneMapping=Te}function c2(E,O,H){let X=O.isScene===!0?O.overrideMaterial:null;for(let F=0,ue=E.length;F<ue;F++){let Te=E[F],Ne=Te.object,Re=Te.geometry,Ye=X===null?Te.material:X,He=Te.group;Ne.layers.test(H.layers)&&ce(Ne,O,H,Re,Ye,He)}}function ce(E,O,H,X,F,ue){E.onBeforeRender(y,O,H,X,F,ue),E.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),F.onBeforeRender(y,O,H,X,E,ue),F.transparent===!0&&F.side===ut&&F.forceSinglePass===!1?(F.side=et,F.needsUpdate=!0,y.renderBufferDirect(H,O,X,F,E,ue),F.side=Nt,F.needsUpdate=!0,y.renderBufferDirect(H,O,X,F,E,ue),F.side=ut):y.renderBufferDirect(H,O,X,F,E,ue),E.onAfterRender(y,O,H,X,F,ue)}function ge(E,O,H){O.isScene!==!0&&(O=Me);let X=Ce.get(E),F=_.state.lights,ue=_.state.shadowsArray,Te=F.state.version,Ne=ie.getParameters(E,F.state,ue,O,H),Re=ie.getProgramCacheKey(Ne),Ye=X.programs;X.environment=E.isMeshStandardMaterial?O.environment:null,X.fog=O.fog,X.envMap=(E.isMeshStandardMaterial?W:w).get(E.envMap||X.environment),X.envMapRotation=X.environment!==null&&E.envMap===null?O.environmentRotation:E.envMapRotation,Ye===void 0&&(E.addEventListener("dispose",Oe),Ye=new Map,X.programs=Ye);let He=Ye.get(Re);if(He!==void 0){if(X.currentProgram===He&&X.lightsStateVersion===Te)return $1(E,Ne),He}else Ne.uniforms=ie.getUniforms(E),E.onBuild(H,Ne,y),E.onBeforeCompile(Ne,y),He=ie.acquireProgram(Ne,Re),Ye.set(Re,He),X.uniforms=Ne.uniforms;let Ge=X.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Ge.clippingPlanes=oe.uniform),$1(E,Ne),X.needsLights=L2(E),X.lightsStateVersion=Te,X.needsLights&&(Ge.ambientLightColor.value=F.state.ambient,Ge.lightProbe.value=F.state.probe,Ge.directionalLights.value=F.state.directional,Ge.directionalLightShadows.value=F.state.directionalShadow,Ge.spotLights.value=F.state.spot,Ge.spotLightShadows.value=F.state.spotShadow,Ge.rectAreaLights.value=F.state.rectArea,Ge.ltc_1.value=F.state.rectAreaLTC1,Ge.ltc_2.value=F.state.rectAreaLTC2,Ge.pointLights.value=F.state.point,Ge.pointLightShadows.value=F.state.pointShadow,Ge.hemisphereLights.value=F.state.hemi,Ge.directionalShadowMap.value=F.state.directionalShadowMap,Ge.directionalShadowMatrix.value=F.state.directionalShadowMatrix,Ge.spotShadowMap.value=F.state.spotShadowMap,Ge.spotLightMatrix.value=F.state.spotLightMatrix,Ge.spotLightMap.value=F.state.spotLightMap,Ge.pointShadowMap.value=F.state.pointShadowMap,Ge.pointShadowMatrix.value=F.state.pointShadowMatrix),X.currentProgram=He,X.uniformsList=null,He}function d1(E){if(E.uniformsList===null){let O=E.currentProgram.getUniforms();E.uniformsList=$a.seqWithValue(O.seq,E.uniforms)}return E.uniformsList}function $1(E,O){let H=Ce.get(E);H.outputColorSpace=O.outputColorSpace,H.batching=O.batching,H.instancing=O.instancing,H.instancingColor=O.instancingColor,H.instancingMorph=O.instancingMorph,H.skinning=O.skinning,H.morphTargets=O.morphTargets,H.morphNormals=O.morphNormals,H.morphColors=O.morphColors,H.morphTargetsCount=O.morphTargetsCount,H.numClippingPlanes=O.numClippingPlanes,H.numIntersection=O.numClipIntersection,H.vertexAlphas=O.vertexAlphas,H.vertexTangents=O.vertexTangents,H.toneMapping=O.toneMapping}function $e(E,O,H,X,F){O.isScene!==!0&&(O=Me),T.resetTextureUnits();let ue=O.fog,Te=X.isMeshStandardMaterial?O.environment:null,Ne=A===null?y.outputColorSpace:A.isXRRenderTarget===!0?A.texture.colorSpace:U1,Re=(X.isMeshStandardMaterial?W:w).get(X.envMap||Te),Ye=X.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,He=!!H.attributes.tangent&&(!!X.normalMap||X.anisotropy>0),Ge=!!H.morphAttributes.position,_1=!!H.morphAttributes.normal,C1=!!H.morphAttributes.color,X1=h2;X.toneMapped&&(A===null||A.isXRRenderTarget===!0)&&(X1=y.toneMapping);let xt=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,G=xt!==void 0?xt.length:0,te=Ce.get(X),De=_.state.lights;if(q===!0&&(K===!0||E!==U)){let yt=E===U&&X.id===C;oe.setState(X,E,yt)}let E1=!1;X.version===te.__version?(te.needsLights&&te.lightsStateVersion!==De.state.version||te.outputColorSpace!==Ne||F.isBatchedMesh&&te.batching===!1||!F.isBatchedMesh&&te.batching===!0||F.isInstancedMesh&&te.instancing===!1||!F.isInstancedMesh&&te.instancing===!0||F.isSkinnedMesh&&te.skinning===!1||!F.isSkinnedMesh&&te.skinning===!0||F.isInstancedMesh&&te.instancingColor===!0&&F.instanceColor===null||F.isInstancedMesh&&te.instancingColor===!1&&F.instanceColor!==null||F.isInstancedMesh&&te.instancingMorph===!0&&F.morphTexture===null||F.isInstancedMesh&&te.instancingMorph===!1&&F.morphTexture!==null||te.envMap!==Re||X.fog===!0&&te.fog!==ue||te.numClippingPlanes!==void 0&&(te.numClippingPlanes!==oe.numPlanes||te.numIntersection!==oe.numIntersection)||te.vertexAlphas!==Ye||te.vertexTangents!==He||te.morphTargets!==Ge||te.morphNormals!==_1||te.morphColors!==C1||te.toneMapping!==X1||te.morphTargetsCount!==G)&&(E1=!0):(E1=!0,te.__version=X.version);let nt=te.currentProgram;E1===!0&&(nt=ge(X,O,F));let S3=!1,ga=!1,U0=!1,Y1=nt.getUniforms(),R2=te.uniforms;if(we.useProgram(nt.program)&&(S3=!0,ga=!0,U0=!0),X.id!==C&&(C=X.id,ga=!0),S3||U!==E){Y1.setValue(z,"projectionMatrix",E.projectionMatrix),Y1.setValue(z,"viewMatrix",E.matrixWorldInverse);let yt=Y1.map.cameraPosition;yt!==void 0&&yt.setValue(z,ae.setFromMatrixPosition(E.matrixWorld)),Le.logarithmicDepthBuffer&&Y1.setValue(z,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(X.isMeshPhongMaterial||X.isMeshToonMaterial||X.isMeshLambertMaterial||X.isMeshBasicMaterial||X.isMeshStandardMaterial||X.isShaderMaterial)&&Y1.setValue(z,"isOrthographic",E.isOrthographicCamera===!0),U!==E&&(U=E,ga=!0,U0=!0)}if(F.isSkinnedMesh){Y1.setOptional(z,F,"bindMatrix"),Y1.setOptional(z,F,"bindMatrixInverse");let yt=F.skeleton;yt&&(yt.boneTexture===null&&yt.computeBoneTexture(),Y1.setValue(z,"boneTexture",yt.boneTexture,T))}F.isBatchedMesh&&(Y1.setOptional(z,F,"batchingTexture"),Y1.setValue(z,"batchingTexture",F._matricesTexture,T));let k0=H.morphAttributes;if((k0.position!==void 0||k0.normal!==void 0||k0.color!==void 0)&&Ie.update(F,H,nt),(ga||te.receiveShadow!==F.receiveShadow)&&(te.receiveShadow=F.receiveShadow,Y1.setValue(z,"receiveShadow",F.receiveShadow)),X.isMeshGouraudMaterial&&X.envMap!==null&&(R2.envMap.value=Re,R2.flipEnvMap.value=Re.isCubeTexture&&Re.isRenderTargetTexture===!1?-1:1),X.isMeshStandardMaterial&&X.envMap===null&&O.environment!==null&&(R2.envMapIntensity.value=O.environmentIntensity),ga&&(Y1.setValue(z,"toneMappingExposure",y.toneMappingExposure),te.needsLights&&Je(R2,U0),ue&&X.fog===!0&&ee.refreshFogUniforms(R2,ue),ee.refreshMaterialUniforms(R2,X,j,Z,_.state.transmissionRenderTarget),$a.upload(z,d1(te),R2,T)),X.isShaderMaterial&&X.uniformsNeedUpdate===!0&&($a.upload(z,d1(te),R2,T),X.uniformsNeedUpdate=!1),X.isSpriteMaterial&&Y1.setValue(z,"center",F.center),Y1.setValue(z,"modelViewMatrix",F.modelViewMatrix),Y1.setValue(z,"normalMatrix",F.normalMatrix),Y1.setValue(z,"modelMatrix",F.matrixWorld),X.isShaderMaterial||X.isRawShaderMaterial){let yt=X.uniformsGroups;for(let O0=0,uM=yt.length;O0<uM;O0++){let E4=yt[O0];i1.update(E4,nt),i1.bind(E4,nt)}}return nt}function Je(E,O){E.ambientLightColor.needsUpdate=O,E.lightProbe.needsUpdate=O,E.directionalLights.needsUpdate=O,E.directionalLightShadows.needsUpdate=O,E.pointLights.needsUpdate=O,E.pointLightShadows.needsUpdate=O,E.spotLights.needsUpdate=O,E.spotLightShadows.needsUpdate=O,E.rectAreaLights.needsUpdate=O,E.hemisphereLights.needsUpdate=O}function L2(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return A},this.setRenderTargetTextures=function(E,O,H){Ce.get(E.texture).__webglTexture=O,Ce.get(E.depthTexture).__webglTexture=H;let X=Ce.get(E);X.__hasExternalTextures=!0,X.__autoAllocateDepthBuffer=H===void 0,X.__autoAllocateDepthBuffer||ve.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),X.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,O){let H=Ce.get(E);H.__webglFramebuffer=O,H.__useDefaultFramebuffer=O===void 0},this.setRenderTarget=function(E,O=0,H=0){A=E,b=O,N=H;let X=!0,F=null,ue=!1,Te=!1;if(E){let Ne=Ce.get(E);Ne.__useDefaultFramebuffer!==void 0?(we.bindFramebuffer(z.FRAMEBUFFER,null),X=!1):Ne.__webglFramebuffer===void 0?T.setupRenderTarget(E):Ne.__hasExternalTextures&&T.rebindTextures(E,Ce.get(E.texture).__webglTexture,Ce.get(E.depthTexture).__webglTexture);let Re=E.texture;(Re.isData3DTexture||Re.isDataArrayTexture||Re.isCompressedArrayTexture)&&(Te=!0);let Ye=Ce.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Ye[O])?F=Ye[O][H]:F=Ye[O],ue=!0):E.samples>0&&T.useMultisampledRTT(E)===!1?F=Ce.get(E).__webglMultisampledFramebuffer:Array.isArray(Ye)?F=Ye[H]:F=Ye,S.copy(E.viewport),M.copy(E.scissor),k=E.scissorTest}else S.copy(J).multiplyScalar(j).floor(),M.copy(Y).multiplyScalar(j).floor(),k=he;if(we.bindFramebuffer(z.FRAMEBUFFER,F)&&X&&we.drawBuffers(E,F),we.viewport(S),we.scissor(M),we.setScissorTest(k),ue){let Ne=Ce.get(E.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+O,Ne.__webglTexture,H)}else if(Te){let Ne=Ce.get(E.texture),Re=O||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ne.__webglTexture,H||0,Re)}C=-1},this.readRenderTargetPixels=function(E,O,H,X,F,ue,Te){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ne=Ce.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&Te!==void 0&&(Ne=Ne[Te]),Ne){we.bindFramebuffer(z.FRAMEBUFFER,Ne);try{let Re=E.texture,Ye=Re.format,He=Re.type;if(Ye!==D1&&ze.convert(Ye)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let Ge=He===ot&&(ve.has("EXT_color_buffer_half_float")||ve.has("EXT_color_buffer_float"));if(He!==Rt&&ze.convert(He)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&He!==q1&&!Ge){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}O>=0&&O<=E.width-X&&H>=0&&H<=E.height-F&&z.readPixels(O,H,X,F,ze.convert(Ye),ze.convert(He),ue)}finally{let Re=A!==null?Ce.get(A).__webglFramebuffer:null;we.bindFramebuffer(z.FRAMEBUFFER,Re)}}},this.copyFramebufferToTexture=function(E,O,H=0){let X=Math.pow(2,-H),F=Math.floor(O.image.width*X),ue=Math.floor(O.image.height*X);T.setTexture2D(O,0),z.copyTexSubImage2D(z.TEXTURE_2D,H,0,0,E.x,E.y,F,ue),we.unbindTexture()},this.copyTextureToTexture=function(E,O,H,X=0){let F=O.image.width,ue=O.image.height,Te=ze.convert(H.format),Ne=ze.convert(H.type);T.setTexture2D(H,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,H.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,H.unpackAlignment),O.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,X,E.x,E.y,F,ue,Te,Ne,O.image.data):O.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,X,E.x,E.y,O.mipmaps[0].width,O.mipmaps[0].height,Te,O.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,X,E.x,E.y,Te,Ne,O.image),X===0&&H.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),we.unbindTexture()},this.copyTextureToTexture3D=function(E,O,H,X,F=0){let ue=Math.round(E.max.x-E.min.x),Te=Math.round(E.max.y-E.min.y),Ne=E.max.z-E.min.z+1,Re=ze.convert(X.format),Ye=ze.convert(X.type),He;if(X.isData3DTexture)T.setTexture3D(X,0),He=z.TEXTURE_3D;else if(X.isDataArrayTexture||X.isCompressedArrayTexture)T.setTexture2DArray(X,0),He=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,X.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,X.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,X.unpackAlignment);let Ge=z.getParameter(z.UNPACK_ROW_LENGTH),_1=z.getParameter(z.UNPACK_IMAGE_HEIGHT),C1=z.getParameter(z.UNPACK_SKIP_PIXELS),X1=z.getParameter(z.UNPACK_SKIP_ROWS),xt=z.getParameter(z.UNPACK_SKIP_IMAGES),G=H.isCompressedTexture?H.mipmaps[F]:H.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,G.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,G.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,E.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,E.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,E.min.z),H.isDataTexture||H.isData3DTexture?z.texSubImage3D(He,F,O.x,O.y,O.z,ue,Te,Ne,Re,Ye,G.data):X.isCompressedArrayTexture?z.compressedTexSubImage3D(He,F,O.x,O.y,O.z,ue,Te,Ne,Re,G.data):z.texSubImage3D(He,F,O.x,O.y,O.z,ue,Te,Ne,Re,Ye,G),z.pixelStorei(z.UNPACK_ROW_LENGTH,Ge),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,_1),z.pixelStorei(z.UNPACK_SKIP_PIXELS,C1),z.pixelStorei(z.UNPACK_SKIP_ROWS,X1),z.pixelStorei(z.UNPACK_SKIP_IMAGES,xt),F===0&&X.generateMipmaps&&z.generateMipmap(He),we.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?T.setTextureCube(E,0):E.isData3DTexture?T.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?T.setTexture2DArray(E,0):T.setTexture2D(E,0),we.unbindTexture()},this.resetState=function(){b=0,N=0,A=null,we.reset(),e1.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Zt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;let t=this.getContext();t.drawingBufferColorSpace=e===W3?"display-p3":"srgb",t.unpackColorSpace=n1.workingColorSpace===Aa?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}},S2=class extends I1{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new k1,this.environmentIntensity=1,this.environmentRotation=new k1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){let t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},Xg=class{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=j3,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=St()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return es("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,i){e*=this.stride,i*=t.stride;for(let r=0,n=this.stride;r<n;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=St()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=St()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}},J1=new I,Yg=class D4{constructor(t,i,r,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=r,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,r=this.data.count;i<r;i++)J1.fromBufferAttribute(this,i),J1.applyMatrix4(t),this.setXYZ(i,J1.x,J1.y,J1.z);return this}applyNormalMatrix(t){for(let i=0,r=this.count;i<r;i++)J1.fromBufferAttribute(this,i),J1.applyNormalMatrix(t),this.setXYZ(i,J1.x,J1.y,J1.z);return this}transformDirection(t){for(let i=0,r=this.count;i<r;i++)J1.fromBufferAttribute(this,i),J1.transformDirection(t),this.setXYZ(i,J1.x,J1.y,J1.z);return this}getComponent(t,i){let r=this.array[t*this.data.stride+this.offset+i];return this.normalized&&(r=Mt(r,this.array)),r}setComponent(t,i,r){return this.normalized&&(r=l1(r,this.array)),this.data.array[t*this.data.stride+this.offset+i]=r,this}setX(t,i){return this.normalized&&(i=l1(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=l1(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=l1(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=l1(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Mt(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Mt(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Mt(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Mt(i,this.array)),i}setXY(t,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(i=l1(i,this.array),r=l1(r,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this}setXYZ(t,i,r,n){return t=t*this.data.stride+this.offset,this.normalized&&(i=l1(i,this.array),r=l1(r,this.array),n=l1(n,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this}setXYZW(t,i,r,n,o){return t=t*this.data.stride+this.offset,this.normalized&&(i=l1(i,this.array),r=l1(r,this.array),n=l1(n,this.array),o=l1(o,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this.data.array[t+3]=o,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)i.push(this.data.array[n+o])}return new W1(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new D4(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let o=0;o<this.itemSize;o++)i.push(this.data.array[n+o])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},rl=new I,al=new f1,nl=new f1,qg=new I,ol=new Fe,e3=new I,An=new Dt,sl=new Fe,En=new kr,Zg=class extends v1{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=oo,this.bindMatrix=new Fe,this.bindMatrixInverse=new Fe,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Qt),this.boundingBox.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,e3),this.boundingBox.expandByPoint(e3)}computeBoundingSphere(){let e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Dt),this.boundingSphere.makeEmpty();let t=e.getAttribute("position");for(let i=0;i<t.count;i++)this.getVertexPosition(i,e3),this.boundingSphere.expandByPoint(e3)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){let i=this.material,r=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),An.copy(this.boundingSphere),An.applyMatrix4(r),e.ray.intersectsSphere(An)!==!1&&(sl.copy(r).invert(),En.copy(e.ray).applyMatrix4(sl),!(this.boundingBox!==null&&En.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,En)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){let e=new f1,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.fromBufferAttribute(t,i);let n=1/e.manhattanLength();n!==1/0?e.multiplyScalar(n):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===oo?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===eh?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){let i=this.skeleton,r=this.geometry;al.fromBufferAttribute(r.attributes.skinIndex,e),nl.fromBufferAttribute(r.attributes.skinWeight,e),rl.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let n=0;n<4;n++){let o=nl.getComponent(n);if(o!==0){let s=al.getComponent(n);ol.multiplyMatrices(i.bones[s].matrixWorld,i.boneInverses[s]),t.addScaledVector(qg.copy(rl).applyMatrix4(ol),o)}}return t.applyMatrix4(this.bindMatrixInverse)}},ll=class extends I1{constructor(){super(),this.isBone=!0,this.type="Bone"}},M2=class extends tt{constructor(e=null,t=1,i=1,r,n,o,s,l,d=u1,c=u1,h,u){super(null,o,s,l,d,c,r,n,h,u),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},cl=new Fe,Qg=new Fe,Jg=class U4{constructor(t=[],i=[]){this.uuid=St(),this.bones=t.slice(0),this.boneInverses=i,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){let t=this.bones,i=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),i.length===0)this.calculateInverses();else if(t.length!==i.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,n=this.bones.length;r<n;r++)this.boneInverses.push(new Fe)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,i=this.bones.length;t<i;t++){let r=new Fe;this.bones[t]&&r.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&r.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){let t=this.bones,i=this.boneInverses,r=this.boneMatrices,n=this.boneTexture;for(let o=0,s=t.length;o<s;o++){let l=t[o]?t[o].matrixWorld:Qg;cl.multiplyMatrices(l,i[o]),cl.toArray(r,o*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new U4(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=Math.ceil(t/4)*4,t=Math.max(t,4);let i=new Float32Array(t*t*4);i.set(this.boneMatrices);let r=new M2(i,t,t,D1,q1);return r.needsUpdate=!0,this.boneMatrices=i,this.boneTexture=r,this}getBoneByName(t){for(let i=0,r=this.bones.length;i<r;i++){let n=this.bones[i];if(n.name===t)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,i){this.uuid=t.uuid;for(let r=0,n=t.bones.length;r<n;r++){let o=t.bones[r],s=i[o];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",o),s=new ll),this.bones.push(s),this.boneInverses.push(new Fe().fromArray(t.boneInverses[r]))}return this.init(),this}toJSON(){let t={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let i=this.bones,r=this.boneInverses;for(let n=0,o=i.length;n<o;n++){let s=i[n];t.bones.push(s.uuid);let l=r[n];t.boneInverses.push(l.toArray())}return t}},bn=class extends W1{constructor(e,t,i,r=1){super(e,t,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){let e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}},Ui=new Fe,dl=new Fe,t3=[],hl=new Qt,Kg=new Fe,Br=new v1,Fr=new Dt,$g=class extends v1{constructor(e,t,i){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new bn(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<i;r++)this.setMatrixAt(r,Kg)}computeBoundingBox(){let e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Qt),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Ui),hl.copy(e.boundingBox).applyMatrix4(Ui),this.boundingBox.union(hl)}computeBoundingSphere(){let e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Dt),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<t;i++)this.getMatrixAt(i,Ui),Fr.copy(e.boundingSphere).applyMatrix4(Ui),this.boundingSphere.union(Fr)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){let i=t.morphTargetInfluences,r=this.morphTexture.source.data.data,n=i.length+1,o=e*n+1;for(let s=0;s<i.length;s++)i[s]=r[o+s]}raycast(e,t){let i=this.matrixWorld,r=this.count;if(Br.geometry=this.geometry,Br.material=this.material,Br.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Fr.copy(this.boundingSphere),Fr.applyMatrix4(i),e.ray.intersectsSphere(Fr)!==!1))for(let n=0;n<r;n++){this.getMatrixAt(n,Ui),dl.multiplyMatrices(i,Ui),Br.matrixWorld=dl,Br.raycast(e,t3);for(let o=0,s=t3.length;o<s;o++){let l=t3[o];l.instanceId=n,l.object=this,t.push(l)}t3.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new bn(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){let i=t.morphTargetInfluences,r=i.length+1;this.morphTexture===null&&(this.morphTexture=new M2(new Float32Array(r*this.count),r,this.count,k3,q1));let n=this.morphTexture.source.data.data,o=0;for(let d=0;d<i.length;d++)o+=i[d];let s=this.geometry.morphTargetsRelative?1:1-o,l=r*e;n[l]=s,n.set(i,l+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}},ul=class extends mt{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ue(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}},ml=new I,fl=new I,pl=new Fe,Cn=new kr,i3=new Dt,Tn=class extends I1{constructor(e=new Ut,t=new ul){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[0];for(let r=1,n=t.count;r<n;r++)ml.fromBufferAttribute(t,r-1),fl.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=ml.distanceTo(fl);e.setAttribute("lineDistance",new it(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),i3.copy(i.boundingSphere),i3.applyMatrix4(r),i3.radius+=n,e.ray.intersectsSphere(i3)===!1)return;pl.copy(r).invert(),Cn.copy(e.ray).applyMatrix4(pl);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,d=new I,c=new I,h=new I,u=new I,m=this.isLineSegments?2:1,f=i.index,v=i.attributes.position;if(f!==null){let _=Math.max(0,o.start),g=Math.min(f.count,o.start+o.count);for(let p=_,y=g-1;p<y;p+=m){let x=f.getX(p),b=f.getX(p+1);if(d.fromBufferAttribute(v,x),c.fromBufferAttribute(v,b),Cn.distanceSqToSegment(d,c,u,h)>l)continue;u.applyMatrix4(this.matrixWorld);let N=e.ray.origin.distanceTo(u);N<e.near||N>e.far||t.push({distance:N,point:h.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}else{let _=Math.max(0,o.start),g=Math.min(v.count,o.start+o.count);for(let p=_,y=g-1;p<y;p+=m){if(d.fromBufferAttribute(v,p),c.fromBufferAttribute(v,p+1),Cn.distanceSqToSegment(d,c,u,h)>l)continue;u.applyMatrix4(this.matrixWorld);let x=e.ray.origin.distanceTo(u);x<e.near||x>e.far||t.push({distance:x,point:h.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}},gl=new I,_l=new I,e8=class extends Tn{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,i=[];for(let r=0,n=t.count;r<n;r+=2)gl.fromBufferAttribute(t,r),_l.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+gl.distanceTo(_l);e.setAttribute("lineDistance",new it(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},t8=class extends Tn{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}},vl=class extends mt{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ue(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},xl=new Fe,In=new kr,r3=new Dt,a3=new I,i8=class extends I1{constructor(e=new Ut,t=new vl){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){let i=this.geometry,r=this.matrixWorld,n=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),r3.copy(i.boundingSphere),r3.applyMatrix4(r),r3.radius+=n,e.ray.intersectsSphere(r3)===!1)return;xl.copy(r).invert(),In.copy(e.ray).applyMatrix4(xl);let s=n/((this.scale.x+this.scale.y+this.scale.z)/3),l=s*s,d=i.index,c=i.attributes.position;if(d!==null){let h=Math.max(0,o.start),u=Math.min(d.count,o.start+o.count);for(let m=h,f=u;m<f;m++){let v=d.getX(m);a3.fromBufferAttribute(c,v),yl(a3,v,l,r,e,t,this)}}else{let h=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let m=h,f=u;m<f;m++)a3.fromBufferAttribute(c,m),yl(a3,m,l,r,e,t,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let i=e[t[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++){let o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}};function yl(e,t,i,r,n,o,s){let l=In.distanceSqToPoint(e);if(l<i){let d=new I;In.closestPointToPoint(e,d),d.applyMatrix4(r);let c=n.ray.origin.distanceTo(d);if(c<n.near||c>n.far)return;o.push({distance:c,distanceToRay:Math.sqrt(l),point:d,index:t,face:null,object:s})}}var r8=class k4 extends Ut{constructor(t=1,i=32,r=16,n=0,o=Math.PI*2,s=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:r,phiStart:n,phiLength:o,thetaStart:s,thetaLength:l},i=Math.max(3,Math.floor(i)),r=Math.max(2,Math.floor(r));let d=Math.min(s+l,Math.PI),c=0,h=[],u=new I,m=new I,f=[],v=[],_=[],g=[];for(let p=0;p<=r;p++){let y=[],x=p/r,b=0;p===0&&s===0?b=.5/i:p===r&&d===Math.PI&&(b=-.5/i);for(let N=0;N<=i;N++){let A=N/i;u.x=-t*Math.cos(n+A*o)*Math.sin(s+x*l),u.y=t*Math.cos(s+x*l),u.z=t*Math.sin(n+A*o)*Math.sin(s+x*l),v.push(u.x,u.y,u.z),m.copy(u).normalize(),_.push(m.x,m.y,m.z),g.push(A+b,1-x),y.push(c++)}h.push(y)}for(let p=0;p<r;p++)for(let y=0;y<i;y++){let x=h[p][y+1],b=h[p][y],N=h[p+1][y],A=h[p+1][y+1];(p!==0||s>0)&&f.push(x,b,A),(p!==r-1||d<Math.PI)&&f.push(b,N,A)}this.setIndex(f),this.setAttribute("position",new it(v,3)),this.setAttribute("normal",new it(_,3)),this.setAttribute("uv",new it(g,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new k4(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},Pn=class extends mt{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ue(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ue(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Yo,this.normalScale=new ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new k1,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},i2=class extends Pn{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ye(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return H1(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ue(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ue(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ue(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};function n3(e,t,i){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT=="number"?new t(e):Array.prototype.slice.call(e)}function a8(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function n8(e){function t(n,o){return e[n]-e[o]}let i=e.length,r=new Array(i);for(let n=0;n!==i;++n)r[n]=n;return r.sort(t),r}function Sl(e,t,i){let r=e.length,n=new e.constructor(r);for(let o=0,s=0;s!==r;++o){let l=i[o]*t;for(let d=0;d!==t;++d)n[s++]=e[l+d]}return n}function Ml(e,t,i,r){let n=1,o=e[0];for(;o!==void 0&&o[r]===void 0;)o=e[n++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(t.push(o.time),i.push.apply(i,s)),o=e[n++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(t.push(o.time),s.toArray(i,i.length)),o=e[n++];while(o!==void 0);else do s=o[r],s!==void 0&&(t.push(o.time),i.push(s)),o=e[n++];while(o!==void 0)}var Hr=class{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){let t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{let o;i:{r:if(!(e<r)){for(let s=i+2;;){if(r===void 0){if(e<n)break r;return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===s)break;if(n=r,r=t[++i],e<r)break t}o=t.length;break i}if(!(e>=n)){let s=t[1];e<s&&(i=2,n=s);for(let l=i-2;;){if(n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===l)break;if(r=n,n=t[--i-1],e>=n)break t}o=i,i=0;break i}break e}for(;i<o;){let s=i+o>>>1;e<t[s]?o=s:i=s+1}if(r=t[i],n=t[i-1],n===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return i=t.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r;for(let o=0;o!==r;++o)t[o]=i[n+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},o8=class extends Hr{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Go,endingEnd:Go}}intervalChanged_(e,t,i){let r=this.parameterPositions,n=e-2,o=e+1,s=r[n],l=r[o];if(s===void 0)switch(this.getSettings_().endingStart){case Wo:n=e,s=2*t-i;break;case jo:n=r.length-2,s=t+r[n]-r[n+1];break;default:n=e,s=i}if(l===void 0)switch(this.getSettings_().endingEnd){case Wo:o=e,l=2*i-t;break;case jo:o=1,l=i+r[1]-r[0];break;default:o=e-1,l=t}let d=(i-t)*.5,c=this.valueSize;this._weightPrev=d/(t-s),this._weightNext=d/(l-i),this._offsetPrev=n*c,this._offsetNext=o*c}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,d=l-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,m=this._weightNext,f=(i-t)/(r-t),v=f*f,_=v*f,g=-u*_+2*u*v-u*f,p=(1+u)*_+(-1.5-2*u)*v+(-.5+u)*f+1,y=(-1-m)*_+(1.5+m)*v+.5*f,x=m*_-m*v;for(let b=0;b!==s;++b)n[b]=g*o[c+b]+p*o[d+b]+y*o[l+b]+x*o[h+b];return n}},s8=class extends Hr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=e*s,d=l-s,c=(i-t)/(r-t),h=1-c;for(let u=0;u!==s;++u)n[u]=o[d+u]*h+o[l+u]*c;return n}},l8=class extends Hr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}},Vt=class{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=n3(t,this.TimeBufferType),this.values=n3(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){let t=e.constructor,i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:n3(e.times,Array),values:n3(e.values,Array)};let r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new l8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new o8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Pr:t=this.InterpolantFactoryMethodDiscrete;break;case di:t=this.InterpolantFactoryMethodLinear;break;case H3:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){let i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pr;case this.InterpolantFactoryMethodLinear:return di;case this.InterpolantFactoryMethodSmooth:return H3}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){let t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){let i=this.times,r=i.length,n=0,o=r-1;for(;n!==r&&i[n]<e;)++n;for(;o!==-1&&i[o]>t;)--o;if(++o,n!==0||o!==r){n>=o&&(o=Math.max(o,1),n=o-1);let s=this.getValueSize();this.times=i.slice(n,o),this.values=this.values.slice(n*s,o*s)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);let i=this.times,r=this.values,n=i.length;n===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let s=0;s!==n;s++){let l=i[s];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,l,o),e=!1;break}o=l}if(r!==void 0&&a8(r))for(let s=0,l=r.length;s!==l;++s){let d=r[s];if(isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,d),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===H3,n=e.length-1,o=1;for(let s=1;s<n;++s){let l=!1,d=e[s],c=e[s+1];if(d!==c&&(s!==1||d!==e[0]))if(r)l=!0;else{let h=s*i,u=h-i,m=h+i;for(let f=0;f!==i;++f){let v=t[h+f];if(v!==t[u+f]||v!==t[m+f]){l=!0;break}}}if(l){if(s!==o){e[o]=e[s];let h=s*i,u=o*i;for(let m=0;m!==i;++m)t[u+m]=t[h+m]}++o}}if(n>0){e[o]=e[n];for(let s=n*i,l=o*i,d=0;d!==i;++d)t[l+d]=t[s+d];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*i)):(this.times=e,this.values=t),this}clone(){let e=this.times.slice(),t=this.values.slice(),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Vt.prototype.TimeBufferType=Float32Array,Vt.prototype.ValueBufferType=Float32Array,Vt.prototype.DefaultInterpolation=di;var ki=class extends Vt{};ki.prototype.ValueTypeName="bool",ki.prototype.ValueBufferType=Array,ki.prototype.DefaultInterpolation=Pr,ki.prototype.InterpolantFactoryMethodLinear=void 0,ki.prototype.InterpolantFactoryMethodSmooth=void 0;var wl=class extends Vt{};wl.prototype.ValueTypeName="color";var Oi=class extends Vt{};Oi.prototype.ValueTypeName="number";var c8=class extends Hr{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=(i-t)/(r-t),d=e*s;for(let c=d+s;d!==c;d+=4)m2.slerpFlat(n,0,o,d-s,o,d,l);return n}},Y2=class extends Vt{InterpolantFactoryMethodLinear(e){return new c8(this.times,this.values,this.getValueSize(),e)}};Y2.prototype.ValueTypeName="quaternion",Y2.prototype.DefaultInterpolation=di,Y2.prototype.InterpolantFactoryMethodSmooth=void 0;var zi=class extends Vt{};zi.prototype.ValueTypeName="string",zi.prototype.ValueBufferType=Array,zi.prototype.DefaultInterpolation=Pr,zi.prototype.InterpolantFactoryMethodLinear=void 0,zi.prototype.InterpolantFactoryMethodSmooth=void 0;var Vi=class extends Vt{};Vi.prototype.ValueTypeName="vector";var d8=class{constructor(e="",t=-1,i=[],r=dh){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=St(),this.duration<0&&this.resetDuration()}static parse(e){let t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,s=i.length;o!==s;++o)t.push(u8(i[o]).scale(r));let n=new this(e.name,e.duration,t,e.blendMode);return n.uuid=e.uuid,n}static toJSON(e){let t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let n=0,o=i.length;n!==o;++n)t.push(Vt.toJSON(i[n]));return r}static CreateFromMorphTargetSequence(e,t,i,r){let n=t.length,o=[];for(let s=0;s<n;s++){let l=[],d=[];l.push((s+n-1)%n,s,(s+1)%n),d.push(0,1,0);let c=n8(l);l=Sl(l,1,c),d=Sl(d,1,c),!r&&l[0]===0&&(l.push(n),d.push(d[0])),o.push(new Oi(".morphTargetInfluences["+t[s].name+"]",l,d).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){let r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){let r={},n=/^([\w-]*?)([\d]+)$/;for(let s=0,l=e.length;s<l;s++){let d=e[s],c=d.name.match(n);if(c&&c.length>1){let h=c[1],u=r[h];u||(r[h]=u=[]),u.push(d)}}let o=[];for(let s in r)o.push(this.CreateFromMorphTargetSequence(s,r[s],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let i=function(c,h,u,m,f){if(u.length!==0){let v=[],_=[];Ml(u,v,_,m),v.length!==0&&f.push(new c(h,v,_))}},r=[],n=e.name||"default",o=e.fps||30,s=e.blendMode,l=e.length||-1,d=e.hierarchy||[];for(let c=0;c<d.length;c++){let h=d[c].keys;if(!(!h||h.length===0))if(h[0].morphTargets){let u={},m;for(m=0;m<h.length;m++)if(h[m].morphTargets)for(let f=0;f<h[m].morphTargets.length;f++)u[h[m].morphTargets[f]]=-1;for(let f in u){let v=[],_=[];for(let g=0;g!==h[m].morphTargets.length;++g){let p=h[m];v.push(p.time),_.push(p.morphTarget===f?1:0)}r.push(new Oi(".morphTargetInfluence["+f+"]",v,_))}l=u.length*o}else{let u=".bones["+t[c].name+"]";i(Vi,u+".position",h,"pos",r),i(Y2,u+".quaternion",h,"rot",r),i(Vi,u+".scale",h,"scl",r)}}return r.length===0?null:new this(n,l,r,s)}resetDuration(){let e=this.tracks,t=0;for(let i=0,r=e.length;i!==r;++i){let n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){let e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function h8(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Oi;case"vector":case"vector2":case"vector3":case"vector4":return Vi;case"color":return wl;case"quaternion":return Y2;case"bool":case"boolean":return ki;case"string":return zi}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function u8(e){if(e.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let t=h8(e.type);if(e.times===void 0){let i=[],r=[];Ml(e.keys,i,r,"value"),e.times=i,e.values=r}return t.parse!==void 0?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}var w2={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},m8=class{constructor(e,t,i){let r=this,n=!1,o=0,s=0,l,d=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(c){s++,n===!1&&r.onStart!==void 0&&r.onStart(c,o,s),n=!0},this.itemEnd=function(c){o++,r.onProgress!==void 0&&r.onProgress(c,o,s),o===s&&(n=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(c){r.onError!==void 0&&r.onError(c)},this.resolveURL=function(c){return l?l(c):c},this.setURLModifier=function(c){return l=c,this},this.addHandler=function(c,h){return d.push(c,h),this},this.removeHandler=function(c){let h=d.indexOf(c);return h!==-1&&d.splice(h,2),this},this.getHandler=function(c){for(let h=0,u=d.length;h<u;h+=2){let m=d[h],f=d[h+1];if(m.global&&(m.lastIndex=0),m.test(c))return f}return null}}},f8=new m8,Bi=class{constructor(e){this.manager=e!==void 0?e:f8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){let i=this;return new Promise(function(r,n){i.load(e,r,t,n)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}};Bi.DEFAULT_MATERIAL_NAME="__DEFAULT";var r2={},p8=class extends Error{constructor(e,t){super(e),this.response=t}},Al=class extends Bi{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=w2.get(e);if(n!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(n),this.manager.itemEnd(e)},0),n;if(r2[e]!==void 0){r2[e].push({onLoad:t,onProgress:i,onError:r});return}r2[e]=[],r2[e].push({onLoad:t,onProgress:i,onError:r});let o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),s=this.mimeType,l=this.responseType;fetch(o).then(d=>{if(d.status===200||d.status===0){if(d.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||d.body===void 0||d.body.getReader===void 0)return d;let c=r2[e],h=d.body.getReader(),u=d.headers.get("Content-Length")||d.headers.get("X-File-Size"),m=u?parseInt(u):0,f=m!==0,v=0,_=new ReadableStream({start(g){p();function p(){h.read().then(({done:y,value:x})=>{if(y)g.close();else{v+=x.byteLength;let b=new ProgressEvent("progress",{lengthComputable:f,loaded:v,total:m});for(let N=0,A=c.length;N<A;N++){let C=c[N];C.onProgress&&C.onProgress(b)}g.enqueue(x),p()}})}}});return new Response(_)}else throw new p8(`fetch for "${d.url}" responded with ${d.status}: ${d.statusText}`,d)}).then(d=>{switch(l){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(c=>new DOMParser().parseFromString(c,s));case"json":return d.json();default:if(s===void 0)return d.text();{let c=/charset="?([^;"\s]*)"?/i.exec(s),h=c&&c[1]?c[1].toLowerCase():void 0,u=new TextDecoder(h);return d.arrayBuffer().then(m=>u.decode(m))}}}).then(d=>{w2.add(e,d);let c=r2[e];delete r2[e];for(let h=0,u=c.length;h<u;h++){let m=c[h];m.onLoad&&m.onLoad(d)}}).catch(d=>{let c=r2[e];if(c===void 0)throw this.manager.itemError(e),d;delete r2[e];for(let h=0,u=c.length;h<u;h++){let m=c[h];m.onError&&m.onError(d)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}},g8=class extends Bi{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,o=w2.get(e);if(o!==void 0)return n.manager.itemStart(e),setTimeout(function(){t&&t(o),n.manager.itemEnd(e)},0),o;let s=Rr("img");function l(){c(),w2.add(e,this),t&&t(this),n.manager.itemEnd(e)}function d(h){c(),r&&r(h),n.manager.itemError(e),n.manager.itemEnd(e)}function c(){s.removeEventListener("load",l,!1),s.removeEventListener("error",d,!1)}return s.addEventListener("load",l,!1),s.addEventListener("error",d,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(s.crossOrigin=this.crossOrigin),n.manager.itemStart(e),s.src=e,s}},Nn=class extends Bi{constructor(e){super(e)}load(e,t,i,r){let n=new tt,o=new g8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(s){n.image=s,n.needsUpdate=!0,t!==void 0&&t(n)},i,r),n}},Ln=class extends I1{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ue(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){let t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}},Rn=new Fe,El=new I,bl=new I,Dn=class{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new ye(512,512),this.map=null,this.mapPass=null,this.matrix=new Fe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new fn,this._frameExtents=new ye(1,1),this._viewportCount=1,this._viewports=[new f1(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){let t=this.camera,i=this.matrix;El.setFromMatrixPosition(e.matrixWorld),t.position.copy(El),bl.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(bl),t.updateMatrixWorld(),Rn.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Rn),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(Rn)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}},_8=class extends Dn{constructor(){super(new j1(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){let t=this.camera,i=mi*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,n=e.distance||t.far;(i!==t.fov||r!==t.aspect||n!==t.far)&&(t.fov=i,t.aspect=r,t.far=n,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}},v8=class extends Ln{constructor(e,t,i=0,r=Math.PI/3,n=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(I1.DEFAULT_UP),this.updateMatrix(),this.target=new I1,this.distance=i,this.angle=r,this.penumbra=n,this.decay=o,this.map=null,this.shadow=new _8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Cl=new Fe,Gr=new I,Un=new I,x8=class extends Dn{constructor(){super(new j1(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new ye(4,2),this._viewportCount=6,this._viewports=[new f1(2,1,1,1),new f1(0,1,1,1),new f1(3,1,1,1),new f1(1,1,1,1),new f1(3,0,1,1),new f1(1,0,1,1)],this._cubeDirections=[new I(1,0,0),new I(-1,0,0),new I(0,0,1),new I(0,0,-1),new I(0,1,0),new I(0,-1,0)],this._cubeUps=[new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,1,0),new I(0,0,1),new I(0,0,-1)]}updateMatrices(e,t=0){let i=this.camera,r=this.matrix,n=e.distance||i.far;n!==i.far&&(i.far=n,i.updateProjectionMatrix()),Gr.setFromMatrixPosition(e.matrixWorld),i.position.copy(Gr),Un.copy(i.position),Un.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(Un),i.updateMatrixWorld(),r.makeTranslation(-Gr.x,-Gr.y,-Gr.z),Cl.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Cl)}},y8=class extends Ln{constructor(e,t,i=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new x8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}},S8=class extends Dn{constructor(){super(new zt(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},M8=class extends Ln{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(I1.DEFAULT_UP),this.updateMatrix(),this.target=new I1,this.shadow=new S8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}},Wr=class{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){let t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}},w8=class extends Bi{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let n=this,o=w2.get(e);if(o!==void 0){if(n.manager.itemStart(e),o.then){o.then(d=>{t&&t(d),n.manager.itemEnd(e)}).catch(d=>{r&&r(d)});return}return setTimeout(function(){t&&t(o),n.manager.itemEnd(e)},0),o}let s={};s.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",s.headers=this.requestHeader;let l=fetch(e,s).then(function(d){return d.blob()}).then(function(d){return createImageBitmap(d,Object.assign(n.options,{colorSpaceConversion:"none"}))}).then(function(d){return w2.add(e,d),t&&t(d),n.manager.itemEnd(e),d}).catch(function(d){r&&r(d),w2.remove(e),n.manager.itemError(e),n.manager.itemEnd(e)});w2.add(e,l),n.manager.itemStart(e)}},A8=class{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Tl(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let t=Tl();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}};function Tl(){return(typeof performance>"u"?Date:performance).now()}var kn="\\[\\]\\.:\\/",E8=new RegExp("["+kn+"]","g"),On="[^"+kn+"]",b8="[^"+kn.replace("\\.","")+"]",C8=/((?:WC+[\/:])*)/.source.replace("WC",On),T8=/(WCOD+)?/.source.replace("WCOD",b8),I8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",On),P8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",On),N8=new RegExp("^"+C8+T8+I8+P8+"$"),L8=["material","materials","bones","map"],R8=class{constructor(e,t,i){let r=i||M1.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){let i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},M1=class Er{constructor(t,i,r){this.path=i,this.parsedPath=r||Er.parseTrackName(i),this.node=Er.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,r){return t&&t.isAnimationObjectGroup?new Er.Composite(t,i,r):new Er(t,i,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(t){let i=N8.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let r={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let o=r.nodeName.substring(n+1);L8.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let r=t.skeleton.getBoneByName(i);if(r!==void 0)return r}if(t.children){let r=function(o){for(let s=0;s<o.length;s++){let l=o[s];if(l.name===i||l.uuid===i)return l;let d=r(l.children);if(d)return d}return null},n=r(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,i){t[i]=this.targetObject[this.propertyName]}_getValue_array(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)t[i++]=r[n]}_getValue_arrayElement(t,i){t[i]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,i){this.resolvedProperty.toArray(t,i)}_setValue_direct(t,i){this.targetObject[this.propertyName]=t[i]}_setValue_direct_setNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++]}_setValue_array_setNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,o=r.length;n!==o;++n)r[n]=t[i++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,i){this.resolvedProperty[this.propertyIndex]=t[i]}_setValue_arrayElement_setNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,i){this.resolvedProperty.fromArray(t,i)}_setValue_fromArray_setNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,i){this.bind(),this.getValue(t,i)}_setValue_unbound(t,i){this.bind(),this.setValue(t,i)}bind(){let t=this.node,i=this.parsedPath,r=i.objectName,n=i.propertyName,o=i.propertyIndex;if(t||(t=Er.findNode(this.rootNode,i.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(r){let c=i.objectIndex;switch(r){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[r]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let s=t[n];if(s===void 0){let c=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",t);return}let l=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let d=this.BindingType.Direct;if(o!==void 0){if(n==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[o]!==void 0&&(o=t.morphTargetDictionary[o])}d=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=o}else s.fromArray!==void 0&&s.toArray!==void 0?(d=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(d=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[d],this.setValue=this.SetterByBindingTypeAndVersioning[d][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};M1.Composite=R8,M1.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},M1.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},M1.prototype.GetterByBindingType=[M1.prototype._getValue_direct,M1.prototype._getValue_array,M1.prototype._getValue_arrayElement,M1.prototype._getValue_toArray],M1.prototype.SetterByBindingTypeAndVersioning=[[M1.prototype._setValue_direct,M1.prototype._setValue_direct_setNeedsUpdate,M1.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_array,M1.prototype._setValue_array_setNeedsUpdate,M1.prototype._setValue_array_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_arrayElement,M1.prototype._setValue_arrayElement_setNeedsUpdate,M1.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[M1.prototype._setValue_fromArray,M1.prototype._setValue_fromArray_setNeedsUpdate,M1.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var Il=new Fe,Pl=class{constructor(e,t,i=0,r=1/0){this.ray=new kr(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new rn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Il.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Il),this}intersectObject(e,t=!0,i=[]){return zn(e,this,i,t),i.sort(Nl),i}intersectObjects(e,t=!0,i=[]){for(let r=0,n=e.length;r<n;r++)zn(e[r],this,i,t);return i.sort(Nl),i}};function Nl(e,t){return e.distance-t.distance}function zn(e,t,i,r){if(e.layers.test(t.layers)&&e.raycast(t,i),r===!0){let n=e.children;for(let o=0,s=n.length;o<s;o++)zn(n[o],t,i,!0)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"163"}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="163");var D8=`
3794
3794
  varying vec2 v_texCoord;
3795
3795
 
3796
3796
  void main() {
@@ -4007,7 +4007,7 @@ void main() {
4007
4007
  colorRaw=renderLayers(colorRaw);
4008
4008
  gl_FragColor = colorRaw;
4009
4009
  }
4010
- `}var Ct=class _a{constructor(){this.textures=new Map,this.materials=new Map,this.geometries=new Map}static get instance(){return _a._instance||(_a._instance=new _a),_a._instance}registerTexture(t,i){return t}disposeTexture(t){var i;if(t){if(t instanceof w2){let r=t;(i=r.image)!=null&&i.data&&(r.image.data=null)}t.dispose()}}registerMaterial(t,i){return t}disposeMaterial(t){t&&t.dispose()}registerGeometry(t,i){return t}disposeGeometry(t){t&&t.dispose()}disposeAll(){this.textures.forEach((t,i)=>{this.disposeTexture(i)}),this.materials.forEach((t,i)=>{this.disposeMaterial(i)}),this.geometries.forEach((t,i)=>{this.disposeGeometry(i)})}listUnfreedResources(){console.log("**** MemoryManager report (Lists tracked objects only) ****"),console.log("********************************************")}},O8=class{constructor(e){this.material=null,this.renderTarget=null,this.nLayers=0,this.main=e}setSize(e,t){this.material=this.createBaseMaterial(e/t),this.renderTarget=this.main.createRenderTarget()}setLayers(e){this.nLayers!==e&&(this.nLayers=e,this.material&&Ct.instance.disposeMaterial(this.material),this.material=this.createBaseMaterial(this.main.aspectRatio))}getRenderTarget(){if(!this.renderTarget)throw new Error("Render texture not initialized");return this.renderTarget}getShaderMaterial(){return this.material||(this.material=this.createBaseMaterial(this.main.aspectRatio)),this.material}createBaseMaterial(e){return new x1({uniforms:{panoramaCurrent:{value:null},panoramaNext:{value:null},motionFlow:{value:null},layerPanoramaSphereCurrent:{value:null},layerPanoramaSphereNext:{value:null},u_isPanoramaTransition:{value:!1},u_panoramaCurrentAlpha:{value:0},u_panoramaNextAlpha:{value:0},u_transitionPercentage:{value:0},u_rotation:{value:new ye(0,0)},u_fovy:{value:this.main.options.defaultFov},u_aspectratio:{value:e},layerTextures:{value:[]},layerInfo:{value:[]},time:{value:0}},vertexShader:U8,fragmentShader:k8(this.nLayers)})}},Vn={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
4010
+ `}var bt=class _a{constructor(){this.textures=new Map,this.materials=new Map,this.geometries=new Map}static get instance(){return _a._instance||(_a._instance=new _a),_a._instance}registerTexture(t,i){return t}disposeTexture(t){var i;if(t){if(t instanceof M2){let r=t;(i=r.image)!=null&&i.data&&(r.image.data=null)}t.dispose()}}registerMaterial(t,i){return t}disposeMaterial(t){t&&t.dispose()}registerGeometry(t,i){return t}disposeGeometry(t){t&&t.dispose()}disposeAll(){this.textures.forEach((t,i)=>{this.disposeTexture(i)}),this.materials.forEach((t,i)=>{this.disposeMaterial(i)}),this.geometries.forEach((t,i)=>{this.disposeGeometry(i)})}listUnfreedResources(){console.log("**** MemoryManager report (Lists tracked objects only) ****"),console.log("********************************************")}},O8=class{constructor(e){this.material=null,this.renderTarget=null,this.nLayers=0,this.main=e}setSize(e,t){this.material=this.createBaseMaterial(e/t),this.renderTarget=this.main.createRenderTarget()}setLayers(e){this.nLayers!==e&&(this.nLayers=e,this.material&&bt.instance.disposeMaterial(this.material),this.material=this.createBaseMaterial(this.main.aspectRatio))}getRenderTarget(){if(!this.renderTarget)throw new Error("Render texture not initialized");return this.renderTarget}getShaderMaterial(){return this.material||(this.material=this.createBaseMaterial(this.main.aspectRatio)),this.material}createBaseMaterial(e){return new x1({uniforms:{panoramaCurrent:{value:null},panoramaNext:{value:null},motionFlow:{value:null},layerPanoramaSphereCurrent:{value:null},layerPanoramaSphereNext:{value:null},u_isPanoramaTransition:{value:!1},u_panoramaCurrentAlpha:{value:0},u_panoramaNextAlpha:{value:0},u_transitionPercentage:{value:0},u_rotation:{value:new ye(0,0)},u_fovy:{value:this.main.options.defaultFov},u_aspectratio:{value:e},layerTextures:{value:[]},layerInfo:{value:[]},time:{value:0}},vertexShader:U8,fragmentShader:k8(this.nLayers)})}},Vn={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
4011
4011
 
4012
4012
  varying vec2 vUv;
4013
4013
 
@@ -4030,7 +4030,7 @@ void main() {
4030
4030
  gl_FragColor = opacity * texel;
4031
4031
 
4032
4032
 
4033
- }`},Xr=class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}},z8=new zt(-1,1,1,-1,0,1),V8=class extends Ut{constructor(){super(),this.setAttribute("position",new rt([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new rt([0,2,0,0,2,0],2))}},B8=new V8,Rl=class{constructor(e){this._mesh=new v1(B8,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,z8)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},Bt=class extends Xr{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof x1?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=qa.clone(e.uniforms),this.material=new x1({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Rl(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}},Dl=class extends Xr{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){let r=e.getContext(),n=e.state;n.buffers.color.setMask(!1),n.buffers.depth.setMask(!1),n.buffers.color.setLocked(!0),n.buffers.depth.setLocked(!0);let o,s;this.inverse?(o=0,s=1):(o=1,s=0),n.buffers.stencil.setTest(!0),n.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),n.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),n.buffers.stencil.setClear(s),n.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),n.buffers.color.setLocked(!1),n.buffers.depth.setLocked(!1),n.buffers.color.setMask(!0),n.buffers.depth.setMask(!0),n.buffers.stencil.setLocked(!1),n.buffers.stencil.setFunc(r.EQUAL,1,4294967295),n.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),n.buffers.stencil.setLocked(!0)}},F8=class extends Xr{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}},Ul=class{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){let i=e.getSize(new ye);this._width=i.width,this._height=i.height,t=new S1(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:ot}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Bt(Vn),this.copyPass.material.blending=Yt,this.clock=new A8}swapBuffers(){let e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){let t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());let t=this.renderer.getRenderTarget(),i=!1;for(let r=0,n=this.passes.length;r<n;r++){let o=this.passes[r];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(r),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,i),o.needsSwap){if(i){let s=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;l.setFunc(s.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),l.setFunc(s.EQUAL,1,4294967295)}this.swapBuffers()}Dl!==void 0&&(o instanceof Dl?i=!0:o instanceof F8&&(i=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){let t=this.renderer.getSize(new ye);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;let i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(i,r),this.renderTarget2.setSize(i,r);for(let n=0;n<this.passes.length;n++)this.passes[n].setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}},H8=class extends Xr{constructor(e,t,i=null,r=null,n=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=n,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ue}render(e,t,i){let r=e.autoClear;e.autoClear=!1;let n,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(n=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(n),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=r}},G8={name:"LuminosityHighPassShader",shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ue(0)},defaultOpacity:{value:0}},vertexShader:`
4033
+ }`},jr=class{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}},z8=new zt(-1,1,1,-1,0,1),V8=class extends Ut{constructor(){super(),this.setAttribute("position",new it([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new it([0,2,0,0,2,0],2))}},B8=new V8,Rl=class{constructor(e){this._mesh=new v1(B8,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,z8)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}},Bt=class extends jr{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof x1?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=qa.clone(e.uniforms),this.material=new x1({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Rl(this.material)}render(e,t,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}},Dl=class extends jr{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,i){let r=e.getContext(),n=e.state;n.buffers.color.setMask(!1),n.buffers.depth.setMask(!1),n.buffers.color.setLocked(!0),n.buffers.depth.setLocked(!0);let o,s;this.inverse?(o=0,s=1):(o=1,s=0),n.buffers.stencil.setTest(!0),n.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),n.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),n.buffers.stencil.setClear(s),n.buffers.stencil.setLocked(!0),e.setRenderTarget(i),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),n.buffers.color.setLocked(!1),n.buffers.depth.setLocked(!1),n.buffers.color.setMask(!0),n.buffers.depth.setMask(!0),n.buffers.stencil.setLocked(!1),n.buffers.stencil.setFunc(r.EQUAL,1,4294967295),n.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),n.buffers.stencil.setLocked(!0)}},F8=class extends jr{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}},Ul=class{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){let i=e.getSize(new ye);this._width=i.width,this._height=i.height,t=new S1(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:ot}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Bt(Vn),this.copyPass.material.blending=Yt,this.clock=new A8}swapBuffers(){let e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){let t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());let t=this.renderer.getRenderTarget(),i=!1;for(let r=0,n=this.passes.length;r<n;r++){let o=this.passes[r];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(r),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,i),o.needsSwap){if(i){let s=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;l.setFunc(s.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),l.setFunc(s.EQUAL,1,4294967295)}this.swapBuffers()}Dl!==void 0&&(o instanceof Dl?i=!0:o instanceof F8&&(i=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){let t=this.renderer.getSize(new ye);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;let i=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(i,r),this.renderTarget2.setSize(i,r);for(let n=0;n<this.passes.length;n++)this.passes[n].setSize(i,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}},H8=class extends jr{constructor(e,t,i=null,r=null,n=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=n,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ue}render(e,t,i){let r=e.autoClear;e.autoClear=!1;let n,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(n=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:i),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(n),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=r}},G8={name:"LuminosityHighPassShader",shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ue(0)},defaultOpacity:{value:0}},vertexShader:`
4034
4034
 
4035
4035
  varying vec2 vUv;
4036
4036
 
@@ -4064,7 +4064,7 @@ void main() {
4064
4064
 
4065
4065
  gl_FragColor = mix( outputColor, texel, alpha );
4066
4066
 
4067
- }`},Bn=class V0 extends Xr{constructor(t,i,r,n){super(),this.strength=i!==void 0?i:1,this.radius=r,this.threshold=n,this.resolution=t!==void 0?new ye(t.x,t.y):new ye(256,256),this.clearColor=new Ue(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let o=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new S1(o,s,{type:ot}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let u=0;u<this.nMips;u++){let m=new S1(o,s,{type:ot});m.texture.name="UnrealBloomPass.h"+u,m.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(m);let f=new S1(o,s,{type:ot});f.texture.name="UnrealBloomPass.v"+u,f.texture.generateMipmaps=!1,this.renderTargetsVertical.push(f),o=Math.round(o/2),s=Math.round(s/2)}let l=G8;this.highPassUniforms=qa.clone(l.uniforms),this.highPassUniforms.luminosityThreshold.value=n,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new x1({uniforms:this.highPassUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}),this.separableBlurMaterials=[];let d=[3,5,7,9,11];o=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let u=0;u<this.nMips;u++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(d[u])),this.separableBlurMaterials[u].uniforms.invSize.value=new ye(1/o,1/s),o=Math.round(o/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=i,this.compositeMaterial.uniforms.bloomRadius.value=.1;let c=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=c,this.bloomTintColors=[new I(1,1,1),new I(1,1,1),new I(1,1,1),new I(1,1,1),new I(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;let h=Vn;this.copyUniforms=qa.clone(h.uniforms),this.blendMaterial=new x1({uniforms:this.copyUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,blending:N3,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ue,this.oldClearAlpha=1,this.basic=new lt,this.fsQuad=new Rl(null)}dispose(){for(let t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(let t=0;t<this.renderTargetsVertical.length;t++)this.renderTargetsVertical[t].dispose();this.renderTargetBright.dispose();for(let t=0;t<this.separableBlurMaterials.length;t++)this.separableBlurMaterials[t].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(t,i){let r=Math.round(t/2),n=Math.round(i/2);this.renderTargetBright.setSize(r,n);for(let o=0;o<this.nMips;o++)this.renderTargetsHorizontal[o].setSize(r,n),this.renderTargetsVertical[o].setSize(r,n),this.separableBlurMaterials[o].uniforms.invSize.value=new ye(1/r,1/n),r=Math.round(r/2),n=Math.round(n/2)}render(t,i,r,n,o){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();let s=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),o&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=r.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=r.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);let l=this.renderTargetBright;for(let d=0;d<this.nMips;d++)this.fsQuad.material=this.separableBlurMaterials[d],this.separableBlurMaterials[d].uniforms.colorTexture.value=l.texture,this.separableBlurMaterials[d].uniforms.direction.value=V0.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[d]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[d].uniforms.colorTexture.value=this.renderTargetsHorizontal[d].texture,this.separableBlurMaterials[d].uniforms.direction.value=V0.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[d]),t.clear(),this.fsQuad.render(t),l=this.renderTargetsVertical[d];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,o&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(r),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=s}getSeperableBlurMaterial(t){let i=[];for(let r=0;r<t;r++)i.push(.39894*Math.exp(-.5*r*r/(t*t))/t);return new x1({defines:{KERNEL_RADIUS:t},uniforms:{colorTexture:{value:null},invSize:{value:new ye(.5,.5)},direction:{value:new ye(.5,.5)},gaussianCoefficients:{value:i}},vertexShader:`varying vec2 vUv;
4067
+ }`},Bn=class V0 extends jr{constructor(t,i,r,n){super(),this.strength=i!==void 0?i:1,this.radius=r,this.threshold=n,this.resolution=t!==void 0?new ye(t.x,t.y):new ye(256,256),this.clearColor=new Ue(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let o=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new S1(o,s,{type:ot}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let u=0;u<this.nMips;u++){let m=new S1(o,s,{type:ot});m.texture.name="UnrealBloomPass.h"+u,m.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(m);let f=new S1(o,s,{type:ot});f.texture.name="UnrealBloomPass.v"+u,f.texture.generateMipmaps=!1,this.renderTargetsVertical.push(f),o=Math.round(o/2),s=Math.round(s/2)}let l=G8;this.highPassUniforms=qa.clone(l.uniforms),this.highPassUniforms.luminosityThreshold.value=n,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new x1({uniforms:this.highPassUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}),this.separableBlurMaterials=[];let d=[3,5,7,9,11];o=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let u=0;u<this.nMips;u++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(d[u])),this.separableBlurMaterials[u].uniforms.invSize.value=new ye(1/o,1/s),o=Math.round(o/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=i,this.compositeMaterial.uniforms.bloomRadius.value=.1;let c=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=c,this.bloomTintColors=[new I(1,1,1),new I(1,1,1),new I(1,1,1),new I(1,1,1),new I(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;let h=Vn;this.copyUniforms=qa.clone(h.uniforms),this.blendMaterial=new x1({uniforms:this.copyUniforms,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,blending:N3,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ue,this.oldClearAlpha=1,this.basic=new lt,this.fsQuad=new Rl(null)}dispose(){for(let t=0;t<this.renderTargetsHorizontal.length;t++)this.renderTargetsHorizontal[t].dispose();for(let t=0;t<this.renderTargetsVertical.length;t++)this.renderTargetsVertical[t].dispose();this.renderTargetBright.dispose();for(let t=0;t<this.separableBlurMaterials.length;t++)this.separableBlurMaterials[t].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(t,i){let r=Math.round(t/2),n=Math.round(i/2);this.renderTargetBright.setSize(r,n);for(let o=0;o<this.nMips;o++)this.renderTargetsHorizontal[o].setSize(r,n),this.renderTargetsVertical[o].setSize(r,n),this.separableBlurMaterials[o].uniforms.invSize.value=new ye(1/r,1/n),r=Math.round(r/2),n=Math.round(n/2)}render(t,i,r,n,o){t.getClearColor(this._oldClearColor),this.oldClearAlpha=t.getClearAlpha();let s=t.autoClear;t.autoClear=!1,t.setClearColor(this.clearColor,0),o&&t.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=r.texture,t.setRenderTarget(null),t.clear(),this.fsQuad.render(t)),this.highPassUniforms.tDiffuse.value=r.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,t.setRenderTarget(this.renderTargetBright),t.clear(),this.fsQuad.render(t);let l=this.renderTargetBright;for(let d=0;d<this.nMips;d++)this.fsQuad.material=this.separableBlurMaterials[d],this.separableBlurMaterials[d].uniforms.colorTexture.value=l.texture,this.separableBlurMaterials[d].uniforms.direction.value=V0.BlurDirectionX,t.setRenderTarget(this.renderTargetsHorizontal[d]),t.clear(),this.fsQuad.render(t),this.separableBlurMaterials[d].uniforms.colorTexture.value=this.renderTargetsHorizontal[d].texture,this.separableBlurMaterials[d].uniforms.direction.value=V0.BlurDirectionY,t.setRenderTarget(this.renderTargetsVertical[d]),t.clear(),this.fsQuad.render(t),l=this.renderTargetsVertical[d];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,t.setRenderTarget(this.renderTargetsHorizontal[0]),t.clear(),this.fsQuad.render(t),this.fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,o&&t.state.buffers.stencil.setTest(!0),this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(r),this.fsQuad.render(t)),t.setClearColor(this._oldClearColor,this.oldClearAlpha),t.autoClear=s}getSeperableBlurMaterial(t){let i=[];for(let r=0;r<t;r++)i.push(.39894*Math.exp(-.5*r*r/(t*t))/t);return new x1({defines:{KERNEL_RADIUS:t},uniforms:{colorTexture:{value:null},invSize:{value:new ye(.5,.5)},direction:{value:new ye(.5,.5)},gaussianCoefficients:{value:i}},vertexShader:`varying vec2 vUv;
4068
4068
  void main() {
4069
4069
  vUv = uv;
4070
4070
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -4346,7 +4346,7 @@ void main() {
4346
4346
  float brightness = hsv.z;
4347
4347
  gl_FragColor = pack(brightness);
4348
4348
  }
4349
- `,t7=e7,i7=(_t=class{constructor(t){this.main=t,this.scene=new M2,this.camera=new zt(-.5,.5,.5,-.5,0,1),this.material=this.createShaderMaterial();let i=new kt(1,1);this.plane=new v1(i,this.material),this.scene.add(this.plane),this.renderTexture=new S1(_t.HISTOGRAM_WIDTH,_t.HISTOGRAM_HEIGHT,{type:Rt,depthBuffer:!1,stencilBuffer:!1}),this.pixelBuffer=new Uint8Array(_t.HISTOGRAM_WIDTH*_t.HISTOGRAM_HEIGHT*4)}createShaderMaterial(){return new x1({uniforms:{u_image:{value:null},u_fovy_scale:{value:1}},vertexShader:$8,fragmentShader:t7})}unpack(t,i,r,n){let o=t*65536+i*256+r,s=n/255;return o+s}calculateExposure(t){this.material.uniforms.u_image.value=t,this.material.uniforms.u_fovy_scale.value=this.main.options.exposureFovScale,this.main.runRenderTarget(this.scene,this.renderTexture,this.camera),this.main.renderer.readRenderTargetPixels(this.renderTexture,0,0,_t.HISTOGRAM_WIDTH,_t.HISTOGRAM_HEIGHT,this.pixelBuffer);let i=0,r=0;for(let n=0;n<this.pixelBuffer.length;n+=4){let o=this.unpack(this.pixelBuffer[n],this.pixelBuffer[n+1],this.pixelBuffer[n+2],this.pixelBuffer[n+3]);if(o<=0)continue;let s=Math.log2(this.main.options.targetLuminance/o);i+=s,r++}return r>0?i/r:0}},_t.HISTOGRAM_WIDTH=256,_t.HISTOGRAM_HEIGHT=144,_t),r7=(d1=class{constructor(t){this.main=t,this.preparedWidth=0,this.preparedHeight=0,this.copyRenderTarget=null,this.passthroughVS=`
4349
+ `,t7=e7,i7=(_t=class{constructor(t){this.main=t,this.scene=new S2,this.camera=new zt(-.5,.5,.5,-.5,0,1),this.material=this.createShaderMaterial();let i=new kt(1,1);this.plane=new v1(i,this.material),this.scene.add(this.plane),this.renderTexture=new S1(_t.HISTOGRAM_WIDTH,_t.HISTOGRAM_HEIGHT,{type:Rt,depthBuffer:!1,stencilBuffer:!1}),this.pixelBuffer=new Uint8Array(_t.HISTOGRAM_WIDTH*_t.HISTOGRAM_HEIGHT*4)}createShaderMaterial(){return new x1({uniforms:{u_image:{value:null},u_fovy_scale:{value:1}},vertexShader:$8,fragmentShader:t7})}unpack(t,i,r,n){let o=t*65536+i*256+r,s=n/255;return o+s}calculateExposure(t){this.material.uniforms.u_image.value=t,this.material.uniforms.u_fovy_scale.value=this.main.options.exposureFovScale,this.main.runRenderTarget(this.scene,this.renderTexture,this.camera),this.main.renderer.readRenderTargetPixels(this.renderTexture,0,0,_t.HISTOGRAM_WIDTH,_t.HISTOGRAM_HEIGHT,this.pixelBuffer);let i=0,r=0;for(let n=0;n<this.pixelBuffer.length;n+=4){let o=this.unpack(this.pixelBuffer[n],this.pixelBuffer[n+1],this.pixelBuffer[n+2],this.pixelBuffer[n+3]);if(o<=0)continue;let s=Math.log2(this.main.options.targetLuminance/o);i+=s,r++}return r>0?i/r:0}},_t.HISTOGRAM_WIDTH=256,_t.HISTOGRAM_HEIGHT=144,_t),r7=(c1=class{constructor(t){this.main=t,this.preparedWidth=0,this.preparedHeight=0,this.copyRenderTarget=null,this.passthroughVS=`
4350
4350
  varying vec2 vUv;
4351
4351
  void main() {
4352
4352
  vUv = uv;
@@ -4457,7 +4457,7 @@ void main() {
4457
4457
  mix(1.0, finalMultiplier, (luminance / lerpToUnityThreshold) * (luminance / lerpToUnityThreshold));
4458
4458
  vec3 texelFinal = sqrt(max(ACESFilmicToneMapping(texture2D(tOriginal, vUv).xyz * exposure * finalMultiplier), 0.0));
4459
4459
  gl_FragColor = vec4(texelFinal, 1.0);
4460
- }`;this.effectFinalCombine=new Bt({uniforms:{tDiffuse:{value:null},tOriginal:{value:null},tOriginalMip:{value:null},mipPixelSize:{value:null},exposure:{value:1}},vertexShader:this.passthroughVS,fragmentShader:t})}getRenderTexture(t,i){return(!i||i.width!==t.width||i.height!==t.height)&&(i&&i.dispose(),i=new S1(t.width,t.height,{minFilter:m1,magFilter:m1,format:t.texture.format,type:t.texture.type})),i}prepareTextures(t){if(this.preparedWidth===t.width&&this.preparedHeight===t.height)return;this.mips&&this.mips.forEach(s=>{s.dispose()}),this.mipsWeights&&this.mipsWeights.forEach(s=>{s.dispose()}),this.mipsAssemble&&this.mipsAssemble.forEach(s=>{s.dispose()}),this.mips=[],this.mipsWeights=[],this.mipsAssemble=[];let i=t.width,r=t.height,n={minFilter:m1,magFilter:m1,format:U1,type:ot},o={minFilter:m1,magFilter:m1,format:k3,type:ot};for(;i>1&&r>1;)this.mips.push(new S1(i,r,n)),this.mipsWeights.push(new S1(i,r,n)),this.mipsAssemble.push(new S1(i,r,o)),i=i/2,r=r/2;this.preparedWidth=t.width,this.preparedHeight=t.height}render(t,i){i=2**i*d1.EXPOSURE_SCALE,this.prepareTextures(t),this.copyRenderTarget=this.getRenderTexture(t,this.copyRenderTarget),this.copyPass.render(this.main.renderer,this.copyRenderTarget,t,void 0,!1),this.effectLuminance.uniforms.exposure.value=i,this.effectLuminance.uniforms.shadows.value=d1.ENABLE_LTM?2**d1.SHADOWS:1,this.effectLuminance.uniforms.highlights.value=d1.ENABLE_LTM?2**-d1.HIGHLIGHTS:1,this.effectLuminance.uniforms.tOriginal.value=this.copyRenderTarget.texture,this.effectLuminance.render(this.main.renderer,this.mips[0],void 0,void 0,!1),this.effectWeights.uniforms.sigmaSq.value=d1.EXPOSURE_PREFERENCE_SIGMA*d1.EXPOSURE_PREFERENCE_SIGMA,this.effectWeights.render(this.main.renderer,this.mipsWeights[0],this.mips[0],void 0,!1);for(let n=0;n<this.mips.length-1;n++)this.copyPass.render(this.main.renderer,this.mips[n+1],this.mips[n],void 0,!1),this.copyPass.render(this.main.renderer,this.mipsWeights[n+1],this.mipsWeights[n],void 0,!1);this.effectBlend.uniforms.tExposures.value=this.mips[d1.MIP].texture,this.effectBlend.uniforms.tWeights.value=this.mipsWeights[d1.MIP].texture,this.effectBlend.render(this.main.renderer,this.mipsAssemble[d1.MIP],void 0,void 0,!1);for(let n=d1.MIP;n>d1.DISPLAY_MIP;n--)this.effectBlendLaplacian.uniforms.tExposures.value=this.mips[n-1].texture,this.effectBlendLaplacian.uniforms.tExposuresCoarser.value=this.mips[n].texture,this.effectBlendLaplacian.uniforms.boostLocalContrast.value=d1.BOOST_LOCAL_CONTRAST,this.effectBlendLaplacian.uniforms.tWeights.value=this.mipsWeights[n-1].texture,this.effectBlendLaplacian.uniforms.tAccumSoFar.value=this.mipsAssemble[n].texture,this.effectBlendLaplacian.render(this.main.renderer,this.mipsAssemble[n-1],void 0,void 0,!1);let r=Math.min(d1.DISPLAY_MIP,d1.MIP);this.effectFinalCombine.uniforms.tOriginal.value=this.copyRenderTarget.texture,this.effectFinalCombine.uniforms.mipPixelSize.value=new f1(this.mips[r].width,this.mips[r].height,1/this.mips[r].width,1/this.mips[r].height),this.effectFinalCombine.uniforms.tOriginalMip.value=this.mips[r].texture,this.effectFinalCombine.uniforms.exposure.value=i,this.effectFinalCombine.render(this.main.renderer,t,this.mipsAssemble[d1.DISPLAY_MIP],0,!1)}},d1.ENABLE_LTM=!0,d1.BOOST_LOCAL_CONTRAST=!1,d1.SHADOWS=1.5,d1.HIGHLIGHTS=2,d1.MIP=6,d1.DISPLAY_MIP=2,d1.EXPOSURE_PREFERENCE_SIGMA=5,d1.EXPOSURE_SCALE=.3,d1),a7=(er=class extends Event{constructor(t){super(er.EVENT_NAME),this.data=t}},er.EVENT_NAME="postProcessorOptions",er),n7=(It=class{static getKelvinRGB(t){let i=Math.floor((t-1e3)/1e3),r=i+1;if(i<0)return It.rgbValues[0].clone();if(r>=It.rgbValues.length)return It.rgbValues[It.rgbValues.length-1].clone();let n=i*1e3+1e3,o=(t-n)/1e3;return It.rgbValues[i].clone().lerp(It.rgbValues[r],o)}},It.rgbValues=[new I(1,.26,0),new I(1,.53,.05),new I(1,.69,.43),new I(1,.8,.65),new I(1,.89,.8),new I(1,.96,.93),new I(.95,.95,1),new I(.87,.9,1),new I(.82,.87,1),new I(.79,.85,1),new I(.76,.84,1),new I(.75,.83,1)],It),o7=(e=>(e.None="NoTonemap",e.Agx="AgXTonemap",e.Reinhard="reinhardTonemap",e.Fusion="fusionTonemap",e))(o7||{});function s7(e){return e&&typeof e=="object"&&("activeTonemapper"in e||"unrealBloomEnabled"in e||"unrealBloomStrength"in e||"unrealBloomRadius"in e||"unrealBloomThreshold"in e||"sharpenFilterAmount"in e||"whitePoint"in e||"temperature"in e)}var l7=class{constructor(e,t,i){this.nLayers=0,this.renderTarget=null,this.options={activeTonemapper:"AgXTonemap",unrealBloomEnabled:!0,unrealBloomStrength:.3,unrealBloomRadius:.5,unrealBloomThreshold:.99,sharpenFilterAmount:.6,whitePoint:new I(1,1,1),temperature:6500},this.finalComposer=null,this.exposurePass=null,this.textureRenderPass=null,this.composer=null,this.sharpenPass=null,this.bloomPass=null,this.fullScreenQuadMaterial=null,this.main=e,this.exposureCalculator=new i7(e),this.hasHdr=t,this.setOptions(i||{}),e.addEventListener(a7.EVENT_NAME,r=>{this.setOptions(r.data),this.main.resetRenderLayers()})}setOptions(e){this.options.activeTonemapper=e.activeTonemapper??this.options.activeTonemapper,this.options.unrealBloomEnabled=e.unrealBloomEnabled??this.options.unrealBloomEnabled,this.options.unrealBloomStrength=e.unrealBloomStrength??this.options.unrealBloomStrength,this.options.unrealBloomRadius=e.unrealBloomRadius??this.options.unrealBloomRadius,this.options.unrealBloomThreshold=e.unrealBloomThreshold??this.options.unrealBloomThreshold,this.options.sharpenFilterAmount=e.sharpenFilterAmount??this.options.sharpenFilterAmount,this.options.whitePoint=e.whitePoint??this.options.whitePoint,this.options.temperature=e.temperature??this.options.temperature,this.options.activeTonemapper==="fusionTonemap"&&(this.tonemapperFusion=new r7(this.main))}setLayers(e){this.nLayers!==e&&(this.nLayers=e,this.finalComposer=new Ul(this.main.renderer),this.exposurePass=new Bt(this.createExposureMaterial()),this.options.activeTonemapper==="fusionTonemap"?(this.fullScreenQuadMaterial=new x1({uniforms:{tex:{value:null}},vertexShader:q8,fragmentShader:Q8}),this.textureRenderPass=new Bt(this.fullScreenQuadMaterial),this.finalComposer.addPass(this.textureRenderPass)):(this.finalComposer.addPass(this.exposurePass),this.main.isMobile||(this.sharpenPass=new Bt(new J8),this.finalComposer.addPass(this.sharpenPass)),this.hasHdr&&this.options.unrealBloomEnabled&&(this.bloomPass=new Bn(new ye(this.main.width,this.main.height),this.options.unrealBloomStrength,this.options.unrealBloomRadius,this.options.unrealBloomThreshold),this.finalComposer.addPass(this.bloomPass))),this.setSize(this.main.width,this.main.height))}getShaderMaterial(){if(!this.exposurePass)throw new Error("Exposure pass not initialized");return this.exposurePass.material}getRenderTarget(){if(!this.renderTarget)throw new Error("Render texture not initialized");return this.renderTarget}setSize(e,t){this.renderTarget=this.main.createRenderTarget(),this.sharpenPass&&(this.sharpenPass.uniforms.resolution.value=new ye(e,t),this.sharpenPass.uniforms.amount.value=Math.min(this.options.sharpenFilterAmount,t/1080)),this.bloomPass&&(this.bloomPass.resolution=new ye(e,t)),this.finalComposer.setSize(e,t),this.composer=new Ul(this.main.renderer,this.main.mainRenderTarget),this.composer.addPass(new H8(this.main.scene,this.main.mainCamera)),this.composer.setSize(e,t)}createExposureMaterial(){return new x1({uniforms:{inputTexture:{value:null},u_exposure:{value:.5},debugTexture:{value:null},uApplyLut:{value:!1},uLutTexture:{value:null},layerTextures:{value:[]},layerInfo:{value:[]},u_whitePoint:{value:new I(1,1,1)},time:{value:0}},vertexShader:j8,fragmentShader:X8(this.nLayers,this.hasHdr,this.options.activeTonemapper)})}async setLUT(e){this.lutTexture&&this.lutTexture.dispose();let t=await new Nn().loadAsync(e),i=t.image.width,r=t.image.height;if(i!==512||r!==512){console.log("The LUT is not 512 x 512: "+e);return}let n=new S1(i,r,{minFilter:u1,magFilter:u1}),o=new zt(-i/2,i/2,r/2,-r/2,.1,10);o.position.z=1;let s=new kt(i,r),l=new lt({map:t});l.map.needsUpdate=!0;let d=new v1(s,l),c=new M2;c.add(d),this.main.renderer.setRenderTarget(n),this.main.renderer.clear(),this.main.renderer.render(c,o);let h=new Uint8Array(i*r*4);this.main.renderer.readRenderTargetPixels(n,0,0,i,r,h),this.main.renderer.setRenderTarget(null),t.dispose();let u=new Uint8Array(i*4);for(let _=0;_<r/2;_++){let g=_*i*4,p=(r-_-1)*i*4;u.set(h.subarray(g,g+i*4)),h.copyWithin(g,p,p+i*4),h.set(u,p)}let m=64,f=new Uint8Array(m*m*m*4);for(let _=0;_<m;_++){let g=_%8,p=Math.floor(_/8),y=g*m+p*m*i;for(let x=0;x<m;x++)for(let b=0;b<m;b++){let N=(_*m*m+x*m+b)*4,A=(b+x*i+y)*4;f[N]=h[A],f[N+1]=h[A+1],f[N+2]=h[A+2],f[N+3]=255}}let v=new ns(f,m,m,m);v.format=U1,v.type=Rt,v.minFilter=m1,v.magFilter=m1,v.wrapS=Lt,v.wrapT=Lt,v.needsUpdate=!0,this.lutTexture=v,n.dispose(),l.dispose(),s.dispose(),d.geometry.dispose()}renderFinalComposer(){let e=this.exposurePass,t=this.exposureCalculator.calculateExposure(this.main.mainRenderTarget.texture);if(e.material.uniforms.u_exposure.value+=(t-e.uniforms.u_exposure.value)*.06,e.material.uniforms.inputTexture.value=this.main.mainRenderTarget.texture,this.tonemapperFusion!==void 0)this.textureRenderPass.material.uniforms.tex.value=this.main.mainRenderTarget.texture,this.tonemapperFusion.render(this.main.mainRenderTarget,e.material.uniforms.u_exposure.value),this.finalComposer.render(this.main.deltaTime);else{e.material.uniforms.uApplyLut.value=this.lutTexture!==void 0,e.material.uniforms.uApplyLut.value&&(e.material.uniforms.uLutTexture.value=this.lutTexture);let i=n7.getKelvinRGB(this.options.temperature);if(this.options.whitePoint){let r=Array.isArray(this.options.whitePoint)?new I(...this.options.whitePoint):this.options.whitePoint;e.material.uniforms.u_whitePoint.value.set(i.x/r.x,i.y/r.y,i.z/r.z)}this.finalComposer.render(this.main.deltaTime)}}},c7=(tr=class extends Event{constructor(t){super(tr.EVENT_NAME),this.data=t}},tr.EVENT_NAME="dataPointsLoaded",tr),o3=(Ve=class{static newDataTexture(t,i,r,n,o,s,l,d,c,h,u,m){let f=new w2(t,i,r,n,o,s,l,d,c,h,u,m);return f.needsUpdate=!0,Ve.texturesToNullify.add(f),Ve.scheduleDataClear(),f}static scheduleDataClear(){let t=()=>{var i;for(let r of Ve.texturesToNullify)(i=r.image)!=null&&i.data&&(r.image.data=null),r.needsUpdate=!1,Ve.texturesToNullify.delete(r)};requestAnimationFrame(()=>requestAnimationFrame(t))}static flipTexture(t,i,r,n,o,s){let l={uniforms:{u_texture:{value:t},u_flipH:{value:n?-1:1},u_flipV:{value:o?-1:1},u_offsetX:{value:i},u_offsetY:{value:r}},vertexShader:`
4460
+ }`;this.effectFinalCombine=new Bt({uniforms:{tDiffuse:{value:null},tOriginal:{value:null},tOriginalMip:{value:null},mipPixelSize:{value:null},exposure:{value:1}},vertexShader:this.passthroughVS,fragmentShader:t})}getRenderTexture(t,i){return(!i||i.width!==t.width||i.height!==t.height)&&(i&&i.dispose(),i=new S1(t.width,t.height,{minFilter:m1,magFilter:m1,format:t.texture.format,type:t.texture.type})),i}prepareTextures(t){if(this.preparedWidth===t.width&&this.preparedHeight===t.height)return;this.mips&&this.mips.forEach(s=>{s.dispose()}),this.mipsWeights&&this.mipsWeights.forEach(s=>{s.dispose()}),this.mipsAssemble&&this.mipsAssemble.forEach(s=>{s.dispose()}),this.mips=[],this.mipsWeights=[],this.mipsAssemble=[];let i=t.width,r=t.height,n={minFilter:m1,magFilter:m1,format:D1,type:ot},o={minFilter:m1,magFilter:m1,format:k3,type:ot};for(;i>1&&r>1;)this.mips.push(new S1(i,r,n)),this.mipsWeights.push(new S1(i,r,n)),this.mipsAssemble.push(new S1(i,r,o)),i=i/2,r=r/2;this.preparedWidth=t.width,this.preparedHeight=t.height}render(t,i){i=2**i*c1.EXPOSURE_SCALE,this.prepareTextures(t),this.copyRenderTarget=this.getRenderTexture(t,this.copyRenderTarget),this.copyPass.render(this.main.renderer,this.copyRenderTarget,t,void 0,!1),this.effectLuminance.uniforms.exposure.value=i,this.effectLuminance.uniforms.shadows.value=c1.ENABLE_LTM?2**c1.SHADOWS:1,this.effectLuminance.uniforms.highlights.value=c1.ENABLE_LTM?2**-c1.HIGHLIGHTS:1,this.effectLuminance.uniforms.tOriginal.value=this.copyRenderTarget.texture,this.effectLuminance.render(this.main.renderer,this.mips[0],void 0,void 0,!1),this.effectWeights.uniforms.sigmaSq.value=c1.EXPOSURE_PREFERENCE_SIGMA*c1.EXPOSURE_PREFERENCE_SIGMA,this.effectWeights.render(this.main.renderer,this.mipsWeights[0],this.mips[0],void 0,!1);for(let n=0;n<this.mips.length-1;n++)this.copyPass.render(this.main.renderer,this.mips[n+1],this.mips[n],void 0,!1),this.copyPass.render(this.main.renderer,this.mipsWeights[n+1],this.mipsWeights[n],void 0,!1);this.effectBlend.uniforms.tExposures.value=this.mips[c1.MIP].texture,this.effectBlend.uniforms.tWeights.value=this.mipsWeights[c1.MIP].texture,this.effectBlend.render(this.main.renderer,this.mipsAssemble[c1.MIP],void 0,void 0,!1);for(let n=c1.MIP;n>c1.DISPLAY_MIP;n--)this.effectBlendLaplacian.uniforms.tExposures.value=this.mips[n-1].texture,this.effectBlendLaplacian.uniforms.tExposuresCoarser.value=this.mips[n].texture,this.effectBlendLaplacian.uniforms.boostLocalContrast.value=c1.BOOST_LOCAL_CONTRAST,this.effectBlendLaplacian.uniforms.tWeights.value=this.mipsWeights[n-1].texture,this.effectBlendLaplacian.uniforms.tAccumSoFar.value=this.mipsAssemble[n].texture,this.effectBlendLaplacian.render(this.main.renderer,this.mipsAssemble[n-1],void 0,void 0,!1);let r=Math.min(c1.DISPLAY_MIP,c1.MIP);this.effectFinalCombine.uniforms.tOriginal.value=this.copyRenderTarget.texture,this.effectFinalCombine.uniforms.mipPixelSize.value=new f1(this.mips[r].width,this.mips[r].height,1/this.mips[r].width,1/this.mips[r].height),this.effectFinalCombine.uniforms.tOriginalMip.value=this.mips[r].texture,this.effectFinalCombine.uniforms.exposure.value=i,this.effectFinalCombine.render(this.main.renderer,t,this.mipsAssemble[c1.DISPLAY_MIP],0,!1)}},c1.ENABLE_LTM=!0,c1.BOOST_LOCAL_CONTRAST=!1,c1.SHADOWS=1.5,c1.HIGHLIGHTS=2,c1.MIP=6,c1.DISPLAY_MIP=2,c1.EXPOSURE_PREFERENCE_SIGMA=5,c1.EXPOSURE_SCALE=.3,c1),a7=($i=class extends Event{constructor(t){super($i.EVENT_NAME),this.data=t}},$i.EVENT_NAME="postProcessorOptions",$i),n7=(Tt=class{static getKelvinRGB(t){let i=Math.floor((t-1e3)/1e3),r=i+1;if(i<0)return Tt.rgbValues[0].clone();if(r>=Tt.rgbValues.length)return Tt.rgbValues[Tt.rgbValues.length-1].clone();let n=i*1e3+1e3,o=(t-n)/1e3;return Tt.rgbValues[i].clone().lerp(Tt.rgbValues[r],o)}},Tt.rgbValues=[new I(1,.26,0),new I(1,.53,.05),new I(1,.69,.43),new I(1,.8,.65),new I(1,.89,.8),new I(1,.96,.93),new I(.95,.95,1),new I(.87,.9,1),new I(.82,.87,1),new I(.79,.85,1),new I(.76,.84,1),new I(.75,.83,1)],Tt),o7=(e=>(e.None="NoTonemap",e.Agx="AgXTonemap",e.Reinhard="reinhardTonemap",e.Fusion="fusionTonemap",e))(o7||{});function s7(e){return e&&typeof e=="object"&&("activeTonemapper"in e||"unrealBloomEnabled"in e||"unrealBloomStrength"in e||"unrealBloomRadius"in e||"unrealBloomThreshold"in e||"sharpenFilterAmount"in e||"whitePoint"in e||"temperature"in e)}var l7=class{constructor(e,t,i){this.nLayers=0,this.renderTarget=null,this.options={activeTonemapper:"AgXTonemap",unrealBloomEnabled:!0,unrealBloomStrength:.3,unrealBloomRadius:.5,unrealBloomThreshold:.99,sharpenFilterAmount:.6,whitePoint:new I(1,1,1),temperature:6500},this.finalComposer=null,this.exposurePass=null,this.textureRenderPass=null,this.composer=null,this.sharpenPass=null,this.bloomPass=null,this.fullScreenQuadMaterial=null,this.main=e,this.exposureCalculator=new i7(e),this.hasHdr=t,this.setOptions(i||{}),e.addEventListener(a7.EVENT_NAME,r=>{this.setOptions(r.data),this.main.resetRenderLayers()})}setOptions(e){this.options.activeTonemapper=e.activeTonemapper??this.options.activeTonemapper,this.options.unrealBloomEnabled=e.unrealBloomEnabled??this.options.unrealBloomEnabled,this.options.unrealBloomStrength=e.unrealBloomStrength??this.options.unrealBloomStrength,this.options.unrealBloomRadius=e.unrealBloomRadius??this.options.unrealBloomRadius,this.options.unrealBloomThreshold=e.unrealBloomThreshold??this.options.unrealBloomThreshold,this.options.sharpenFilterAmount=e.sharpenFilterAmount??this.options.sharpenFilterAmount,this.options.whitePoint=e.whitePoint??this.options.whitePoint,this.options.temperature=e.temperature??this.options.temperature,this.options.activeTonemapper==="fusionTonemap"&&(this.tonemapperFusion=new r7(this.main))}setLayers(e){this.nLayers!==e&&(this.nLayers=e,this.finalComposer=new Ul(this.main.renderer),this.exposurePass=new Bt(this.createExposureMaterial()),this.options.activeTonemapper==="fusionTonemap"?(this.fullScreenQuadMaterial=new x1({uniforms:{tex:{value:null}},vertexShader:q8,fragmentShader:Q8}),this.textureRenderPass=new Bt(this.fullScreenQuadMaterial),this.finalComposer.addPass(this.textureRenderPass)):(this.finalComposer.addPass(this.exposurePass),this.main.isMobile||(this.sharpenPass=new Bt(new J8),this.finalComposer.addPass(this.sharpenPass)),this.hasHdr&&this.options.unrealBloomEnabled&&(this.bloomPass=new Bn(new ye(this.main.width,this.main.height),this.options.unrealBloomStrength,this.options.unrealBloomRadius,this.options.unrealBloomThreshold),this.finalComposer.addPass(this.bloomPass))),this.setSize(this.main.width,this.main.height))}getShaderMaterial(){if(!this.exposurePass)throw new Error("Exposure pass not initialized");return this.exposurePass.material}getRenderTarget(){if(!this.renderTarget)throw new Error("Render texture not initialized");return this.renderTarget}setSize(e,t){this.renderTarget=this.main.createRenderTarget(),this.sharpenPass&&(this.sharpenPass.uniforms.resolution.value=new ye(e,t),this.sharpenPass.uniforms.amount.value=Math.min(this.options.sharpenFilterAmount,t/1080)),this.bloomPass&&(this.bloomPass.resolution=new ye(e,t)),this.finalComposer.setSize(e,t),this.composer=new Ul(this.main.renderer,this.main.mainRenderTarget),this.composer.addPass(new H8(this.main.scene,this.main.mainCamera)),this.composer.setSize(e,t)}createExposureMaterial(){return new x1({uniforms:{inputTexture:{value:null},u_exposure:{value:.5},debugTexture:{value:null},uApplyLut:{value:!1},uLutTexture:{value:null},layerTextures:{value:[]},layerInfo:{value:[]},u_whitePoint:{value:new I(1,1,1)},time:{value:0}},vertexShader:j8,fragmentShader:X8(this.nLayers,this.hasHdr,this.options.activeTonemapper)})}async setLUT(e){this.lutTexture&&this.lutTexture.dispose();let t=await new Nn().loadAsync(e),i=t.image.width,r=t.image.height;if(i!==512||r!==512){console.log("The LUT is not 512 x 512: "+e);return}let n=new S1(i,r,{minFilter:u1,magFilter:u1}),o=new zt(-i/2,i/2,r/2,-r/2,.1,10);o.position.z=1;let s=new kt(i,r),l=new lt({map:t});l.map.needsUpdate=!0;let d=new v1(s,l),c=new S2;c.add(d),this.main.renderer.setRenderTarget(n),this.main.renderer.clear(),this.main.renderer.render(c,o);let h=new Uint8Array(i*r*4);this.main.renderer.readRenderTargetPixels(n,0,0,i,r,h),this.main.renderer.setRenderTarget(null),t.dispose();let u=new Uint8Array(i*4);for(let _=0;_<r/2;_++){let g=_*i*4,p=(r-_-1)*i*4;u.set(h.subarray(g,g+i*4)),h.copyWithin(g,p,p+i*4),h.set(u,p)}let m=64,f=new Uint8Array(m*m*m*4);for(let _=0;_<m;_++){let g=_%8,p=Math.floor(_/8),y=g*m+p*m*i;for(let x=0;x<m;x++)for(let b=0;b<m;b++){let N=(_*m*m+x*m+b)*4,A=(b+x*i+y)*4;f[N]=h[A],f[N+1]=h[A+1],f[N+2]=h[A+2],f[N+3]=255}}let v=new ns(f,m,m,m);v.format=D1,v.type=Rt,v.minFilter=m1,v.magFilter=m1,v.wrapS=Lt,v.wrapT=Lt,v.needsUpdate=!0,this.lutTexture=v,n.dispose(),l.dispose(),s.dispose(),d.geometry.dispose()}renderFinalComposer(){let e=this.exposurePass,t=this.exposureCalculator.calculateExposure(this.main.mainRenderTarget.texture);if(e.material.uniforms.u_exposure.value+=(t-e.uniforms.u_exposure.value)*.06,e.material.uniforms.inputTexture.value=this.main.mainRenderTarget.texture,this.tonemapperFusion!==void 0)this.textureRenderPass.material.uniforms.tex.value=this.main.mainRenderTarget.texture,this.tonemapperFusion.render(this.main.mainRenderTarget,e.material.uniforms.u_exposure.value),this.finalComposer.render(this.main.deltaTime);else{e.material.uniforms.uApplyLut.value=this.lutTexture!==void 0,e.material.uniforms.uApplyLut.value&&(e.material.uniforms.uLutTexture.value=this.lutTexture);let i=n7.getKelvinRGB(this.options.temperature);if(this.options.whitePoint){let r=Array.isArray(this.options.whitePoint)?new I(...this.options.whitePoint):this.options.whitePoint;e.material.uniforms.u_whitePoint.value.set(i.x/r.x,i.y/r.y,i.z/r.z)}this.finalComposer.render(this.main.deltaTime)}}},c7=(er=class extends Event{constructor(t){super(er.EVENT_NAME),this.data=t}},er.EVENT_NAME="dataPointsLoaded",er),o3=(Ve=class{static newDataTexture(t,i,r,n,o,s,l,d,c,h,u,m){let f=new M2(t,i,r,n,o,s,l,d,c,h,u,m);return f.needsUpdate=!0,Ve.texturesToNullify.add(f),Ve.scheduleDataClear(),f}static scheduleDataClear(){let t=()=>{var i;for(let r of Ve.texturesToNullify)(i=r.image)!=null&&i.data&&(r.image.data=null),r.needsUpdate=!1,Ve.texturesToNullify.delete(r)};requestAnimationFrame(()=>requestAnimationFrame(t))}static flipTexture(t,i,r,n,o,s){let l={uniforms:{u_texture:{value:t},u_flipH:{value:n?-1:1},u_flipV:{value:o?-1:1},u_offsetX:{value:i},u_offsetY:{value:r}},vertexShader:`
4461
4461
  varying vec2 vUv;
4462
4462
  void main() {
4463
4463
  vUv = uv;
@@ -4475,7 +4475,7 @@ void main() {
4475
4475
  vec4 texColor = texture2D(u_texture, flippedUv);
4476
4476
  gl_FragColor = texColor;
4477
4477
  }
4478
- `};t.wrapS=D1,t.wrapT=D1;let d=new x1(l),c=new v1(new kt(1,1),d);Ve.scene.add(c);let h=new S1(t.image.width,t.image.height,{minFilter:m1,magFilter:m1,format:U1});return Ve.renderer.setRenderTarget(h),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(c),c.geometry.dispose(),d.dispose(),s&&t.dispose(),h.texture}static scaleTextureFast(t,i,r){let n=new x1({uniforms:{u_texture:{value:t}},vertexShader:`
4478
+ `};t.wrapS=R1,t.wrapT=R1;let d=new x1(l),c=new v1(new kt(1,1),d);Ve.scene.add(c);let h=new S1(t.image.width,t.image.height,{minFilter:m1,magFilter:m1,format:D1});return Ve.renderer.setRenderTarget(h),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(c),c.geometry.dispose(),d.dispose(),s&&t.dispose(),h.texture}static scaleTextureFast(t,i,r){let n=new x1({uniforms:{u_texture:{value:t}},vertexShader:`
4479
4479
  varying vec2 vUv;
4480
4480
  void main() {
4481
4481
  vUv = uv;
@@ -4488,7 +4488,7 @@ void main() {
4488
4488
  vec4 texColor = texture2D(u_texture, vUv);
4489
4489
  gl_FragColor = texColor;
4490
4490
  }
4491
- `}),o=new v1(new kt(1,1),n);Ve.scene.add(o);let s=new S1(i,r,{type:Q1,wrapS:D1,wrapT:D1});return Ve.renderer.setRenderTarget(s),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(o),o.geometry.dispose(),n.dispose(),s}static getNullNormalMap(){if(!Ve.nullNormalMap){let t=new Float32Array([.5,.5,1,1]);Ve.nullNormalMap=new w2(t,1,1,U1,Q1),Ve.nullNormalMap.magFilter=u1,Ve.nullNormalMap.minFilter=u1,Ve.nullNormalMap.needsUpdate=!0}return Ve.nullNormalMap}static getWhiteMap(){if(!Ve.nullNormalMap){let t=new Float32Array([1,1,1,1]);Ve.whiteMap=new w2(t,1,1,U1,Q1),Ve.whiteMap.magFilter=u1,Ve.whiteMap.minFilter=u1,Ve.whiteMap.needsUpdate=!0}return Ve.whiteMap}static blurTexture(t,i){let r=new x1({uniforms:{u_texture:{value:t},u_resolution:{value:new ye(t.image.width,t.image.height)}},vertexShader:`
4491
+ `}),o=new v1(new kt(1,1),n);Ve.scene.add(o);let s=new S1(i,r,{type:q1,wrapS:R1,wrapT:R1});return Ve.renderer.setRenderTarget(s),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(o),o.geometry.dispose(),n.dispose(),s}static getNullNormalMap(){if(!Ve.nullNormalMap){let t=new Float32Array([.5,.5,1,1]);Ve.nullNormalMap=new M2(t,1,1,D1,q1),Ve.nullNormalMap.magFilter=u1,Ve.nullNormalMap.minFilter=u1,Ve.nullNormalMap.needsUpdate=!0}return Ve.nullNormalMap}static getWhiteMap(){if(!Ve.nullNormalMap){let t=new Float32Array([1,1,1,1]);Ve.whiteMap=new M2(t,1,1,D1,q1),Ve.whiteMap.magFilter=u1,Ve.whiteMap.minFilter=u1,Ve.whiteMap.needsUpdate=!0}return Ve.whiteMap}static blurTexture(t,i){let r=new x1({uniforms:{u_texture:{value:t},u_resolution:{value:new ye(t.image.width,t.image.height)}},vertexShader:`
4492
4492
  varying vec2 vUv;
4493
4493
  void main() {
4494
4494
  vUv = uv;
@@ -4545,7 +4545,7 @@ void main() {
4545
4545
  vec3 color = blur(u_texture, vUv, scale);
4546
4546
  gl_FragColor = vec4(color, texture2D(u_texture,vUv).a);
4547
4547
  }
4548
- `}),n=new v1(new kt,r);Ve.scene.add(n);let o=new S1(t.image.width,t.image.height,{type:Q1,wrapS:D1,wrapT:D1});return Ve.renderer.setRenderTarget(o),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(n),n.geometry.dispose(),r.dispose(),o}},Ve.texturesToNullify=new Set,Ve.camera=new zt(-.5,.5,.5,-.5,0,1),Ve.scene=new M2,Ve),d7=(e=>(e[e.Default=0]="Default",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.AnimatedMarkers=3]="AnimatedMarkers",e[e.NoDepth=4]="NoDepth",e))(d7||{}),a2=class{constructor(){this.renderTextureScaler=1,window.addEventListener("beforeunload",()=>this.dispose())}get renderTarget(){let{width:e,height:t}=this.getScaledCanvasSize();return(!this._renderTarget||this._renderTarget.width!==e||this._renderTarget.height!==t)&&(this._renderTarget&&this._renderTarget.dispose(),this._renderTarget=this.main.createRenderTarget()),this._renderTarget}get scene(){return this._scene||(this._scene=new M2),this._scene}getScaledCanvasSize(){let{width:e,height:t}=this.main.getCurrentCanvasSize(),i=Math.floor(e*this.renderTextureScaler),r=Math.floor(t*this.renderTextureScaler);return{width:i,height:r}}async register(e){this.main=e}reset(){}setSize(e,t){}async dispose(){var e;(e=this._renderTarget)==null||e.dispose(),this._renderTarget=void 0}},Fn=class extends Event{constructor(e,t){super(e),this.data=t}},h7=(ir=class extends Fn{constructor(t){super(ir.EVENT_NAME,t)}},ir.EVENT_NAME="keyDown",ir),Hn=(rr=class extends Fn{constructor(t){super(rr.EVENT_NAME,t)}},rr.EVENT_NAME="key",rr),u7=(ar=class extends Fn{constructor(t){super(ar.EVENT_NAME,t)}},ar.EVENT_NAME="keyUp",ar),m7=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(m7||{}),Hi=class extends Event{constructor(e,t){super(e),this.data=t}},f7=(nr=class extends Hi{constructor(t){super(nr.EVENT_NAME,t)}},nr.EVENT_NAME="mouseDown",nr),Yr=(or=class extends Hi{constructor(t){super(or.EVENT_NAME,t)}},or.EVENT_NAME="mouse",or),Gn=(sr=class extends Hi{constructor(t){super(sr.EVENT_NAME,t)}},sr.EVENT_NAME="mouseMove",sr),Wn=(lr=class extends Hi{constructor(t){super(lr.EVENT_NAME,t)}},lr.EVENT_NAME="mouseScroll",lr),p7=(cr=class extends Hi{constructor(t){super(cr.EVENT_NAME,t)}},cr.EVENT_NAME="mouseUp",cr),jn=(dr=class extends Hi{constructor(t){super(dr.EVENT_NAME,t)}},dr.EVENT_NAME="mousePick",dr),kl=(hr=class extends Event{constructor(t){super(hr.EVENT_NAME),this.data=t}},hr.EVENT_NAME="userInputPluginOptions",hr);function g7(e){return e&&typeof e=="object"&&"dragScale"in e}var _7=class extends a2{constructor(e){super(),this.name="userInputPlugin",this.options={dragScale:new ye(1,1)},this.userInputPluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.keysState=new Map,this.keysUp=new Map,this.keysDown=new Map,this.mouseButtonsState=new Map,this.mouseButtonsUp=new Map,this.mouseButtonsDown=new Map,this.mousePosition=new ye,this.mouseScrollDelta=new ye,this.mouseDragDelta=new ye,this.mouseDownPosition=new ye,this.mouseUpPosition=new ye,this.lastTouchPosition=new ye,this.mouseDownTime=0,this.mouseUpTime=0,this.maxTapTime=200,this.maxTapMove=5,this.mousePickConsumed=!1,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.raycaster=new Pl,this.hitPlane=new S2(new I(0,1,0),0),this.setOptions(e||{})}setOptions(e){this.options.dragScale=e.dragScale??this.options.dragScale}async register(e){super.register(e),document.addEventListener("keydown",t=>this.handleKeyDown(t)),document.addEventListener("keyup",t=>this.handleKeyUp(t)),this.main.canvas.addEventListener("mousedown",t=>this.handleMouseDown(t)),document.addEventListener("mouseup",t=>this.handleMouseUp(t)),this.main.canvas.addEventListener("mousemove",t=>this.handleMouseMove(t)),this.main.canvas.addEventListener("touchstart",t=>this.handleTouchStart(t)),this.main.canvas.addEventListener("touchend",t=>this.handleTouchEnd(t)),this.main.canvas.addEventListener("touchmove",t=>this.handleTouchMove(t)),this.main.canvas.addEventListener("wheel",t=>this.handleMouseWheel(t)),this.main.addEventListener(kl.EVENT_NAME,this.userInputPluginOptionsEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(kl.EVENT_NAME,this.userInputPluginOptionsEventHandler)}handleKeyDown(e){var t;(t=this.main.canvas.parentElement)!=null&&t.matches(":hover")&&(e.preventDefault(),this.keysState.set(e.code,!0),this.keysDown.set(e.code,!0),this.main.dispatchEvent(new h7({key:e.code})))}handleKeyUp(e){var t;(t=this.main.canvas.parentElement)!=null&&t.matches(":hover")&&(e.preventDefault(),this.keysState.set(e.code,!1),this.keysUp.set(e.code,!0),this.main.dispatchEvent(new u7({key:e.code})))}handleInputDown(e,t,i){this.mouseButtonsState.set(e,!0),this.mouseButtonsDown.set(e,!0),this.mouseDownPosition.set(t,i),this.mouseDownTime=performance.now(),this.main.dispatchEvent(new f7(this.getMouseEventData(e)))}handleMouseDown(e){this.handleInputDown(e.button,e.clientX,e.clientY)}handleTouchStart(e){if(e.touches.length===1&&(this.handleInputDown(0,e.touches[0].clientX,e.touches[0].clientY),this.lastTouchPosition.set(e.touches[0].clientX,e.touches[0].clientY)),e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,i=e.touches[0].clientY-e.touches[1].clientY,r=Math.hypot(t,i);this.touchZoomDistanceEnd=this.touchZoomDistanceStart=r}}handleInputUp(e,t,i){if(this.mouseButtonsState.set(e,!1),this.mouseButtonsUp.set(e,!0),this.mouseUpPosition.set(t,i),this.mouseUpTime=performance.now(),this.main.dispatchEvent(new p7(this.getMouseEventData(e))),e===0&&!this.mousePickConsumed){let r=this.mouseDownPosition.distanceTo(this.mouseUpPosition),n=this.mouseUpTime-this.mouseDownTime;r<=this.maxTapMove&&n<=this.maxTapTime&&(this.mousePickConsumed=!0,this.main.dispatchEvent(new jn(this.getMouseEventData(e))))}}handleMouseUp(e){this.handleInputUp(e.button,e.clientX,e.clientY)}handleTouchEnd(e){let t=e.changedTouches[0];this.handleInputUp(0,t.clientX,t.clientY),this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0}handleInputMove(e,t,i,r){this.mousePosition.set(e,t),this.mouseDragDelta.x+=i*this.options.dragScale.x,this.mouseDragDelta.y+=r*this.options.dragScale.y,this.main.dispatchEvent(new Gn(this.getMouseEventData(this.mouseButtonsState.get(0)?0:this.mouseButtonsState.get(1)?1:void 0)))}handleMouseMove(e){this.handleInputMove(e.clientX,e.clientY,e.movementX,e.movementY)}handleTouchMove(e){if(e.touches.length===1){let t=e.touches[0],i=t.clientX-this.lastTouchPosition.x,r=t.clientY-this.lastTouchPosition.y;this.handleInputMove(t.clientX,t.clientY,i,r),this.lastTouchPosition.set(t.clientX,t.clientY)}if(e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,i=e.touches[0].clientY-e.touches[1].clientY,r=Math.hypot(t,i);this.touchZoomDistanceEnd=r;let n=this.touchZoomDistanceEnd-this.touchZoomDistanceStart;this.touchZoomDistanceStart=this.touchZoomDistanceEnd,this.mouseScrollDelta.set(0,-2*n)}}handleMouseWheel(e){this.mouseScrollDelta.set(e.deltaX,e.deltaY),this.main.dispatchEvent(new Wn(this.getMouseEventData()))}getMousePositionLocal(){let e=this.main.canvas.getBoundingClientRect();return new ye(this.mousePosition.x-e.left,this.mousePosition.y-e.top)}getMousePositionGlobal(){return this.mousePosition}getMousePositionNormalized(){let e=this.main.canvas.getBoundingClientRect(),t=new ye(this.mousePosition.x-e.left,this.mousePosition.y-e.top);return new ye(t.x/e.width*2-1,-(t.y/e.height)*2+1)}getMousePosition(){return new ye(this.mousePosition.x,this.mousePosition.y)}getRay(){var o;let e=((o=this.main.getCurrentDataPoint())==null?void 0:o.floorPositionY)||0;this.raycaster.setFromCamera(this.getMousePositionNormalized(),this.main.camera),this.hitPlane.constant=-e;let t=new I,i=this.raycaster.ray.intersectPlane(this.hitPlane,t),r=!0;if(!i){r=!1;let s=this.main.camera.position.y+(this.main.camera.position.y-e);this.hitPlane.constant=-s,i=this.raycaster.ray.intersectPlane(this.hitPlane,t)}let n=new I(t.x-this.main.camera.position.x,0,t.z-this.main.camera.position.z);return n.normalize(),{hitPoint:t,directionXZ:n,isFloor:r}}getMouseEventData(e){return{local:this.getMousePositionLocal(),global:this.getMousePositionGlobal(),normalized:this.getMousePositionNormalized(),screen:this.getMousePosition(),delta:this.mouseDragDelta,scrollDelta:this.mouseScrollDelta,ray:this.getRay(),button:e}}update(){let e={local:this.getMousePositionLocal(),global:this.getMousePositionGlobal(),normalized:this.getMousePositionNormalized(),screen:this.getMousePosition(),delta:this.mouseDragDelta,scrollDelta:this.mouseScrollDelta,ray:this.getRay()};this.mouseButtonsState.get(0)||(this.mousePickConsumed=!1);for(let[t,i]of this.keysState.entries())i&&this.main.dispatchEvent(new Hn({key:t}));for(let[t,i]of this.mouseButtonsState.entries())i&&this.main.dispatchEvent(new Yr({...e,button:t}));return{}}reset(){this.mouseButtonsUp.set(0,!1),this.mouseButtonsUp.set(1,!1),this.mouseButtonsDown.set(0,!1),this.mouseButtonsDown.set(1,!1),this.keysUp.clear(),this.keysDown.clear(),this.mouseDragDelta.set(0,0),this.mouseScrollDelta.set(0,0)}},v7=class extends a2{constructor(){super(...arguments),this.name="panoramaRendererPlugin"}update(){var t,i;let e=this.main.camera.rotation.clone();return e.x=-e.x,e.y=-e.y,{panorama:{currentPanorama:(t=this.main.panoramaTextureHandler)==null?void 0:t.getTexture(),nextPanorama:(i=this.main.panoramaTextureHandler)==null?void 0:i.getTexture(),currentSphere:this.main.panoramaRenderTargetFrom.texture,nextSphere:this.main.panoramaRenderTargetTo.texture,rotation:e,fovY:this.main.camera.fov,aspectRatio:this.main.aspectRatio}}}},x7=class extends a2{constructor(){super(...arguments),this.name="panCameraPlugin",this.keyHandler=this.onKey.bind(this),this.mouseHandler=this.onMouse.bind(this),this.mouseScrollHandler=this.onMouseScroll.bind(this)}async register(e){await super.register(e),this.main.addEventListener(Hn.EVENT_NAME,this.keyHandler),this.main.addEventListener(Yr.EVENT_NAME,this.mouseHandler),this.main.addEventListener(Wn.EVENT_NAME,this.mouseScrollHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(Hn.EVENT_NAME,this.keyHandler),this.main.removeEventListener(Yr.EVENT_NAME,this.mouseHandler),this.main.removeEventListener(Wn.EVENT_NAME,this.mouseScrollHandler)}onKey({data:e}){let t=1*this.main.deltaTime;e.key==="KeyQ"?this.main.camera.position.addScaledVector(new I(0,1,0),-t):e.key==="KeyE"&&this.main.camera.position.addScaledVector(new I(0,1,0),t)}onMouse({data:e}){e.button===0&&(this.lastMouseDataEvent=e)}onMouseScroll({data:e}){this.lastMouseScrollDataEvent=e}update(){let e={targetCameraDelta:{}};if(this.lastMouseDataEvent){let t=this.main.camera.fov/300;e.targetCameraDelta.rotation=new O1(this.lastMouseDataEvent.delta.y*t*pi.DEG2RAD,this.lastMouseDataEvent.delta.x*t*.8*pi.DEG2RAD,0)}return this.lastMouseScrollDataEvent&&(e.targetCameraDelta.fov=this.lastMouseScrollDataEvent.scrollDelta.y*.1),e}reset(){this.lastMouseDataEvent=void 0,this.lastMouseScrollDataEvent=void 0}},y7=class{static applyMaterial(e,t){e.traverse(i=>{i instanceof v1&&(i.material=t,i.material.needsUpdate=!0)})}static applyUniforms(e,t){if(t)for(let i in t)e.uniforms.hasOwnProperty(i)&&(e.uniforms[i].value=t[i])}},Ol=(l2=class{static getMaterial(t,i){let r=new t,n=l2.materials.get(t);n||(n=r.createMaterial(),l2.materials.set(t,n));let o=n.clone();return Ct.instance.registerMaterial(o,`Materialcache ${t.name}`),y7.applyUniforms(o,i),o}static dispose(){l2.materials.forEach(t=>{t.dispose()}),l2.materials.clear()}},l2.materials=new Map,l2),Xn=class extends Ol{createMaterial(){let e={map:{value:null},color:{value:new Ue(1,1,1)},repeat:{value:new ye(1,1)},depthOffset:{value:0}},t=`
4548
+ `}),n=new v1(new kt,r);Ve.scene.add(n);let o=new S1(t.image.width,t.image.height,{type:q1,wrapS:R1,wrapT:R1});return Ve.renderer.setRenderTarget(o),Ve.renderer.render(Ve.scene,Ve.camera),Ve.renderer.setRenderTarget(null),Ve.scene.remove(n),n.geometry.dispose(),r.dispose(),o}},Ve.texturesToNullify=new Set,Ve.camera=new zt(-.5,.5,.5,-.5,0,1),Ve.scene=new S2,Ve),d7=(e=>(e[e.Default=0]="Default",e[e.Additive=1]="Additive",e[e.Multiply=2]="Multiply",e[e.AnimatedMarkers=3]="AnimatedMarkers",e[e.NoDepth=4]="NoDepth",e))(d7||{}),a2=class{constructor(){this.renderTextureScaler=1,window.addEventListener("beforeunload",()=>this.dispose())}get renderTarget(){let{width:e,height:t}=this.getScaledCanvasSize();return(!this._renderTarget||this._renderTarget.width!==e||this._renderTarget.height!==t)&&(this._renderTarget&&this._renderTarget.dispose(),this._renderTarget=this.main.createRenderTarget()),this._renderTarget}get scene(){return this._scene||(this._scene=new S2),this._scene}getScaledCanvasSize(){let{width:e,height:t}=this.main.getCurrentCanvasSize(),i=Math.floor(e*this.renderTextureScaler),r=Math.floor(t*this.renderTextureScaler);return{width:i,height:r}}async register(e){this.main=e}reset(){}setSize(e,t){}async dispose(){var e;(e=this._renderTarget)==null||e.dispose(),this._renderTarget=void 0}},Fn=class extends Event{constructor(e,t){super(e),this.data=t}},h7=(tr=class extends Fn{constructor(t){super(tr.EVENT_NAME,t)}},tr.EVENT_NAME="keyDown",tr),Hn=(ir=class extends Fn{constructor(t){super(ir.EVENT_NAME,t)}},ir.EVENT_NAME="key",ir),u7=(rr=class extends Fn{constructor(t){super(rr.EVENT_NAME,t)}},rr.EVENT_NAME="keyUp",rr),m7=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(m7||{}),Fi=class extends Event{constructor(e,t){super(e),this.data=t}},f7=(ar=class extends Fi{constructor(t){super(ar.EVENT_NAME,t)}},ar.EVENT_NAME="mouseDown",ar),Xr=(nr=class extends Fi{constructor(t){super(nr.EVENT_NAME,t)}},nr.EVENT_NAME="mouse",nr),Gn=(or=class extends Fi{constructor(t){super(or.EVENT_NAME,t)}},or.EVENT_NAME="mouseMove",or),Wn=(sr=class extends Fi{constructor(t){super(sr.EVENT_NAME,t)}},sr.EVENT_NAME="mouseScroll",sr),p7=(lr=class extends Fi{constructor(t){super(lr.EVENT_NAME,t)}},lr.EVENT_NAME="mouseUp",lr),jn=(cr=class extends Fi{constructor(t){super(cr.EVENT_NAME,t)}},cr.EVENT_NAME="mousePick",cr),kl=(dr=class extends Event{constructor(t){super(dr.EVENT_NAME),this.data=t}},dr.EVENT_NAME="userInputPluginOptions",dr);function g7(e){return e&&typeof e=="object"&&"dragScale"in e}var _7=class extends a2{constructor(e){super(),this.name="userInputPlugin",this.options={dragScale:new ye(1,1)},this.userInputPluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.keysState=new Map,this.keysUp=new Map,this.keysDown=new Map,this.mouseButtonsState=new Map,this.mouseButtonsUp=new Map,this.mouseButtonsDown=new Map,this.mousePosition=new ye,this.mouseScrollDelta=new ye,this.mouseDragDelta=new ye,this.mouseDownPosition=new ye,this.mouseUpPosition=new ye,this.lastTouchPosition=new ye,this.mouseDownTime=0,this.mouseUpTime=0,this.maxTapTime=200,this.maxTapMove=5,this.mousePickConsumed=!1,this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0,this.raycaster=new Pl,this.hitPlane=new y2(new I(0,1,0),0),this.setOptions(e||{})}setOptions(e){this.options.dragScale=e.dragScale??this.options.dragScale}async register(e){super.register(e),document.addEventListener("keydown",t=>this.handleKeyDown(t)),document.addEventListener("keyup",t=>this.handleKeyUp(t)),this.main.canvas.addEventListener("mousedown",t=>this.handleMouseDown(t)),document.addEventListener("mouseup",t=>this.handleMouseUp(t)),this.main.canvas.addEventListener("mousemove",t=>this.handleMouseMove(t)),this.main.canvas.addEventListener("touchstart",t=>this.handleTouchStart(t)),this.main.canvas.addEventListener("touchend",t=>this.handleTouchEnd(t)),this.main.canvas.addEventListener("touchmove",t=>this.handleTouchMove(t)),this.main.canvas.addEventListener("wheel",t=>this.handleMouseWheel(t)),this.main.addEventListener(kl.EVENT_NAME,this.userInputPluginOptionsEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(kl.EVENT_NAME,this.userInputPluginOptionsEventHandler)}handleKeyDown(e){var t;(t=this.main.canvas.parentElement)!=null&&t.matches(":hover")&&(e.preventDefault(),this.keysState.set(e.code,!0),this.keysDown.set(e.code,!0),this.main.dispatchEvent(new h7({key:e.code})))}handleKeyUp(e){var t;(t=this.main.canvas.parentElement)!=null&&t.matches(":hover")&&(e.preventDefault(),this.keysState.set(e.code,!1),this.keysUp.set(e.code,!0),this.main.dispatchEvent(new u7({key:e.code})))}handleInputDown(e,t,i){this.mouseButtonsState.set(e,!0),this.mouseButtonsDown.set(e,!0),this.mouseDownPosition.set(t,i),this.mouseDownTime=performance.now(),this.main.dispatchEvent(new f7(this.getMouseEventData(e)))}handleMouseDown(e){this.handleInputDown(e.button,e.clientX,e.clientY)}handleTouchStart(e){if(e.touches.length===1&&(this.handleInputDown(0,e.touches[0].clientX,e.touches[0].clientY),this.lastTouchPosition.set(e.touches[0].clientX,e.touches[0].clientY)),e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,i=e.touches[0].clientY-e.touches[1].clientY,r=Math.hypot(t,i);this.touchZoomDistanceEnd=this.touchZoomDistanceStart=r}}handleInputUp(e,t,i){if(this.mouseButtonsState.set(e,!1),this.mouseButtonsUp.set(e,!0),this.mouseUpPosition.set(t,i),this.mouseUpTime=performance.now(),this.main.dispatchEvent(new p7(this.getMouseEventData(e))),e===0&&!this.mousePickConsumed){let r=this.mouseDownPosition.distanceTo(this.mouseUpPosition),n=this.mouseUpTime-this.mouseDownTime;r<=this.maxTapMove&&n<=this.maxTapTime&&(this.mousePickConsumed=!0,this.main.dispatchEvent(new jn(this.getMouseEventData(e))))}}handleMouseUp(e){this.handleInputUp(e.button,e.clientX,e.clientY)}handleTouchEnd(e){let t=e.changedTouches[0];this.handleInputUp(0,t.clientX,t.clientY),this.touchZoomDistanceStart=0,this.touchZoomDistanceEnd=0}handleInputMove(e,t,i,r){this.mousePosition.set(e,t),this.mouseDragDelta.x+=i*this.options.dragScale.x,this.mouseDragDelta.y+=r*this.options.dragScale.y,this.main.dispatchEvent(new Gn(this.getMouseEventData(this.mouseButtonsState.get(0)?0:this.mouseButtonsState.get(1)?1:void 0)))}handleMouseMove(e){this.handleInputMove(e.clientX,e.clientY,e.movementX,e.movementY)}handleTouchMove(e){if(e.touches.length===1){let t=e.touches[0],i=t.clientX-this.lastTouchPosition.x,r=t.clientY-this.lastTouchPosition.y;this.handleInputMove(t.clientX,t.clientY,i,r),this.lastTouchPosition.set(t.clientX,t.clientY)}if(e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,i=e.touches[0].clientY-e.touches[1].clientY,r=Math.hypot(t,i);this.touchZoomDistanceEnd=r;let n=this.touchZoomDistanceEnd-this.touchZoomDistanceStart;this.touchZoomDistanceStart=this.touchZoomDistanceEnd,this.mouseScrollDelta.set(0,-2*n)}}handleMouseWheel(e){this.mouseScrollDelta.set(e.deltaX,e.deltaY),this.main.dispatchEvent(new Wn(this.getMouseEventData()))}getMousePositionLocal(){let e=this.main.canvas.getBoundingClientRect();return new ye(this.mousePosition.x-e.left,this.mousePosition.y-e.top)}getMousePositionGlobal(){return this.mousePosition}getMousePositionNormalized(){let e=this.main.canvas.getBoundingClientRect(),t=new ye(this.mousePosition.x-e.left,this.mousePosition.y-e.top);return new ye(t.x/e.width*2-1,-(t.y/e.height)*2+1)}getMousePosition(){return new ye(this.mousePosition.x,this.mousePosition.y)}getRay(){var o;let e=((o=this.main.getCurrentDataPoint())==null?void 0:o.floorPositionY)||0;this.raycaster.setFromCamera(this.getMousePositionNormalized(),this.main.camera),this.hitPlane.constant=-e;let t=new I,i=this.raycaster.ray.intersectPlane(this.hitPlane,t),r=!0;if(!i){r=!1;let s=this.main.camera.position.y+(this.main.camera.position.y-e);this.hitPlane.constant=-s,i=this.raycaster.ray.intersectPlane(this.hitPlane,t)}let n=new I(t.x-this.main.camera.position.x,0,t.z-this.main.camera.position.z);return n.normalize(),{hitPoint:t,directionXZ:n,isFloor:r}}getMouseEventData(e){return{local:this.getMousePositionLocal(),global:this.getMousePositionGlobal(),normalized:this.getMousePositionNormalized(),screen:this.getMousePosition(),delta:this.mouseDragDelta,scrollDelta:this.mouseScrollDelta,ray:this.getRay(),button:e}}update(){let e={local:this.getMousePositionLocal(),global:this.getMousePositionGlobal(),normalized:this.getMousePositionNormalized(),screen:this.getMousePosition(),delta:this.mouseDragDelta,scrollDelta:this.mouseScrollDelta,ray:this.getRay()};this.mouseButtonsState.get(0)||(this.mousePickConsumed=!1);for(let[t,i]of this.keysState.entries())i&&this.main.dispatchEvent(new Hn({key:t}));for(let[t,i]of this.mouseButtonsState.entries())i&&this.main.dispatchEvent(new Xr({...e,button:t}));return{}}reset(){this.mouseButtonsUp.set(0,!1),this.mouseButtonsUp.set(1,!1),this.mouseButtonsDown.set(0,!1),this.mouseButtonsDown.set(1,!1),this.keysUp.clear(),this.keysDown.clear(),this.mouseDragDelta.set(0,0),this.mouseScrollDelta.set(0,0)}},v7=class extends a2{constructor(){super(...arguments),this.name="panoramaRendererPlugin"}update(){var t,i;let e=this.main.camera.rotation.clone();return e.x=-e.x,e.y=-e.y,{panorama:{currentPanorama:(t=this.main.panoramaTextureHandler)==null?void 0:t.getTexture(),nextPanorama:(i=this.main.panoramaTextureHandler)==null?void 0:i.getTexture(),currentSphere:this.main.panoramaRenderTargetFrom.texture,nextSphere:this.main.panoramaRenderTargetTo.texture,rotation:e,fovY:this.main.camera.fov,aspectRatio:this.main.aspectRatio}}}},x7=class extends a2{constructor(){super(...arguments),this.name="panCameraPlugin",this.keyHandler=this.onKey.bind(this),this.mouseHandler=this.onMouse.bind(this),this.mouseScrollHandler=this.onMouseScroll.bind(this)}async register(e){await super.register(e),this.main.addEventListener(Hn.EVENT_NAME,this.keyHandler),this.main.addEventListener(Xr.EVENT_NAME,this.mouseHandler),this.main.addEventListener(Wn.EVENT_NAME,this.mouseScrollHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(Hn.EVENT_NAME,this.keyHandler),this.main.removeEventListener(Xr.EVENT_NAME,this.mouseHandler),this.main.removeEventListener(Wn.EVENT_NAME,this.mouseScrollHandler)}onKey({data:e}){let t=1*this.main.deltaTime;e.key==="KeyQ"?this.main.camera.position.addScaledVector(new I(0,1,0),-t):e.key==="KeyE"&&this.main.camera.position.addScaledVector(new I(0,1,0),t)}onMouse({data:e}){e.button===0&&(this.lastMouseDataEvent=e)}onMouseScroll({data:e}){this.lastMouseScrollDataEvent=e}update(){let e={targetCameraDelta:{}};if(this.lastMouseDataEvent){let t=this.main.camera.fov/300;e.targetCameraDelta.rotation=new k1(this.lastMouseDataEvent.delta.y*t*fi.DEG2RAD,this.lastMouseDataEvent.delta.x*t*.8*fi.DEG2RAD,0)}return this.lastMouseScrollDataEvent&&(e.targetCameraDelta.fov=this.lastMouseScrollDataEvent.scrollDelta.y*.1),e}reset(){this.lastMouseDataEvent=void 0,this.lastMouseScrollDataEvent=void 0}},y7=class{static applyMaterial(e,t){e.traverse(i=>{i instanceof v1&&(i.material=t,i.material.needsUpdate=!0)})}static applyUniforms(e,t){if(t)for(let i in t)e.uniforms.hasOwnProperty(i)&&(e.uniforms[i].value=t[i])}},Ol=(l2=class{static getMaterial(t,i){let r=new t,n=l2.materials.get(t);n||(n=r.createMaterial(),l2.materials.set(t,n));let o=n.clone();return bt.instance.registerMaterial(o,`Materialcache ${t.name}`),y7.applyUniforms(o,i),o}static dispose(){l2.materials.forEach(t=>{t.dispose()}),l2.materials.clear()}},l2.materials=new Map,l2),Xn=class extends Ol{createMaterial(){let e={map:{value:null},color:{value:new Ue(1,1,1)},repeat:{value:new ye(1,1)},depthOffset:{value:0}},t=`
4549
4549
  #include <common>
4550
4550
  #include <uv_pars_vertex>
4551
4551
  #include <logdepthbuf_pars_vertex>
@@ -4614,7 +4614,7 @@ void main() {
4614
4614
  float depth = distance(cameraPosition, vWorldPosition)+depthOffset;
4615
4615
  gl_FragColor = vec4(texture2D(map, vUv*repeat).rgb* color, depth);
4616
4616
  }
4617
- `;return new x1({uniforms:e,vertexShader:t,fragmentShader:i,side:Nt})}},Yn=(ur=class extends Event{constructor(t,i,r,n){super(ur.EVENT_NAME),this.from=t,this.to=i,this.rotate=r,this.animate=n}},ur.EVENT_NAME="dataPointChanged",ur),zl=(mr=class extends Event{constructor(t){super(mr.EVENT_NAME),this.data=t}},mr.EVENT_NAME="panoramaTransitionRendererPluginOptions",mr),s3=class A3{static linear(t){return t}static easeIn(t){return t*t}static easeOut(t){return t*(2-t)}static easeInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}static bounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static moveTowards(t,i,r){let n=i-t,o=Math.abs(n)<=r?n:Math.sign(n)*r;return t+o}static lerpAngleRadians(t,i,r){let n=Math.PI,o=(i-t+n+2*n)%(2*n)-n;return t+o*r}static lerpEuler(t,i,r){let n=new O1;return n.x=A3.lerpAngleRadians(t.x,i.x,r),n.y=A3.lerpAngleRadians(t.y,i.y,r),n.z=A3.lerpAngleRadians(t.z,i.z,r),n.order=t.order,n}};function S7(e){return e&&typeof e=="object"&&"transitionMovementScale"in e}var M7=class extends a2{constructor(e){super(),this.name="panoramaTransitionRendererPlugin",this.options={transitionMovementScale:1.3},this.panoramaTransitionRendererPluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.dataPointChangedEventHandler=this.onDataPointChanged.bind(this),this.rotate=!1,this.percentage=0,this.percentageMovement=0,this.currentCamRotation=new O1,this.nextCamRotation=new O1,this.currentAlpha=0,this.nextAlpha=0,this.sceneFrom=new M2,this.sceneTo=new M2,this.startLocation=new I,this.endLocation=new I,this.setOptions(e||{})}async register(e){await super.register(e),this.main.addEventListener(Yn.EVENT_NAME,this.dataPointChangedEventHandler),this.main.addEventListener(zl.EVENT_NAME,this.panoramaTransitionRendererPluginOptionsEventHandler)}setOptions(e){this.options.transitionMovementScale=e.transitionMovementScale??this.options.transitionMovementScale}async dispose(){await super.dispose(),this.main.removeEventListener(Yn.EVENT_NAME,this.dataPointChangedEventHandler),this.main.removeEventListener(zl.EVENT_NAME,this.panoramaTransitionRendererPluginOptionsEventHandler),this.from&&(Ct.instance.disposeMaterial(this.from.depthMaterial),this.from.sphere&&Ct.instance.disposeGeometry(this.from.sphere.geometry)),this.to&&(Ct.instance.disposeMaterial(this.to.depthMaterial),this.to.sphere&&Ct.instance.disposeGeometry(this.to.sphere.geometry))}onDataPointChanged({rotate:e,animate:t}){this.rotate=e,this.main.loadDataPoint({animateFunction:t?this.animate.bind(this):void 0,rotation:this.rotate})}async animate(e){let t=new Promise(i=>{this.resolver=i});return this.percentage=-1,this.percentageMovement=0,this.animation=e,this.from=this.createPanoramaSphere(e.from),this.to=this.createPanoramaSphere(e.to),this.sceneFrom.add(this.from.sphere),this.sceneTo.add(this.to.sphere),this.startLocation=e.from.position.clone(),this.endLocation=e.to.position.clone(),this.currentCamRotation.set(e.from.rotation.x,e.from.rotation.y,e.from.rotation.z),this.nextCamRotation.set(e.to.rotation.x,e.to.rotation.y,e.to.rotation.z),t}createPanoramaSphere(e){let t=new r8(1,500,500);Ct.instance.registerGeometry(t,"Panorama3DLayer sphere"),t.scale(-1,1,1),t.rotateY(-Math.PI/2);let i=t.attributes.position,r=new Float32Array(i.count*3);if(e.depth)for(let s=0;s<i.count;s++){let l=new I(i.array[s*3],i.array[s*3+1],i.array[s*3+2]),d=Math.min(100,e.depth.getDepth(l));r[s*3]=l.x*d,r[s*3+1]=l.y*d,r[s*3+2]=l.z*d}t.attributes.position=new X1(r,3);let n=Xn.getMaterial(Xn,{map:e.texture}),o=new v1(t,n);return o.position.copy(e.position),{depthMaterial:n,sphere:o}}calculateTransition(e){let t=.7000000000000001;this.percentage=Math.min(1,e);let i=Math.max(0,Math.min(1,(this.percentage-.1)/t));this.percentageMovement=s3.easeInOut(i),this.currentAlpha=this.nextAlpha=0,this.percentage<.1&&(this.currentAlpha=1-this.percentage/.1),this.percentage>.8&&(this.nextAlpha=(this.percentage-.8)/(1-.8))}getTransform(){let e={camera:{}},t=new I;if(t.lerpVectors(this.startLocation,this.endLocation,this.percentageMovement),e.camera.position=t,this.rotate){let i=s3.lerpEuler(this.currentCamRotation,this.nextCamRotation,this.percentageMovement);e.camera.rotation=i}return e.panorama={currentPanorama:this.animation.from.texture,nextPanorama:this.animation.to.texture,currentSphere:this.main.panoramaRenderTargetFrom.texture,nextSphere:this.main.panoramaRenderTargetTo.texture,percentage:this.percentageMovement,currentAlpha:this.currentAlpha,nextAlpha:this.nextAlpha,isTransition:!0},this.percentage>=1&&(this.percentage=1,Ct.instance.disposeMaterial(this.from.depthMaterial),Ct.instance.disposeMaterial(this.to.depthMaterial),Ct.instance.disposeGeometry(this.from.sphere.geometry),Ct.instance.disposeGeometry(this.to.sphere.geometry),this.sceneFrom.remove(this.from.sphere),this.sceneTo.remove(this.to.sphere),delete this.animation,this.resolver(),delete this.resolver),e}update(){return this.animation&&(this.percentage===-1?this.calculateTransition(0):this.calculateTransition(this.percentage===0?.001:this.percentage+this.main.deltaTime*this.options.transitionMovementScale)),{...this.animation?this.getTransform():{},layerlessRenderLayer:[{scene:this.sceneFrom,renderTarget:this.main.panoramaRenderTargetFrom,camera:this.main.camera},{scene:this.sceneTo,renderTarget:this.main.panoramaRenderTargetTo,camera:this.main.camera}]}}},w7=(fr=class extends Event{constructor(t){super(fr.EVENT_NAME),this.data=t}},fr.EVENT_NAME="frontendMarkersUpdate",fr),A7=class extends a2{constructor(){super(...arguments),this.name="frontendMarkersPlugin",this.markers=[],this.orthoCamera=null,this.prevCameraRot=new O1(NaN,NaN,NaN,"XYZ"),this.prevCameraPos=new I(NaN,NaN,NaN)}async register(e){await super.register(e);let t=1;this.orthoCamera=new zt(-t,t,t,-t,1,1e3),this.orthoCamera.position.set(0,0,10),this.orthoCamera.lookAt(0,0,0)}updateMarkers(e){this.markers=e,this.prevCameraRot=new O1(NaN,NaN,NaN,"XYZ"),this.prevCameraPos=new I(NaN,NaN,NaN)}update(){let e=[],t=this.main.camera.rotation,i=this.main.camera.position;if(!(t.equals(this.prevCameraRot)&&i.equals(this.prevCameraPos))){this.prevCameraPos=i.clone(),this.prevCameraRot=t.clone();let r=new I;this.markers.forEach(({position:n,id:o})=>{let s=new I(n.x,n.y,n.z);r.subVectors(s,i);let l=r.length();r.normalize();let d=this.main.getCurrentDataPoint().textureHandler.getDepth().getDepth(r),c=s.project(this.main.camera);if(c.z>=-1&&c.z<=1){let h=this.main.renderer.domElement.clientWidth/2,u=this.main.renderer.domElement.clientHeight/2,m=(c.x*h+h)/h-1,f=((-(c.y*u)+u)/u-1)*-1;e.push({id:o,position:{x:n.x,y:n.y,z:n.z},normalizedPosition:{x:c.x,y:c.y},screenPosition:{x:m,y:f},occluded:!(d>l-.5),visible:m>=-1&&m<=1&&f>=-1&&f<=1})}this.main.dispatchEvent(new w7(e))})}return{postProcessingRenderLayer:{renderTarget:this.renderTarget,scene:this.scene,camera:this.orthoCamera,type:4}}}},Vl="data:image/png;base64,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",E7="data:image/png;base64,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";function Bl(e,t){if(t===hh)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===G3||t===Xo){let i=e.getIndex();if(i===null){let s=[],l=e.getAttribute("position");if(l!==void 0){for(let d=0;d<l.count;d++)s.push(d);e.setIndex(s),i=e.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}let r=i.count-2,n=[];if(t===G3)for(let s=1;s<=r;s++)n.push(i.getX(0)),n.push(i.getX(s)),n.push(i.getX(s+1));else for(let s=0;s<r;s++)s%2===0?(n.push(i.getX(s)),n.push(i.getX(s+1)),n.push(i.getX(s+2))):(n.push(i.getX(s+2)),n.push(i.getX(s+1)),n.push(i.getX(s)));n.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let o=e.clone();return o.setIndex(n),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}var b7=class extends Fi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new N7(t)}),this.register(function(t){return new B7(t)}),this.register(function(t){return new F7(t)}),this.register(function(t){return new H7(t)}),this.register(function(t){return new R7(t)}),this.register(function(t){return new D7(t)}),this.register(function(t){return new U7(t)}),this.register(function(t){return new k7(t)}),this.register(function(t){return new P7(t)}),this.register(function(t){return new O7(t)}),this.register(function(t){return new L7(t)}),this.register(function(t){return new V7(t)}),this.register(function(t){return new z7(t)}),this.register(function(t){return new T7(t)}),this.register(function(t){return new G7(t)}),this.register(function(t){return new W7(t)})}load(e,t,i,r){let n=this,o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){let d=jr.extractUrlBase(e);o=jr.resolveURL(d,this.path)}else o=jr.extractUrlBase(e);this.manager.itemStart(e);let s=function(d){r?r(d):console.error(d),n.manager.itemError(e),n.manager.itemEnd(e)},l=new Al(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(d){try{n.parse(d,o,function(c){t(c),n.manager.itemEnd(e)},s)}catch(c){s(c)}},i,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let n,o={},s={},l=new TextDecoder;if(typeof e=="string")n=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===Fl){try{o[Ze.KHR_BINARY_GLTF]=new j7(e)}catch(c){r&&r(c);return}n=JSON.parse(o[Ze.KHR_BINARY_GLTF].content)}else n=JSON.parse(l.decode(e));else n=e;if(n.asset===void 0||n.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let d=new a_(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){let h=this.pluginCallbacks[c](d);h.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),s[h.name]=h,o[h.name]=!0}if(n.extensionsUsed)for(let c=0;c<n.extensionsUsed.length;++c){let h=n.extensionsUsed[c],u=n.extensionsRequired||[];switch(h){case Ze.KHR_MATERIALS_UNLIT:o[h]=new I7;break;case Ze.KHR_DRACO_MESH_COMPRESSION:o[h]=new X7(n,this.dracoLoader);break;case Ze.KHR_TEXTURE_TRANSFORM:o[h]=new Y7;break;case Ze.KHR_MESH_QUANTIZATION:o[h]=new q7;break;default:u.indexOf(h)>=0&&s[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}d.setExtensions(o),d.setPlugins(s),d.parse(i,r)}parseAsync(e,t){let i=this;return new Promise(function(r,n){i.parse(e,t,r,n)})}};function C7(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Ze={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},T7=class{constructor(e){this.parser=e,this.name=Ze.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){let n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){let t=this.parser,i="light:"+e,r=t.cache.get(i);if(r)return r;let n=t.json,o=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e],s,l=new Ue(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],k1);let d=o.range!==void 0?o.range:0;switch(o.type){case"directional":s=new M8(l),s.target.position.set(0,0,-1),s.add(s.target);break;case"point":s=new y8(l),s.distance=d;break;case"spot":s=new v8(l),s.distance=d,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,s.angle=o.spot.outerConeAngle,s.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return s.position.set(0,0,0),s.decay=2,b2(s,o),o.intensity!==void 0&&(s.intensity=o.intensity),s.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(s),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){let t=this,i=this.parser,r=i.json.nodes[e],n=(r.extensions&&r.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(o){return i._getNodeRef(t.cache,n,o)})}},I7=class{constructor(){this.name=Ze.KHR_MATERIALS_UNLIT}getMaterialType(){return lt}extendParams(e,t,i){let r=[];e.color=new Ue(1,1,1),e.opacity=1;let n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){let o=n.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],k1),e.opacity=o[3]}n.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",n.baseColorTexture,J1))}return Promise.all(r)}},P7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}},N7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&n.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&n.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(n.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){let s=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ye(s,s)}return Promise.all(n)}},L7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&n.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&n.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(n)}},R7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[];t.sheenColor=new Ue(0,0,0),t.sheenRoughness=0,t.sheen=1;let o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){let s=o.sheenColorFactor;t.sheenColor.setRGB(s[0],s[1],s[2],k1)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&n.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,J1)),o.sheenRoughnessTexture!==void 0&&n.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(n)}},D7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&n.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(n)}},U7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&n.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;let s=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ue().setRGB(s[0],s[1],s[2],k1),Promise.all(n)}},k7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}},O7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&n.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));let s=o.specularColorFactor||[1,1,1];return t.specularColor=new Ue().setRGB(s[0],s[1],s[2],k1),o.specularColorTexture!==void 0&&n.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,J1)),Promise.all(n)}},z7=class{constructor(e){this.parser=e,this.name=Ze.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&n.push(i.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(n)}},V7=class{constructor(e){this.parser=e,this.name=Ze.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&n.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(n)}},B7=class{constructor(e){this.parser=e,this.name=Ze.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let n=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,o)}},F7=class{constructor(e){this.parser=e,this.name=Ze.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,r=i.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let o=n.extensions[t],s=r.images[o.source],l=i.textureLoader;if(s.uri){let d=i.options.manager.getHandler(s.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);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){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},H7=class{constructor(e){this.parser=e,this.name=Ze.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,r=i.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let o=n.extensions[t],s=r.images[o.source],l=i.textureLoader;if(s.uri){let d=i.options.manager.getHandler(s.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},G7=class{constructor(e){this.name=Ze.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){let r=i.extensions[this.name],n=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 n.then(function(s){let l=r.byteOffset||0,d=r.byteLength||0,c=r.count,h=r.byteStride,u=new Uint8Array(s,l,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,h,u,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){let m=new ArrayBuffer(c*h);return o.decodeGltfBuffer(new Uint8Array(m),c,h,u,r.mode,r.filter),m})})}else return null}},W7=class{constructor(e){this.name=Ze.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;let r=t.meshes[i.mesh];for(let l of r.primitives)if(l.mode!==pt.TRIANGLES&&l.mode!==pt.TRIANGLE_STRIP&&l.mode!==pt.TRIANGLE_FAN&&l.mode!==void 0)return null;let n=i.extensions[this.name].attributes,o=[],s={};for(let l in n)o.push(this.parser.getDependency("accessor",n[l]).then(d=>(s[l]=d,s[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{let d=l.pop(),c=d.isGroup?d.children:[d],h=l[0].count,u=[];for(let m of c){let f=new Fe,v=new I,_=new f2,g=new I(1,1,1),p=new $g(m.geometry,m.material,h);for(let y=0;y<h;y++)s.TRANSLATION&&v.fromBufferAttribute(s.TRANSLATION,y),s.ROTATION&&_.fromBufferAttribute(s.ROTATION,y),s.SCALE&&g.fromBufferAttribute(s.SCALE,y),p.setMatrixAt(y,f.compose(v,_,g));for(let y in s)if(y==="_COLOR_0"){let x=s[y];p.instanceColor=new bn(x.array,x.itemSize,x.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&m.geometry.setAttribute(y,s[y]);N1.prototype.copy.call(p,m),this.parser.assignFinalMaterial(p),u.push(p)}return d.isGroup?(d.clear(),d.add(...u),d):u[0]}))}},Fl="glTF",qr=12,Hl={JSON:1313821514,BIN:5130562},j7=class{constructor(e){this.name=Ze.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,qr),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Fl)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-qr,n=new DataView(e,qr),o=0;for(;o<r;){let s=n.getUint32(o,!0);o+=4;let l=n.getUint32(o,!0);if(o+=4,l===Hl.JSON){let d=new Uint8Array(e,qr+o,s);this.content=i.decode(d)}else if(l===Hl.BIN){let d=qr+o;this.body=e.slice(d,d+s)}o+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}},X7=class{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Ze.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let i=this.json,r=this.dracoLoader,n=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},l={},d={};for(let c in o){let h=Zn[c]||c.toLowerCase();s[h]=o[c]}for(let c in e.attributes){let h=Zn[c]||c.toLowerCase();if(o[c]!==void 0){let u=i.accessors[e.attributes[c]],m=Gi[u.componentType];d[h]=m.name,l[h]=u.normalized===!0}}return t.getDependency("bufferView",n).then(function(c){return new Promise(function(h,u){r.decodeDracoFile(c,function(m){for(let f in m.attributes){let v=m.attributes[f],_=l[f];_!==void 0&&(v.normalized=_)}h(m)},s,d,k1,u)})})}},Y7=class{constructor(){this.name=Ze.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}},q7=class{constructor(){this.name=Ze.KHR_MESH_QUANTIZATION}},Gl=class extends Gr{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[n+o];return t}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=s*2,d=s*3,c=r-t,h=(i-t)/c,u=h*h,m=u*h,f=e*d,v=f-d,_=-2*m+3*u,g=m-u,p=1-_,y=g-u+h;for(let x=0;x!==s;x++){let b=o[v+x+s],N=o[v+x+l]*c,A=o[f+x+s],C=o[f+x]*c;n[x]=p*b+y*N+_*A+g*C}return n}},Z7=new f2,Q7=class extends Gl{interpolate_(e,t,i,r){let n=super.interpolate_(e,t,i,r);return Z7.fromArray(n).normalize().toArray(n),n}},pt={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},Gi={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Wl={9728:u1,9729:m1,9984:lo,9985:wa,9986:Tr,9987:qt},jl={33071:Lt,33648:Ma,10497:D1},qn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},E2={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},J7={CUBICSPLINE:void 0,LINEAR:hi,STEP:Nr},Qn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function K7(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new Pn({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Nt})),e.DefaultMaterial}function q2(e,t,i){for(let r in i.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=i.extensions[r])}function b2(e,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function $7(e,t,i){let r=!1,n=!1,o=!1;for(let c=0,h=t.length;c<h;c++){let u=t[c];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(o=!0),r&&n&&o)break}if(!r&&!n&&!o)return Promise.resolve(e);let s=[],l=[],d=[];for(let c=0,h=t.length;c<h;c++){let u=t[c];if(r){let m=u.POSITION!==void 0?i.getDependency("accessor",u.POSITION):e.attributes.position;s.push(m)}if(n){let m=u.NORMAL!==void 0?i.getDependency("accessor",u.NORMAL):e.attributes.normal;l.push(m)}if(o){let m=u.COLOR_0!==void 0?i.getDependency("accessor",u.COLOR_0):e.attributes.color;d.push(m)}}return Promise.all([Promise.all(s),Promise.all(l),Promise.all(d)]).then(function(c){let h=c[0],u=c[1],m=c[2];return r&&(e.morphAttributes.position=h),n&&(e.morphAttributes.normal=u),o&&(e.morphAttributes.color=m),e.morphTargetsRelative=!0,e})}function e_(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let i=0,r=t.weights.length;i<r;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++)e.morphTargetDictionary[i[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function t_(e){let t,i=e.extensions&&e.extensions[Ze.KHR_DRACO_MESH_COMPRESSION];if(i?t="draco:"+i.bufferView+":"+i.indices+":"+Jn(i.attributes):t=e.indices+":"+Jn(e.attributes)+":"+e.mode,e.targets!==void 0)for(let r=0,n=e.targets.length;r<n;r++)t+=":"+Jn(e.targets[r]);return t}function Jn(e){let t="",i=Object.keys(e).sort();for(let r=0,n=i.length;r<n;r++)t+=i[r]+":"+e[i[r]]+";";return t}function Kn(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function i_(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?"image/jpeg":e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}var r_=new Fe,a_=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new C7,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,n=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,n=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&n<98?this.textureLoader=new Nn(this.options.manager):this.textureLoader=new w8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Al(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let i=this,r=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){let s={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return q2(n,s,r),b2(s,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(let l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){let o=t[r].joints;for(let s=0,l=o.length;s<l;s++)e[o[s]].isBone=!0}for(let r=0,n=e.length;r<n;r++){let o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;let r=i.clone(),n=(o,s)=>{let l=this.associations.get(o);l!=null&&this.associations.set(s,l);for(let[d,c]of o.children.entries())n(c,s.children[d])};return n(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let r=e(t[i]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let r=0;r<t.length;r++){let n=e(t[r]);n&&i.push(n)}return i}getDependency(e,t){let i=e+":"+t,r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":r=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(n,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Ze.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(n,o){i.load(jr.resolveURL(t.uri,r.path),n,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){let r=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+r)})}loadAccessor(e){let t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let o=qn[r.type],s=Gi[r.componentType],l=r.normalized===!0,d=new s(r.count*o);return Promise.resolve(new X1(d,o,l))}let n=[];return r.bufferView!==void 0?n.push(this.getDependency("bufferView",r.bufferView)):n.push(null),r.sparse!==void 0&&(n.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(n).then(function(o){let s=o[0],l=qn[r.type],d=Gi[r.componentType],c=d.BYTES_PER_ELEMENT,h=c*l,u=r.byteOffset||0,m=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,f=r.normalized===!0,v,_;if(m&&m!==h){let g=Math.floor(u/m),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+g+":"+r.count,y=t.cache.get(p);y||(v=new d(s,g*m,r.count*m/c),y=new Xg(v,m/c),t.cache.add(p,y)),_=new Yg(y,l,u%m/c,f)}else s===null?v=new d(r.count*l):v=new d(s,u,r.count*l),_=new X1(v,l,f);if(r.sparse!==void 0){let g=qn.SCALAR,p=Gi[r.sparse.indices.componentType],y=r.sparse.indices.byteOffset||0,x=r.sparse.values.byteOffset||0,b=new p(o[1],y,r.sparse.count*g),N=new d(o[2],x,r.sparse.count*l);s!==null&&(_=new X1(_.array.slice(),_.itemSize,_.normalized));for(let A=0,C=b.length;A<C;A++){let U=b[A];if(_.setX(U,N[A*l]),l>=2&&_.setY(U,N[A*l+1]),l>=3&&_.setZ(U,N[A*l+2]),l>=4&&_.setW(U,N[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){let t=this.json,i=this.options,r=t.textures[e].source,n=t.images[r],o=this.textureLoader;if(n.uri){let s=i.manager.getHandler(n.uri);s!==null&&(o=s)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,i){let r=this,n=this.json,o=n.textures[e],s=n.images[t],l=(s.uri||s.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];let d=this.loadImageSource(t,i).then(function(c){c.flipY=!1,c.name=o.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);let h=(n.samplers||{})[o.sampler]||{};return c.magFilter=Wl[h.magFilter]||m1,c.minFilter=Wl[h.minFilter]||qt,c.wrapS=jl[h.wrapS]||D1,c.wrapT=jl[h.wrapT]||D1,r.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=d,d}loadImageSource(e,t){let i=this,r=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());let o=r.images[e],s=self.URL||self.webkitURL,l=o.uri||"",d=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){d=!0;let u=new Blob([h],{type:o.mimeType});return l=s.createObjectURL(u),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let c=Promise.resolve(l).then(function(h){return new Promise(function(u,m){let f=u;t.isImageBitmapLoader===!0&&(f=function(v){let _=new it(v);_.needsUpdate=!0,u(_)}),t.load(jr.resolveURL(h,n.path),f,void 0,m)})}).then(function(h){return d===!0&&s.revokeObjectURL(l),h.userData.mimeType=o.mimeType||i_(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=c,c}assignTexture(e,t,i,r){let n=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),n.extensions[Ze.KHR_TEXTURE_TRANSFORM]){let s=i.extensions!==void 0?i.extensions[Ze.KHR_TEXTURE_TRANSFORM]:void 0;if(s){let l=n.associations.get(o);o=n.extensions[Ze.KHR_TEXTURE_TRANSFORM].extendTexture(o,s),n.associations.set(o,l)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){let t=e.geometry,i=e.material,r=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let s="PointsMaterial:"+i.uuid,l=this.cache.get(s);l||(l=new vl,mt.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(s,l)),i=l}else if(e.isLine){let s="LineBasicMaterial:"+i.uuid,l=this.cache.get(s);l||(l=new ul,mt.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(s,l)),i=l}if(r||n||o){let s="ClonedMaterial:"+i.uuid+":";r&&(s+="derivative-tangents:"),n&&(s+="vertex-colors:"),o&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=i.clone(),n&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Pn}loadMaterial(e){let t=this,i=this.json,r=this.extensions,n=i.materials[e],o,s={},l=n.extensions||{},d=[];if(l[Ze.KHR_MATERIALS_UNLIT]){let h=r[Ze.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),d.push(h.extendParams(s,n,t))}else{let h=n.pbrMetallicRoughness||{};if(s.color=new Ue(1,1,1),s.opacity=1,Array.isArray(h.baseColorFactor)){let u=h.baseColorFactor;s.color.setRGB(u[0],u[1],u[2],k1),s.opacity=u[3]}h.baseColorTexture!==void 0&&d.push(t.assignTexture(s,"map",h.baseColorTexture,J1)),s.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,s.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(s,"metalnessMap",h.metallicRoughnessTexture)),d.push(t.assignTexture(s,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(u){return u.getMaterialType&&u.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(u){return u.extendMaterialParams&&u.extendMaterialParams(e,s)})))}n.doubleSided===!0&&(s.side=ut);let c=n.alphaMode||Qn.OPAQUE;if(c===Qn.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===Qn.MASK&&(s.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&o!==lt&&(d.push(t.assignTexture(s,"normalMap",n.normalTexture)),s.normalScale=new ye(1,1),n.normalTexture.scale!==void 0)){let h=n.normalTexture.scale;s.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&o!==lt&&(d.push(t.assignTexture(s,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&o!==lt){let h=n.emissiveFactor;s.emissive=new Ue().setRGB(h[0],h[1],h[2],k1)}return n.emissiveTexture!==void 0&&o!==lt&&d.push(t.assignTexture(s,"emissiveMap",n.emissiveTexture,J1)),Promise.all(d).then(function(){let h=new o(s);return n.name&&(h.name=n.name),b2(h,n),t.associations.set(h,{materials:e}),n.extensions&&q2(r,h,n),h})}createUniqueName(e){let t=M1.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,i=this.extensions,r=this.primitiveCache;function n(s){return i[Ze.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,t).then(function(l){return Xl(l,s,t)})}let o=[];for(let s=0,l=e.length;s<l;s++){let d=e[s],c=t_(d),h=r[c];if(h)o.push(h.promise);else{let u;d.extensions&&d.extensions[Ze.KHR_DRACO_MESH_COMPRESSION]?u=n(d):u=Xl(new Ut,d,t),r[c]={primitive:d,promise:u},o.push(u)}}return Promise.all(o)}loadMesh(e){let t=this,i=this.json,r=this.extensions,n=i.meshes[e],o=n.primitives,s=[];for(let l=0,d=o.length;l<d;l++){let c=o[l].material===void 0?K7(this.cache):this.getDependency("material",o[l].material);s.push(c)}return s.push(t.loadGeometries(o)),Promise.all(s).then(function(l){let d=l.slice(0,l.length-1),c=l[l.length-1],h=[];for(let m=0,f=c.length;m<f;m++){let v=c[m],_=o[m],g,p=d[m];if(_.mode===pt.TRIANGLES||_.mode===pt.TRIANGLE_STRIP||_.mode===pt.TRIANGLE_FAN||_.mode===void 0)g=n.isSkinnedMesh===!0?new Zg(v,p):new v1(v,p),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),_.mode===pt.TRIANGLE_STRIP?g.geometry=Bl(g.geometry,Xo):_.mode===pt.TRIANGLE_FAN&&(g.geometry=Bl(g.geometry,G3));else if(_.mode===pt.LINES)g=new e8(v,p);else if(_.mode===pt.LINE_STRIP)g=new Tn(v,p);else if(_.mode===pt.LINE_LOOP)g=new t8(v,p);else if(_.mode===pt.POINTS)g=new i8(v,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(g.geometry.morphAttributes).length>0&&e_(g,n),g.name=t.createUniqueName(n.name||"mesh_"+e),b2(g,n),_.extensions&&q2(r,g,_),t.assignFinalMaterial(g),h.push(g)}for(let m=0,f=h.length;m<f;m++)t.associations.set(h[m],{meshes:e,primitives:m});if(h.length===1)return n.extensions&&q2(r,h[0],n),h[0];let u=new j2;n.extensions&&q2(r,u,n),t.associations.set(u,{meshes:e});for(let m=0,f=h.length;m<f;m++)u.add(h[m]);return u})}loadCamera(e){let t,i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Y1(pi.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new zt(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),b2(t,i),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],i=[];for(let r=0,n=t.joints.length;r<n;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){let n=r.pop(),o=r,s=[],l=[];for(let d=0,c=o.length;d<c;d++){let h=o[d];if(h){s.push(h);let u=new Fe;n!==null&&u.fromArray(n.array,d*16),l.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[d])}return new Jg(s,l)})}loadAnimation(e){let t=this.json,i=this,r=t.animations[e],n=r.name?r.name:"animation_"+e,o=[],s=[],l=[],d=[],c=[];for(let h=0,u=r.channels.length;h<u;h++){let m=r.channels[h],f=r.samplers[m.sampler],v=m.target,_=v.node,g=r.parameters!==void 0?r.parameters[f.input]:f.input,p=r.parameters!==void 0?r.parameters[f.output]:f.output;v.node!==void 0&&(o.push(this.getDependency("node",_)),s.push(this.getDependency("accessor",g)),l.push(this.getDependency("accessor",p)),d.push(f),c.push(v))}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(l),Promise.all(d),Promise.all(c)]).then(function(h){let u=h[0],m=h[1],f=h[2],v=h[3],_=h[4],g=[];for(let p=0,y=u.length;p<y;p++){let x=u[p],b=m[p],N=f[p],A=v[p],C=_[p];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();let U=i._createAnimationTracks(x,b,N,A,C);if(U)for(let S=0;S<U.length;S++)g.push(U[S])}return new d8(n,void 0,g)})}createNodeMesh(e){let t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(n){let o=i._getNodeRef(i.meshCache,r.mesh,n);return r.weights!==void 0&&o.traverse(function(s){if(s.isMesh)for(let l=0,d=r.weights.length;l<d;l++)s.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){let t=this.json,i=this,r=t.nodes[e],n=i._loadNodeShallow(e),o=[],s=r.children||[];for(let d=0,c=s.length;d<c;d++)o.push(i.getDependency("node",s[d]));let l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([n,Promise.all(o),l]).then(function(d){let c=d[0],h=d[1],u=d[2];u!==null&&c.traverse(function(m){m.isSkinnedMesh&&m.bind(u,r_)});for(let m=0,f=h.length;m<f;m++)c.add(h[m]);return c})}_loadNodeShallow(e){let t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let n=t.nodes[e],o=n.name?r.createUniqueName(n.name):"",s=[],l=r._invokeOne(function(d){return d.createNodeMesh&&d.createNodeMesh(e)});return l&&s.push(l),n.camera!==void 0&&s.push(r.getDependency("camera",n.camera).then(function(d){return r._getNodeRef(r.cameraCache,n.camera,d)})),r._invokeAll(function(d){return d.createNodeAttachment&&d.createNodeAttachment(e)}).forEach(function(d){s.push(d)}),this.nodeCache[e]=Promise.all(s).then(function(d){let c;if(n.isBone===!0?c=new ll:d.length>1?c=new j2:d.length===1?c=d[0]:c=new N1,c!==d[0])for(let h=0,u=d.length;h<u;h++)c.add(d[h]);if(n.name&&(c.userData.name=n.name,c.name=o),b2(c,n),n.extensions&&q2(i,c,n),n.matrix!==void 0){let h=new Fe;h.fromArray(n.matrix),c.applyMatrix4(h)}else n.translation!==void 0&&c.position.fromArray(n.translation),n.rotation!==void 0&&c.quaternion.fromArray(n.rotation),n.scale!==void 0&&c.scale.fromArray(n.scale);return r.associations.has(c)||r.associations.set(c,{}),r.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){let t=this.extensions,i=this.json.scenes[e],r=this,n=new j2;i.name&&(n.name=r.createUniqueName(i.name)),b2(n,i),i.extensions&&q2(t,n,i);let o=i.nodes||[],s=[];for(let l=0,d=o.length;l<d;l++)s.push(r.getDependency("node",o[l]));return Promise.all(s).then(function(l){for(let c=0,h=l.length;c<h;c++)n.add(l[c]);let d=c=>{let h=new Map;for(let[u,m]of r.associations)(u instanceof mt||u instanceof it)&&h.set(u,m);return c.traverse(u=>{let m=r.associations.get(u);m!=null&&h.set(u,m)}),h};return r.associations=d(n),n})}_createAnimationTracks(e,t,i,r,n){let o=[],s=e.name?e.name:e.uuid,l=[];E2[n.path]===E2.weights?e.traverse(function(u){u.morphTargetInfluences&&l.push(u.name?u.name:u.uuid)}):l.push(s);let d;switch(E2[n.path]){case E2.weights:d=zi;break;case E2.rotation:d=Y2;break;case E2.position:case E2.scale:d=Bi;break;default:switch(i.itemSize){case 1:d=zi;break;case 2:case 3:default:d=Bi;break}break}let c=r.interpolation!==void 0?J7[r.interpolation]:hi,h=this._getArrayFromAccessor(i);for(let u=0,m=l.length;u<m;u++){let f=new d(l[u]+"."+E2[n.path],t.array,h,c);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),o.push(f)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let i=Kn(t.constructor),r=new Float32Array(t.length);for(let n=0,o=t.length;n<o;n++)r[n]=t[n]*i;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){let i=this instanceof Y2?Q7:Gl;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function n_(e,t,i){let r=t.attributes,n=new Qt;if(r.POSITION!==void 0){let l=i.json.accessors[r.POSITION],d=l.min,c=l.max;if(d!==void 0&&c!==void 0){if(n.set(new I(d[0],d[1],d[2]),new I(c[0],c[1],c[2])),l.normalized){let h=Kn(Gi[l.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let o=t.targets;if(o!==void 0){let l=new I,d=new I;for(let c=0,h=o.length;c<h;c++){let u=o[c];if(u.POSITION!==void 0){let m=i.json.accessors[u.POSITION],f=m.min,v=m.max;if(f!==void 0&&v!==void 0){if(d.setX(Math.max(Math.abs(f[0]),Math.abs(v[0]))),d.setY(Math.max(Math.abs(f[1]),Math.abs(v[1]))),d.setZ(Math.max(Math.abs(f[2]),Math.abs(v[2]))),m.normalized){let _=Kn(Gi[m.componentType]);d.multiplyScalar(_)}l.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(l)}e.boundingBox=n;let s=new Dt;n.getCenter(s.center),s.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=s}function Xl(e,t,i){let r=t.attributes,n=[];function o(s,l){return i.getDependency("accessor",s).then(function(d){e.setAttribute(l,d)})}for(let s in r){let l=Zn[s]||s.toLowerCase();l in e.attributes||n.push(o(r[s],l))}if(t.indices!==void 0&&!e.index){let s=i.getDependency("accessor",t.indices).then(function(l){e.setIndex(l)});n.push(s)}return n1.workingColorSpace!==k1&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${n1.workingColorSpace}" not supported.`),b2(e,t),n_(e,t,i),Promise.all(n).then(function(){return t.targets!==void 0?$7(e,t.targets,i):e})}var $n=class va{constructor(){this.modelCache=new Map,this.textureCache=new Map,this.loader=new b7}static get instance(){return va._instance||(va._instance=new va),va._instance}async loadModel(t){var i;return this.modelCache.has(t)?(i=this.modelCache.get(t))==null?void 0:i.clone():(await new Promise((r,n)=>{this.loader.load(t,o=>{this.modelCache.set(t,o.scene),r(o)},void 0,n)})).scene}async loadTexture(t,i=!1){if(this.textureCache.has(t))return this.textureCache.get(t);{let r=await new Promise((n,o)=>{new Nn().load(t,n,void 0,o)});return i&&(r.minFilter=u1,r.magFilter=u1),this.textureCache.set(t,r),r}}async loadTexturedPlaneModel(t,i,r=new I(0,0,0),n=new I(1,1,1),o=!1){let s,l=`plane:${t}:${r.x.toFixed(2)},${r.y.toFixed(2)},${r.z.toFixed(2)}:${n.x.toFixed(2)},${n.y.toFixed(2)},${n.z.toFixed(2)}`;if(this.modelCache.has(l))s=this.modelCache.get(l);else{let d=await this.loadTexture(t,o),c=new kt(1,1);i instanceof x1?i.uniforms.map.value=d:i instanceof lt&&(i.map=d),c.applyMatrix4(new Fe().makeRotationX(-Math.PI/2).multiply(new Fe().makeScale(n.x,n.y,n.z))),c.applyMatrix4(new Fe().makeTranslation(r.x,r.y,r.z)),s=new v1(c,i),this.modelCache.set(l,s)}return s.clone()}dispose(){this.modelCache.forEach(t=>{t.traverse(i=>{if(i.isMesh){let r=i;r.geometry.dispose(),Array.isArray(r.material)?r.material.forEach(n=>{n instanceof mt&&n.dispose()}):r.material instanceof mt&&r.material.dispose()}})}),this.textureCache.forEach(t=>{t.dispose()}),this.modelCache.clear(),this.textureCache.clear()}},e0=(pr=class extends Event{constructor(t){super(pr.EVENT_NAME),this.data=t}},pr.EVENT_NAME="dataPointsActivated",pr),Zr=(gr=class extends Event{constructor(t,i,r){super(gr.EVENT_NAME),this.dataPoint=t,this.progress=i,this.finished=r}},gr.EVENT_NAME="dataPointTextureLoad",gr),Yl=(e=>(e[e.Start=0]="Start",e[e.StartTexture=1]="StartTexture",e[e.FinishTexture=2]="FinishTexture",e[e.StartAnimate=3]="StartAnimate",e[e.FinishAnimate=4]="FinishAnimate",e[e.Finished=5]="Finished",e))(Yl||{}),C2=(_r=class extends Event{constructor(t,i){super(_r.EVENT_NAME),this.dataPoint=t,this.state=i}},_r.EVENT_NAME="dataPointLoad",_r),t0=(vr=class extends Event{constructor(t){super(vr.EVENT_NAME),this.data=t}},vr.EVENT_NAME="dataPointsDeactivated",vr),o_=class extends a2{constructor(){super(...arguments),this.name="navigationPlugin",this.receiveDataPointClickEvent=!0,this.markerArray=[],this.dataActivatedEventHandler=this.onDataActivated.bind(this),this.dataDeactivatedEventHandler=this.onDataDeactivated.bind(this),this.mousePickEventHandler=this.onMousePick.bind(this),this.dataPointTextureLoadEventHandler=this.onDataPointTextureLoad.bind(this),this.dataPointLoadEventHandler=this.onDataPointLoad.bind(this)}async register(e){await super.register(e),this.main.addEventListener(e0.EVENT_NAME,this.dataActivatedEventHandler),this.main.addEventListener(t0.EVENT_NAME,this.dataDeactivatedEventHandler),this.main.addEventListener(jn.EVENT_NAME,this.mousePickEventHandler),this.main.addEventListener(Zr.EVENT_NAME,this.dataPointTextureLoadEventHandler),this.main.addEventListener(C2.EVENT_NAME,this.dataPointLoadEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(e0.EVENT_NAME,this.dataActivatedEventHandler),this.main.removeEventListener(t0.EVENT_NAME,this.dataDeactivatedEventHandler),this.main.removeEventListener(jn.EVENT_NAME,this.mousePickEventHandler),this.main.removeEventListener(Zr.EVENT_NAME,this.dataPointTextureLoadEventHandler),this.main.removeEventListener(C2.EVENT_NAME,this.dataPointLoadEventHandler)}async onDataActivated({data:e}){this.markerArray=await Promise.all(e.filter(t=>t.navigable).map(async t=>{let i=await this.createMarker(t,t.done?Vl:E7);return this.scene.add(i),t.extra.marker=i,{dataPoint:t,marker:i,visible:!0}}))}async onDataDeactivated({data:e}){await Promise.all(e.map(async t=>{let i=this.markerArray.findIndex(({dataPoint:r})=>r===t);i>=0&&(this.scene.remove(this.markerArray[i].dataPoint.extra.marker),this.markerArray.splice(i,1))}))}async onDataPointTextureLoad({dataPoint:e,finished:t}){if(t){let i=this.markerArray.findIndex(({dataPoint:r})=>r===e);if(i>=0){this.scene.remove(this.markerArray[i].marker);let r=await this.createMarker(e,Vl);this.scene.add(r),e.extra.marker=r,this.markerArray[i].marker=r}}}onDataPointLoad(e){var t;if(e.state===2&&e.dataPoint.navigable){this.lastLoadedDataPoint=e.dataPoint;let i=this.lastLoadedDataPoint.extra.marker.position;for(let r of this.markerArray){let n=r.marker.position,o=new I().subVectors(n,i),s=i.distanceTo(n),l=(t=this.lastLoadedDataPoint.textureHandler.getDepth())==null?void 0:t.getDepth(o);r.visible=s<l}}}onMousePick({data:e}){if(!this.main.isTransitioning&&this.receiveDataPointClickEvent){let t=this.pickClosest(this.main.camera.position,e.ray.hitPoint);t&&this.main.setCurrentDataPoint(t,{rotate:!1})}}async createMarker(e,t){let i=new I(.25,.25,.25),r=await $n.instance.loadTexturedPlaneModel(t,Ol.getMaterial(Xn,{depthOffset:-.2,color:new Ue(1,1,1)}),new I(0,e.floorPositionY-e.position.y,0),i,!0);return r.position.copy(e.position),r}pickClosest(e,t){var o;let i=this.scene.children.filter(s=>s.visible),r,n=1/0;return i.forEach(s=>{if(s.position.x===e.x&&s.position.y===e.y&&s.position.z===e.z)return;let l=t.distanceTo(s.position);l<n&&(n=l,r=s)}),(o=this.markerArray.find(({marker:s})=>s===r))==null?void 0:o.dataPoint}pickRaymarch(e,t){let i=null,r=1/0,n=.1;for(let{dataPoint:o,marker:s}of this.markerArray){let l=e.distanceTo(s.position);if(l>n){let d=new I().subVectors(s.position,e);if(d.dot(t)>0){let c=d.cross(t).length(),h=l*.1+c;h<r&&(r=h,i=o)}}}return i}update(){for(let e of this.markerArray)e.marker.visible=(!this.main.isTransitioning||e.dataPoint===this.lastLoadedDataPoint)&&e.visible&&this.main.options.showArrowAndMarkers;return{postProcessingRenderLayer:{renderTarget:this.renderTarget,scene:this.scene,camera:this.main.camera,type:3}}}},s_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0OGRmMzY0ZS0zMmViLTlhNGMtOGE2NS1kMDZmNzZkY2UxZGUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTEwNTM3NDQ1RDUwMTFFQUE5RkZEMDIyOUEwNzcwMjUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTEwNTM3NDM1RDUwMTFFQUE5RkZEMDIyOUEwNzcwMjUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YTVlMmIzNmEtOWZhMC1hMTQ5LWIxM2EtN2U5N2M5ZThjOGU0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjQ4ZGYzNjRlLTMyZWItOWE0Yy04YTY1LWQwNmY3NmRjZTFkZSIv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",l_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAwnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVDBEcMgDPszRUewLYeYcUiT3nWDjl8TQy+01R2yQIkwTsfr+Ui3BmFNuqyWS87k0KJFqgujQD2ZSU8e4M7TefpI8QqvCMNy/2uc8xRDXF0tlyC7d2ObjaJRxb6CJApaR03vPaj0IEgY3ANqPItysfX6hO2gGRYrNVKb2/7Zrz69ffF7IHKAQc5AjgbQFhKqG+wsKP4hw1wTsrNihPlA/s1pIL0B1wxZDwCxK2YAAAGFaUNDUElDQyBwcm9maWxlAAB4nH2RPUjDQBzFX1OlohURK4goZKhOdlERwaVUsQgWSluhVQeTS7+gSUOS4uIouBYc/FisOrg46+rgKgiCHyCuLk6KLlLi/5JCi1gPjvvx7t7j7h0g1EpMNTvCgKpZRiIaEdOZVdH3ih6Moh+DmJOYqceSiym0HV/38PD1LsSz2p/7c/QqWZMBHpE4zHTDIt4gntm0dM77xAFWkBTic+IJgy5I/Mh12eU3znmHBZ4ZMFKJeeIAsZhvYbmFWcFQiaeJg4qqUb6QdlnhvMVZLVVY4578hf6stpLkOs0RRLGEGOIQIaOCIkqwEKJVI8VEgvYjbfzDjj9OLplcRTByLKAMFZLjB/+D392aualJN8kfATpfbPtjDPDtAvWqbX8f23b9BPA+A1da01+uAbOfpFebWvAI6NsGLq6bmrwHXO4AQ0+6ZEiO5KUp5HLA+xl9UwYYuAW619zeGvs4fQBS1NXyDXBwCIznKXu9zbu7Wnv790yjvx8RnXLmBDZw9wAADXZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDQuNC4wLUV4aXYyIj4KIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICB4bXBNTTpEb2N1bWVudElEPSJnaW1wOmRvY2lkOmdpbXA6NGJjMTA0MmQtYWI3Ny00ZmVhLWI2OGItMTU5MDljZmY4OWI3IgogICB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmRiOGNjM2IwLTM3ZmItNDE0Yi1hMWM4LWQxNjJiZTI5ZDA5YyIKICAgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjRiN2NmZGU2LTFhMzgtNDE4Ny05YTQwLTIwMzAyYmFkZTY5MSIKICAgZGM6Rm9ybWF0PSJpbWFnZS9wbmciCiAgIEdJTVA6QVBJPSIyLjAiCiAgIEdJTVA6UGxhdGZvcm09IldpbmRvd3MiCiAgIEdJTVA6VGltZVN0YW1wPSIxNzAxMjgxMjAzNDQ5NDQwIgogICBHSU1QOlZlcnNpb249IjIuMTAuMzYiCiAgIHRpZmY6T3JpZW50YXRpb249IjEiCiAgIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIgogICB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzOjExOjI5VDE4OjA2OjQwKzAwOjAwIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyMzoxMToyOVQxODowNjo0MCswMDowMCI+CiAgIDx4bXBNTTpIaXN0b3J5PgogICAgPHJkZjpTZXE+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjAyNGE3YzdiLTY5MzUtNDc1Zi04ZTNiLTZiOTE5NzJmYWY1MiIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMy0xMS0yOVQxODowNjo0MyIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6kdp6CAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5wsdEgYr93IWEQAAIABJREFUeNrt3Xt0lPW97/H3TBICCSEhgRCgahAF8ZIESyhyq4qAl7q9KxCpWhXsxS7Lsls9rdtzzna3p0vPbq0VPZWtAgJWLYpa3ICKRgh3yAUv3AQRCoQQEnJPJvM7fzzPpE+eTiKXSTIz+bzWynLNL5JM5vf7fp/f7fk9ICIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiXc+jjyCqeIEYIAXoB/QHUoFkoA+QAPQC4oE4INb+dz6gCWgA6oBa4ARQCZQDR4EyoAJoBvz6qJUApOuCPBE4z/WVCQwCBtrf99pfoeC3v2qAQ8BB4Gtgt+urRslBCUBCG+zJwEj761IgGzgX6BlG9WeAeuAroAjYan8V2r0IJQUlADnJgM8AxgMT7f9eAPSIwLoyQCPwBbAGyAfWAoeVEJQA5B8SgHHAVGAScJE9Pj8tvXr1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",c_=class extends a2{constructor(){super(...arguments),this.mouseDown=!1,this.mouseMoveHandler=this.onMouseMove.bind(this),this.mouseHandler=this.onMouse.bind(this),this.name="arrowPlugin"}async register(e){await super.register(e),this.arrowMaterial=new lt,this.arrowMaterial.transparent=!0,this.arrowMaterial.side=ut,this.mouseoverFloorMaterial=new lt,this.mouseoverFloorMaterial.transparent=!0,this.mouseoverFloorMaterial.side=ut,this.mouseArrowObject=await $n.instance.loadTexturedPlaneModel(s_,this.arrowMaterial,void 0,new I(.25,.5,.25)),this.mouseFloorObject=await $n.instance.loadTexturedPlaneModel(l_,this.mouseoverFloorMaterial,void 0,new I(.25,.25,.25)),this.scene.add(this.mouseArrowObject),this.scene.add(this.mouseFloorObject),this.main.addEventListener(Gn.EVENT_NAME,this.mouseMoveHandler),this.main.addEventListener(Yr.EVENT_NAME,this.mouseHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(Gn.EVENT_NAME,this.mouseMoveHandler),this.main.addEventListener(Yr.EVENT_NAME,this.mouseHandler)}onMouseMove({data:e}){this.mouseRay=e.ray}onMouse({data:e}){this.mouseDown=e.button===0}update(){var e;if(!this.main.options.showArrowAndMarkers)return this.mouseArrowObject.visible=!1,{};if(this.mouseRay&&this.mouseArrowObject&&this.mouseFloorObject){let{hitPoint:t,isFloor:i}=this.mouseRay;if(this.mouseArrowObject.visible=!i,this.mouseFloorObject.visible=i,this.mouseDown)this.mouseArrowObject.visible=!1;else if(!this.main.camera.position)this.mouseArrowObject.visible=!1;else{let r=new I(this.main.camera.position.x,0,this.main.camera.position.z),n=new I(t.x,0,t.z).distanceTo(r),o=t.clone().sub(this.main.camera.position).normalize(),s=Math.atan2(o.x,o.z)+Math.PI;if(n>3){let l=o.multiplyScalar(3);(e=this.mouseArrowObject)==null||e.position.copy(this.main.camera.position).add(l)}else this.mouseArrowObject.position.copy(t);this.mouseArrowObject.rotation.y=s,this.mouseFloorObject.position.copy(t)}}return{postProcessingRenderLayer:{camera:this.main.camera,scene:this.scene,renderTarget:this.renderTarget,alpha:.3,type:4}}}reset(){this.mouseDown=!1}},ql=(xr=class extends Event{constructor(t){super(xr.EVENT_NAME),this.data=t}},xr.EVENT_NAME="autoRotatePluginOptions",xr);function d_(e){return e&&typeof e=="object"&&("autoRotate"in e||"autoRotateSpeed"in e)}var h_=class extends a2{constructor(e){super(),this.name="autoRotatePlugin",this.options={autoRotate:!1,autoRotateSpeed:1},this.autoRotatePluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.setOptions(e||{})}setOptions(e){this.options.autoRotate=e.autoRotate??this.options.autoRotate,this.options.autoRotateSpeed=e.autoRotateSpeed??this.options.autoRotateSpeed}async register(e){await super.register(e),this.main.addEventListener(ql.EVENT_NAME,this.autoRotatePluginOptionsEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(ql.EVENT_NAME,this.autoRotatePluginOptionsEventHandler)}update(){return this.main.initialized&&this.options.autoRotate?{cameraDelta:{rotation:new O1(0,.001*this.options.autoRotateSpeed,0)}}:{}}toggleAutoRotate(){this.options.autoRotate=!this.options.autoRotate}setAutoRotateSpeed(e){this.options.autoRotateSpeed=e}},u_=(yr=class extends Event{constructor(t){super(yr.EVENT_NAME),this.data=t}},yr.EVENT_NAME="mainOptions",yr);function Wi(e){let t=e.length;for(;--t>=0;)e[t]=0}var m_=0,Zl=1,f_=2,p_=3,g_=258,i0=29,Qr=256,Jr=Qr+1+i0,ji=30,r0=19,Ql=2*Jr+1,Z2=15,a0=16,__=7,n0=256,Jl=16,Kl=17,$l=18,o0=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l3=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),v_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),e6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),x_=512,n2=new Array((Jr+2)*2);Wi(n2);var Kr=new Array(ji*2);Wi(Kr);var $r=new Array(x_);Wi($r);var ea=new Array(g_-p_+1);Wi(ea);var s0=new Array(i0);Wi(s0);var c3=new Array(ji);Wi(c3);function l0(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}var t6,i6,r6;function c0(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var a6=e=>e<256?$r[e]:$r[256+(e>>>7)],ta=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},at=(e,t,i)=>{e.bi_valid>a0-i?(e.bi_buf|=t<<e.bi_valid&65535,ta(e,e.bi_buf),e.bi_buf=t>>a0-e.bi_valid,e.bi_valid+=i-a0):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Ft=(e,t,i)=>{at(e,i[t*2],i[t*2+1])},n6=(e,t)=>{let i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1},y_=e=>{e.bi_valid===16?(ta(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},S_=(e,t)=>{let i=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,c,h,u,m,f,v,_=0;for(m=0;m<=Z2;m++)e.bl_count[m]=0;for(i[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Ql;c++)h=e.heap[c],m=i[i[h*2+1]*2+1]+1,m>d&&(m=d,_++),i[h*2+1]=m,!(h>r)&&(e.bl_count[m]++,f=0,h>=l&&(f=s[h-l]),v=i[h*2],e.opt_len+=v*(m+f),o&&(e.static_len+=v*(n[h*2+1]+f)));if(_!==0){do{for(m=d-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[d]--,_-=2}while(_>0);for(m=d;m!==0;m--)for(h=e.bl_count[m];h!==0;)u=e.heap[--c],!(u>r)&&(i[u*2+1]!==m&&(e.opt_len+=(m-i[u*2+1])*i[u*2],i[u*2+1]=m),h--)}},o6=(e,t,i)=>{let r=new Array(Z2+1),n=0,o,s;for(o=1;o<=Z2;o++)n=n+i[o-1]<<1,r[o]=n;for(s=0;s<=t;s++){let l=e[s*2+1];l!==0&&(e[s*2]=n6(r[l]++,l))}},M_=()=>{let e,t,i,r,n,o=new Array(Z2+1);for(i=0,r=0;r<i0-1;r++)for(s0[r]=i,e=0;e<1<<o0[r];e++)ea[i++]=r;for(ea[i-1]=r,n=0,r=0;r<16;r++)for(c3[r]=n,e=0;e<1<<l3[r];e++)$r[n++]=r;for(n>>=7;r<ji;r++)for(c3[r]=n<<7,e=0;e<1<<l3[r]-7;e++)$r[256+n++]=r;for(t=0;t<=Z2;t++)o[t]=0;for(e=0;e<=143;)n2[e*2+1]=8,e++,o[8]++;for(;e<=255;)n2[e*2+1]=9,e++,o[9]++;for(;e<=279;)n2[e*2+1]=7,e++,o[7]++;for(;e<=287;)n2[e*2+1]=8,e++,o[8]++;for(o6(n2,Jr+1,o),e=0;e<ji;e++)Kr[e*2+1]=5,Kr[e*2]=n6(e,5);t6=new l0(n2,o0,Qr+1,Jr,Z2),i6=new l0(Kr,l3,0,ji,Z2),r6=new l0(new Array(0),v_,0,r0,__)},s6=e=>{let t;for(t=0;t<Jr;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ji;t++)e.dyn_dtree[t*2]=0;for(t=0;t<r0;t++)e.bl_tree[t*2]=0;e.dyn_ltree[n0*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},l6=e=>{e.bi_valid>8?ta(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},c6=(e,t,i,r)=>{let n=t*2,o=i*2;return e[n]<e[o]||e[n]===e[o]&&r[t]<=r[i]},d0=(e,t,i)=>{let r=e.heap[i],n=i<<1;for(;n<=e.heap_len&&(n<e.heap_len&&c6(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!c6(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},d6=(e,t,i)=>{let r,n,o=0,s,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,n=e.pending_buf[e.sym_buf+o++],r===0?Ft(e,n,t):(s=ea[n],Ft(e,s+Qr+1,t),l=o0[s],l!==0&&(n-=s0[s],at(e,n,l)),r--,s=a6(r),Ft(e,s,i),l=l3[s],l!==0&&(r-=c3[s],at(e,r,l)));while(o<e.sym_next);Ft(e,n0,t)},h0=(e,t)=>{let i=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.elems,s,l,d=-1,c;for(e.heap_len=0,e.heap_max=Ql,s=0;s<o;s++)i[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[s*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,i[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=r[c*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)d0(e,i,s);c=o;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],d0(e,i,1),l=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=l,i[c*2]=i[s*2]+i[l*2],e.depth[c]=(e.depth[s]>=e.depth[l]?e.depth[s]:e.depth[l])+1,i[s*2+1]=i[l*2+1]=c,e.heap[1]=c++,d0(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],S_(e,t),o6(i,d,e.bl_count)},h6=(e,t,i)=>{let r,n=-1,o,s=t[1],l=0,d=7,c=4;for(s===0&&(d=138,c=3),t[(i+1)*2+1]=65535,r=0;r<=i;r++)o=s,s=t[(r+1)*2+1],!(++l<d&&o===s)&&(l<c?e.bl_tree[o*2]+=l:o!==0?(o!==n&&e.bl_tree[o*2]++,e.bl_tree[Jl*2]++):l<=10?e.bl_tree[Kl*2]++:e.bl_tree[$l*2]++,l=0,n=o,s===0?(d=138,c=3):o===s?(d=6,c=3):(d=7,c=4))},u6=(e,t,i)=>{let r,n=-1,o,s=t[1],l=0,d=7,c=4;for(s===0&&(d=138,c=3),r=0;r<=i;r++)if(o=s,s=t[(r+1)*2+1],!(++l<d&&o===s)){if(l<c)do Ft(e,o,e.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Ft(e,o,e.bl_tree),l--),Ft(e,Jl,e.bl_tree),at(e,l-3,2)):l<=10?(Ft(e,Kl,e.bl_tree),at(e,l-3,3)):(Ft(e,$l,e.bl_tree),at(e,l-11,7));l=0,n=o,s===0?(d=138,c=3):o===s?(d=6,c=3):(d=7,c=4)}},w_=e=>{let t;for(h6(e,e.dyn_ltree,e.l_desc.max_code),h6(e,e.dyn_dtree,e.d_desc.max_code),h0(e,e.bl_desc),t=r0-1;t>=3&&e.bl_tree[e6[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},A_=(e,t,i,r)=>{let n;for(at(e,t-257,5),at(e,i-1,5),at(e,r-4,4),n=0;n<r;n++)at(e,e.bl_tree[e6[n]*2+1],3);u6(e,e.dyn_ltree,t-1),u6(e,e.dyn_dtree,i-1)},E_=e=>{let t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(i=32;i<Qr;i++)if(e.dyn_ltree[i*2]!==0)return 1;return 0},m6=!1,b_=e=>{m6||(M_(),m6=!0),e.l_desc=new c0(e.dyn_ltree,t6),e.d_desc=new c0(e.dyn_dtree,i6),e.bl_desc=new c0(e.bl_tree,r6),e.bi_buf=0,e.bi_valid=0,s6(e)},f6=(e,t,i,r)=>{at(e,(m_<<1)+(r?1:0),3),l6(e),ta(e,i),ta(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i},C_=e=>{at(e,Zl<<1,3),Ft(e,n0,n2),y_(e)},T_=(e,t,i,r)=>{let n,o,s=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=E_(e)),h0(e,e.l_desc),h0(e,e.d_desc),s=w_(e),n=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=n&&(n=o)):n=o=i+5,i+4<=n&&t!==-1?f6(e,t,i,r):e.strategy===4||o===n?(at(e,(Zl<<1)+(r?1:0),3),d6(e,n2,Kr)):(at(e,(f_<<1)+(r?1:0),3),A_(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),d6(e,e.dyn_ltree,e.dyn_dtree)),s6(e),r&&l6(e)},I_=(e,t,i)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,t===0?e.dyn_ltree[i*2]++:(e.matches++,t--,e.dyn_ltree[(ea[i]+Qr+1)*2]++,e.dyn_dtree[a6(t)*2]++),e.sym_next===e.sym_end),P_=b_,N_=f6,L_=T_,R_=I_,D_=C_,U_={_tr_init:P_,_tr_stored_block:N_,_tr_flush_block:L_,_tr_tally:R_,_tr_align:D_},k_=(e,t,i,r)=>{let n=e&65535|0,o=e>>>16&65535|0,s=0;for(;i!==0;){s=i>2e3?2e3:i,i-=s;do n=n+t[r++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0},ia=k_,O_=()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t},z_=new Uint32Array(O_()),V_=(e,t,i,r)=>{let n=z_,o=r+i;e^=-1;for(let s=r;s<o;s++)e=e>>>8^n[(e^t[s])&255];return e^-1},V1=V_,Xi={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ra={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:B_,_tr_stored_block:u0,_tr_flush_block:F_,_tr_tally:T2,_tr_align:H_}=U_,{Z_NO_FLUSH:I2,Z_PARTIAL_FLUSH:G_,Z_FULL_FLUSH:W_,Z_FINISH:gt,Z_BLOCK:p6,Z_OK:F1,Z_STREAM_END:g6,Z_STREAM_ERROR:Ht,Z_DATA_ERROR:j_,Z_BUF_ERROR:m0,Z_DEFAULT_COMPRESSION:X_,Z_FILTERED:Y_,Z_HUFFMAN_ONLY:d3,Z_RLE:q_,Z_FIXED:Z_,Z_DEFAULT_STRATEGY:Q_,Z_UNKNOWN:J_,Z_DEFLATED:h3}=ra,K_=9,$_=15,ev=8,tv=29,iv=256,f0=iv+1+tv,rv=30,av=19,nv=2*f0+1,ov=15,Qe=3,P2=258,Gt=P2+Qe+1,sv=32,Yi=42,p0=57,g0=69,_0=73,v0=91,x0=103,Q2=113,aa=666,et=1,qi=2,J2=3,Zi=4,lv=3,K2=(e,t)=>(e.msg=Xi[t],t),_6=e=>e*2-(e>4?9:0),N2=e=>{let t=e.length;for(;--t>=0;)e[t]=0},cv=e=>{let t,i,r,n=e.w_size;t=e.hash_size,r=t;do i=e.head[--r],e.head[r]=i>=n?i-n:0;while(--t);t=n,r=t;do i=e.prev[--r],e.prev[r]=i>=n?i-n:0;while(--t)},dv=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask,L2=dv,dt=e=>{let t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,t.pending===0&&(t.pending_out=0))},ht=(e,t)=>{F_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,dt(e.strm)},t1=(e,t)=>{e.pending_buf[e.pending++]=t},na=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},y0=(e,t,i,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),e.state.wrap===1?e.adler=ia(e.adler,t,n,i):e.state.wrap===2&&(e.adler=V1(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},v6=(e,t)=>{let i=e.max_chain_length,r=e.strstart,n,o,s=e.prev_length,l=e.nice_match,d=e.strstart>e.w_size-Gt?e.strstart-(e.w_size-Gt):0,c=e.window,h=e.w_mask,u=e.prev,m=e.strstart+P2,f=c[r+s-1],v=c[r+s];e.prev_length>=e.good_match&&(i>>=2),l>e.lookahead&&(l=e.lookahead);do if(n=t,!(c[n+s]!==v||c[n+s-1]!==f||c[n]!==c[r]||c[++n]!==c[r+1])){r+=2,n++;do;while(c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&r<m);if(o=P2-(m-r),r=m-P2,o>s){if(e.match_start=t,s=o,o>=l)break;f=c[r+s-1],v=c[r+s]}}while((t=u[t&h])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead},Qi=e=>{let t=e.w_size,i,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Gt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),cv(e),r+=t),e.strm.avail_in===0)break;if(i=y0(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=Qe)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=L2(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=L2(e,e.ins_h,e.window[n+Qe-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<Qe)););}while(e.lookahead<Gt&&e.strm.avail_in!==0)},x6=(e,t)=>{let i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,n,o,s=0,l=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>o&&(r=o),r<i&&(r===0&&t!==gt||t===I2||r!==n+e.strm.avail_in)))break;s=t===gt&&r===n+e.strm.avail_in?1:0,u0(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,dt(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(y0(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(s===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?Zi:t!==I2&&t!==gt&&e.strm.avail_in===0&&e.strstart===e.block_start?qi:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(y0(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,i=o>e.w_size?e.w_size:o,n=e.strstart-e.block_start,(n>=i||(n||t===gt)&&t!==I2&&e.strm.avail_in===0&&n<=o)&&(r=n>o?o:n,s=t===gt&&e.strm.avail_in===0&&r===n?1:0,u0(e,e.block_start,r,s),e.block_start+=r,dt(e.strm)),s?J2:et)},S0=(e,t)=>{let i,r;for(;;){if(e.lookahead<Gt){if(Qi(e),e.lookahead<Gt&&t===I2)return et;if(e.lookahead===0)break}if(i=0,e.lookahead>=Qe&&(e.ins_h=L2(e,e.ins_h,e.window[e.strstart+Qe-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),i!==0&&e.strstart-i<=e.w_size-Gt&&(e.match_length=v6(e,i)),e.match_length>=Qe)if(r=T2(e,e.strstart-e.match_start,e.match_length-Qe),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Qe){e.match_length--;do e.strstart++,e.ins_h=L2(e,e.ins_h,e.window[e.strstart+Qe-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=L2(e,e.ins_h,e.window[e.strstart+1]);else r=T2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ht(e,!1),e.strm.avail_out===0))return et}return e.insert=e.strstart<Qe-1?e.strstart:Qe-1,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:Zi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?et:qi},Ji=(e,t)=>{let i,r,n;for(;;){if(e.lookahead<Gt){if(Qi(e),e.lookahead<Gt&&t===I2)return et;if(e.lookahead===0)break}if(i=0,e.lookahead>=Qe&&(e.ins_h=L2(e,e.ins_h,e.window[e.strstart+Qe-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Qe-1,i!==0&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Gt&&(e.match_length=v6(e,i),e.match_length<=5&&(e.strategy===Y_||e.match_length===Qe&&e.strstart-e.match_start>4096)&&(e.match_length=Qe-1)),e.prev_length>=Qe&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-Qe,r=T2(e,e.strstart-1-e.prev_match,e.prev_length-Qe),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=L2(e,e.ins_h,e.window[e.strstart+Qe-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Qe-1,e.strstart++,r&&(ht(e,!1),e.strm.avail_out===0))return et}else if(e.match_available){if(r=T2(e,0,e.window[e.strstart-1]),r&&ht(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return et}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=T2(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Qe-1?e.strstart:Qe-1,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:Zi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?et:qi},hv=(e,t)=>{let i,r,n,o,s=e.window;for(;;){if(e.lookahead<=P2){if(Qi(e),e.lookahead<=P2&&t===I2)return et;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Qe&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){o=e.strstart+P2;do;while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);e.match_length=P2-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Qe?(i=T2(e,1,e.match_length-Qe),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=T2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(ht(e,!1),e.strm.avail_out===0))return et}return e.insert=0,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:Zi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?et:qi},uv=(e,t)=>{let i;for(;;){if(e.lookahead===0&&(Qi(e),e.lookahead===0)){if(t===I2)return et;break}if(e.match_length=0,i=T2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(ht(e,!1),e.strm.avail_out===0))return et}return e.insert=0,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:Zi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?et:qi};function Wt(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}var oa=[new Wt(0,0,0,0,x6),new Wt(4,4,8,4,S0),new Wt(4,5,16,8,S0),new Wt(4,6,32,32,S0),new Wt(4,4,16,16,Ji),new Wt(8,16,32,32,Ji),new Wt(8,16,128,128,Ji),new Wt(8,32,128,256,Ji),new Wt(32,128,258,1024,Ji),new Wt(32,258,258,4096,Ji)],mv=e=>{e.window_size=2*e.w_size,N2(e.head),e.max_lazy_match=oa[e.level].max_lazy,e.good_match=oa[e.level].good_length,e.nice_match=oa[e.level].nice_length,e.max_chain_length=oa[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Qe-1,e.match_available=0,e.ins_h=0};function fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=h3,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(nv*2),this.dyn_dtree=new Uint16Array((2*rv+1)*2),this.bl_tree=new Uint16Array((2*av+1)*2),N2(this.dyn_ltree),N2(this.dyn_dtree),N2(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ov+1),this.heap=new Uint16Array(2*f0+1),N2(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*f0+1),N2(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var sa=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Yi&&t.status!==p0&&t.status!==g0&&t.status!==_0&&t.status!==v0&&t.status!==x0&&t.status!==Q2&&t.status!==aa?1:0},y6=e=>{if(sa(e))return K2(e,Ht);e.total_in=e.total_out=0,e.data_type=J_;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?p0:t.wrap?Yi:Q2,e.adler=t.wrap===2?0:1,t.last_flush=-2,B_(t),F1},S6=e=>{let t=y6(e);return t===F1&&mv(e.state),t},pv=(e,t)=>sa(e)||e.state.wrap!==2?Ht:(e.state.gzhead=t,F1),M6=(e,t,i,r,n,o)=>{if(!e)return Ht;let s=1;if(t===X_&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>K_||i!==h3||r<8||r>15||t<0||t>9||o<0||o>Z_||r===8&&s!==1)return K2(e,Ht);r===8&&(r=9);let l=new fv;return e.state=l,l.strm=e,l.status=Yi,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Qe-1)/Qe),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=t,l.strategy=o,l.method=i,S6(e)},gv=(e,t)=>M6(e,t,h3,$_,ev,Q_),_v=(e,t)=>{if(sa(e)||t>p6||t<0)return e?K2(e,Ht):Ht;let i=e.state;if(!e.output||e.avail_in!==0&&!e.input||i.status===aa&&t!==gt)return K2(e,e.avail_out===0?m0:Ht);let r=i.last_flush;if(i.last_flush=t,i.pending!==0){if(dt(e),e.avail_out===0)return i.last_flush=-1,F1}else if(e.avail_in===0&&_6(t)<=_6(r)&&t!==gt)return K2(e,m0);if(i.status===aa&&e.avail_in!==0)return K2(e,m0);if(i.status===Yi&&i.wrap===0&&(i.status=Q2),i.status===Yi){let n=h3+(i.w_bits-8<<4)<<8,o=-1;if(i.strategy>=d3||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,n|=o<<6,i.strstart!==0&&(n|=sv),n+=31-n%31,na(i,n),i.strstart!==0&&(na(i,e.adler>>>16),na(i,e.adler&65535)),e.adler=1,i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,F1}if(i.status===p0){if(e.adler=0,t1(i,31),t1(i,139),t1(i,8),i.gzhead)t1(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),t1(i,i.gzhead.time&255),t1(i,i.gzhead.time>>8&255),t1(i,i.gzhead.time>>16&255),t1(i,i.gzhead.time>>24&255),t1(i,i.level===9?2:i.strategy>=d3||i.level<2?4:0),t1(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(t1(i,i.gzhead.extra.length&255),t1(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=V1(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=g0;else if(t1(i,0),t1(i,0),t1(i,0),t1(i,0),t1(i,0),t1(i,i.level===9?2:i.strategy>=d3||i.level<2?4:0),t1(i,lv),i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,F1}if(i.status===g0){if(i.gzhead.extra){let n=i.pending,o=(i.gzhead.extra.length&65535)-i.gzindex;for(;i.pending+o>i.pending_buf_size;){let l=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+l),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex+=l,dt(e),i.pending!==0)return i.last_flush=-1,F1;n=0,o-=l}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending+=o,i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=_0}if(i.status===_0){if(i.gzhead.name){let n=i.pending,o;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n)),dt(e),i.pending!==0)return i.last_flush=-1,F1;n=0}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,t1(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=v0}if(i.status===v0){if(i.gzhead.comment){let n=i.pending,o;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n)),dt(e),i.pending!==0)return i.last_flush=-1,F1;n=0}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,t1(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=V1(e.adler,i.pending_buf,i.pending-n,n))}i.status=x0}if(i.status===x0){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(dt(e),i.pending!==0))return i.last_flush=-1,F1;t1(i,e.adler&255),t1(i,e.adler>>8&255),e.adler=0}if(i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,F1}if(e.avail_in!==0||i.lookahead!==0||t!==I2&&i.status!==aa){let n=i.level===0?x6(i,t):i.strategy===d3?uv(i,t):i.strategy===q_?hv(i,t):oa[i.level].func(i,t);if((n===J2||n===Zi)&&(i.status=aa),n===et||n===J2)return e.avail_out===0&&(i.last_flush=-1),F1;if(n===qi&&(t===G_?H_(i):t!==p6&&(u0(i,0,0,!1),t===W_&&(N2(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),dt(e),e.avail_out===0))return i.last_flush=-1,F1}return t!==gt?F1:i.wrap<=0?g6:(i.wrap===2?(t1(i,e.adler&255),t1(i,e.adler>>8&255),t1(i,e.adler>>16&255),t1(i,e.adler>>24&255),t1(i,e.total_in&255),t1(i,e.total_in>>8&255),t1(i,e.total_in>>16&255),t1(i,e.total_in>>24&255)):(na(i,e.adler>>>16),na(i,e.adler&65535)),dt(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?F1:g6)},vv=e=>{if(sa(e))return Ht;let t=e.state.status;return e.state=null,t===Q2?K2(e,j_):F1},xv=(e,t)=>{let i=t.length;if(sa(e))return Ht;let r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==Yi||r.lookahead)return Ht;if(n===1&&(e.adler=ia(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){n===0&&(N2(r.head),r.strstart=0,r.block_start=0,r.insert=0);let d=new Uint8Array(r.w_size);d.set(t.subarray(i-r.w_size,i),0),t=d,i=r.w_size}let o=e.avail_in,s=e.next_in,l=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Qi(r);r.lookahead>=Qe;){let d=r.strstart,c=r.lookahead-(Qe-1);do r.ins_h=L2(r,r.ins_h,r.window[d+Qe-1]),r.prev[d&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=d,d++;while(--c);r.strstart=d,r.lookahead=Qe-1,Qi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Qe-1,r.match_available=0,e.next_in=s,e.input=l,e.avail_in=o,r.wrap=n,F1},yv=gv,Sv=M6,Mv=S6,wv=y6,Av=pv,Ev=_v,bv=vv,Cv=xv,Tv="pako deflate (from Nodeca project)",la={deflateInit:yv,deflateInit2:Sv,deflateReset:Mv,deflateResetKeep:wv,deflateSetHeader:Av,deflate:Ev,deflateEnd:bv,deflateSetDictionary:Cv,deflateInfo:Tv},Iv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Pv=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let i=t.shift();if(i){if(typeof i!="object")throw new TypeError(i+"must be non-object");for(let r in i)Iv(i,r)&&(e[r]=i[r])}}return e},Nv=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;let i=new Uint8Array(t);for(let r=0,n=0,o=e.length;r<o;r++){let s=e[r];i.set(s,n),n+=s.length}return i},u3={assign:Pv,flattenChunks:Nv},w6=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{w6=!1}var ca=new Uint8Array(256);for(let e=0;e<256;e++)ca[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;ca[254]=ca[254]=1;var Lv=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,i,r,n,o,s=e.length,l=0;for(n=0;n<s;n++)i=e.charCodeAt(n),(i&64512)===55296&&n+1<s&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(i=65536+(i-55296<<10)+(r-56320),n++)),l+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(l),o=0,n=0;o<l;n++)i=e.charCodeAt(n),(i&64512)===55296&&n+1<s&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|i&63):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|i&63):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|i&63);return t},Rv=(e,t)=>{if(t<65534&&e.subarray&&w6)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i},Dv=(e,t)=>{let i=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,n,o=new Array(i*2);for(n=0,r=0;r<i;){let s=e[r++];if(s<128){o[n++]=s;continue}let l=ca[s];if(l>4){o[n++]=65533,r+=l-1;continue}for(s&=l===2?31:l===3?15:7;l>1&&r<i;)s=s<<6|e[r++]&63,l--;if(l>1){o[n++]=65533;continue}s<65536?o[n++]=s:(s-=65536,o[n++]=55296|s>>10&1023,o[n++]=56320|s&1023)}return Rv(o,n)},Uv=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let i=t-1;for(;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+ca[e[i]]>t?i:t},da={string2buf:Lv,buf2string:Dv,utf8border:Uv};function kv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var A6=kv,E6=Object.prototype.toString,{Z_NO_FLUSH:Ov,Z_SYNC_FLUSH:zv,Z_FULL_FLUSH:Vv,Z_FINISH:Bv,Z_OK:m3,Z_STREAM_END:Fv,Z_DEFAULT_COMPRESSION:Hv,Z_DEFAULT_STRATEGY:Gv,Z_DEFLATED:Wv}=ra;function M0(e){this.options=u3.assign({level:Hv,method:Wv,chunkSize:16384,windowBits:15,memLevel:8,strategy:Gv},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A6,this.strm.avail_out=0;let i=la.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==m3)throw new Error(Xi[i]);if(t.header&&la.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=da.string2buf(t.dictionary):E6.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,i=la.deflateSetDictionary(this.strm,r),i!==m3)throw new Error(Xi[i]);this._dict_set=!0}}M0.prototype.push=function(e,t){let i=this.strm,r=this.options.chunkSize,n,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?Bv:Ov,typeof e=="string"?i.input=da.string2buf(e):E6.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){if(i.avail_out===0&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(o===zv||o===Vv)&&i.avail_out<=6){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if(n=la.deflate(i,o),n===Fv)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=la.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===m3;if(i.avail_out===0){this.onData(i.output);continue}if(o>0&&i.next_out>0){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if(i.avail_in===0)break}return!0},M0.prototype.onData=function(e){this.chunks.push(e)},M0.prototype.onEnd=function(e){e===m3&&(this.result=u3.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var f3=16209,jv=16191,Xv=function(e,t){let i,r,n,o,s,l,d,c,h,u,m,f,v,_,g,p,y,x,b,N,A,C,U,S,M=e.state;i=e.next_in,U=e.input,r=i+(e.avail_in-5),n=e.next_out,S=e.output,o=n-(t-e.avail_out),s=n+(e.avail_out-257),l=M.dmax,d=M.wsize,c=M.whave,h=M.wnext,u=M.window,m=M.hold,f=M.bits,v=M.lencode,_=M.distcode,g=(1<<M.lenbits)-1,p=(1<<M.distbits)-1;e:do{f<15&&(m+=U[i++]<<f,f+=8,m+=U[i++]<<f,f+=8),y=v[m&g];t:for(;;){if(x=y>>>24,m>>>=x,f-=x,x=y>>>16&255,x===0)S[n++]=y&65535;else if(x&16){b=y&65535,x&=15,x&&(f<x&&(m+=U[i++]<<f,f+=8),b+=m&(1<<x)-1,m>>>=x,f-=x),f<15&&(m+=U[i++]<<f,f+=8,m+=U[i++]<<f,f+=8),y=_[m&p];i:for(;;){if(x=y>>>24,m>>>=x,f-=x,x=y>>>16&255,x&16){if(N=y&65535,x&=15,f<x&&(m+=U[i++]<<f,f+=8,f<x&&(m+=U[i++]<<f,f+=8)),N+=m&(1<<x)-1,N>l){e.msg="invalid distance too far back",M.mode=f3;break e}if(m>>>=x,f-=x,x=n-o,N>x){if(x=N-x,x>c&&M.sane){e.msg="invalid distance too far back",M.mode=f3;break e}if(A=0,C=u,h===0){if(A+=d-x,x<b){b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}}else if(h<x){if(A+=d+h-x,x-=h,x<b){b-=x;do S[n++]=u[A++];while(--x);if(A=0,h<b){x=h,b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}}}else if(A+=h-x,x<b){b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}for(;b>2;)S[n++]=C[A++],S[n++]=C[A++],S[n++]=C[A++],b-=3;b&&(S[n++]=C[A++],b>1&&(S[n++]=C[A++]))}else{A=n-N;do S[n++]=S[A++],S[n++]=S[A++],S[n++]=S[A++],b-=3;while(b>2);b&&(S[n++]=S[A++],b>1&&(S[n++]=S[A++]))}}else if(x&64){e.msg="invalid distance code",M.mode=f3;break e}else{y=_[(y&65535)+(m&(1<<x)-1)];continue i}break}}else if(x&64)if(x&32){M.mode=jv;break e}else{e.msg="invalid literal/length code",M.mode=f3;break e}else{y=v[(y&65535)+(m&(1<<x)-1)];continue t}break}}while(i<r&&n<s);b=f>>3,i-=b,f-=b<<3,m&=(1<<f)-1,e.next_in=i,e.next_out=n,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=n<s?257+(s-n):257-(n-s),M.hold=m,M.bits=f},Ki=15,b6=852,C6=592,T6=0,w0=1,I6=2,Yv=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),qv=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Zv=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qv=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Jv=(e,t,i,r,n,o,s,l)=>{let d=l.bits,c=0,h=0,u=0,m=0,f=0,v=0,_=0,g=0,p=0,y=0,x,b,N,A,C,U=null,S,M=new Uint16Array(Ki+1),k=new Uint16Array(Ki+1),R=null,D,V,q;for(c=0;c<=Ki;c++)M[c]=0;for(h=0;h<r;h++)M[t[i+h]]++;for(f=d,m=Ki;m>=1&&M[m]===0;m--);if(f>m&&(f=m),m===0)return n[o++]=1<<24|64<<16|0,n[o++]=1<<24|64<<16|0,l.bits=1,0;for(u=1;u<m&&M[u]===0;u++);for(f<u&&(f=u),g=1,c=1;c<=Ki;c++)if(g<<=1,g-=M[c],g<0)return-1;if(g>0&&(e===T6||m!==1))return-1;for(k[1]=0,c=1;c<Ki;c++)k[c+1]=k[c]+M[c];for(h=0;h<r;h++)t[i+h]!==0&&(s[k[t[i+h]]++]=h);if(e===T6?(U=R=s,S=20):e===w0?(U=Yv,R=qv,S=257):(U=Zv,R=Qv,S=0),y=0,h=0,c=u,C=o,v=f,_=0,N=-1,p=1<<f,A=p-1,e===w0&&p>b6||e===I6&&p>C6)return 1;for(;;){D=c-_,s[h]+1<S?(V=0,q=s[h]):s[h]>=S?(V=R[s[h]-S],q=U[s[h]-S]):(V=96,q=0),x=1<<c-_,b=1<<v,u=b;do b-=x,n[C+(y>>_)+b]=D<<24|V<<16|q|0;while(b!==0);for(x=1<<c-1;y&x;)x>>=1;if(x!==0?(y&=x-1,y+=x):y=0,h++,--M[c]===0){if(c===m)break;c=t[i+s[h]]}if(c>f&&(y&A)!==N){for(_===0&&(_=f),C+=u,v=c-_,g=1<<v;v+_<m&&(g-=M[v+_],!(g<=0));)v++,g<<=1;if(p+=1<<v,e===w0&&p>b6||e===I6&&p>C6)return 1;N=y&A,n[N]=f<<24|v<<16|C-o|0}}return y!==0&&(n[C+y]=c-_<<24|64<<16|0),l.bits=f,0},ha=Jv,Kv=0,P6=1,N6=2,{Z_FINISH:L6,Z_BLOCK:$v,Z_TREES:p3,Z_OK:$2,Z_STREAM_END:e9,Z_NEED_DICT:t9,Z_STREAM_ERROR:Tt,Z_DATA_ERROR:R6,Z_MEM_ERROR:D6,Z_BUF_ERROR:i9,Z_DEFLATED:U6}=ra,g3=16180,k6=16181,O6=16182,z6=16183,V6=16184,B6=16185,F6=16186,H6=16187,G6=16188,W6=16189,_3=16190,o2=16191,A0=16192,j6=16193,E0=16194,X6=16195,Y6=16196,q6=16197,Z6=16198,v3=16199,x3=16200,Q6=16201,J6=16202,K6=16203,$6=16204,e4=16205,b0=16206,t4=16207,i4=16208,y1=16209,r4=16210,a4=16211,r9=852,a9=592,n9=15,o9=n9,n4=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function s9(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ei=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<g3||t.mode>a4?1:0},o4=e=>{if(ei(e))return Tt;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=g3,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(r9),t.distcode=t.distdyn=new Int32Array(a9),t.sane=1,t.back=-1,$2},s4=e=>{if(ei(e))return Tt;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,o4(e)},l4=(e,t)=>{let i;if(ei(e))return Tt;let r=e.state;return t<0?(i=0,t=-t):(i=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Tt:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,s4(e))},c4=(e,t)=>{if(!e)return Tt;let i=new s9;e.state=i,i.strm=e,i.window=null,i.mode=g3;let r=l4(e,t);return r!==$2&&(e.state=null),r},l9=e=>c4(e,o9),d4=!0,C0,T0,c9=e=>{if(d4){C0=new Int32Array(512),T0=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ha(P6,e.lens,0,288,C0,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ha(N6,e.lens,0,32,T0,0,e.work,{bits:5}),d4=!1}e.lencode=C0,e.lenbits=9,e.distcode=T0,e.distbits=5},h4=(e,t,i,r)=>{let n,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(i-o.wsize,i),0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>r&&(n=r),o.window.set(t.subarray(i-r,i-r+n),o.wnext),r-=n,r?(o.window.set(t.subarray(i-r,i),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0},d9=(e,t)=>{let i,r,n,o,s,l,d,c,h,u,m,f,v,_,g=0,p,y,x,b,N,A,C,U,S=new Uint8Array(4),M,k,R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ei(e)||!e.output||!e.input&&e.avail_in!==0)return Tt;i=e.state,i.mode===o2&&(i.mode=A0),s=e.next_out,n=e.output,d=e.avail_out,o=e.next_in,r=e.input,l=e.avail_in,c=i.hold,h=i.bits,u=l,m=d,U=$2;e:for(;;)switch(i.mode){case g3:if(i.wrap===0){i.mode=A0;break}for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&2&&c===35615){i.wbits===0&&(i.wbits=15),i.check=0,S[0]=c&255,S[1]=c>>>8&255,i.check=V1(i.check,S,2,0),c=0,h=0,i.mode=k6;break}if(i.head&&(i.head.done=!1),!(i.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=y1;break}if((c&15)!==U6){e.msg="unknown compression method",i.mode=y1;break}if(c>>>=4,h-=4,C=(c&15)+8,i.wbits===0&&(i.wbits=C),C>15||C>i.wbits){e.msg="invalid window size",i.mode=y1;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=c&512?W6:o2,c=0,h=0;break;case k6:for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.flags=c,(i.flags&255)!==U6){e.msg="unknown compression method",i.mode=y1;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=y1;break}i.head&&(i.head.text=c>>8&1),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=V1(i.check,S,2,0)),c=0,h=0,i.mode=O6;case O6:for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.head&&(i.head.time=c),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,i.check=V1(i.check,S,4,0)),c=0,h=0,i.mode=z6;case z6:for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.head&&(i.head.xflags=c&255,i.head.os=c>>8),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=V1(i.check,S,2,0)),c=0,h=0,i.mode=V6;case V6:if(i.flags&1024){for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.length=c,i.head&&(i.head.extra_len=c),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=V1(i.check,S,2,0)),c=0,h=0}else i.head&&(i.head.extra=null);i.mode=B6;case B6:if(i.flags&1024&&(f=i.length,f>l&&(f=l),f&&(i.head&&(C=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(o,o+f),C)),i.flags&512&&i.wrap&4&&(i.check=V1(i.check,r,f,o)),l-=f,o+=f,i.length-=f),i.length))break e;i.length=0,i.mode=F6;case F6:if(i.flags&2048){if(l===0)break e;f=0;do C=r[o+f++],i.head&&C&&i.length<65536&&(i.head.name+=String.fromCharCode(C));while(C&&f<l);if(i.flags&512&&i.wrap&4&&(i.check=V1(i.check,r,f,o)),l-=f,o+=f,C)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=H6;case H6:if(i.flags&4096){if(l===0)break e;f=0;do C=r[o+f++],i.head&&C&&i.length<65536&&(i.head.comment+=String.fromCharCode(C));while(C&&f<l);if(i.flags&512&&i.wrap&4&&(i.check=V1(i.check,r,f,o)),l-=f,o+=f,C)break e}else i.head&&(i.head.comment=null);i.mode=G6;case G6:if(i.flags&512){for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&4&&c!==(i.check&65535)){e.msg="header crc mismatch",i.mode=y1;break}c=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=o2;break;case W6:for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}e.adler=i.check=n4(c),c=0,h=0,i.mode=_3;case _3:if(i.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,t9;e.adler=i.check=1,i.mode=o2;case o2:if(t===$v||t===p3)break e;case A0:if(i.last){c>>>=h&7,h-=h&7,i.mode=b0;break}for(;h<3;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}switch(i.last=c&1,c>>>=1,h-=1,c&3){case 0:i.mode=j6;break;case 1:if(c9(i),i.mode=v3,t===p3){c>>>=2,h-=2;break e}break;case 2:i.mode=Y6;break;case 3:e.msg="invalid block type",i.mode=y1}c>>>=2,h-=2;break;case j6:for(c>>>=h&7,h-=h&7;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",i.mode=y1;break}if(i.length=c&65535,c=0,h=0,i.mode=E0,t===p3)break e;case E0:i.mode=X6;case X6:if(f=i.length,f){if(f>l&&(f=l),f>d&&(f=d),f===0)break e;n.set(r.subarray(o,o+f),s),l-=f,o+=f,d-=f,s+=f,i.length-=f;break}i.mode=o2;break;case Y6:for(;h<14;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.nlen=(c&31)+257,c>>>=5,h-=5,i.ndist=(c&31)+1,c>>>=5,h-=5,i.ncode=(c&15)+4,c>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=y1;break}i.have=0,i.mode=q6;case q6:for(;i.have<i.ncode;){for(;h<3;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.lens[R[i.have++]]=c&7,c>>>=3,h-=3}for(;i.have<19;)i.lens[R[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,M={bits:i.lenbits},U=ha(Kv,i.lens,0,19,i.lencode,0,i.work,M),i.lenbits=M.bits,U){e.msg="invalid code lengths set",i.mode=y1;break}i.have=0,i.mode=Z6;case Z6:for(;i.have<i.nlen+i.ndist;){for(;g=i.lencode[c&(1<<i.lenbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(x<16)c>>>=p,h-=p,i.lens[i.have++]=x;else{if(x===16){for(k=p+2;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(c>>>=p,h-=p,i.have===0){e.msg="invalid bit length repeat",i.mode=y1;break}C=i.lens[i.have-1],f=3+(c&3),c>>>=2,h-=2}else if(x===17){for(k=p+3;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=p,h-=p,C=0,f=3+(c&7),c>>>=3,h-=3}else{for(k=p+7;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=p,h-=p,C=0,f=11+(c&127),c>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=y1;break}for(;f--;)i.lens[i.have++]=C}}if(i.mode===y1)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=y1;break}if(i.lenbits=9,M={bits:i.lenbits},U=ha(P6,i.lens,0,i.nlen,i.lencode,0,i.work,M),i.lenbits=M.bits,U){e.msg="invalid literal/lengths set",i.mode=y1;break}if(i.distbits=6,i.distcode=i.distdyn,M={bits:i.distbits},U=ha(N6,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M),i.distbits=M.bits,U){e.msg="invalid distances set",i.mode=y1;break}if(i.mode=v3,t===p3)break e;case v3:i.mode=x3;case x3:if(l>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,Xv(e,m),s=e.next_out,n=e.output,d=e.avail_out,o=e.next_in,r=e.input,l=e.avail_in,c=i.hold,h=i.bits,i.mode===o2&&(i.back=-1);break}for(i.back=0;g=i.lencode[c&(1<<i.lenbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(y&&!(y&240)){for(b=p,N=y,A=x;g=i.lencode[A+((c&(1<<b+N)-1)>>b)],p=g>>>24,y=g>>>16&255,x=g&65535,!(b+p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=b,h-=b,i.back+=b}if(c>>>=p,h-=p,i.back+=p,i.length=x,y===0){i.mode=e4;break}if(y&32){i.back=-1,i.mode=o2;break}if(y&64){e.msg="invalid literal/length code",i.mode=y1;break}i.extra=y&15,i.mode=Q6;case Q6:if(i.extra){for(k=i.extra;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=J6;case J6:for(;g=i.distcode[c&(1<<i.distbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(!(y&240)){for(b=p,N=y,A=x;g=i.distcode[A+((c&(1<<b+N)-1)>>b)],p=g>>>24,y=g>>>16&255,x=g&65535,!(b+p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=b,h-=b,i.back+=b}if(c>>>=p,h-=p,i.back+=p,y&64){e.msg="invalid distance code",i.mode=y1;break}i.offset=x,i.extra=y&15,i.mode=K6;case K6:if(i.extra){for(k=i.extra;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=y1;break}i.mode=$6;case $6:if(d===0)break e;if(f=m-d,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=y1;break}f>i.wnext?(f-=i.wnext,v=i.wsize-f):v=i.wnext-f,f>i.length&&(f=i.length),_=i.window}else _=n,v=s-i.offset,f=i.length;f>d&&(f=d),d-=f,i.length-=f;do n[s++]=_[v++];while(--f);i.length===0&&(i.mode=x3);break;case e4:if(d===0)break e;n[s++]=i.length,d--,i.mode=x3;break;case b0:if(i.wrap){for(;h<32;){if(l===0)break e;l--,c|=r[o++]<<h,h+=8}if(m-=d,e.total_out+=m,i.total+=m,i.wrap&4&&m&&(e.adler=i.check=i.flags?V1(i.check,n,m,s-m):ia(i.check,n,m,s-m)),m=d,i.wrap&4&&(i.flags?c:n4(c))!==i.check){e.msg="incorrect data check",i.mode=y1;break}c=0,h=0}i.mode=t4;case t4:if(i.wrap&&i.flags){for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&4&&c!==(i.total&4294967295)){e.msg="incorrect length check",i.mode=y1;break}c=0,h=0}i.mode=i4;case i4:U=e9;break e;case y1:U=R6;break e;case r4:return D6;case a4:default:return Tt}return e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,(i.wsize||m!==e.avail_out&&i.mode<y1&&(i.mode<b0||t!==L6))&&h4(e,e.output,e.next_out,m-e.avail_out),u-=e.avail_in,m-=e.avail_out,e.total_in+=u,e.total_out+=m,i.total+=m,i.wrap&4&&m&&(e.adler=i.check=i.flags?V1(i.check,n,m,e.next_out-m):ia(i.check,n,m,e.next_out-m)),e.data_type=i.bits+(i.last?64:0)+(i.mode===o2?128:0)+(i.mode===v3||i.mode===E0?256:0),(u===0&&m===0||t===L6)&&U===$2&&(U=i9),U},h9=e=>{if(ei(e))return Tt;let t=e.state;return t.window&&(t.window=null),e.state=null,$2},u9=(e,t)=>{if(ei(e))return Tt;let i=e.state;return i.wrap&2?(i.head=t,t.done=!1,$2):Tt},m9=(e,t)=>{let i=t.length,r,n,o;return ei(e)||(r=e.state,r.wrap!==0&&r.mode!==_3)?Tt:r.mode===_3&&(n=1,n=ia(n,t,i,0),n!==r.check)?R6:(o=h4(e,t,i,i),o?(r.mode=r4,D6):(r.havedict=1,$2))},f9=s4,p9=l4,g9=o4,_9=l9,v9=c4,x9=d9,y9=h9,S9=u9,M9=m9,w9="pako inflate (from Nodeca project)",s2={inflateReset:f9,inflateReset2:p9,inflateResetKeep:g9,inflateInit:_9,inflateInit2:v9,inflate:x9,inflateEnd:y9,inflateGetHeader:S9,inflateSetDictionary:M9,inflateInfo:w9};function A9(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var E9=A9,u4=Object.prototype.toString,{Z_NO_FLUSH:b9,Z_FINISH:C9,Z_OK:ua,Z_STREAM_END:I0,Z_NEED_DICT:P0,Z_STREAM_ERROR:T9,Z_DATA_ERROR:m4,Z_MEM_ERROR:I9}=ra;function ma(e){this.options=u3.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(t.windowBits&15)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A6,this.strm.avail_out=0;let i=s2.inflateInit2(this.strm,t.windowBits);if(i!==ua)throw new Error(Xi[i]);if(this.header=new E9,s2.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=da.string2buf(t.dictionary):u4.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=s2.inflateSetDictionary(this.strm,t.dictionary),i!==ua)))throw new Error(Xi[i])}ma.prototype.push=function(e,t){let i=this.strm,r=this.options.chunkSize,n=this.options.dictionary,o,s,l;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?C9:b9,u4.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(i.avail_out===0&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),o=s2.inflate(i,s),o===P0&&n&&(o=s2.inflateSetDictionary(i,n),o===ua?o=s2.inflate(i,s):o===m4&&(o=P0));i.avail_in>0&&o===I0&&i.state.wrap>0&&e[i.next_in]!==0;)s2.inflateReset(i),o=s2.inflate(i,s);switch(o){case T9:case m4:case P0:case I9:return this.onEnd(o),this.ended=!0,!1}if(l=i.avail_out,i.next_out&&(i.avail_out===0||o===I0))if(this.options.to==="string"){let d=da.utf8border(i.output,i.next_out),c=i.next_out-d,h=da.buf2string(i.output,d);i.next_out=c,i.avail_out=r-c,c&&i.output.set(i.output.subarray(d,d+c),0),this.onData(h)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(!(o===ua&&l===0)){if(o===I0)return o=s2.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(i.avail_in===0)break}}return!0},ma.prototype.onData=function(e){this.chunks.push(e)},ma.prototype.onEnd=function(e){e===ua&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u3.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function N0(e,t){let i=new ma(t);if(i.push(e),i.err)throw i.msg||Xi[i.err];return i.result}function P9(e,t){return t=t||{},t.raw=!0,N0(e,t)}var N9=ma,L9=N0,R9=P9,D9=N0,U9=ra,k9={Inflate:N9,inflate:L9,inflateRaw:R9,ungzip:D9,constants:U9},{Inflate:VM,inflate:BM,inflateRaw:O9,ungzip:FM}=k9,z9=O9,V9=(Sr=class extends Event{constructor(t){super(Sr.EVENT_NAME),this.data=t}},Sr.EVENT_NAME="imageLoaderOptions",Sr),B9=class O4{static async fetchArrayBufferWithProgress(t,i){return i?await(await O4.fetchBlobWithProgress(t,i)).arrayBuffer():await(await fetch(t)).arrayBuffer()}static async fetchBlobWithProgress(t,i){var r;if(i){let n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! ${n.status}`);let o=Number(n.headers.get("Content-Length"));o||console.warn("No Content-Length header — cannot compute progress.");let s=(r=n.body)==null?void 0:r.getReader(),l=[],d=0;for(;;){let{done:c,value:h}=await s.read();if(c)break;l.push(h),d+=h.length,o&&i(d/o)}return new Blob(l)}else return await(await fetch(t)).blob()}},F9=`var ui=300;var Ee=1e3,de=1001,Gn=1002,Xe=1003;var Bt=1006;var fi=1008;var Ji=1009;var $i=1014,Ke=1015,Re=1016;var Ki=1020;var Cn=1023;var nn=1026,Wn=1027,di=1028;var qe=2300,Ye=2301,sn=2302,Xn=2400,qn=2401,Yn=2402;var Qe="",Qt="srgb",_e="srgb-linear",Qi="display-p3",pi="display-p3-linear",fn="linear",Zn="srgb",Jn="rec709",$n="p3";var ji=515;var ze=2e3,Kn=2001,Ze=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,t);t.target=null}}},ct=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var So=Math.PI/180,bo=180/Math.PI;function Rn(){let p=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ct[p&255]+ct[p>>8&255]+ct[p>>16&255]+ct[p>>24&255]+"-"+ct[t&255]+ct[t>>8&255]+"-"+ct[t>>16&15|64]+ct[t>>24&255]+"-"+ct[e&63|128]+ct[e>>8&255]+"-"+ct[e>>16&255]+ct[e>>24&255]+ct[n&255]+ct[n>>8&255]+ct[n>>16&255]+ct[n>>24&255]).toLowerCase()}function dt(p,t,e){return Math.max(t,Math.min(e,p))}function ts(p,t){return(p%t+t)%t}function rn(p,t,e){return(1-e)*p+e*t}var zt=class p{constructor(t=0,e=0){p.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(dt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*i+t.x,this.y=s*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},z=class p{constructor(t,e,n,i,s,a,c,l,o){p.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,c,l,o)}set(t,e,n,i,s,a,c,l,o){let u=this.elements;return u[0]=t,u[1]=i,u[2]=c,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=o,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],c=n[3],l=n[6],o=n[1],u=n[4],f=n[7],m=n[2],g=n[5],x=n[8],w=i[0],L=i[3],P=i[6],$=i[1],G=i[4],Y=i[7],O=i[2],K=i[5],V=i[8];return s[0]=a*w+c*$+l*O,s[3]=a*L+c*G+l*K,s[6]=a*P+c*Y+l*V,s[1]=o*w+u*$+f*O,s[4]=o*L+u*G+f*K,s[7]=o*P+u*Y+f*V,s[2]=m*w+g*$+x*O,s[5]=m*L+g*G+x*K,s[8]=m*P+g*Y+x*V,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8];return e*a*u-e*c*o-n*s*u+n*c*l+i*s*o-i*a*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8],f=u*a-c*o,m=c*l-u*s,g=o*s-a*l,x=e*f+n*m+i*g;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);let w=1/x;return t[0]=f*w,t[1]=(i*o-u*n)*w,t[2]=(c*n-i*a)*w,t[3]=m*w,t[4]=(u*e-i*l)*w,t[5]=(i*s-c*e)*w,t[6]=g*w,t[7]=(n*l-o*e)*w,t[8]=(a*e-n*s)*w,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,a,c){let l=Math.cos(s),o=Math.sin(s);return this.set(n*l,n*o,-n*(l*a+o*c)+a+t,-i*o,i*l,-i*(-o*a+l*c)+c+e,0,0,1),this}scale(t,e){return this.premultiply(an.makeScale(t,e)),this}rotate(t){return this.premultiply(an.makeRotation(-t)),this}translate(t,e){return this.premultiply(an.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},an=new z;function Qn(p){return document.createElementNS("http://www.w3.org/1999/xhtml",p)}var jn=new z().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),ti=new z().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ke={[_e]:{transfer:fn,primaries:Jn,toReference:p=>p,fromReference:p=>p},[Qt]:{transfer:Zn,primaries:Jn,toReference:p=>p.convertSRGBToLinear(),fromReference:p=>p.convertLinearToSRGB()},[pi]:{transfer:fn,primaries:$n,toReference:p=>p.applyMatrix3(ti),fromReference:p=>p.applyMatrix3(jn)},[Qi]:{transfer:Zn,primaries:$n,toReference:p=>p.convertSRGBToLinear().applyMatrix3(ti),fromReference:p=>p.applyMatrix3(jn).convertLinearToSRGB()}},es=new Set([_e,pi]),At={enabled:!0,_workingColorSpace:_e,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(p){if(!es.has(p))throw new Error(\`Unsupported working color space, "\${p}".\`);this._workingColorSpace=p},convert:function(p,t,e){if(this.enabled===!1||t===e||!t||!e)return p;let n=ke[t].toReference,i=ke[e].fromReference;return i(n(p))},fromWorkingColorSpace:function(p,t){return this.convert(p,this._workingColorSpace,t)},toWorkingColorSpace:function(p,t){return this.convert(p,t,this._workingColorSpace)},getPrimaries:function(p){return ke[p].primaries},getTransfer:function(p){return p===Qe?fn:ke[p].transfer}};function pe(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}function on(p){return p<.0031308?p*12.92:1.055*Math.pow(p,.41666)-.055}var le,dn=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{le===void 0&&(le=Qn("canvas")),le.width=t.width,le.height=t.height;let n=le.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=le}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Qn("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=pe(s[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(pe(e[n]/255)*255):e[n]=pe(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},ns=0,pn=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ns++}),this.uuid=Rn(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,c=i.length;a<c;a++)i[a].isDataTexture?s.push(ln(i[a].image)):s.push(ln(i[a]))}else s=ln(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function ln(p){return typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&p instanceof ImageBitmap?dn.getDataURL(p):p.data?{data:Array.from(p.data),width:p.width,height:p.height,type:p.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var is=0,ne=class p extends Ze{constructor(t=p.DEFAULT_IMAGE,e=p.DEFAULT_MAPPING,n=de,i=de,s=Bt,a=fi,c=Cn,l=Ji,o=p.DEFAULT_ANISOTROPY,u=Qe){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:is++}),this.uuid=Rn(),this.name="",this.source=new pn(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=o,this.format=c,this.internalFormat=null,this.type=l,this.offset=new zt(0,0),this.repeat=new zt(1,1),this.center=new zt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new z,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ui)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ee:t.x=t.x-Math.floor(t.x);break;case de:t.x=t.x<0?0:1;break;case Gn:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Ee:t.y=t.y-Math.floor(t.y);break;case de:t.y=t.y<0?0:1;break;case Gn:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};ne.DEFAULT_IMAGE=null;ne.DEFAULT_MAPPING=ui;ne.DEFAULT_ANISOTROPY=1;var te=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,a,c){let l=n[i+0],o=n[i+1],u=n[i+2],f=n[i+3],m=s[a+0],g=s[a+1],x=s[a+2],w=s[a+3];if(c===0){t[e+0]=l,t[e+1]=o,t[e+2]=u,t[e+3]=f;return}if(c===1){t[e+0]=m,t[e+1]=g,t[e+2]=x,t[e+3]=w;return}if(f!==w||l!==m||o!==g||u!==x){let L=1-c,P=l*m+o*g+u*x+f*w,$=P>=0?1:-1,G=1-P*P;if(G>Number.EPSILON){let O=Math.sqrt(G),K=Math.atan2(O,P*$);L=Math.sin(L*K)/O,c=Math.sin(c*K)/O}let Y=c*$;if(l=l*L+m*Y,o=o*L+g*Y,u=u*L+x*Y,f=f*L+w*Y,L===1-c){let O=1/Math.sqrt(l*l+o*o+u*u+f*f);l*=O,o*=O,u*=O,f*=O}}t[e]=l,t[e+1]=o,t[e+2]=u,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,a){let c=n[i],l=n[i+1],o=n[i+2],u=n[i+3],f=s[a],m=s[a+1],g=s[a+2],x=s[a+3];return t[e]=c*x+u*f+l*g-o*m,t[e+1]=l*x+u*m+o*f-c*g,t[e+2]=o*x+u*g+c*m-l*f,t[e+3]=u*x-c*f-l*m-o*g,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,a=t._order,c=Math.cos,l=Math.sin,o=c(n/2),u=c(i/2),f=c(s/2),m=l(n/2),g=l(i/2),x=l(s/2);switch(a){case"XYZ":this._x=m*u*f+o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f-m*g*x;break;case"YXZ":this._x=m*u*f+o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f+m*g*x;break;case"ZXY":this._x=m*u*f-o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f-m*g*x;break;case"ZYX":this._x=m*u*f-o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f+m*g*x;break;case"YZX":this._x=m*u*f+o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f-m*g*x;break;case"XZY":this._x=m*u*f-o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f+m*g*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],a=e[1],c=e[5],l=e[9],o=e[2],u=e[6],f=e[10],m=n+c+f;if(m>0){let g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(u-l)*g,this._y=(s-o)*g,this._z=(a-i)*g}else if(n>c&&n>f){let g=2*Math.sqrt(1+n-c-f);this._w=(u-l)/g,this._x=.25*g,this._y=(i+a)/g,this._z=(s+o)/g}else if(c>f){let g=2*Math.sqrt(1+c-n-f);this._w=(s-o)/g,this._x=(i+a)/g,this._y=.25*g,this._z=(l+u)/g}else{let g=2*Math.sqrt(1+f-n-c);this._w=(a-i)/g,this._x=(s+o)/g,this._y=(l+u)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(dt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,a=t._w,c=e._x,l=e._y,o=e._z,u=e._w;return this._x=n*u+a*c+i*o-s*l,this._y=i*u+a*l+s*c-n*o,this._z=s*u+a*o+n*l-i*c,this._w=a*u-n*c-i*l-s*o,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,a=this._w,c=a*t._w+n*t._x+i*t._y+s*t._z;if(c<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,c=-c):this.copy(t),c>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;let l=1-c*c;if(l<=Number.EPSILON){let g=1-e;return this._w=g*a+e*this._w,this._x=g*n+e*this._x,this._y=g*i+e*this._y,this._z=g*s+e*this._z,this.normalize(),this}let o=Math.sqrt(l),u=Math.atan2(o,c),f=Math.sin((1-e)*u)/o,m=Math.sin(e*u)/o;return this._w=a*f+this._w*m,this._x=n*f+this._x*m,this._y=i*f+this._y*m,this._z=s*f+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},q=class p{constructor(t=0,e=0,n=0){p.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ei.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ei.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,a=t.y,c=t.z,l=t.w,o=2*(a*i-c*n),u=2*(c*e-s*i),f=2*(s*n-a*e);return this.x=e+l*o+a*f-c*u,this.y=n+l*u+c*o-s*f,this.z=i+l*f+s*u-a*o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,a=e.x,c=e.y,l=e.z;return this.x=i*l-s*c,this.y=s*a-n*l,this.z=n*c-i*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return cn.copy(this).projectOnVector(t),this.sub(cn)}reflect(t){return this.sub(cn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(dt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},cn=new q,ei=new te;var jt=class p{constructor(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L){p.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L)}set(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L){let P=this.elements;return P[0]=t,P[4]=e,P[8]=n,P[12]=i,P[1]=s,P[5]=a,P[9]=c,P[13]=l,P[2]=o,P[6]=u,P[10]=f,P[14]=m,P[3]=g,P[7]=x,P[11]=w,P[15]=L,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 p().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/ce.setFromMatrixColumn(t,0).length(),s=1/ce.setFromMatrixColumn(t,1).length(),a=1/ce.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,a=Math.cos(n),c=Math.sin(n),l=Math.cos(i),o=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let m=a*u,g=a*f,x=c*u,w=c*f;e[0]=l*u,e[4]=-l*f,e[8]=o,e[1]=g+x*o,e[5]=m-w*o,e[9]=-c*l,e[2]=w-m*o,e[6]=x+g*o,e[10]=a*l}else if(t.order==="YXZ"){let m=l*u,g=l*f,x=o*u,w=o*f;e[0]=m+w*c,e[4]=x*c-g,e[8]=a*o,e[1]=a*f,e[5]=a*u,e[9]=-c,e[2]=g*c-x,e[6]=w+m*c,e[10]=a*l}else if(t.order==="ZXY"){let m=l*u,g=l*f,x=o*u,w=o*f;e[0]=m-w*c,e[4]=-a*f,e[8]=x+g*c,e[1]=g+x*c,e[5]=a*u,e[9]=w-m*c,e[2]=-a*o,e[6]=c,e[10]=a*l}else if(t.order==="ZYX"){let m=a*u,g=a*f,x=c*u,w=c*f;e[0]=l*u,e[4]=x*o-g,e[8]=m*o+w,e[1]=l*f,e[5]=w*o+m,e[9]=g*o-x,e[2]=-o,e[6]=c*l,e[10]=a*l}else if(t.order==="YZX"){let m=a*l,g=a*o,x=c*l,w=c*o;e[0]=l*u,e[4]=w-m*f,e[8]=x*f+g,e[1]=f,e[5]=a*u,e[9]=-c*u,e[2]=-o*u,e[6]=g*f+x,e[10]=m-w*f}else if(t.order==="XZY"){let m=a*l,g=a*o,x=c*l,w=c*o;e[0]=l*u,e[4]=-f,e[8]=o*u,e[1]=m*f+w,e[5]=a*u,e[9]=g*f-x,e[2]=x*f-g,e[6]=c*u,e[10]=w*f+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ss,t,rs)}lookAt(t,e,n){let i=this.elements;return _t.subVectors(t,e),_t.lengthSq()===0&&(_t.z=1),_t.normalize(),$t.crossVectors(n,_t),$t.lengthSq()===0&&(Math.abs(n.z)===1?_t.x+=1e-4:_t.z+=1e-4,_t.normalize(),$t.crossVectors(n,_t)),$t.normalize(),Ve.crossVectors(_t,$t),i[0]=$t.x,i[4]=Ve.x,i[8]=_t.x,i[1]=$t.y,i[5]=Ve.y,i[9]=_t.y,i[2]=$t.z,i[6]=Ve.z,i[10]=_t.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],c=n[4],l=n[8],o=n[12],u=n[1],f=n[5],m=n[9],g=n[13],x=n[2],w=n[6],L=n[10],P=n[14],$=n[3],G=n[7],Y=n[11],O=n[15],K=i[0],V=i[4],Et=i[8],vt=i[12],It=i[1],it=i[5],at=i[9],kt=i[13],xt=i[2],Vt=i[6],mt=i[10],yt=i[14],Lt=i[3],ut=i[7],ft=i[11],Ut=i[15];return s[0]=a*K+c*It+l*xt+o*Lt,s[4]=a*V+c*it+l*Vt+o*ut,s[8]=a*Et+c*at+l*mt+o*ft,s[12]=a*vt+c*kt+l*yt+o*Ut,s[1]=u*K+f*It+m*xt+g*Lt,s[5]=u*V+f*it+m*Vt+g*ut,s[9]=u*Et+f*at+m*mt+g*ft,s[13]=u*vt+f*kt+m*yt+g*Ut,s[2]=x*K+w*It+L*xt+P*Lt,s[6]=x*V+w*it+L*Vt+P*ut,s[10]=x*Et+w*at+L*mt+P*ft,s[14]=x*vt+w*kt+L*yt+P*Ut,s[3]=$*K+G*It+Y*xt+O*Lt,s[7]=$*V+G*it+Y*Vt+O*ut,s[11]=$*Et+G*at+Y*mt+O*ft,s[15]=$*vt+G*kt+Y*yt+O*Ut,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],a=t[1],c=t[5],l=t[9],o=t[13],u=t[2],f=t[6],m=t[10],g=t[14],x=t[3],w=t[7],L=t[11],P=t[15];return x*(+s*l*f-i*o*f-s*c*m+n*o*m+i*c*g-n*l*g)+w*(+e*l*g-e*o*m+s*a*m-i*a*g+i*o*u-s*l*u)+L*(+e*o*f-e*c*g-s*a*f+n*a*g+s*c*u-n*o*u)+P*(-i*c*u-e*l*f+e*c*m+i*a*f-n*a*m+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8],f=t[9],m=t[10],g=t[11],x=t[12],w=t[13],L=t[14],P=t[15],$=f*L*o-w*m*o+w*l*g-c*L*g-f*l*P+c*m*P,G=x*m*o-u*L*o-x*l*g+a*L*g+u*l*P-a*m*P,Y=u*w*o-x*f*o+x*c*g-a*w*g-u*c*P+a*f*P,O=x*f*l-u*w*l-x*c*m+a*w*m+u*c*L-a*f*L,K=e*$+n*G+i*Y+s*O;if(K===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let V=1/K;return t[0]=$*V,t[1]=(w*m*s-f*L*s-w*i*g+n*L*g+f*i*P-n*m*P)*V,t[2]=(c*L*s-w*l*s+w*i*o-n*L*o-c*i*P+n*l*P)*V,t[3]=(f*l*s-c*m*s-f*i*o+n*m*o+c*i*g-n*l*g)*V,t[4]=G*V,t[5]=(u*L*s-x*m*s+x*i*g-e*L*g-u*i*P+e*m*P)*V,t[6]=(x*l*s-a*L*s-x*i*o+e*L*o+a*i*P-e*l*P)*V,t[7]=(a*m*s-u*l*s+u*i*o-e*m*o-a*i*g+e*l*g)*V,t[8]=Y*V,t[9]=(x*f*s-u*w*s-x*n*g+e*w*g+u*n*P-e*f*P)*V,t[10]=(a*w*s-x*c*s+x*n*o-e*w*o-a*n*P+e*c*P)*V,t[11]=(u*c*s-a*f*s-u*n*o+e*f*o+a*n*g-e*c*g)*V,t[12]=O*V,t[13]=(u*w*i-x*f*i+x*n*m-e*w*m-u*n*L+e*f*L)*V,t[14]=(x*c*i-a*w*i-x*n*l+e*w*l+a*n*L-e*c*L)*V,t[15]=(a*f*i-u*c*i+u*n*l-e*f*l-a*n*m+e*c*m)*V,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,a=t.x,c=t.y,l=t.z,o=s*a,u=s*c;return this.set(o*a+n,o*c-i*l,o*l+i*c,0,o*c+i*l,u*c+n,u*l-i*a,0,o*l-i*c,u*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,a){return this.set(1,n,s,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,a=e._y,c=e._z,l=e._w,o=s+s,u=a+a,f=c+c,m=s*o,g=s*u,x=s*f,w=a*u,L=a*f,P=c*f,$=l*o,G=l*u,Y=l*f,O=n.x,K=n.y,V=n.z;return i[0]=(1-(w+P))*O,i[1]=(g+Y)*O,i[2]=(x-G)*O,i[3]=0,i[4]=(g-Y)*K,i[5]=(1-(m+P))*K,i[6]=(L+$)*K,i[7]=0,i[8]=(x+G)*V,i[9]=(L-$)*V,i[10]=(1-(m+w))*V,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=ce.set(i[0],i[1],i[2]).length(),a=ce.set(i[4],i[5],i[6]).length(),c=ce.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],Tt.copy(this);let o=1/s,u=1/a,f=1/c;return Tt.elements[0]*=o,Tt.elements[1]*=o,Tt.elements[2]*=o,Tt.elements[4]*=u,Tt.elements[5]*=u,Tt.elements[6]*=u,Tt.elements[8]*=f,Tt.elements[9]*=f,Tt.elements[10]*=f,e.setFromRotationMatrix(Tt),n.x=s,n.y=a,n.z=c,this}makePerspective(t,e,n,i,s,a,c=ze){let l=this.elements,o=2*s/(e-t),u=2*s/(n-i),f=(e+t)/(e-t),m=(n+i)/(n-i),g,x;if(c===ze)g=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(c===Kn)g=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return l[0]=o,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=m,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=x,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,a,c=ze){let l=this.elements,o=1/(e-t),u=1/(n-i),f=1/(a-s),m=(e+t)*o,g=(n+i)*u,x,w;if(c===ze)x=(a+s)*f,w=-2*f;else if(c===Kn)x=s*f,w=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return l[0]=2*o,l[4]=0,l[8]=0,l[12]=-m,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=w,l[14]=-x,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},ce=new q,Tt=new jt,ss=new q(0,0,0),rs=new q(1,1,1),$t=new q,Ve=new q,_t=new q,ni=new jt,ii=new te,Je=class p{constructor(t=0,e=0,n=0,i=p.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],a=i[4],c=i[8],l=i[1],o=i[5],u=i[9],f=i[2],m=i[6],g=i[10];switch(e){case"XYZ":this._y=Math.asin(dt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,g),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(m,o),this._z=0);break;case"YXZ":this._x=Math.asin(-dt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(l,o)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(dt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-f,g),this._z=Math.atan2(-a,o)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-dt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,o));break;case"YZX":this._z=Math.asin(dt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,o),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-dt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(m,o),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-u,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return ni.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ni,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ii.setFromEuler(this),this.setFromQuaternion(ii,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Je.DEFAULT_ORDER="XYZ";var mn=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},as=0,si=new q,he=new te,Xt=new jt,He=new q,we=new q,os=new q,ls=new te,ri=new q(1,0,0),ai=new q(0,1,0),oi=new q(0,0,1),li={type:"added"},cs={type:"removed"},ue={type:"childadded",child:null},hn={type:"childremoved",child:null},Ae=class p extends Ze{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:as++}),this.uuid=Rn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=p.DEFAULT_UP.clone();let t=new q,e=new Je,n=new te,i=new q(1,1,1);function s(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new jt},normalMatrix:{value:new z}}),this.matrix=new jt,this.matrixWorld=new jt,this.matrixAutoUpdate=p.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=p.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new mn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return he.setFromAxisAngle(t,e),this.quaternion.multiply(he),this}rotateOnWorldAxis(t,e){return he.setFromAxisAngle(t,e),this.quaternion.premultiply(he),this}rotateX(t){return this.rotateOnAxis(ri,t)}rotateY(t){return this.rotateOnAxis(ai,t)}rotateZ(t){return this.rotateOnAxis(oi,t)}translateOnAxis(t,e){return si.copy(t).applyQuaternion(this.quaternion),this.position.add(si.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ri,t)}translateY(t){return this.translateOnAxis(ai,t)}translateZ(t){return this.translateOnAxis(oi,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xt.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?He.copy(t):He.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),we.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xt.lookAt(we,He,this.up):Xt.lookAt(He,we,this.up),this.quaternion.setFromRotationMatrix(Xt),i&&(Xt.extractRotation(i.matrixWorld),he.setFromRotationMatrix(Xt),this.quaternion.premultiply(he.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(li),ue.child=t,this.dispatchEvent(ue),ue.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(cs),hn.child=t,this.dispatchEvent(hn),hn.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xt.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Xt.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xt),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(li),ue.child=t,this.dispatchEvent(ue),ue.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(we,t,os),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(we,ls,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,a=i.length;s<a;s++){let c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,l){return c[l.uuid]===void 0&&(c[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let l=c.shapes;if(Array.isArray(l))for(let o=0,u=l.length;o<u;o++){let f=l[o];s(t.shapes,f)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let l=0,o=this.material.length;l<o;l++)c.push(s(t.materials,this.material[l]));i.material=c}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let l=this.animations[c];i.animations.push(s(t.animations,l))}}if(e){let c=a(t.geometries),l=a(t.materials),o=a(t.textures),u=a(t.images),f=a(t.shapes),m=a(t.skeletons),g=a(t.animations),x=a(t.nodes);c.length>0&&(n.geometries=c),l.length>0&&(n.materials=l),o.length>0&&(n.textures=o),u.length>0&&(n.images=u),f.length>0&&(n.shapes=f),m.length>0&&(n.skeletons=m),g.length>0&&(n.animations=g),x.length>0&&(n.nodes=x)}return n.object=i,n;function a(c){let l=[];for(let o in c){let u=c[o];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};Ae.DEFAULT_UP=new q(0,1,0);Ae.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ae.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var mi={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},Kt={h:0,s:0,l:0},Ge={h:0,s:0,l:0};function un(p,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?p+(t-p)*6*e:e<1/2?t:e<2/3?p+(t-p)*6*(2/3-e):p}var ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Qt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,At.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=At.workingColorSpace){return this.r=t,this.g=e,this.b=n,At.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=At.workingColorSpace){if(t=ts(t,1),e=dt(e,0,1),n=dt(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=un(a,s,t+1/3),this.g=un(a,s,t),this.b=un(a,s,t-1/3)}return At.toWorkingColorSpace(this,i),this}setStyle(t,e=Qt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\\w+)\\(([^\\)]*)\\)/.exec(t)){let s,a=i[1],c=i[2];switch(a){case"rgb":case"rgba":if(s=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(t)){let s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Qt){let n=mi[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=pe(t.r),this.g=pe(t.g),this.b=pe(t.b),this}copyLinearToSRGB(t){return this.r=on(t.r),this.g=on(t.g),this.b=on(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Qt){return At.fromWorkingColorSpace(ht.copy(this),t),Math.round(dt(ht.r*255,0,255))*65536+Math.round(dt(ht.g*255,0,255))*256+Math.round(dt(ht.b*255,0,255))}getHexString(t=Qt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=At.workingColorSpace){At.fromWorkingColorSpace(ht.copy(this),e);let n=ht.r,i=ht.g,s=ht.b,a=Math.max(n,i,s),c=Math.min(n,i,s),l,o,u=(c+a)/2;if(c===a)l=0,o=0;else{let f=a-c;switch(o=u<=.5?f/(a+c):f/(2-a-c),a){case n:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-n)/f+2;break;case s:l=(n-i)/f+4;break}l/=6}return t.h=l,t.s=o,t.l=u,t}getRGB(t,e=At.workingColorSpace){return At.fromWorkingColorSpace(ht.copy(this),e),t.r=ht.r,t.g=ht.g,t.b=ht.b,t}getStyle(t=Qt){At.fromWorkingColorSpace(ht.copy(this),t);let e=ht.r,n=ht.g,i=ht.b;return t!==Qt?\`color(\${t} \${e.toFixed(3)} \${n.toFixed(3)} \${i.toFixed(3)})\`:\`rgb(\${Math.round(e*255)},\${Math.round(n*255)},\${Math.round(i*255)})\`}offsetHSL(t,e,n){return this.getHSL(Kt),this.setHSL(Kt.h+t,Kt.s+e,Kt.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Kt),t.getHSL(Ge);let n=rn(Kt.h,Ge.h,e),i=rn(Kt.s,Ge.s,e),s=rn(Kt.l,Ge.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ht=new ot;ot.NAMES=mi;var Yt=hs();function hs(){let p=new ArrayBuffer(4),t=new Float32Array(p),e=new Uint32Array(p),n=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){let o=l-127;o<-27?(n[l]=0,n[l|256]=32768,i[l]=24,i[l|256]=24):o<-14?(n[l]=1024>>-o-14,n[l|256]=1024>>-o-14|32768,i[l]=-o-1,i[l|256]=-o-1):o<=15?(n[l]=o+15<<10,n[l|256]=o+15<<10|32768,i[l]=13,i[l|256]=13):o<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}let s=new Uint32Array(2048),a=new Uint32Array(64),c=new Uint32Array(64);for(let l=1;l<1024;++l){let o=l<<13,u=0;for(;(o&8388608)===0;)o<<=1,u-=8388608;o&=-8388609,u+=947912704,s[l]=o|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(c[l]=1024);return{floatView:t,uint32View:e,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:c}}function us(p){Math.abs(p)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),p=dt(p,-65504,65504),Yt.floatView[0]=p;let t=Yt.uint32View[0],e=t>>23&511;return Yt.baseTable[e]+((t&8388607)>>Yt.shiftTable[e])}function fs(p){let t=p>>10;return Yt.uint32View[0]=Yt.mantissaTable[Yt.offsetTable[t]+(p&1023)]+Yt.exponentTable[t],Yt.floatView[0]}var Pn={toHalfFloat:us,fromHalfFloat:fs};function ds(p){let t={};for(let e in p){t[e]={};for(let n in p[e]){let i=p[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function pt(p){let t={};for(let e=0;e<p.length;e++){let n=ds(p[e]);for(let i in n)t[i]=n[i]}return t}var ps=\`#ifdef USE_ALPHAHASH
4617
+ `;return new x1({uniforms:e,vertexShader:t,fragmentShader:i,side:Nt})}},Yn=(hr=class extends Event{constructor(t,i,r,n){super(hr.EVENT_NAME),this.from=t,this.to=i,this.rotate=r,this.animate=n}},hr.EVENT_NAME="dataPointChanged",hr),zl=(ur=class extends Event{constructor(t){super(ur.EVENT_NAME),this.data=t}},ur.EVENT_NAME="panoramaTransitionRendererPluginOptions",ur),s3=class A3{static linear(t){return t}static easeIn(t){return t*t}static easeOut(t){return t*(2-t)}static easeInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}static bounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static moveTowards(t,i,r){let n=i-t,o=Math.abs(n)<=r?n:Math.sign(n)*r;return t+o}static lerpAngleRadians(t,i,r){let n=Math.PI,o=(i-t+n+2*n)%(2*n)-n;return t+o*r}static lerpEuler(t,i,r){let n=new k1;return n.x=A3.lerpAngleRadians(t.x,i.x,r),n.y=A3.lerpAngleRadians(t.y,i.y,r),n.z=A3.lerpAngleRadians(t.z,i.z,r),n.order=t.order,n}};function S7(e){return e&&typeof e=="object"&&"transitionMovementScale"in e}var M7=class extends a2{constructor(e){super(),this.name="panoramaTransitionRendererPlugin",this.options={transitionMovementScale:1.3},this.panoramaTransitionRendererPluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.dataPointChangedEventHandler=this.onDataPointChanged.bind(this),this.rotate=!1,this.percentage=0,this.percentageMovement=0,this.currentCamRotation=new k1,this.nextCamRotation=new k1,this.currentAlpha=0,this.nextAlpha=0,this.sceneFrom=new S2,this.sceneTo=new S2,this.startLocation=new I,this.endLocation=new I,this.setOptions(e||{})}async register(e){await super.register(e),this.main.addEventListener(Yn.EVENT_NAME,this.dataPointChangedEventHandler),this.main.addEventListener(zl.EVENT_NAME,this.panoramaTransitionRendererPluginOptionsEventHandler)}setOptions(e){this.options.transitionMovementScale=e.transitionMovementScale??this.options.transitionMovementScale}async dispose(){await super.dispose(),this.main.removeEventListener(Yn.EVENT_NAME,this.dataPointChangedEventHandler),this.main.removeEventListener(zl.EVENT_NAME,this.panoramaTransitionRendererPluginOptionsEventHandler),this.from&&(bt.instance.disposeMaterial(this.from.depthMaterial),this.from.sphere&&bt.instance.disposeGeometry(this.from.sphere.geometry)),this.to&&(bt.instance.disposeMaterial(this.to.depthMaterial),this.to.sphere&&bt.instance.disposeGeometry(this.to.sphere.geometry))}onDataPointChanged({rotate:e,animate:t}){this.rotate=e,this.main.loadDataPoint({animateFunction:t?this.animate.bind(this):void 0,rotation:this.rotate})}async animate(e){let t=new Promise(i=>{this.resolver=i});return this.percentage=-1,this.percentageMovement=0,this.animation=e,this.from=this.createPanoramaSphere(e.from),this.to=this.createPanoramaSphere(e.to),this.sceneFrom.add(this.from.sphere),this.sceneTo.add(this.to.sphere),this.startLocation=e.from.position.clone(),this.endLocation=e.to.position.clone(),this.currentCamRotation.set(e.from.rotation.x,e.from.rotation.y,e.from.rotation.z),this.nextCamRotation.set(e.to.rotation.x,e.to.rotation.y,e.to.rotation.z),t}createPanoramaSphere(e){let t=new r8(1,500,500);bt.instance.registerGeometry(t,"Panorama3DLayer sphere"),t.scale(-1,1,1),t.rotateY(-Math.PI/2);let i=t.attributes.position,r=new Float32Array(i.count*3);if(e.depth)for(let s=0;s<i.count;s++){let l=new I(i.array[s*3],i.array[s*3+1],i.array[s*3+2]),d=Math.min(100,e.depth.getDepth(l));r[s*3]=l.x*d,r[s*3+1]=l.y*d,r[s*3+2]=l.z*d}t.attributes.position=new W1(r,3);let n=Xn.getMaterial(Xn,{map:e.texture}),o=new v1(t,n);return o.position.copy(e.position),{depthMaterial:n,sphere:o}}calculateTransition(e){let t=.7000000000000001;this.percentage=Math.min(1,e);let i=Math.max(0,Math.min(1,(this.percentage-.1)/t));this.percentageMovement=s3.easeInOut(i),this.currentAlpha=this.nextAlpha=0,this.percentage<.1&&(this.currentAlpha=1-this.percentage/.1),this.percentage>.8&&(this.nextAlpha=(this.percentage-.8)/(1-.8))}getTransform(){let e={camera:{}},t=new I;if(t.lerpVectors(this.startLocation,this.endLocation,this.percentageMovement),e.camera.position=t,this.rotate){let i=s3.lerpEuler(this.currentCamRotation,this.nextCamRotation,this.percentageMovement);e.camera.rotation=i}return e.panorama={currentPanorama:this.animation.from.texture,nextPanorama:this.animation.to.texture,currentSphere:this.main.panoramaRenderTargetFrom.texture,nextSphere:this.main.panoramaRenderTargetTo.texture,percentage:this.percentageMovement,currentAlpha:this.currentAlpha,nextAlpha:this.nextAlpha,isTransition:!0},this.percentage>=1&&(this.percentage=1,bt.instance.disposeMaterial(this.from.depthMaterial),bt.instance.disposeMaterial(this.to.depthMaterial),bt.instance.disposeGeometry(this.from.sphere.geometry),bt.instance.disposeGeometry(this.to.sphere.geometry),this.sceneFrom.remove(this.from.sphere),this.sceneTo.remove(this.to.sphere),delete this.animation,this.resolver(),delete this.resolver),e}update(){return this.animation&&(this.percentage===-1?this.calculateTransition(0):this.calculateTransition(this.percentage===0?.001:this.percentage+this.main.deltaTime*this.options.transitionMovementScale)),{...this.animation?this.getTransform():{},layerlessRenderLayer:[{scene:this.sceneFrom,renderTarget:this.main.panoramaRenderTargetFrom,camera:this.main.camera},{scene:this.sceneTo,renderTarget:this.main.panoramaRenderTargetTo,camera:this.main.camera}]}}},w7=(mr=class extends Event{constructor(t){super(mr.EVENT_NAME),this.data=t}},mr.EVENT_NAME="frontendMarkersUpdate",mr),A7=class extends a2{constructor(){super(...arguments),this.name="frontendMarkersPlugin",this.markers=[],this.orthoCamera=null,this.prevCameraRot=new k1(NaN,NaN,NaN,"XYZ"),this.prevCameraPos=new I(NaN,NaN,NaN)}async register(e){await super.register(e);let t=1;this.orthoCamera=new zt(-t,t,t,-t,1,1e3),this.orthoCamera.position.set(0,0,10),this.orthoCamera.lookAt(0,0,0)}updateMarkers(e){this.markers=e,this.prevCameraRot=new k1(NaN,NaN,NaN,"XYZ"),this.prevCameraPos=new I(NaN,NaN,NaN)}update(){let e=[],t=this.main.camera.rotation,i=this.main.camera.position;if(!(t.equals(this.prevCameraRot)&&i.equals(this.prevCameraPos))){this.prevCameraPos=i.clone(),this.prevCameraRot=t.clone();let r=new I;this.markers.forEach(({position:n,id:o})=>{let s=new I(n.x,n.y,n.z);r.subVectors(s,i);let l=r.length();r.normalize();let d=this.main.getCurrentDataPoint().textureHandler.getDepth().getDepth(r),c=s.project(this.main.camera);if(c.z>=-1&&c.z<=1){let h=this.main.renderer.domElement.clientWidth/2,u=this.main.renderer.domElement.clientHeight/2,m=(c.x*h+h)/h-1,f=((-(c.y*u)+u)/u-1)*-1;e.push({id:o,position:{x:n.x,y:n.y,z:n.z},normalizedPosition:{x:c.x,y:c.y},screenPosition:{x:m,y:f},occluded:!(d>l-.5),visible:m>=-1&&m<=1&&f>=-1&&f<=1})}this.main.dispatchEvent(new w7(e))})}return{postProcessingRenderLayer:{renderTarget:this.renderTarget,scene:this.scene,camera:this.orthoCamera,type:4}}}},Vl="data:image/png;base64,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",E7="data:image/png;base64,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";function Bl(e,t){if(t===hh)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===G3||t===Xo){let i=e.getIndex();if(i===null){let s=[],l=e.getAttribute("position");if(l!==void 0){for(let d=0;d<l.count;d++)s.push(d);e.setIndex(s),i=e.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e}let r=i.count-2,n=[];if(t===G3)for(let s=1;s<=r;s++)n.push(i.getX(0)),n.push(i.getX(s)),n.push(i.getX(s+1));else for(let s=0;s<r;s++)s%2===0?(n.push(i.getX(s)),n.push(i.getX(s+1)),n.push(i.getX(s+2))):(n.push(i.getX(s+2)),n.push(i.getX(s+1)),n.push(i.getX(s)));n.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");let o=e.clone();return o.setIndex(n),o.clearGroups(),o}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}var b7=class extends Bi{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new N7(t)}),this.register(function(t){return new B7(t)}),this.register(function(t){return new F7(t)}),this.register(function(t){return new H7(t)}),this.register(function(t){return new R7(t)}),this.register(function(t){return new D7(t)}),this.register(function(t){return new U7(t)}),this.register(function(t){return new k7(t)}),this.register(function(t){return new P7(t)}),this.register(function(t){return new O7(t)}),this.register(function(t){return new L7(t)}),this.register(function(t){return new V7(t)}),this.register(function(t){return new z7(t)}),this.register(function(t){return new T7(t)}),this.register(function(t){return new G7(t)}),this.register(function(t){return new W7(t)})}load(e,t,i,r){let n=this,o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){let d=Wr.extractUrlBase(e);o=Wr.resolveURL(d,this.path)}else o=Wr.extractUrlBase(e);this.manager.itemStart(e);let s=function(d){r?r(d):console.error(d),n.manager.itemError(e),n.manager.itemEnd(e)},l=new Al(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(d){try{n.parse(d,o,function(c){t(c),n.manager.itemEnd(e)},s)}catch(c){s(c)}},i,s)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,i,r){let n,o={},s={},l=new TextDecoder;if(typeof e=="string")n=JSON.parse(e);else if(e instanceof ArrayBuffer)if(l.decode(new Uint8Array(e,0,4))===Fl){try{o[qe.KHR_BINARY_GLTF]=new j7(e)}catch(c){r&&r(c);return}n=JSON.parse(o[qe.KHR_BINARY_GLTF].content)}else n=JSON.parse(l.decode(e));else n=e;if(n.asset===void 0||n.asset.version[0]<2){r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let d=new a_(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});d.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c<this.pluginCallbacks.length;c++){let h=this.pluginCallbacks[c](d);h.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),s[h.name]=h,o[h.name]=!0}if(n.extensionsUsed)for(let c=0;c<n.extensionsUsed.length;++c){let h=n.extensionsUsed[c],u=n.extensionsRequired||[];switch(h){case qe.KHR_MATERIALS_UNLIT:o[h]=new I7;break;case qe.KHR_DRACO_MESH_COMPRESSION:o[h]=new X7(n,this.dracoLoader);break;case qe.KHR_TEXTURE_TRANSFORM:o[h]=new Y7;break;case qe.KHR_MESH_QUANTIZATION:o[h]=new q7;break;default:u.indexOf(h)>=0&&s[h]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+h+'".')}}d.setExtensions(o),d.setPlugins(s),d.parse(i,r)}parseAsync(e,t){let i=this;return new Promise(function(r,n){i.parse(e,t,r,n)})}};function C7(){let e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var qe={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},T7=class{constructor(e){this.parser=e,this.name=qe.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let i=0,r=t.length;i<r;i++){let n=t[i];n.extensions&&n.extensions[this.name]&&n.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(e){let t=this.parser,i="light:"+e,r=t.cache.get(i);if(r)return r;let n=t.json,o=((n.extensions&&n.extensions[this.name]||{}).lights||[])[e],s,l=new Ue(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],U1);let d=o.range!==void 0?o.range:0;switch(o.type){case"directional":s=new M8(l),s.target.position.set(0,0,-1),s.add(s.target);break;case"point":s=new y8(l),s.distance=d;break;case"spot":s=new v8(l),s.distance=d,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,s.angle=o.spot.outerConeAngle,s.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return s.position.set(0,0,0),s.decay=2,E2(s,o),o.intensity!==void 0&&(s.intensity=o.intensity),s.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(s),t.cache.add(i,r),r}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){let t=this,i=this.parser,r=i.json.nodes[e],n=(r.extensions&&r.extensions[this.name]||{}).light;return n===void 0?null:this._loadLight(n).then(function(o){return i._getNodeRef(t.cache,n,o)})}},I7=class{constructor(){this.name=qe.KHR_MATERIALS_UNLIT}getMaterialType(){return lt}extendParams(e,t,i){let r=[];e.color=new Ue(1,1,1),e.opacity=1;let n=t.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){let o=n.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],U1),e.opacity=o[3]}n.baseColorTexture!==void 0&&r.push(i.assignTexture(e,"map",n.baseColorTexture,Z1))}return Promise.all(r)}},P7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name].emissiveStrength;return r!==void 0&&(t.emissiveIntensity=r),Promise.resolve()}},N7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&n.push(i.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&n.push(i.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(n.push(i.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){let s=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new ye(s,s)}return Promise.all(n)}},L7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&n.push(i.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&n.push(i.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(n)}},R7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_SHEEN}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[];t.sheenColor=new Ue(0,0,0),t.sheenRoughness=0,t.sheen=1;let o=r.extensions[this.name];if(o.sheenColorFactor!==void 0){let s=o.sheenColorFactor;t.sheenColor.setRGB(s[0],s[1],s[2],U1)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&n.push(i.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Z1)),o.sheenRoughnessTexture!==void 0&&n.push(i.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(n)}},D7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&n.push(i.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(n)}},U7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_VOLUME}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&n.push(i.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;let s=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ue().setRGB(s[0],s[1],s[2],U1),Promise.all(n)}},k7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_IOR}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();let r=i.extensions[this.name];return t.ior=r.ior!==void 0?r.ior:1.5,Promise.resolve()}},O7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_SPECULAR}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&n.push(i.assignTexture(t,"specularIntensityMap",o.specularTexture));let s=o.specularColorFactor||[1,1,1];return t.specularColor=new Ue().setRGB(s[0],s[1],s[2],U1),o.specularColorTexture!==void 0&&n.push(i.assignTexture(t,"specularColorMap",o.specularColorTexture,Z1)),Promise.all(n)}},z7=class{constructor(e){this.parser=e,this.name=qe.EXT_MATERIALS_BUMP}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&n.push(i.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(n)}},V7=class{constructor(e){this.parser=e,this.name=qe.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){let t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:i2}extendMaterialParams(e,t){let i=this.parser,r=i.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();let n=[],o=r.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&n.push(i.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(n)}},B7=class{constructor(e){this.parser=e,this.name=qe.KHR_TEXTURE_BASISU}loadTexture(e){let t=this.parser,i=t.json,r=i.textures[e];if(!r.extensions||!r.extensions[this.name])return null;let n=r.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,n.source,o)}},F7=class{constructor(e){this.parser=e,this.name=qe.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,r=i.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let o=n.extensions[t],s=r.images[o.source],l=i.textureLoader;if(s.uri){let d=i.options.manager.getHandler(s.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);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){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},H7=class{constructor(e){this.parser=e,this.name=qe.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,i=this.parser,r=i.json,n=r.textures[e];if(!n.extensions||!n.extensions[t])return null;let o=n.extensions[t],s=r.images[o.source],l=i.textureLoader;if(s.uri){let d=i.options.manager.getHandler(s.uri);d!==null&&(l=d)}return this.detectSupport().then(function(d){if(d)return i.loadTextureImage(e,o.source,l);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return i.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}},G7=class{constructor(e){this.name=qe.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,i=t.bufferViews[e];if(i.extensions&&i.extensions[this.name]){let r=i.extensions[this.name],n=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 n.then(function(s){let l=r.byteOffset||0,d=r.byteLength||0,c=r.count,h=r.byteStride,u=new Uint8Array(s,l,d);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(c,h,u,r.mode,r.filter).then(function(m){return m.buffer}):o.ready.then(function(){let m=new ArrayBuffer(c*h);return o.decodeGltfBuffer(new Uint8Array(m),c,h,u,r.mode,r.filter),m})})}else return null}},W7=class{constructor(e){this.name=qe.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,i=t.nodes[e];if(!i.extensions||!i.extensions[this.name]||i.mesh===void 0)return null;let r=t.meshes[i.mesh];for(let l of r.primitives)if(l.mode!==pt.TRIANGLES&&l.mode!==pt.TRIANGLE_STRIP&&l.mode!==pt.TRIANGLE_FAN&&l.mode!==void 0)return null;let n=i.extensions[this.name].attributes,o=[],s={};for(let l in n)o.push(this.parser.getDependency("accessor",n[l]).then(d=>(s[l]=d,s[l])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(l=>{let d=l.pop(),c=d.isGroup?d.children:[d],h=l[0].count,u=[];for(let m of c){let f=new Fe,v=new I,_=new m2,g=new I(1,1,1),p=new $g(m.geometry,m.material,h);for(let y=0;y<h;y++)s.TRANSLATION&&v.fromBufferAttribute(s.TRANSLATION,y),s.ROTATION&&_.fromBufferAttribute(s.ROTATION,y),s.SCALE&&g.fromBufferAttribute(s.SCALE,y),p.setMatrixAt(y,f.compose(v,_,g));for(let y in s)if(y==="_COLOR_0"){let x=s[y];p.instanceColor=new bn(x.array,x.itemSize,x.normalized)}else y!=="TRANSLATION"&&y!=="ROTATION"&&y!=="SCALE"&&m.geometry.setAttribute(y,s[y]);I1.prototype.copy.call(p,m),this.parser.assignFinalMaterial(p),u.push(p)}return d.isGroup?(d.clear(),d.add(...u),d):u[0]}))}},Fl="glTF",Yr=12,Hl={JSON:1313821514,BIN:5130562},j7=class{constructor(e){this.name=qe.KHR_BINARY_GLTF,this.content=null,this.body=null;let t=new DataView(e,0,Yr),i=new TextDecoder;if(this.header={magic:i.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Fl)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let r=this.header.length-Yr,n=new DataView(e,Yr),o=0;for(;o<r;){let s=n.getUint32(o,!0);o+=4;let l=n.getUint32(o,!0);if(o+=4,l===Hl.JSON){let d=new Uint8Array(e,Yr+o,s);this.content=i.decode(d)}else if(l===Hl.BIN){let d=Yr+o;this.body=e.slice(d,d+s)}o+=s}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}},X7=class{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=qe.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){let i=this.json,r=this.dracoLoader,n=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,s={},l={},d={};for(let c in o){let h=Zn[c]||c.toLowerCase();s[h]=o[c]}for(let c in e.attributes){let h=Zn[c]||c.toLowerCase();if(o[c]!==void 0){let u=i.accessors[e.attributes[c]],m=Hi[u.componentType];d[h]=m.name,l[h]=u.normalized===!0}}return t.getDependency("bufferView",n).then(function(c){return new Promise(function(h,u){r.decodeDracoFile(c,function(m){for(let f in m.attributes){let v=m.attributes[f],_=l[f];_!==void 0&&(v.normalized=_)}h(m)},s,d,U1,u)})})}},Y7=class{constructor(){this.name=qe.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}},q7=class{constructor(){this.name=qe.KHR_MESH_QUANTIZATION}},Gl=class extends Hr{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){let t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[n+o];return t}interpolate_(e,t,i,r){let n=this.resultBuffer,o=this.sampleValues,s=this.valueSize,l=s*2,d=s*3,c=r-t,h=(i-t)/c,u=h*h,m=u*h,f=e*d,v=f-d,_=-2*m+3*u,g=m-u,p=1-_,y=g-u+h;for(let x=0;x!==s;x++){let b=o[v+x+s],N=o[v+x+l]*c,A=o[f+x+s],C=o[f+x]*c;n[x]=p*b+y*N+_*A+g*C}return n}},Z7=new m2,Q7=class extends Gl{interpolate_(e,t,i,r){let n=super.interpolate_(e,t,i,r);return Z7.fromArray(n).normalize().toArray(n),n}},pt={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},Hi={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Wl={9728:u1,9729:m1,9984:lo,9985:wa,9986:Cr,9987:qt},jl={33071:Lt,33648:Ma,10497:R1},qn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zn={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},A2={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},J7={CUBICSPLINE:void 0,LINEAR:di,STEP:Pr},Qn={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function K7(e){return e.DefaultMaterial===void 0&&(e.DefaultMaterial=new Pn({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Nt})),e.DefaultMaterial}function q2(e,t,i){for(let r in i.extensions)e[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=i.extensions[r])}function E2(e,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function $7(e,t,i){let r=!1,n=!1,o=!1;for(let c=0,h=t.length;c<h;c++){let u=t[c];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(o=!0),r&&n&&o)break}if(!r&&!n&&!o)return Promise.resolve(e);let s=[],l=[],d=[];for(let c=0,h=t.length;c<h;c++){let u=t[c];if(r){let m=u.POSITION!==void 0?i.getDependency("accessor",u.POSITION):e.attributes.position;s.push(m)}if(n){let m=u.NORMAL!==void 0?i.getDependency("accessor",u.NORMAL):e.attributes.normal;l.push(m)}if(o){let m=u.COLOR_0!==void 0?i.getDependency("accessor",u.COLOR_0):e.attributes.color;d.push(m)}}return Promise.all([Promise.all(s),Promise.all(l),Promise.all(d)]).then(function(c){let h=c[0],u=c[1],m=c[2];return r&&(e.morphAttributes.position=h),n&&(e.morphAttributes.normal=u),o&&(e.morphAttributes.color=m),e.morphTargetsRelative=!0,e})}function e_(e,t){if(e.updateMorphTargets(),t.weights!==void 0)for(let i=0,r=t.weights.length;i<r;i++)e.morphTargetInfluences[i]=t.weights[i];if(t.extras&&Array.isArray(t.extras.targetNames)){let i=t.extras.targetNames;if(e.morphTargetInfluences.length===i.length){e.morphTargetDictionary={};for(let r=0,n=i.length;r<n;r++)e.morphTargetDictionary[i[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function t_(e){let t,i=e.extensions&&e.extensions[qe.KHR_DRACO_MESH_COMPRESSION];if(i?t="draco:"+i.bufferView+":"+i.indices+":"+Jn(i.attributes):t=e.indices+":"+Jn(e.attributes)+":"+e.mode,e.targets!==void 0)for(let r=0,n=e.targets.length;r<n;r++)t+=":"+Jn(e.targets[r]);return t}function Jn(e){let t="",i=Object.keys(e).sort();for(let r=0,n=i.length;r<n;r++)t+=i[r]+":"+e[i[r]]+";";return t}function Kn(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function i_(e){return e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0?"image/jpeg":e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}var r_=new Fe,a_=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new C7,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let i=!1,r=!1,n=-1;typeof navigator<"u"&&(i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,r=navigator.userAgent.indexOf("Firefox")>-1,n=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||i||r&&n<98?this.textureLoader=new Nn(this.options.manager):this.textureLoader=new w8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Al(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let i=this,r=this.json,n=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){let s={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};return q2(n,s,r),E2(s,r),Promise.all(i._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(let l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,n=t.length;r<n;r++){let o=t[r].joints;for(let s=0,l=o.length;s<l;s++)e[o[s]].isBone=!0}for(let r=0,n=e.length;r<n;r++){let o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;let r=i.clone(),n=(o,s)=>{let l=this.associations.get(o);l!=null&&this.associations.set(s,l);for(let[d,c]of o.children.entries())n(c,s.children[d])};return n(i,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){let r=e(t[i]);if(r)return r}return null}_invokeAll(e){let t=Object.values(this.plugins);t.unshift(this);let i=[];for(let r=0;r<t.length;r++){let n=e(t[r]);n&&i.push(n)}return i}getDependency(e,t){let i=e+":"+t,r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne(function(n){return n.loadNode&&n.loadNode(t)});break;case"mesh":r=this._invokeOne(function(n){return n.loadMesh&&n.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(n){return n.loadBufferView&&n.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(n){return n.loadMaterial&&n.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(n){return n.loadTexture&&n.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne(function(n){return n.loadAnimation&&n.loadAnimation(t)});break;case"camera":r=this.loadCamera(t);break;default:if(r=this._invokeOne(function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}),!r)throw new Error("Unknown type: "+e);break}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){let i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(n,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){let t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[qe.KHR_BINARY_GLTF].body);let r=this.options;return new Promise(function(n,o){i.load(Wr.resolveURL(t.uri,r.path),n,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){let t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){let r=t.byteLength||0,n=t.byteOffset||0;return i.slice(n,n+r)})}loadAccessor(e){let t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0){let o=qn[r.type],s=Hi[r.componentType],l=r.normalized===!0,d=new s(r.count*o);return Promise.resolve(new W1(d,o,l))}let n=[];return r.bufferView!==void 0?n.push(this.getDependency("bufferView",r.bufferView)):n.push(null),r.sparse!==void 0&&(n.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(n).then(function(o){let s=o[0],l=qn[r.type],d=Hi[r.componentType],c=d.BYTES_PER_ELEMENT,h=c*l,u=r.byteOffset||0,m=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,f=r.normalized===!0,v,_;if(m&&m!==h){let g=Math.floor(u/m),p="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+g+":"+r.count,y=t.cache.get(p);y||(v=new d(s,g*m,r.count*m/c),y=new Xg(v,m/c),t.cache.add(p,y)),_=new Yg(y,l,u%m/c,f)}else s===null?v=new d(r.count*l):v=new d(s,u,r.count*l),_=new W1(v,l,f);if(r.sparse!==void 0){let g=qn.SCALAR,p=Hi[r.sparse.indices.componentType],y=r.sparse.indices.byteOffset||0,x=r.sparse.values.byteOffset||0,b=new p(o[1],y,r.sparse.count*g),N=new d(o[2],x,r.sparse.count*l);s!==null&&(_=new W1(_.array.slice(),_.itemSize,_.normalized));for(let A=0,C=b.length;A<C;A++){let U=b[A];if(_.setX(U,N[A*l]),l>=2&&_.setY(U,N[A*l+1]),l>=3&&_.setZ(U,N[A*l+2]),l>=4&&_.setW(U,N[A*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return _})}loadTexture(e){let t=this.json,i=this.options,r=t.textures[e].source,n=t.images[r],o=this.textureLoader;if(n.uri){let s=i.manager.getHandler(n.uri);s!==null&&(o=s)}return this.loadTextureImage(e,r,o)}loadTextureImage(e,t,i){let r=this,n=this.json,o=n.textures[e],s=n.images[t],l=(s.uri||s.bufferView)+":"+o.sampler;if(this.textureCache[l])return this.textureCache[l];let d=this.loadImageSource(t,i).then(function(c){c.flipY=!1,c.name=o.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);let h=(n.samplers||{})[o.sampler]||{};return c.magFilter=Wl[h.magFilter]||m1,c.minFilter=Wl[h.minFilter]||qt,c.wrapS=jl[h.wrapS]||R1,c.wrapT=jl[h.wrapT]||R1,r.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=d,d}loadImageSource(e,t){let i=this,r=this.json,n=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(h=>h.clone());let o=r.images[e],s=self.URL||self.webkitURL,l=o.uri||"",d=!1;if(o.bufferView!==void 0)l=i.getDependency("bufferView",o.bufferView).then(function(h){d=!0;let u=new Blob([h],{type:o.mimeType});return l=s.createObjectURL(u),l});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let c=Promise.resolve(l).then(function(h){return new Promise(function(u,m){let f=u;t.isImageBitmapLoader===!0&&(f=function(v){let _=new tt(v);_.needsUpdate=!0,u(_)}),t.load(Wr.resolveURL(h,n.path),f,void 0,m)})}).then(function(h){return d===!0&&s.revokeObjectURL(l),h.userData.mimeType=o.mimeType||i_(o.uri),h}).catch(function(h){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),h});return this.sourceCache[e]=c,c}assignTexture(e,t,i,r){let n=this;return this.getDependency("texture",i.index).then(function(o){if(!o)return null;if(i.texCoord!==void 0&&i.texCoord>0&&(o=o.clone(),o.channel=i.texCoord),n.extensions[qe.KHR_TEXTURE_TRANSFORM]){let s=i.extensions!==void 0?i.extensions[qe.KHR_TEXTURE_TRANSFORM]:void 0;if(s){let l=n.associations.get(o);o=n.extensions[qe.KHR_TEXTURE_TRANSFORM].extendTexture(o,s),n.associations.set(o,l)}}return r!==void 0&&(o.colorSpace=r),e[t]=o,o})}assignFinalMaterial(e){let t=e.geometry,i=e.material,r=t.attributes.tangent===void 0,n=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){let s="PointsMaterial:"+i.uuid,l=this.cache.get(s);l||(l=new vl,mt.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,l.sizeAttenuation=!1,this.cache.add(s,l)),i=l}else if(e.isLine){let s="LineBasicMaterial:"+i.uuid,l=this.cache.get(s);l||(l=new ul,mt.prototype.copy.call(l,i),l.color.copy(i.color),l.map=i.map,this.cache.add(s,l)),i=l}if(r||n||o){let s="ClonedMaterial:"+i.uuid+":";r&&(s+="derivative-tangents:"),n&&(s+="vertex-colors:"),o&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=i.clone(),n&&(l.vertexColors=!0),o&&(l.flatShading=!0),r&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(i))),i=l}e.material=i}getMaterialType(){return Pn}loadMaterial(e){let t=this,i=this.json,r=this.extensions,n=i.materials[e],o,s={},l=n.extensions||{},d=[];if(l[qe.KHR_MATERIALS_UNLIT]){let h=r[qe.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),d.push(h.extendParams(s,n,t))}else{let h=n.pbrMetallicRoughness||{};if(s.color=new Ue(1,1,1),s.opacity=1,Array.isArray(h.baseColorFactor)){let u=h.baseColorFactor;s.color.setRGB(u[0],u[1],u[2],U1),s.opacity=u[3]}h.baseColorTexture!==void 0&&d.push(t.assignTexture(s,"map",h.baseColorTexture,Z1)),s.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,s.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(d.push(t.assignTexture(s,"metalnessMap",h.metallicRoughnessTexture)),d.push(t.assignTexture(s,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(u){return u.getMaterialType&&u.getMaterialType(e)}),d.push(Promise.all(this._invokeAll(function(u){return u.extendMaterialParams&&u.extendMaterialParams(e,s)})))}n.doubleSided===!0&&(s.side=ut);let c=n.alphaMode||Qn.OPAQUE;if(c===Qn.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===Qn.MASK&&(s.alphaTest=n.alphaCutoff!==void 0?n.alphaCutoff:.5)),n.normalTexture!==void 0&&o!==lt&&(d.push(t.assignTexture(s,"normalMap",n.normalTexture)),s.normalScale=new ye(1,1),n.normalTexture.scale!==void 0)){let h=n.normalTexture.scale;s.normalScale.set(h,h)}if(n.occlusionTexture!==void 0&&o!==lt&&(d.push(t.assignTexture(s,"aoMap",n.occlusionTexture)),n.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=n.occlusionTexture.strength)),n.emissiveFactor!==void 0&&o!==lt){let h=n.emissiveFactor;s.emissive=new Ue().setRGB(h[0],h[1],h[2],U1)}return n.emissiveTexture!==void 0&&o!==lt&&d.push(t.assignTexture(s,"emissiveMap",n.emissiveTexture,Z1)),Promise.all(d).then(function(){let h=new o(s);return n.name&&(h.name=n.name),E2(h,n),t.associations.set(h,{materials:e}),n.extensions&&q2(r,h,n),h})}createUniqueName(e){let t=M1.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,i=this.extensions,r=this.primitiveCache;function n(s){return i[qe.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,t).then(function(l){return Xl(l,s,t)})}let o=[];for(let s=0,l=e.length;s<l;s++){let d=e[s],c=t_(d),h=r[c];if(h)o.push(h.promise);else{let u;d.extensions&&d.extensions[qe.KHR_DRACO_MESH_COMPRESSION]?u=n(d):u=Xl(new Ut,d,t),r[c]={primitive:d,promise:u},o.push(u)}}return Promise.all(o)}loadMesh(e){let t=this,i=this.json,r=this.extensions,n=i.meshes[e],o=n.primitives,s=[];for(let l=0,d=o.length;l<d;l++){let c=o[l].material===void 0?K7(this.cache):this.getDependency("material",o[l].material);s.push(c)}return s.push(t.loadGeometries(o)),Promise.all(s).then(function(l){let d=l.slice(0,l.length-1),c=l[l.length-1],h=[];for(let m=0,f=c.length;m<f;m++){let v=c[m],_=o[m],g,p=d[m];if(_.mode===pt.TRIANGLES||_.mode===pt.TRIANGLE_STRIP||_.mode===pt.TRIANGLE_FAN||_.mode===void 0)g=n.isSkinnedMesh===!0?new Zg(v,p):new v1(v,p),g.isSkinnedMesh===!0&&g.normalizeSkinWeights(),_.mode===pt.TRIANGLE_STRIP?g.geometry=Bl(g.geometry,Xo):_.mode===pt.TRIANGLE_FAN&&(g.geometry=Bl(g.geometry,G3));else if(_.mode===pt.LINES)g=new e8(v,p);else if(_.mode===pt.LINE_STRIP)g=new Tn(v,p);else if(_.mode===pt.LINE_LOOP)g=new t8(v,p);else if(_.mode===pt.POINTS)g=new i8(v,p);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+_.mode);Object.keys(g.geometry.morphAttributes).length>0&&e_(g,n),g.name=t.createUniqueName(n.name||"mesh_"+e),E2(g,n),_.extensions&&q2(r,g,_),t.assignFinalMaterial(g),h.push(g)}for(let m=0,f=h.length;m<f;m++)t.associations.set(h[m],{meshes:e,primitives:m});if(h.length===1)return n.extensions&&q2(r,h[0],n),h[0];let u=new j2;n.extensions&&q2(r,u,n),t.associations.set(u,{meshes:e});for(let m=0,f=h.length;m<f;m++)u.add(h[m]);return u})}loadCamera(e){let t,i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new j1(fi.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new zt(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),E2(t,i),Promise.resolve(t)}loadSkin(e){let t=this.json.skins[e],i=[];for(let r=0,n=t.joints.length;r<n;r++)i.push(this._loadNodeShallow(t.joints[r]));return t.inverseBindMatrices!==void 0?i.push(this.getDependency("accessor",t.inverseBindMatrices)):i.push(null),Promise.all(i).then(function(r){let n=r.pop(),o=r,s=[],l=[];for(let d=0,c=o.length;d<c;d++){let h=o[d];if(h){s.push(h);let u=new Fe;n!==null&&u.fromArray(n.array,d*16),l.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[d])}return new Jg(s,l)})}loadAnimation(e){let t=this.json,i=this,r=t.animations[e],n=r.name?r.name:"animation_"+e,o=[],s=[],l=[],d=[],c=[];for(let h=0,u=r.channels.length;h<u;h++){let m=r.channels[h],f=r.samplers[m.sampler],v=m.target,_=v.node,g=r.parameters!==void 0?r.parameters[f.input]:f.input,p=r.parameters!==void 0?r.parameters[f.output]:f.output;v.node!==void 0&&(o.push(this.getDependency("node",_)),s.push(this.getDependency("accessor",g)),l.push(this.getDependency("accessor",p)),d.push(f),c.push(v))}return Promise.all([Promise.all(o),Promise.all(s),Promise.all(l),Promise.all(d),Promise.all(c)]).then(function(h){let u=h[0],m=h[1],f=h[2],v=h[3],_=h[4],g=[];for(let p=0,y=u.length;p<y;p++){let x=u[p],b=m[p],N=f[p],A=v[p],C=_[p];if(x===void 0)continue;x.updateMatrix&&x.updateMatrix();let U=i._createAnimationTracks(x,b,N,A,C);if(U)for(let S=0;S<U.length;S++)g.push(U[S])}return new d8(n,void 0,g)})}createNodeMesh(e){let t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(n){let o=i._getNodeRef(i.meshCache,r.mesh,n);return r.weights!==void 0&&o.traverse(function(s){if(s.isMesh)for(let l=0,d=r.weights.length;l<d;l++)s.morphTargetInfluences[l]=r.weights[l]}),o})}loadNode(e){let t=this.json,i=this,r=t.nodes[e],n=i._loadNodeShallow(e),o=[],s=r.children||[];for(let d=0,c=s.length;d<c;d++)o.push(i.getDependency("node",s[d]));let l=r.skin===void 0?Promise.resolve(null):i.getDependency("skin",r.skin);return Promise.all([n,Promise.all(o),l]).then(function(d){let c=d[0],h=d[1],u=d[2];u!==null&&c.traverse(function(m){m.isSkinnedMesh&&m.bind(u,r_)});for(let m=0,f=h.length;m<f;m++)c.add(h[m]);return c})}_loadNodeShallow(e){let t=this.json,i=this.extensions,r=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];let n=t.nodes[e],o=n.name?r.createUniqueName(n.name):"",s=[],l=r._invokeOne(function(d){return d.createNodeMesh&&d.createNodeMesh(e)});return l&&s.push(l),n.camera!==void 0&&s.push(r.getDependency("camera",n.camera).then(function(d){return r._getNodeRef(r.cameraCache,n.camera,d)})),r._invokeAll(function(d){return d.createNodeAttachment&&d.createNodeAttachment(e)}).forEach(function(d){s.push(d)}),this.nodeCache[e]=Promise.all(s).then(function(d){let c;if(n.isBone===!0?c=new ll:d.length>1?c=new j2:d.length===1?c=d[0]:c=new I1,c!==d[0])for(let h=0,u=d.length;h<u;h++)c.add(d[h]);if(n.name&&(c.userData.name=n.name,c.name=o),E2(c,n),n.extensions&&q2(i,c,n),n.matrix!==void 0){let h=new Fe;h.fromArray(n.matrix),c.applyMatrix4(h)}else n.translation!==void 0&&c.position.fromArray(n.translation),n.rotation!==void 0&&c.quaternion.fromArray(n.rotation),n.scale!==void 0&&c.scale.fromArray(n.scale);return r.associations.has(c)||r.associations.set(c,{}),r.associations.get(c).nodes=e,c}),this.nodeCache[e]}loadScene(e){let t=this.extensions,i=this.json.scenes[e],r=this,n=new j2;i.name&&(n.name=r.createUniqueName(i.name)),E2(n,i),i.extensions&&q2(t,n,i);let o=i.nodes||[],s=[];for(let l=0,d=o.length;l<d;l++)s.push(r.getDependency("node",o[l]));return Promise.all(s).then(function(l){for(let c=0,h=l.length;c<h;c++)n.add(l[c]);let d=c=>{let h=new Map;for(let[u,m]of r.associations)(u instanceof mt||u instanceof tt)&&h.set(u,m);return c.traverse(u=>{let m=r.associations.get(u);m!=null&&h.set(u,m)}),h};return r.associations=d(n),n})}_createAnimationTracks(e,t,i,r,n){let o=[],s=e.name?e.name:e.uuid,l=[];A2[n.path]===A2.weights?e.traverse(function(u){u.morphTargetInfluences&&l.push(u.name?u.name:u.uuid)}):l.push(s);let d;switch(A2[n.path]){case A2.weights:d=Oi;break;case A2.rotation:d=Y2;break;case A2.position:case A2.scale:d=Vi;break;default:switch(i.itemSize){case 1:d=Oi;break;case 2:case 3:default:d=Vi;break}break}let c=r.interpolation!==void 0?J7[r.interpolation]:di,h=this._getArrayFromAccessor(i);for(let u=0,m=l.length;u<m;u++){let f=new d(l[u]+"."+A2[n.path],t.array,h,c);r.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(f),o.push(f)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){let i=Kn(t.constructor),r=new Float32Array(t.length);for(let n=0,o=t.length;n<o;n++)r[n]=t[n]*i;t=r}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){let i=this instanceof Y2?Q7:Gl;return new i(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};function n_(e,t,i){let r=t.attributes,n=new Qt;if(r.POSITION!==void 0){let l=i.json.accessors[r.POSITION],d=l.min,c=l.max;if(d!==void 0&&c!==void 0){if(n.set(new I(d[0],d[1],d[2]),new I(c[0],c[1],c[2])),l.normalized){let h=Kn(Hi[l.componentType]);n.min.multiplyScalar(h),n.max.multiplyScalar(h)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let o=t.targets;if(o!==void 0){let l=new I,d=new I;for(let c=0,h=o.length;c<h;c++){let u=o[c];if(u.POSITION!==void 0){let m=i.json.accessors[u.POSITION],f=m.min,v=m.max;if(f!==void 0&&v!==void 0){if(d.setX(Math.max(Math.abs(f[0]),Math.abs(v[0]))),d.setY(Math.max(Math.abs(f[1]),Math.abs(v[1]))),d.setZ(Math.max(Math.abs(f[2]),Math.abs(v[2]))),m.normalized){let _=Kn(Hi[m.componentType]);d.multiplyScalar(_)}l.max(d)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(l)}e.boundingBox=n;let s=new Dt;n.getCenter(s.center),s.radius=n.min.distanceTo(n.max)/2,e.boundingSphere=s}function Xl(e,t,i){let r=t.attributes,n=[];function o(s,l){return i.getDependency("accessor",s).then(function(d){e.setAttribute(l,d)})}for(let s in r){let l=Zn[s]||s.toLowerCase();l in e.attributes||n.push(o(r[s],l))}if(t.indices!==void 0&&!e.index){let s=i.getDependency("accessor",t.indices).then(function(l){e.setIndex(l)});n.push(s)}return n1.workingColorSpace!==U1&&"COLOR_0"in r&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${n1.workingColorSpace}" not supported.`),E2(e,t),n_(e,t,i),Promise.all(n).then(function(){return t.targets!==void 0?$7(e,t.targets,i):e})}var $n=class va{constructor(){this.modelCache=new Map,this.textureCache=new Map,this.loader=new b7}static get instance(){return va._instance||(va._instance=new va),va._instance}async loadModel(t){var i;return this.modelCache.has(t)?(i=this.modelCache.get(t))==null?void 0:i.clone():(await new Promise((r,n)=>{this.loader.load(t,o=>{this.modelCache.set(t,o.scene),r(o)},void 0,n)})).scene}async loadTexture(t,i=!1){if(this.textureCache.has(t))return this.textureCache.get(t);{let r=await new Promise((n,o)=>{new Nn().load(t,n,void 0,o)});return i&&(r.minFilter=u1,r.magFilter=u1),this.textureCache.set(t,r),r}}async loadTexturedPlaneModel(t,i,r=new I(0,0,0),n=new I(1,1,1),o=!1){let s,l=`plane:${t}:${r.x.toFixed(2)},${r.y.toFixed(2)},${r.z.toFixed(2)}:${n.x.toFixed(2)},${n.y.toFixed(2)},${n.z.toFixed(2)}`;if(this.modelCache.has(l))s=this.modelCache.get(l);else{let d=await this.loadTexture(t,o),c=new kt(1,1);i instanceof x1?i.uniforms.map.value=d:i instanceof lt&&(i.map=d),c.applyMatrix4(new Fe().makeRotationX(-Math.PI/2).multiply(new Fe().makeScale(n.x,n.y,n.z))),c.applyMatrix4(new Fe().makeTranslation(r.x,r.y,r.z)),s=new v1(c,i),this.modelCache.set(l,s)}return s.clone()}dispose(){this.modelCache.forEach(t=>{t.traverse(i=>{if(i.isMesh){let r=i;r.geometry.dispose(),Array.isArray(r.material)?r.material.forEach(n=>{n instanceof mt&&n.dispose()}):r.material instanceof mt&&r.material.dispose()}})}),this.textureCache.forEach(t=>{t.dispose()}),this.modelCache.clear(),this.textureCache.clear()}},e0=(fr=class extends Event{constructor(t){super(fr.EVENT_NAME),this.data=t}},fr.EVENT_NAME="dataPointsActivated",fr),qr=(pr=class extends Event{constructor(t,i,r){super(pr.EVENT_NAME),this.dataPoint=t,this.progress=i,this.finished=r}},pr.EVENT_NAME="dataPointTextureLoad",pr),Yl=(e=>(e[e.Start=0]="Start",e[e.StartTexture=1]="StartTexture",e[e.FinishTexture=2]="FinishTexture",e[e.StartAnimate=3]="StartAnimate",e[e.FinishAnimate=4]="FinishAnimate",e[e.Finished=5]="Finished",e))(Yl||{}),b2=(gr=class extends Event{constructor(t,i){super(gr.EVENT_NAME),this.dataPoint=t,this.state=i}},gr.EVENT_NAME="dataPointLoad",gr),t0=(_r=class extends Event{constructor(t){super(_r.EVENT_NAME),this.data=t}},_r.EVENT_NAME="dataPointsDeactivated",_r),o_=class extends a2{constructor(){super(...arguments),this.name="navigationPlugin",this.receiveDataPointClickEvent=!0,this.markerArray=[],this.dataActivatedEventHandler=this.onDataActivated.bind(this),this.dataDeactivatedEventHandler=this.onDataDeactivated.bind(this),this.mousePickEventHandler=this.onMousePick.bind(this),this.dataPointTextureLoadEventHandler=this.onDataPointTextureLoad.bind(this),this.dataPointLoadEventHandler=this.onDataPointLoad.bind(this)}async register(e){await super.register(e),this.main.addEventListener(e0.EVENT_NAME,this.dataActivatedEventHandler),this.main.addEventListener(t0.EVENT_NAME,this.dataDeactivatedEventHandler),this.main.addEventListener(jn.EVENT_NAME,this.mousePickEventHandler),this.main.addEventListener(qr.EVENT_NAME,this.dataPointTextureLoadEventHandler),this.main.addEventListener(b2.EVENT_NAME,this.dataPointLoadEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(e0.EVENT_NAME,this.dataActivatedEventHandler),this.main.removeEventListener(t0.EVENT_NAME,this.dataDeactivatedEventHandler),this.main.removeEventListener(jn.EVENT_NAME,this.mousePickEventHandler),this.main.removeEventListener(qr.EVENT_NAME,this.dataPointTextureLoadEventHandler),this.main.removeEventListener(b2.EVENT_NAME,this.dataPointLoadEventHandler)}async onDataActivated({data:e}){this.markerArray=await Promise.all(e.filter(t=>t.navigable).map(async t=>{let i=await this.createMarker(t,t.done?Vl:E7);return this.scene.add(i),t.extra.marker=i,{dataPoint:t,marker:i,visible:!0}}))}async onDataDeactivated({data:e}){await Promise.all(e.map(async t=>{let i=this.markerArray.findIndex(({dataPoint:r})=>r===t);i>=0&&(this.scene.remove(this.markerArray[i].dataPoint.extra.marker),this.markerArray.splice(i,1))}))}async onDataPointTextureLoad({dataPoint:e,finished:t}){if(t){let i=this.markerArray.findIndex(({dataPoint:r})=>r===e);if(i>=0){this.scene.remove(this.markerArray[i].marker);let r=await this.createMarker(e,Vl);this.scene.add(r),e.extra.marker=r,this.markerArray[i].marker=r}}}onDataPointLoad(e){var t;if(e.state===2&&e.dataPoint.navigable){this.lastLoadedDataPoint=e.dataPoint;let i=this.lastLoadedDataPoint.extra.marker.position;for(let r of this.markerArray){let n=r.marker.position,o=new I().subVectors(n,i),s=i.distanceTo(n),l=(t=this.lastLoadedDataPoint.textureHandler.getDepth())==null?void 0:t.getDepth(o);r.visible=s<l}}}onMousePick({data:e}){if(!this.main.isTransitioning&&this.receiveDataPointClickEvent){let t=this.pickClosest(this.main.camera.position,e.ray.hitPoint);t&&this.main.setCurrentDataPoint(t,{rotate:!1})}}async createMarker(e,t){let i=new I(.25,.25,.25),r=await $n.instance.loadTexturedPlaneModel(t,Ol.getMaterial(Xn,{depthOffset:-.2,color:new Ue(1,1,1)}),new I(0,e.floorPositionY-e.position.y,0),i,!0);return r.position.copy(e.position),r}pickClosest(e,t){var o;let i=this.scene.children.filter(s=>s.visible),r,n=1/0;return i.forEach(s=>{if(s.position.x===e.x&&s.position.y===e.y&&s.position.z===e.z)return;let l=t.distanceTo(s.position);l<n&&(n=l,r=s)}),(o=this.markerArray.find(({marker:s})=>s===r))==null?void 0:o.dataPoint}pickRaymarch(e,t){let i=null,r=1/0,n=.1;for(let{dataPoint:o,marker:s}of this.markerArray){let l=e.distanceTo(s.position);if(l>n){let d=new I().subVectors(s.position,e);if(d.dot(t)>0){let c=d.cross(t).length(),h=l*.1+c;h<r&&(r=h,i=o)}}}return i}update(){for(let e of this.markerArray)e.marker.visible=(!this.main.isTransitioning||e.dataPoint===this.lastLoadedDataPoint)&&e.visible&&this.main.options.showArrowAndMarkers;return{postProcessingRenderLayer:{renderTarget:this.renderTarget,scene:this.scene,camera:this.main.camera,type:3}}}},s_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo0OGRmMzY0ZS0zMmViLTlhNGMtOGE2NS1kMDZmNzZkY2UxZGUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTEwNTM3NDQ1RDUwMTFFQUE5RkZEMDIyOUEwNzcwMjUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTEwNTM3NDM1RDUwMTFFQUE5RkZEMDIyOUEwNzcwMjUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YTVlMmIzNmEtOWZhMC1hMTQ5LWIxM2EtN2U5N2M5ZThjOGU0IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjQ4ZGYzNjRlLTMyZWItOWE0Yy04YTY1LWQwNmY3NmRjZTFkZSIv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",l_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAwnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabVDBEcMgDPszRUewLYeYcUiT3nWDjl8TQy+01R2yQIkwTsfr+Ui3BmFNuqyWS87k0KJFqgujQD2ZSU8e4M7TefpI8QqvCMNy/2uc8xRDXF0tlyC7d2ObjaJRxb6CJApaR03vPaj0IEgY3ANqPItysfX6hO2gGRYrNVKb2/7Zrz69ffF7IHKAQc5AjgbQFhKqG+wsKP4hw1wTsrNihPlA/s1pIL0B1wxZDwCxK2YAAAGFaUNDUElDQyBwcm9maWxlAAB4nH2RPUjDQBzFX1OlohURK4goZKhOdlERwaVUsQgWSluhVQeTS7+gSUOS4uIouBYc/FisOrg46+rgKgiCHyCuLk6KLlLi/5JCi1gPjvvx7t7j7h0g1EpMNTvCgKpZRiIaEdOZVdH3ih6Moh+DmJOYqceSiym0HV/38PD1LsSz2p/7c/QqWZMBHpE4zHTDIt4gntm0dM77xAFWkBTic+IJgy5I/Mh12eU3znmHBZ4ZMFKJeeIAsZhvYbmFWcFQiaeJg4qqUb6QdlnhvMVZLVVY4578hf6stpLkOs0RRLGEGOIQIaOCIkqwEKJVI8VEgvYjbfzDjj9OLplcRTByLKAMFZLjB/+D392aualJN8kfATpfbPtjDPDtAvWqbX8f23b9BPA+A1da01+uAbOfpFebWvAI6NsGLq6bmrwHXO4AQ0+6ZEiO5KUp5HLA+xl9UwYYuAW619zeGvs4fQBS1NXyDXBwCIznKXu9zbu7Wnv790yjvx8RnXLmBDZw9wAADXZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+Cjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDQuNC4wLUV4aXYyIj4KIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIKICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICB4bXBNTTpEb2N1bWVudElEPSJnaW1wOmRvY2lkOmdpbXA6NGJjMTA0MmQtYWI3Ny00ZmVhLWI2OGItMTU5MDljZmY4OWI3IgogICB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmRiOGNjM2IwLTM3ZmItNDE0Yi1hMWM4LWQxNjJiZTI5ZDA5YyIKICAgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOjRiN2NmZGU2LTFhMzgtNDE4Ny05YTQwLTIwMzAyYmFkZTY5MSIKICAgZGM6Rm9ybWF0PSJpbWFnZS9wbmciCiAgIEdJTVA6QVBJPSIyLjAiCiAgIEdJTVA6UGxhdGZvcm09IldpbmRvd3MiCiAgIEdJTVA6VGltZVN0YW1wPSIxNzAxMjgxMjAzNDQ5NDQwIgogICBHSU1QOlZlcnNpb249IjIuMTAuMzYiCiAgIHRpZmY6T3JpZW50YXRpb249IjEiCiAgIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIgogICB4bXA6TWV0YWRhdGFEYXRlPSIyMDIzOjExOjI5VDE4OjA2OjQwKzAwOjAwIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyMzoxMToyOVQxODowNjo0MCswMDowMCI+CiAgIDx4bXBNTTpIaXN0b3J5PgogICAgPHJkZjpTZXE+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjAyNGE3YzdiLTY5MzUtNDc1Zi04ZTNiLTZiOTE5NzJmYWY1MiIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMy0xMS0yOVQxODowNjo0MyIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6kdp6CAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5wsdEgYr93IWEQAAIABJREFUeNrt3Xt0lPW97/H3TBICCSEhgRCgahAF8ZIESyhyq4qAl7q9KxCpWhXsxS7Lsls9rdtzzna3p0vPbq0VPZWtAgJWLYpa3ICKRgh3yAUv3AQRCoQQEnJPJvM7fzzPpE+eTiKXSTIz+bzWynLNL5JM5vf7fp/f7fk9ICIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiXc+jjyCqeIEYIAXoB/QHUoFkoA+QAPQC4oE4INb+dz6gCWgA6oBa4ARQCZQDR4EyoAJoBvz6qJUApOuCPBE4z/WVCQwCBtrf99pfoeC3v2qAQ8BB4Gtgt+urRslBCUBCG+zJwEj761IgGzgX6BlG9WeAeuAroAjYan8V2r0IJQUlADnJgM8AxgMT7f9eAPSIwLoyQCPwBbAGyAfWAoeVEJQA5B8SgHHAVGAScJE9Pj8tvXr1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",c_=class extends a2{constructor(){super(...arguments),this.mouseDown=!1,this.mouseMoveHandler=this.onMouseMove.bind(this),this.mouseHandler=this.onMouse.bind(this),this.name="arrowPlugin"}async register(e){await super.register(e),this.arrowMaterial=new lt,this.arrowMaterial.transparent=!0,this.arrowMaterial.side=ut,this.mouseoverFloorMaterial=new lt,this.mouseoverFloorMaterial.transparent=!0,this.mouseoverFloorMaterial.side=ut,this.mouseArrowObject=await $n.instance.loadTexturedPlaneModel(s_,this.arrowMaterial,void 0,new I(.25,.5,.25)),this.mouseFloorObject=await $n.instance.loadTexturedPlaneModel(l_,this.mouseoverFloorMaterial,void 0,new I(.25,.25,.25)),this.scene.add(this.mouseArrowObject),this.scene.add(this.mouseFloorObject),this.main.addEventListener(Gn.EVENT_NAME,this.mouseMoveHandler),this.main.addEventListener(Xr.EVENT_NAME,this.mouseHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(Gn.EVENT_NAME,this.mouseMoveHandler),this.main.addEventListener(Xr.EVENT_NAME,this.mouseHandler)}onMouseMove({data:e}){this.mouseRay=e.ray}onMouse({data:e}){this.mouseDown=e.button===0}update(){var e;if(!this.main.options.showArrowAndMarkers)return this.mouseArrowObject.visible=!1,{};if(this.mouseRay&&this.mouseArrowObject&&this.mouseFloorObject){let{hitPoint:t,isFloor:i}=this.mouseRay;if(this.mouseArrowObject.visible=!i,this.mouseFloorObject.visible=i,this.mouseDown)this.mouseArrowObject.visible=!1;else if(!this.main.camera.position)this.mouseArrowObject.visible=!1;else{let r=new I(this.main.camera.position.x,0,this.main.camera.position.z),n=new I(t.x,0,t.z).distanceTo(r),o=t.clone().sub(this.main.camera.position).normalize(),s=Math.atan2(o.x,o.z)+Math.PI;if(n>3){let l=o.multiplyScalar(3);(e=this.mouseArrowObject)==null||e.position.copy(this.main.camera.position).add(l)}else this.mouseArrowObject.position.copy(t);this.mouseArrowObject.rotation.y=s,this.mouseFloorObject.position.copy(t)}}return{postProcessingRenderLayer:{camera:this.main.camera,scene:this.scene,renderTarget:this.renderTarget,alpha:.3,type:4}}}reset(){this.mouseDown=!1}},ql=(vr=class extends Event{constructor(t){super(vr.EVENT_NAME),this.data=t}},vr.EVENT_NAME="autoRotatePluginOptions",vr);function d_(e){return e&&typeof e=="object"&&("autoRotate"in e||"autoRotateSpeed"in e)}var h_=class extends a2{constructor(e){super(),this.name="autoRotatePlugin",this.options={autoRotate:!1,autoRotateSpeed:1},this.autoRotatePluginOptionsEventHandler=t=>{this.setOptions(t.data),this.main.resetRenderLayers()},this.setOptions(e||{})}setOptions(e){this.options.autoRotate=e.autoRotate??this.options.autoRotate,this.options.autoRotateSpeed=e.autoRotateSpeed??this.options.autoRotateSpeed}async register(e){await super.register(e),this.main.addEventListener(ql.EVENT_NAME,this.autoRotatePluginOptionsEventHandler)}async dispose(){await super.dispose(),this.main.removeEventListener(ql.EVENT_NAME,this.autoRotatePluginOptionsEventHandler)}update(){return this.main.initialized&&this.options.autoRotate?{cameraDelta:{rotation:new k1(0,.001*this.options.autoRotateSpeed,0)}}:{}}toggleAutoRotate(){this.options.autoRotate=!this.options.autoRotate}setAutoRotateSpeed(e){this.options.autoRotateSpeed=e}},u_=(xr=class extends Event{constructor(t){super(xr.EVENT_NAME),this.data=t}},xr.EVENT_NAME="mainOptions",xr);function Gi(e){let t=e.length;for(;--t>=0;)e[t]=0}var m_=0,Zl=1,f_=2,p_=3,g_=258,i0=29,Zr=256,Qr=Zr+1+i0,Wi=30,r0=19,Ql=2*Qr+1,Z2=15,a0=16,__=7,n0=256,Jl=16,Kl=17,$l=18,o0=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l3=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),v_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),e6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),x_=512,n2=new Array((Qr+2)*2);Gi(n2);var Jr=new Array(Wi*2);Gi(Jr);var Kr=new Array(x_);Gi(Kr);var $r=new Array(g_-p_+1);Gi($r);var s0=new Array(i0);Gi(s0);var c3=new Array(Wi);Gi(c3);function l0(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}var t6,i6,r6;function c0(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var a6=e=>e<256?Kr[e]:Kr[256+(e>>>7)],ea=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},rt=(e,t,i)=>{e.bi_valid>a0-i?(e.bi_buf|=t<<e.bi_valid&65535,ea(e,e.bi_buf),e.bi_buf=t>>a0-e.bi_valid,e.bi_valid+=i-a0):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Ft=(e,t,i)=>{rt(e,i[t*2],i[t*2+1])},n6=(e,t)=>{let i=0;do i|=e&1,e>>>=1,i<<=1;while(--t>0);return i>>>1},y_=e=>{e.bi_valid===16?(ea(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},S_=(e,t)=>{let i=t.dyn_tree,r=t.max_code,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,d=t.stat_desc.max_length,c,h,u,m,f,v,_=0;for(m=0;m<=Z2;m++)e.bl_count[m]=0;for(i[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<Ql;c++)h=e.heap[c],m=i[i[h*2+1]*2+1]+1,m>d&&(m=d,_++),i[h*2+1]=m,!(h>r)&&(e.bl_count[m]++,f=0,h>=l&&(f=s[h-l]),v=i[h*2],e.opt_len+=v*(m+f),o&&(e.static_len+=v*(n[h*2+1]+f)));if(_!==0){do{for(m=d-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[d]--,_-=2}while(_>0);for(m=d;m!==0;m--)for(h=e.bl_count[m];h!==0;)u=e.heap[--c],!(u>r)&&(i[u*2+1]!==m&&(e.opt_len+=(m-i[u*2+1])*i[u*2],i[u*2+1]=m),h--)}},o6=(e,t,i)=>{let r=new Array(Z2+1),n=0,o,s;for(o=1;o<=Z2;o++)n=n+i[o-1]<<1,r[o]=n;for(s=0;s<=t;s++){let l=e[s*2+1];l!==0&&(e[s*2]=n6(r[l]++,l))}},M_=()=>{let e,t,i,r,n,o=new Array(Z2+1);for(i=0,r=0;r<i0-1;r++)for(s0[r]=i,e=0;e<1<<o0[r];e++)$r[i++]=r;for($r[i-1]=r,n=0,r=0;r<16;r++)for(c3[r]=n,e=0;e<1<<l3[r];e++)Kr[n++]=r;for(n>>=7;r<Wi;r++)for(c3[r]=n<<7,e=0;e<1<<l3[r]-7;e++)Kr[256+n++]=r;for(t=0;t<=Z2;t++)o[t]=0;for(e=0;e<=143;)n2[e*2+1]=8,e++,o[8]++;for(;e<=255;)n2[e*2+1]=9,e++,o[9]++;for(;e<=279;)n2[e*2+1]=7,e++,o[7]++;for(;e<=287;)n2[e*2+1]=8,e++,o[8]++;for(o6(n2,Qr+1,o),e=0;e<Wi;e++)Jr[e*2+1]=5,Jr[e*2]=n6(e,5);t6=new l0(n2,o0,Zr+1,Qr,Z2),i6=new l0(Jr,l3,0,Wi,Z2),r6=new l0(new Array(0),v_,0,r0,__)},s6=e=>{let t;for(t=0;t<Qr;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Wi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<r0;t++)e.bl_tree[t*2]=0;e.dyn_ltree[n0*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},l6=e=>{e.bi_valid>8?ea(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},c6=(e,t,i,r)=>{let n=t*2,o=i*2;return e[n]<e[o]||e[n]===e[o]&&r[t]<=r[i]},d0=(e,t,i)=>{let r=e.heap[i],n=i<<1;for(;n<=e.heap_len&&(n<e.heap_len&&c6(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!c6(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r},d6=(e,t,i)=>{let r,n,o=0,s,l;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,n=e.pending_buf[e.sym_buf+o++],r===0?Ft(e,n,t):(s=$r[n],Ft(e,s+Zr+1,t),l=o0[s],l!==0&&(n-=s0[s],rt(e,n,l)),r--,s=a6(r),Ft(e,s,i),l=l3[s],l!==0&&(r-=c3[s],rt(e,r,l)));while(o<e.sym_next);Ft(e,n0,t)},h0=(e,t)=>{let i=t.dyn_tree,r=t.stat_desc.static_tree,n=t.stat_desc.has_stree,o=t.stat_desc.elems,s,l,d=-1,c;for(e.heap_len=0,e.heap_max=Ql,s=0;s<o;s++)i[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):i[s*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,i[c*2]=1,e.depth[c]=0,e.opt_len--,n&&(e.static_len-=r[c*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)d0(e,i,s);c=o;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],d0(e,i,1),l=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=l,i[c*2]=i[s*2]+i[l*2],e.depth[c]=(e.depth[s]>=e.depth[l]?e.depth[s]:e.depth[l])+1,i[s*2+1]=i[l*2+1]=c,e.heap[1]=c++,d0(e,i,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],S_(e,t),o6(i,d,e.bl_count)},h6=(e,t,i)=>{let r,n=-1,o,s=t[1],l=0,d=7,c=4;for(s===0&&(d=138,c=3),t[(i+1)*2+1]=65535,r=0;r<=i;r++)o=s,s=t[(r+1)*2+1],!(++l<d&&o===s)&&(l<c?e.bl_tree[o*2]+=l:o!==0?(o!==n&&e.bl_tree[o*2]++,e.bl_tree[Jl*2]++):l<=10?e.bl_tree[Kl*2]++:e.bl_tree[$l*2]++,l=0,n=o,s===0?(d=138,c=3):o===s?(d=6,c=3):(d=7,c=4))},u6=(e,t,i)=>{let r,n=-1,o,s=t[1],l=0,d=7,c=4;for(s===0&&(d=138,c=3),r=0;r<=i;r++)if(o=s,s=t[(r+1)*2+1],!(++l<d&&o===s)){if(l<c)do Ft(e,o,e.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Ft(e,o,e.bl_tree),l--),Ft(e,Jl,e.bl_tree),rt(e,l-3,2)):l<=10?(Ft(e,Kl,e.bl_tree),rt(e,l-3,3)):(Ft(e,$l,e.bl_tree),rt(e,l-11,7));l=0,n=o,s===0?(d=138,c=3):o===s?(d=6,c=3):(d=7,c=4)}},w_=e=>{let t;for(h6(e,e.dyn_ltree,e.l_desc.max_code),h6(e,e.dyn_dtree,e.d_desc.max_code),h0(e,e.bl_desc),t=r0-1;t>=3&&e.bl_tree[e6[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},A_=(e,t,i,r)=>{let n;for(rt(e,t-257,5),rt(e,i-1,5),rt(e,r-4,4),n=0;n<r;n++)rt(e,e.bl_tree[e6[n]*2+1],3);u6(e,e.dyn_ltree,t-1),u6(e,e.dyn_dtree,i-1)},E_=e=>{let t=4093624447,i;for(i=0;i<=31;i++,t>>>=1)if(t&1&&e.dyn_ltree[i*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(i=32;i<Zr;i++)if(e.dyn_ltree[i*2]!==0)return 1;return 0},m6=!1,b_=e=>{m6||(M_(),m6=!0),e.l_desc=new c0(e.dyn_ltree,t6),e.d_desc=new c0(e.dyn_dtree,i6),e.bl_desc=new c0(e.bl_tree,r6),e.bi_buf=0,e.bi_valid=0,s6(e)},f6=(e,t,i,r)=>{rt(e,(m_<<1)+(r?1:0),3),l6(e),ea(e,i),ea(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i},C_=e=>{rt(e,Zl<<1,3),Ft(e,n0,n2),y_(e)},T_=(e,t,i,r)=>{let n,o,s=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=E_(e)),h0(e,e.l_desc),h0(e,e.d_desc),s=w_(e),n=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=n&&(n=o)):n=o=i+5,i+4<=n&&t!==-1?f6(e,t,i,r):e.strategy===4||o===n?(rt(e,(Zl<<1)+(r?1:0),3),d6(e,n2,Jr)):(rt(e,(f_<<1)+(r?1:0),3),A_(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),d6(e,e.dyn_ltree,e.dyn_dtree)),s6(e),r&&l6(e)},I_=(e,t,i)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,t===0?e.dyn_ltree[i*2]++:(e.matches++,t--,e.dyn_ltree[($r[i]+Zr+1)*2]++,e.dyn_dtree[a6(t)*2]++),e.sym_next===e.sym_end),P_=b_,N_=f6,L_=T_,R_=I_,D_=C_,U_={_tr_init:P_,_tr_stored_block:N_,_tr_flush_block:L_,_tr_tally:R_,_tr_align:D_},k_=(e,t,i,r)=>{let n=e&65535|0,o=e>>>16&65535|0,s=0;for(;i!==0;){s=i>2e3?2e3:i,i-=s;do n=n+t[r++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0},ta=k_,O_=()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[i]=e}return t},z_=new Uint32Array(O_()),V_=(e,t,i,r)=>{let n=z_,o=r+i;e^=-1;for(let s=r;s<o;s++)e=e>>>8^n[(e^t[s])&255];return e^-1},z1=V_,ji={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ia={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:B_,_tr_stored_block:u0,_tr_flush_block:F_,_tr_tally:C2,_tr_align:H_}=U_,{Z_NO_FLUSH:T2,Z_PARTIAL_FLUSH:G_,Z_FULL_FLUSH:W_,Z_FINISH:gt,Z_BLOCK:p6,Z_OK:V1,Z_STREAM_END:g6,Z_STREAM_ERROR:Ht,Z_DATA_ERROR:j_,Z_BUF_ERROR:m0,Z_DEFAULT_COMPRESSION:X_,Z_FILTERED:Y_,Z_HUFFMAN_ONLY:d3,Z_RLE:q_,Z_FIXED:Z_,Z_DEFAULT_STRATEGY:Q_,Z_UNKNOWN:J_,Z_DEFLATED:h3}=ia,K_=9,$_=15,ev=8,tv=29,iv=256,f0=iv+1+tv,rv=30,av=19,nv=2*f0+1,ov=15,Ze=3,I2=258,Gt=I2+Ze+1,sv=32,Xi=42,p0=57,g0=69,_0=73,v0=91,x0=103,Q2=113,ra=666,K1=1,Yi=2,J2=3,qi=4,lv=3,K2=(e,t)=>(e.msg=ji[t],t),_6=e=>e*2-(e>4?9:0),P2=e=>{let t=e.length;for(;--t>=0;)e[t]=0},cv=e=>{let t,i,r,n=e.w_size;t=e.hash_size,r=t;do i=e.head[--r],e.head[r]=i>=n?i-n:0;while(--t);t=n,r=t;do i=e.prev[--r],e.prev[r]=i>=n?i-n:0;while(--t)},dv=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask,N2=dv,dt=e=>{let t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),i!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,t.pending===0&&(t.pending_out=0))},ht=(e,t)=>{F_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,dt(e.strm)},t1=(e,t)=>{e.pending_buf[e.pending++]=t},aa=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},y0=(e,t,i,r)=>{let n=e.avail_in;return n>r&&(n=r),n===0?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),i),e.state.wrap===1?e.adler=ta(e.adler,t,n,i):e.state.wrap===2&&(e.adler=z1(e.adler,t,n,i)),e.next_in+=n,e.total_in+=n,n)},v6=(e,t)=>{let i=e.max_chain_length,r=e.strstart,n,o,s=e.prev_length,l=e.nice_match,d=e.strstart>e.w_size-Gt?e.strstart-(e.w_size-Gt):0,c=e.window,h=e.w_mask,u=e.prev,m=e.strstart+I2,f=c[r+s-1],v=c[r+s];e.prev_length>=e.good_match&&(i>>=2),l>e.lookahead&&(l=e.lookahead);do if(n=t,!(c[n+s]!==v||c[n+s-1]!==f||c[n]!==c[r]||c[++n]!==c[r+1])){r+=2,n++;do;while(c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&c[++r]===c[++n]&&r<m);if(o=I2-(m-r),r=m-I2,o>s){if(e.match_start=t,s=o,o>=l)break;f=c[r+s-1],v=c[r+s]}}while((t=u[t&h])>d&&--i!==0);return s<=e.lookahead?s:e.lookahead},Zi=e=>{let t=e.w_size,i,r,n;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Gt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),cv(e),r+=t),e.strm.avail_in===0)break;if(i=y0(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=Ze)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=N2(e,e.ins_h,e.window[n+1]);e.insert&&(e.ins_h=N2(e,e.ins_h,e.window[n+Ze-1]),e.prev[n&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=n,n++,e.insert--,!(e.lookahead+e.insert<Ze)););}while(e.lookahead<Gt&&e.strm.avail_in!==0)},x6=(e,t)=>{let i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,n,o,s=0,l=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>o&&(r=o),r<i&&(r===0&&t!==gt||t===T2||r!==n+e.strm.avail_in)))break;s=t===gt&&r===n+e.strm.avail_in?1:0,u0(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,dt(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(y0(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(s===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?qi:t!==T2&&t!==gt&&e.strm.avail_in===0&&e.strstart===e.block_start?Yi:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(y0(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,i=o>e.w_size?e.w_size:o,n=e.strstart-e.block_start,(n>=i||(n||t===gt)&&t!==T2&&e.strm.avail_in===0&&n<=o)&&(r=n>o?o:n,s=t===gt&&e.strm.avail_in===0&&r===n?1:0,u0(e,e.block_start,r,s),e.block_start+=r,dt(e.strm)),s?J2:K1)},S0=(e,t)=>{let i,r;for(;;){if(e.lookahead<Gt){if(Zi(e),e.lookahead<Gt&&t===T2)return K1;if(e.lookahead===0)break}if(i=0,e.lookahead>=Ze&&(e.ins_h=N2(e,e.ins_h,e.window[e.strstart+Ze-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),i!==0&&e.strstart-i<=e.w_size-Gt&&(e.match_length=v6(e,i)),e.match_length>=Ze)if(r=C2(e,e.strstart-e.match_start,e.match_length-Ze),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ze){e.match_length--;do e.strstart++,e.ins_h=N2(e,e.ins_h,e.window[e.strstart+Ze-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=N2(e,e.ins_h,e.window[e.strstart+1]);else r=C2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(ht(e,!1),e.strm.avail_out===0))return K1}return e.insert=e.strstart<Ze-1?e.strstart:Ze-1,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:qi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?K1:Yi},Qi=(e,t)=>{let i,r,n;for(;;){if(e.lookahead<Gt){if(Zi(e),e.lookahead<Gt&&t===T2)return K1;if(e.lookahead===0)break}if(i=0,e.lookahead>=Ze&&(e.ins_h=N2(e,e.ins_h,e.window[e.strstart+Ze-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ze-1,i!==0&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Gt&&(e.match_length=v6(e,i),e.match_length<=5&&(e.strategy===Y_||e.match_length===Ze&&e.strstart-e.match_start>4096)&&(e.match_length=Ze-1)),e.prev_length>=Ze&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-Ze,r=C2(e,e.strstart-1-e.prev_match,e.prev_length-Ze),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=n&&(e.ins_h=N2(e,e.ins_h,e.window[e.strstart+Ze-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ze-1,e.strstart++,r&&(ht(e,!1),e.strm.avail_out===0))return K1}else if(e.match_available){if(r=C2(e,0,e.window[e.strstart-1]),r&&ht(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return K1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=C2(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<Ze-1?e.strstart:Ze-1,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:qi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?K1:Yi},hv=(e,t)=>{let i,r,n,o,s=e.window;for(;;){if(e.lookahead<=I2){if(Zi(e),e.lookahead<=I2&&t===T2)return K1;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ze&&e.strstart>0&&(n=e.strstart-1,r=s[n],r===s[++n]&&r===s[++n]&&r===s[++n])){o=e.strstart+I2;do;while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);e.match_length=I2-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ze?(i=C2(e,1,e.match_length-Ze),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=C2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(ht(e,!1),e.strm.avail_out===0))return K1}return e.insert=0,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:qi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?K1:Yi},uv=(e,t)=>{let i;for(;;){if(e.lookahead===0&&(Zi(e),e.lookahead===0)){if(t===T2)return K1;break}if(e.match_length=0,i=C2(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(ht(e,!1),e.strm.avail_out===0))return K1}return e.insert=0,t===gt?(ht(e,!0),e.strm.avail_out===0?J2:qi):e.sym_next&&(ht(e,!1),e.strm.avail_out===0)?K1:Yi};function Wt(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}var na=[new Wt(0,0,0,0,x6),new Wt(4,4,8,4,S0),new Wt(4,5,16,8,S0),new Wt(4,6,32,32,S0),new Wt(4,4,16,16,Qi),new Wt(8,16,32,32,Qi),new Wt(8,16,128,128,Qi),new Wt(8,32,128,256,Qi),new Wt(32,128,258,1024,Qi),new Wt(32,258,258,4096,Qi)],mv=e=>{e.window_size=2*e.w_size,P2(e.head),e.max_lazy_match=na[e.level].max_lazy,e.good_match=na[e.level].good_length,e.nice_match=na[e.level].nice_length,e.max_chain_length=na[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ze-1,e.match_available=0,e.ins_h=0};function fv(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=h3,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(nv*2),this.dyn_dtree=new Uint16Array((2*rv+1)*2),this.bl_tree=new Uint16Array((2*av+1)*2),P2(this.dyn_ltree),P2(this.dyn_dtree),P2(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ov+1),this.heap=new Uint16Array(2*f0+1),P2(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*f0+1),P2(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var oa=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Xi&&t.status!==p0&&t.status!==g0&&t.status!==_0&&t.status!==v0&&t.status!==x0&&t.status!==Q2&&t.status!==ra?1:0},y6=e=>{if(oa(e))return K2(e,Ht);e.total_in=e.total_out=0,e.data_type=J_;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?p0:t.wrap?Xi:Q2,e.adler=t.wrap===2?0:1,t.last_flush=-2,B_(t),V1},S6=e=>{let t=y6(e);return t===V1&&mv(e.state),t},pv=(e,t)=>oa(e)||e.state.wrap!==2?Ht:(e.state.gzhead=t,V1),M6=(e,t,i,r,n,o)=>{if(!e)return Ht;let s=1;if(t===X_&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),n<1||n>K_||i!==h3||r<8||r>15||t<0||t>9||o<0||o>Z_||r===8&&s!==1)return K2(e,Ht);r===8&&(r=9);let l=new fv;return e.state=l,l.strm=e,l.status=Xi,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Ze-1)/Ze),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=t,l.strategy=o,l.method=i,S6(e)},gv=(e,t)=>M6(e,t,h3,$_,ev,Q_),_v=(e,t)=>{if(oa(e)||t>p6||t<0)return e?K2(e,Ht):Ht;let i=e.state;if(!e.output||e.avail_in!==0&&!e.input||i.status===ra&&t!==gt)return K2(e,e.avail_out===0?m0:Ht);let r=i.last_flush;if(i.last_flush=t,i.pending!==0){if(dt(e),e.avail_out===0)return i.last_flush=-1,V1}else if(e.avail_in===0&&_6(t)<=_6(r)&&t!==gt)return K2(e,m0);if(i.status===ra&&e.avail_in!==0)return K2(e,m0);if(i.status===Xi&&i.wrap===0&&(i.status=Q2),i.status===Xi){let n=h3+(i.w_bits-8<<4)<<8,o=-1;if(i.strategy>=d3||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,n|=o<<6,i.strstart!==0&&(n|=sv),n+=31-n%31,aa(i,n),i.strstart!==0&&(aa(i,e.adler>>>16),aa(i,e.adler&65535)),e.adler=1,i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,V1}if(i.status===p0){if(e.adler=0,t1(i,31),t1(i,139),t1(i,8),i.gzhead)t1(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),t1(i,i.gzhead.time&255),t1(i,i.gzhead.time>>8&255),t1(i,i.gzhead.time>>16&255),t1(i,i.gzhead.time>>24&255),t1(i,i.level===9?2:i.strategy>=d3||i.level<2?4:0),t1(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(t1(i,i.gzhead.extra.length&255),t1(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=z1(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=g0;else if(t1(i,0),t1(i,0),t1(i,0),t1(i,0),t1(i,0),t1(i,i.level===9?2:i.strategy>=d3||i.level<2?4:0),t1(i,lv),i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,V1}if(i.status===g0){if(i.gzhead.extra){let n=i.pending,o=(i.gzhead.extra.length&65535)-i.gzindex;for(;i.pending+o>i.pending_buf_size;){let l=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+l),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex+=l,dt(e),i.pending!==0)return i.last_flush=-1,V1;n=0,o-=l}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending+=o,i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=_0}if(i.status===_0){if(i.gzhead.name){let n=i.pending,o;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n)),dt(e),i.pending!==0)return i.last_flush=-1,V1;n=0}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,t1(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n)),i.gzindex=0}i.status=v0}if(i.status===v0){if(i.gzhead.comment){let n=i.pending,o;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n)),dt(e),i.pending!==0)return i.last_flush=-1,V1;n=0}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,t1(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(e.adler=z1(e.adler,i.pending_buf,i.pending-n,n))}i.status=x0}if(i.status===x0){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(dt(e),i.pending!==0))return i.last_flush=-1,V1;t1(i,e.adler&255),t1(i,e.adler>>8&255),e.adler=0}if(i.status=Q2,dt(e),i.pending!==0)return i.last_flush=-1,V1}if(e.avail_in!==0||i.lookahead!==0||t!==T2&&i.status!==ra){let n=i.level===0?x6(i,t):i.strategy===d3?uv(i,t):i.strategy===q_?hv(i,t):na[i.level].func(i,t);if((n===J2||n===qi)&&(i.status=ra),n===K1||n===J2)return e.avail_out===0&&(i.last_flush=-1),V1;if(n===Yi&&(t===G_?H_(i):t!==p6&&(u0(i,0,0,!1),t===W_&&(P2(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),dt(e),e.avail_out===0))return i.last_flush=-1,V1}return t!==gt?V1:i.wrap<=0?g6:(i.wrap===2?(t1(i,e.adler&255),t1(i,e.adler>>8&255),t1(i,e.adler>>16&255),t1(i,e.adler>>24&255),t1(i,e.total_in&255),t1(i,e.total_in>>8&255),t1(i,e.total_in>>16&255),t1(i,e.total_in>>24&255)):(aa(i,e.adler>>>16),aa(i,e.adler&65535)),dt(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?V1:g6)},vv=e=>{if(oa(e))return Ht;let t=e.state.status;return e.state=null,t===Q2?K2(e,j_):V1},xv=(e,t)=>{let i=t.length;if(oa(e))return Ht;let r=e.state,n=r.wrap;if(n===2||n===1&&r.status!==Xi||r.lookahead)return Ht;if(n===1&&(e.adler=ta(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){n===0&&(P2(r.head),r.strstart=0,r.block_start=0,r.insert=0);let d=new Uint8Array(r.w_size);d.set(t.subarray(i-r.w_size,i),0),t=d,i=r.w_size}let o=e.avail_in,s=e.next_in,l=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,Zi(r);r.lookahead>=Ze;){let d=r.strstart,c=r.lookahead-(Ze-1);do r.ins_h=N2(r,r.ins_h,r.window[d+Ze-1]),r.prev[d&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=d,d++;while(--c);r.strstart=d,r.lookahead=Ze-1,Zi(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=Ze-1,r.match_available=0,e.next_in=s,e.input=l,e.avail_in=o,r.wrap=n,V1},yv=gv,Sv=M6,Mv=S6,wv=y6,Av=pv,Ev=_v,bv=vv,Cv=xv,Tv="pako deflate (from Nodeca project)",sa={deflateInit:yv,deflateInit2:Sv,deflateReset:Mv,deflateResetKeep:wv,deflateSetHeader:Av,deflate:Ev,deflateEnd:bv,deflateSetDictionary:Cv,deflateInfo:Tv},Iv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Pv=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let i=t.shift();if(i){if(typeof i!="object")throw new TypeError(i+"must be non-object");for(let r in i)Iv(i,r)&&(e[r]=i[r])}}return e},Nv=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;let i=new Uint8Array(t);for(let r=0,n=0,o=e.length;r<o;r++){let s=e[r];i.set(s,n),n+=s.length}return i},u3={assign:Pv,flattenChunks:Nv},w6=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{w6=!1}var la=new Uint8Array(256);for(let e=0;e<256;e++)la[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;la[254]=la[254]=1;var Lv=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,i,r,n,o,s=e.length,l=0;for(n=0;n<s;n++)i=e.charCodeAt(n),(i&64512)===55296&&n+1<s&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(i=65536+(i-55296<<10)+(r-56320),n++)),l+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(l),o=0,n=0;o<l;n++)i=e.charCodeAt(n),(i&64512)===55296&&n+1<s&&(r=e.charCodeAt(n+1),(r&64512)===56320&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|i&63):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|i&63):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|i&63);return t},Rv=(e,t)=>{if(t<65534&&e.subarray&&w6)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i},Dv=(e,t)=>{let i=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,n,o=new Array(i*2);for(n=0,r=0;r<i;){let s=e[r++];if(s<128){o[n++]=s;continue}let l=la[s];if(l>4){o[n++]=65533,r+=l-1;continue}for(s&=l===2?31:l===3?15:7;l>1&&r<i;)s=s<<6|e[r++]&63,l--;if(l>1){o[n++]=65533;continue}s<65536?o[n++]=s:(s-=65536,o[n++]=55296|s>>10&1023,o[n++]=56320|s&1023)}return Rv(o,n)},Uv=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let i=t-1;for(;i>=0&&(e[i]&192)===128;)i--;return i<0||i===0?t:i+la[e[i]]>t?i:t},ca={string2buf:Lv,buf2string:Dv,utf8border:Uv};function kv(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var A6=kv,E6=Object.prototype.toString,{Z_NO_FLUSH:Ov,Z_SYNC_FLUSH:zv,Z_FULL_FLUSH:Vv,Z_FINISH:Bv,Z_OK:m3,Z_STREAM_END:Fv,Z_DEFAULT_COMPRESSION:Hv,Z_DEFAULT_STRATEGY:Gv,Z_DEFLATED:Wv}=ia;function M0(e){this.options=u3.assign({level:Hv,method:Wv,chunkSize:16384,windowBits:15,memLevel:8,strategy:Gv},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A6,this.strm.avail_out=0;let i=sa.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==m3)throw new Error(ji[i]);if(t.header&&sa.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=ca.string2buf(t.dictionary):E6.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,i=sa.deflateSetDictionary(this.strm,r),i!==m3)throw new Error(ji[i]);this._dict_set=!0}}M0.prototype.push=function(e,t){let i=this.strm,r=this.options.chunkSize,n,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?Bv:Ov,typeof e=="string"?i.input=ca.string2buf(e):E6.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){if(i.avail_out===0&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(o===zv||o===Vv)&&i.avail_out<=6){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if(n=sa.deflate(i,o),n===Fv)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=sa.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===m3;if(i.avail_out===0){this.onData(i.output);continue}if(o>0&&i.next_out>0){this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;continue}if(i.avail_in===0)break}return!0},M0.prototype.onData=function(e){this.chunks.push(e)},M0.prototype.onEnd=function(e){e===m3&&(this.result=u3.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var f3=16209,jv=16191,Xv=function(e,t){let i,r,n,o,s,l,d,c,h,u,m,f,v,_,g,p,y,x,b,N,A,C,U,S,M=e.state;i=e.next_in,U=e.input,r=i+(e.avail_in-5),n=e.next_out,S=e.output,o=n-(t-e.avail_out),s=n+(e.avail_out-257),l=M.dmax,d=M.wsize,c=M.whave,h=M.wnext,u=M.window,m=M.hold,f=M.bits,v=M.lencode,_=M.distcode,g=(1<<M.lenbits)-1,p=(1<<M.distbits)-1;e:do{f<15&&(m+=U[i++]<<f,f+=8,m+=U[i++]<<f,f+=8),y=v[m&g];t:for(;;){if(x=y>>>24,m>>>=x,f-=x,x=y>>>16&255,x===0)S[n++]=y&65535;else if(x&16){b=y&65535,x&=15,x&&(f<x&&(m+=U[i++]<<f,f+=8),b+=m&(1<<x)-1,m>>>=x,f-=x),f<15&&(m+=U[i++]<<f,f+=8,m+=U[i++]<<f,f+=8),y=_[m&p];i:for(;;){if(x=y>>>24,m>>>=x,f-=x,x=y>>>16&255,x&16){if(N=y&65535,x&=15,f<x&&(m+=U[i++]<<f,f+=8,f<x&&(m+=U[i++]<<f,f+=8)),N+=m&(1<<x)-1,N>l){e.msg="invalid distance too far back",M.mode=f3;break e}if(m>>>=x,f-=x,x=n-o,N>x){if(x=N-x,x>c&&M.sane){e.msg="invalid distance too far back",M.mode=f3;break e}if(A=0,C=u,h===0){if(A+=d-x,x<b){b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}}else if(h<x){if(A+=d+h-x,x-=h,x<b){b-=x;do S[n++]=u[A++];while(--x);if(A=0,h<b){x=h,b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}}}else if(A+=h-x,x<b){b-=x;do S[n++]=u[A++];while(--x);A=n-N,C=S}for(;b>2;)S[n++]=C[A++],S[n++]=C[A++],S[n++]=C[A++],b-=3;b&&(S[n++]=C[A++],b>1&&(S[n++]=C[A++]))}else{A=n-N;do S[n++]=S[A++],S[n++]=S[A++],S[n++]=S[A++],b-=3;while(b>2);b&&(S[n++]=S[A++],b>1&&(S[n++]=S[A++]))}}else if(x&64){e.msg="invalid distance code",M.mode=f3;break e}else{y=_[(y&65535)+(m&(1<<x)-1)];continue i}break}}else if(x&64)if(x&32){M.mode=jv;break e}else{e.msg="invalid literal/length code",M.mode=f3;break e}else{y=v[(y&65535)+(m&(1<<x)-1)];continue t}break}}while(i<r&&n<s);b=f>>3,i-=b,f-=b<<3,m&=(1<<f)-1,e.next_in=i,e.next_out=n,e.avail_in=i<r?5+(r-i):5-(i-r),e.avail_out=n<s?257+(s-n):257-(n-s),M.hold=m,M.bits=f},Ji=15,b6=852,C6=592,T6=0,w0=1,I6=2,Yv=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),qv=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Zv=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qv=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Jv=(e,t,i,r,n,o,s,l)=>{let d=l.bits,c=0,h=0,u=0,m=0,f=0,v=0,_=0,g=0,p=0,y=0,x,b,N,A,C,U=null,S,M=new Uint16Array(Ji+1),k=new Uint16Array(Ji+1),R=null,D,B,Z;for(c=0;c<=Ji;c++)M[c]=0;for(h=0;h<r;h++)M[t[i+h]]++;for(f=d,m=Ji;m>=1&&M[m]===0;m--);if(f>m&&(f=m),m===0)return n[o++]=1<<24|64<<16|0,n[o++]=1<<24|64<<16|0,l.bits=1,0;for(u=1;u<m&&M[u]===0;u++);for(f<u&&(f=u),g=1,c=1;c<=Ji;c++)if(g<<=1,g-=M[c],g<0)return-1;if(g>0&&(e===T6||m!==1))return-1;for(k[1]=0,c=1;c<Ji;c++)k[c+1]=k[c]+M[c];for(h=0;h<r;h++)t[i+h]!==0&&(s[k[t[i+h]]++]=h);if(e===T6?(U=R=s,S=20):e===w0?(U=Yv,R=qv,S=257):(U=Zv,R=Qv,S=0),y=0,h=0,c=u,C=o,v=f,_=0,N=-1,p=1<<f,A=p-1,e===w0&&p>b6||e===I6&&p>C6)return 1;for(;;){D=c-_,s[h]+1<S?(B=0,Z=s[h]):s[h]>=S?(B=R[s[h]-S],Z=U[s[h]-S]):(B=96,Z=0),x=1<<c-_,b=1<<v,u=b;do b-=x,n[C+(y>>_)+b]=D<<24|B<<16|Z|0;while(b!==0);for(x=1<<c-1;y&x;)x>>=1;if(x!==0?(y&=x-1,y+=x):y=0,h++,--M[c]===0){if(c===m)break;c=t[i+s[h]]}if(c>f&&(y&A)!==N){for(_===0&&(_=f),C+=u,v=c-_,g=1<<v;v+_<m&&(g-=M[v+_],!(g<=0));)v++,g<<=1;if(p+=1<<v,e===w0&&p>b6||e===I6&&p>C6)return 1;N=y&A,n[N]=f<<24|v<<16|C-o|0}}return y!==0&&(n[C+y]=c-_<<24|64<<16|0),l.bits=f,0},da=Jv,Kv=0,P6=1,N6=2,{Z_FINISH:L6,Z_BLOCK:$v,Z_TREES:p3,Z_OK:$2,Z_STREAM_END:e9,Z_NEED_DICT:t9,Z_STREAM_ERROR:Ct,Z_DATA_ERROR:R6,Z_MEM_ERROR:D6,Z_BUF_ERROR:i9,Z_DEFLATED:U6}=ia,g3=16180,k6=16181,O6=16182,z6=16183,V6=16184,B6=16185,F6=16186,H6=16187,G6=16188,W6=16189,_3=16190,o2=16191,A0=16192,j6=16193,E0=16194,X6=16195,Y6=16196,q6=16197,Z6=16198,v3=16199,x3=16200,Q6=16201,J6=16202,K6=16203,$6=16204,e4=16205,b0=16206,t4=16207,i4=16208,y1=16209,r4=16210,a4=16211,r9=852,a9=592,n9=15,o9=n9,n4=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function s9(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var ei=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<g3||t.mode>a4?1:0},o4=e=>{if(ei(e))return Ct;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=g3,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(r9),t.distcode=t.distdyn=new Int32Array(a9),t.sane=1,t.back=-1,$2},s4=e=>{if(ei(e))return Ct;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,o4(e)},l4=(e,t)=>{let i;if(ei(e))return Ct;let r=e.state;return t<0?(i=0,t=-t):(i=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ct:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,s4(e))},c4=(e,t)=>{if(!e)return Ct;let i=new s9;e.state=i,i.strm=e,i.window=null,i.mode=g3;let r=l4(e,t);return r!==$2&&(e.state=null),r},l9=e=>c4(e,o9),d4=!0,C0,T0,c9=e=>{if(d4){C0=new Int32Array(512),T0=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(da(P6,e.lens,0,288,C0,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;da(N6,e.lens,0,32,T0,0,e.work,{bits:5}),d4=!1}e.lencode=C0,e.lenbits=9,e.distcode=T0,e.distbits=5},h4=(e,t,i,r)=>{let n,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(i-o.wsize,i),0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>r&&(n=r),o.window.set(t.subarray(i-r,i-r+n),o.wnext),r-=n,r?(o.window.set(t.subarray(i-r,i),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0},d9=(e,t)=>{let i,r,n,o,s,l,d,c,h,u,m,f,v,_,g=0,p,y,x,b,N,A,C,U,S=new Uint8Array(4),M,k,R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ei(e)||!e.output||!e.input&&e.avail_in!==0)return Ct;i=e.state,i.mode===o2&&(i.mode=A0),s=e.next_out,n=e.output,d=e.avail_out,o=e.next_in,r=e.input,l=e.avail_in,c=i.hold,h=i.bits,u=l,m=d,U=$2;e:for(;;)switch(i.mode){case g3:if(i.wrap===0){i.mode=A0;break}for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&2&&c===35615){i.wbits===0&&(i.wbits=15),i.check=0,S[0]=c&255,S[1]=c>>>8&255,i.check=z1(i.check,S,2,0),c=0,h=0,i.mode=k6;break}if(i.head&&(i.head.done=!1),!(i.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=y1;break}if((c&15)!==U6){e.msg="unknown compression method",i.mode=y1;break}if(c>>>=4,h-=4,C=(c&15)+8,i.wbits===0&&(i.wbits=C),C>15||C>i.wbits){e.msg="invalid window size",i.mode=y1;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=c&512?W6:o2,c=0,h=0;break;case k6:for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.flags=c,(i.flags&255)!==U6){e.msg="unknown compression method",i.mode=y1;break}if(i.flags&57344){e.msg="unknown header flags set",i.mode=y1;break}i.head&&(i.head.text=c>>8&1),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=z1(i.check,S,2,0)),c=0,h=0,i.mode=O6;case O6:for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.head&&(i.head.time=c),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,i.check=z1(i.check,S,4,0)),c=0,h=0,i.mode=z6;case z6:for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.head&&(i.head.xflags=c&255,i.head.os=c>>8),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=z1(i.check,S,2,0)),c=0,h=0,i.mode=V6;case V6:if(i.flags&1024){for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.length=c,i.head&&(i.head.extra_len=c),i.flags&512&&i.wrap&4&&(S[0]=c&255,S[1]=c>>>8&255,i.check=z1(i.check,S,2,0)),c=0,h=0}else i.head&&(i.head.extra=null);i.mode=B6;case B6:if(i.flags&1024&&(f=i.length,f>l&&(f=l),f&&(i.head&&(C=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(o,o+f),C)),i.flags&512&&i.wrap&4&&(i.check=z1(i.check,r,f,o)),l-=f,o+=f,i.length-=f),i.length))break e;i.length=0,i.mode=F6;case F6:if(i.flags&2048){if(l===0)break e;f=0;do C=r[o+f++],i.head&&C&&i.length<65536&&(i.head.name+=String.fromCharCode(C));while(C&&f<l);if(i.flags&512&&i.wrap&4&&(i.check=z1(i.check,r,f,o)),l-=f,o+=f,C)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=H6;case H6:if(i.flags&4096){if(l===0)break e;f=0;do C=r[o+f++],i.head&&C&&i.length<65536&&(i.head.comment+=String.fromCharCode(C));while(C&&f<l);if(i.flags&512&&i.wrap&4&&(i.check=z1(i.check,r,f,o)),l-=f,o+=f,C)break e}else i.head&&(i.head.comment=null);i.mode=G6;case G6:if(i.flags&512){for(;h<16;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&4&&c!==(i.check&65535)){e.msg="header crc mismatch",i.mode=y1;break}c=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=o2;break;case W6:for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}e.adler=i.check=n4(c),c=0,h=0,i.mode=_3;case _3:if(i.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,t9;e.adler=i.check=1,i.mode=o2;case o2:if(t===$v||t===p3)break e;case A0:if(i.last){c>>>=h&7,h-=h&7,i.mode=b0;break}for(;h<3;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}switch(i.last=c&1,c>>>=1,h-=1,c&3){case 0:i.mode=j6;break;case 1:if(c9(i),i.mode=v3,t===p3){c>>>=2,h-=2;break e}break;case 2:i.mode=Y6;break;case 3:e.msg="invalid block type",i.mode=y1}c>>>=2,h-=2;break;case j6:for(c>>>=h&7,h-=h&7;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",i.mode=y1;break}if(i.length=c&65535,c=0,h=0,i.mode=E0,t===p3)break e;case E0:i.mode=X6;case X6:if(f=i.length,f){if(f>l&&(f=l),f>d&&(f=d),f===0)break e;n.set(r.subarray(o,o+f),s),l-=f,o+=f,d-=f,s+=f,i.length-=f;break}i.mode=o2;break;case Y6:for(;h<14;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.nlen=(c&31)+257,c>>>=5,h-=5,i.ndist=(c&31)+1,c>>>=5,h-=5,i.ncode=(c&15)+4,c>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=y1;break}i.have=0,i.mode=q6;case q6:for(;i.have<i.ncode;){for(;h<3;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.lens[R[i.have++]]=c&7,c>>>=3,h-=3}for(;i.have<19;)i.lens[R[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,M={bits:i.lenbits},U=da(Kv,i.lens,0,19,i.lencode,0,i.work,M),i.lenbits=M.bits,U){e.msg="invalid code lengths set",i.mode=y1;break}i.have=0,i.mode=Z6;case Z6:for(;i.have<i.nlen+i.ndist;){for(;g=i.lencode[c&(1<<i.lenbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(x<16)c>>>=p,h-=p,i.lens[i.have++]=x;else{if(x===16){for(k=p+2;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(c>>>=p,h-=p,i.have===0){e.msg="invalid bit length repeat",i.mode=y1;break}C=i.lens[i.have-1],f=3+(c&3),c>>>=2,h-=2}else if(x===17){for(k=p+3;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=p,h-=p,C=0,f=3+(c&7),c>>>=3,h-=3}else{for(k=p+7;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=p,h-=p,C=0,f=11+(c&127),c>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=y1;break}for(;f--;)i.lens[i.have++]=C}}if(i.mode===y1)break;if(i.lens[256]===0){e.msg="invalid code -- missing end-of-block",i.mode=y1;break}if(i.lenbits=9,M={bits:i.lenbits},U=da(P6,i.lens,0,i.nlen,i.lencode,0,i.work,M),i.lenbits=M.bits,U){e.msg="invalid literal/lengths set",i.mode=y1;break}if(i.distbits=6,i.distcode=i.distdyn,M={bits:i.distbits},U=da(N6,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,M),i.distbits=M.bits,U){e.msg="invalid distances set",i.mode=y1;break}if(i.mode=v3,t===p3)break e;case v3:i.mode=x3;case x3:if(l>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,Xv(e,m),s=e.next_out,n=e.output,d=e.avail_out,o=e.next_in,r=e.input,l=e.avail_in,c=i.hold,h=i.bits,i.mode===o2&&(i.back=-1);break}for(i.back=0;g=i.lencode[c&(1<<i.lenbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(y&&!(y&240)){for(b=p,N=y,A=x;g=i.lencode[A+((c&(1<<b+N)-1)>>b)],p=g>>>24,y=g>>>16&255,x=g&65535,!(b+p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=b,h-=b,i.back+=b}if(c>>>=p,h-=p,i.back+=p,i.length=x,y===0){i.mode=e4;break}if(y&32){i.back=-1,i.mode=o2;break}if(y&64){e.msg="invalid literal/length code",i.mode=y1;break}i.extra=y&15,i.mode=Q6;case Q6:if(i.extra){for(k=i.extra;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=J6;case J6:for(;g=i.distcode[c&(1<<i.distbits)-1],p=g>>>24,y=g>>>16&255,x=g&65535,!(p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(!(y&240)){for(b=p,N=y,A=x;g=i.distcode[A+((c&(1<<b+N)-1)>>b)],p=g>>>24,y=g>>>16&255,x=g&65535,!(b+p<=h);){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}c>>>=b,h-=b,i.back+=b}if(c>>>=p,h-=p,i.back+=p,y&64){e.msg="invalid distance code",i.mode=y1;break}i.offset=x,i.extra=y&15,i.mode=K6;case K6:if(i.extra){for(k=i.extra;h<k;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=y1;break}i.mode=$6;case $6:if(d===0)break e;if(f=m-d,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=y1;break}f>i.wnext?(f-=i.wnext,v=i.wsize-f):v=i.wnext-f,f>i.length&&(f=i.length),_=i.window}else _=n,v=s-i.offset,f=i.length;f>d&&(f=d),d-=f,i.length-=f;do n[s++]=_[v++];while(--f);i.length===0&&(i.mode=x3);break;case e4:if(d===0)break e;n[s++]=i.length,d--,i.mode=x3;break;case b0:if(i.wrap){for(;h<32;){if(l===0)break e;l--,c|=r[o++]<<h,h+=8}if(m-=d,e.total_out+=m,i.total+=m,i.wrap&4&&m&&(e.adler=i.check=i.flags?z1(i.check,n,m,s-m):ta(i.check,n,m,s-m)),m=d,i.wrap&4&&(i.flags?c:n4(c))!==i.check){e.msg="incorrect data check",i.mode=y1;break}c=0,h=0}i.mode=t4;case t4:if(i.wrap&&i.flags){for(;h<32;){if(l===0)break e;l--,c+=r[o++]<<h,h+=8}if(i.wrap&4&&c!==(i.total&4294967295)){e.msg="incorrect length check",i.mode=y1;break}c=0,h=0}i.mode=i4;case i4:U=e9;break e;case y1:U=R6;break e;case r4:return D6;case a4:default:return Ct}return e.next_out=s,e.avail_out=d,e.next_in=o,e.avail_in=l,i.hold=c,i.bits=h,(i.wsize||m!==e.avail_out&&i.mode<y1&&(i.mode<b0||t!==L6))&&h4(e,e.output,e.next_out,m-e.avail_out),u-=e.avail_in,m-=e.avail_out,e.total_in+=u,e.total_out+=m,i.total+=m,i.wrap&4&&m&&(e.adler=i.check=i.flags?z1(i.check,n,m,e.next_out-m):ta(i.check,n,m,e.next_out-m)),e.data_type=i.bits+(i.last?64:0)+(i.mode===o2?128:0)+(i.mode===v3||i.mode===E0?256:0),(u===0&&m===0||t===L6)&&U===$2&&(U=i9),U},h9=e=>{if(ei(e))return Ct;let t=e.state;return t.window&&(t.window=null),e.state=null,$2},u9=(e,t)=>{if(ei(e))return Ct;let i=e.state;return i.wrap&2?(i.head=t,t.done=!1,$2):Ct},m9=(e,t)=>{let i=t.length,r,n,o;return ei(e)||(r=e.state,r.wrap!==0&&r.mode!==_3)?Ct:r.mode===_3&&(n=1,n=ta(n,t,i,0),n!==r.check)?R6:(o=h4(e,t,i,i),o?(r.mode=r4,D6):(r.havedict=1,$2))},f9=s4,p9=l4,g9=o4,_9=l9,v9=c4,x9=d9,y9=h9,S9=u9,M9=m9,w9="pako inflate (from Nodeca project)",s2={inflateReset:f9,inflateReset2:p9,inflateResetKeep:g9,inflateInit:_9,inflateInit2:v9,inflate:x9,inflateEnd:y9,inflateGetHeader:S9,inflateSetDictionary:M9,inflateInfo:w9};function A9(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var E9=A9,u4=Object.prototype.toString,{Z_NO_FLUSH:b9,Z_FINISH:C9,Z_OK:ha,Z_STREAM_END:I0,Z_NEED_DICT:P0,Z_STREAM_ERROR:T9,Z_DATA_ERROR:m4,Z_MEM_ERROR:I9}=ia;function ua(e){this.options=u3.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(t.windowBits&15)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A6,this.strm.avail_out=0;let i=s2.inflateInit2(this.strm,t.windowBits);if(i!==ha)throw new Error(ji[i]);if(this.header=new E9,s2.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ca.string2buf(t.dictionary):u4.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=s2.inflateSetDictionary(this.strm,t.dictionary),i!==ha)))throw new Error(ji[i])}ua.prototype.push=function(e,t){let i=this.strm,r=this.options.chunkSize,n=this.options.dictionary,o,s,l;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?C9:b9,u4.call(e)==="[object ArrayBuffer]"?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(i.avail_out===0&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),o=s2.inflate(i,s),o===P0&&n&&(o=s2.inflateSetDictionary(i,n),o===ha?o=s2.inflate(i,s):o===m4&&(o=P0));i.avail_in>0&&o===I0&&i.state.wrap>0&&e[i.next_in]!==0;)s2.inflateReset(i),o=s2.inflate(i,s);switch(o){case T9:case m4:case P0:case I9:return this.onEnd(o),this.ended=!0,!1}if(l=i.avail_out,i.next_out&&(i.avail_out===0||o===I0))if(this.options.to==="string"){let d=ca.utf8border(i.output,i.next_out),c=i.next_out-d,h=ca.buf2string(i.output,d);i.next_out=c,i.avail_out=r-c,c&&i.output.set(i.output.subarray(d,d+c),0),this.onData(h)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(!(o===ha&&l===0)){if(o===I0)return o=s2.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(i.avail_in===0)break}}return!0},ua.prototype.onData=function(e){this.chunks.push(e)},ua.prototype.onEnd=function(e){e===ha&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u3.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function N0(e,t){let i=new ua(t);if(i.push(e),i.err)throw i.msg||ji[i.err];return i.result}function P9(e,t){return t=t||{},t.raw=!0,N0(e,t)}var N9=ua,L9=N0,R9=P9,D9=N0,U9=ia,k9={Inflate:N9,inflate:L9,inflateRaw:R9,ungzip:D9,constants:U9},{Inflate:VM,inflate:BM,inflateRaw:O9,ungzip:FM}=k9,z9=O9,V9=(yr=class extends Event{constructor(t){super(yr.EVENT_NAME),this.data=t}},yr.EVENT_NAME="imageLoaderOptions",yr),B9=class O4{static async fetchArrayBufferWithProgress(t,i){return i?await(await O4.fetchBlobWithProgress(t,i)).arrayBuffer():await(await fetch(t)).arrayBuffer()}static async fetchBlobWithProgress(t,i){var r;if(i){let n=await fetch(t);if(!n.ok)throw new Error(`HTTP error! ${n.status}`);let o=Number(n.headers.get("Content-Length"));o||console.warn("No Content-Length header — cannot compute progress.");let s=(r=n.body)==null?void 0:r.getReader(),l=[],d=0;for(;;){let{done:c,value:h}=await s.read();if(c)break;l.push(h),d+=h.length,o&&i(d/o)}return new Blob(l)}else return await(await fetch(t)).blob()}},F9=`var ui=300;var Ee=1e3,de=1001,Gn=1002,Xe=1003;var Bt=1006;var fi=1008;var Ji=1009;var $i=1014,Ke=1015,Re=1016;var Ki=1020;var Cn=1023;var nn=1026,Wn=1027,di=1028;var qe=2300,Ye=2301,sn=2302,Xn=2400,qn=2401,Yn=2402;var Qe="",Qt="srgb",_e="srgb-linear",Qi="display-p3",pi="display-p3-linear",fn="linear",Zn="srgb",Jn="rec709",$n="p3";var ji=515;var ze=2e3,Kn=2001,Ze=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,a=i.length;s<a;s++)i[s].call(this,t);t.target=null}}},ct=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];var So=Math.PI/180,bo=180/Math.PI;function Rn(){let p=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ct[p&255]+ct[p>>8&255]+ct[p>>16&255]+ct[p>>24&255]+"-"+ct[t&255]+ct[t>>8&255]+"-"+ct[t>>16&15|64]+ct[t>>24&255]+"-"+ct[e&63|128]+ct[e>>8&255]+"-"+ct[e>>16&255]+ct[e>>24&255]+ct[n&255]+ct[n>>8&255]+ct[n>>16&255]+ct[n>>24&255]).toLowerCase()}function dt(p,t,e){return Math.max(t,Math.min(e,p))}function ts(p,t){return(p%t+t)%t}function rn(p,t,e){return(1-e)*p+e*t}var zt=class p{constructor(t=0,e=0){p.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(dt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*n-a*i+t.x,this.y=s*i+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},z=class p{constructor(t,e,n,i,s,a,c,l,o){p.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,c,l,o)}set(t,e,n,i,s,a,c,l,o){let u=this.elements;return u[0]=t,u[1]=i,u[2]=c,u[3]=e,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=o,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],c=n[3],l=n[6],o=n[1],u=n[4],f=n[7],m=n[2],g=n[5],x=n[8],w=i[0],L=i[3],P=i[6],$=i[1],G=i[4],Y=i[7],O=i[2],K=i[5],V=i[8];return s[0]=a*w+c*$+l*O,s[3]=a*L+c*G+l*K,s[6]=a*P+c*Y+l*V,s[1]=o*w+u*$+f*O,s[4]=o*L+u*G+f*K,s[7]=o*P+u*Y+f*V,s[2]=m*w+g*$+x*O,s[5]=m*L+g*G+x*K,s[8]=m*P+g*Y+x*V,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8];return e*a*u-e*c*o-n*s*u+n*c*l+i*s*o-i*a*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8],f=u*a-c*o,m=c*l-u*s,g=o*s-a*l,x=e*f+n*m+i*g;if(x===0)return this.set(0,0,0,0,0,0,0,0,0);let w=1/x;return t[0]=f*w,t[1]=(i*o-u*n)*w,t[2]=(c*n-i*a)*w,t[3]=m*w,t[4]=(u*e-i*l)*w,t[5]=(i*s-c*e)*w,t[6]=g*w,t[7]=(n*l-o*e)*w,t[8]=(a*e-n*s)*w,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,s,a,c){let l=Math.cos(s),o=Math.sin(s);return this.set(n*l,n*o,-n*(l*a+o*c)+a+t,-i*o,i*l,-i*(-o*a+l*c)+c+e,0,0,1),this}scale(t,e){return this.premultiply(an.makeScale(t,e)),this}rotate(t){return this.premultiply(an.makeRotation(-t)),this}translate(t,e){return this.premultiply(an.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},an=new z;function Qn(p){return document.createElementNS("http://www.w3.org/1999/xhtml",p)}var jn=new z().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),ti=new z().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ke={[_e]:{transfer:fn,primaries:Jn,toReference:p=>p,fromReference:p=>p},[Qt]:{transfer:Zn,primaries:Jn,toReference:p=>p.convertSRGBToLinear(),fromReference:p=>p.convertLinearToSRGB()},[pi]:{transfer:fn,primaries:$n,toReference:p=>p.applyMatrix3(ti),fromReference:p=>p.applyMatrix3(jn)},[Qi]:{transfer:Zn,primaries:$n,toReference:p=>p.convertSRGBToLinear().applyMatrix3(ti),fromReference:p=>p.applyMatrix3(jn).convertLinearToSRGB()}},es=new Set([_e,pi]),At={enabled:!0,_workingColorSpace:_e,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(p){if(!es.has(p))throw new Error(\`Unsupported working color space, "\${p}".\`);this._workingColorSpace=p},convert:function(p,t,e){if(this.enabled===!1||t===e||!t||!e)return p;let n=ke[t].toReference,i=ke[e].fromReference;return i(n(p))},fromWorkingColorSpace:function(p,t){return this.convert(p,this._workingColorSpace,t)},toWorkingColorSpace:function(p,t){return this.convert(p,t,this._workingColorSpace)},getPrimaries:function(p){return ke[p].primaries},getTransfer:function(p){return p===Qe?fn:ke[p].transfer}};function pe(p){return p<.04045?p*.0773993808:Math.pow(p*.9478672986+.0521327014,2.4)}function on(p){return p<.0031308?p*12.92:1.055*Math.pow(p,.41666)-.055}var le,dn=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{le===void 0&&(le=Qn("canvas")),le.width=t.width,le.height=t.height;let n=le.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=le}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Qn("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let a=0;a<s.length;a++)s[a]=pe(s[a]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(pe(e[n]/255)*255):e[n]=pe(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},ns=0,pn=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:ns++}),this.uuid=Rn(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let a=0,c=i.length;a<c;a++)i[a].isDataTexture?s.push(ln(i[a].image)):s.push(ln(i[a]))}else s=ln(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function ln(p){return typeof HTMLImageElement<"u"&&p instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&p instanceof ImageBitmap?dn.getDataURL(p):p.data?{data:Array.from(p.data),width:p.width,height:p.height,type:p.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var is=0,ne=class p extends Ze{constructor(t=p.DEFAULT_IMAGE,e=p.DEFAULT_MAPPING,n=de,i=de,s=Bt,a=fi,c=Cn,l=Ji,o=p.DEFAULT_ANISOTROPY,u=Qe){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:is++}),this.uuid=Rn(),this.name="",this.source=new pn(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=a,this.anisotropy=o,this.format=c,this.internalFormat=null,this.type=l,this.offset=new zt(0,0),this.repeat=new zt(1,1),this.center=new zt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new z,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}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(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==ui)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ee:t.x=t.x-Math.floor(t.x);break;case de:t.x=t.x<0?0:1;break;case Gn:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Ee:t.y=t.y-Math.floor(t.y);break;case de:t.y=t.y<0?0:1;break;case Gn:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};ne.DEFAULT_IMAGE=null;ne.DEFAULT_MAPPING=ui;ne.DEFAULT_ANISOTROPY=1;var te=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,a,c){let l=n[i+0],o=n[i+1],u=n[i+2],f=n[i+3],m=s[a+0],g=s[a+1],x=s[a+2],w=s[a+3];if(c===0){t[e+0]=l,t[e+1]=o,t[e+2]=u,t[e+3]=f;return}if(c===1){t[e+0]=m,t[e+1]=g,t[e+2]=x,t[e+3]=w;return}if(f!==w||l!==m||o!==g||u!==x){let L=1-c,P=l*m+o*g+u*x+f*w,$=P>=0?1:-1,G=1-P*P;if(G>Number.EPSILON){let O=Math.sqrt(G),K=Math.atan2(O,P*$);L=Math.sin(L*K)/O,c=Math.sin(c*K)/O}let Y=c*$;if(l=l*L+m*Y,o=o*L+g*Y,u=u*L+x*Y,f=f*L+w*Y,L===1-c){let O=1/Math.sqrt(l*l+o*o+u*u+f*f);l*=O,o*=O,u*=O,f*=O}}t[e]=l,t[e+1]=o,t[e+2]=u,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,a){let c=n[i],l=n[i+1],o=n[i+2],u=n[i+3],f=s[a],m=s[a+1],g=s[a+2],x=s[a+3];return t[e]=c*x+u*f+l*g-o*m,t[e+1]=l*x+u*m+o*f-c*g,t[e+2]=o*x+u*g+c*m-l*f,t[e+3]=u*x-c*f-l*m-o*g,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,i=t._y,s=t._z,a=t._order,c=Math.cos,l=Math.sin,o=c(n/2),u=c(i/2),f=c(s/2),m=l(n/2),g=l(i/2),x=l(s/2);switch(a){case"XYZ":this._x=m*u*f+o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f-m*g*x;break;case"YXZ":this._x=m*u*f+o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f+m*g*x;break;case"ZXY":this._x=m*u*f-o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f-m*g*x;break;case"ZYX":this._x=m*u*f-o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f+m*g*x;break;case"YZX":this._x=m*u*f+o*g*x,this._y=o*g*f+m*u*x,this._z=o*u*x-m*g*f,this._w=o*u*f-m*g*x;break;case"XZY":this._x=m*u*f-o*g*x,this._y=o*g*f-m*u*x,this._z=o*u*x+m*g*f,this._w=o*u*f+m*g*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],a=e[1],c=e[5],l=e[9],o=e[2],u=e[6],f=e[10],m=n+c+f;if(m>0){let g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(u-l)*g,this._y=(s-o)*g,this._z=(a-i)*g}else if(n>c&&n>f){let g=2*Math.sqrt(1+n-c-f);this._w=(u-l)/g,this._x=.25*g,this._y=(i+a)/g,this._z=(s+o)/g}else if(c>f){let g=2*Math.sqrt(1+c-n-f);this._w=(s-o)/g,this._x=(i+a)/g,this._y=.25*g,this._z=(l+u)/g}else{let g=2*Math.sqrt(1+f-n-c);this._w=(a-i)/g,this._x=(s+o)/g,this._y=(l+u)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(dt(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,i=t._y,s=t._z,a=t._w,c=e._x,l=e._y,o=e._z,u=e._w;return this._x=n*u+a*c+i*o-s*l,this._y=i*u+a*l+s*c-n*o,this._z=s*u+a*o+n*l-i*c,this._w=a*u-n*c-i*l-s*o,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,a=this._w,c=a*t._w+n*t._x+i*t._y+s*t._z;if(c<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,c=-c):this.copy(t),c>=1)return this._w=a,this._x=n,this._y=i,this._z=s,this;let l=1-c*c;if(l<=Number.EPSILON){let g=1-e;return this._w=g*a+e*this._w,this._x=g*n+e*this._x,this._y=g*i+e*this._y,this._z=g*s+e*this._z,this.normalize(),this}let o=Math.sqrt(l),u=Math.atan2(o,c),f=Math.sin((1-e)*u)/o,m=Math.sin(e*u)/o;return this._w=a*f+this._w*m,this._x=n*f+this._x*m,this._y=i*f+this._y*m,this._z=s*f+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},q=class p{constructor(t=0,e=0,n=0){p.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(ei.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(ei.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,a=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*a,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*a,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,a=t.y,c=t.z,l=t.w,o=2*(a*i-c*n),u=2*(c*e-s*i),f=2*(s*n-a*e);return this.x=e+l*o+a*f-c*u,this.y=n+l*u+c*o-s*f,this.z=i+l*f+s*u-a*o,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,a=e.x,c=e.y,l=e.z;return this.x=i*l-s*c,this.y=s*a-n*l,this.z=n*c-i*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return cn.copy(this).projectOnVector(t),this.sub(cn)}reflect(t){return this.sub(cn.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(dt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},cn=new q,ei=new te;var jt=class p{constructor(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L){p.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L)}set(t,e,n,i,s,a,c,l,o,u,f,m,g,x,w,L){let P=this.elements;return P[0]=t,P[4]=e,P[8]=n,P[12]=i,P[1]=s,P[5]=a,P[9]=c,P[13]=l,P[2]=o,P[6]=u,P[10]=f,P[14]=m,P[3]=g,P[7]=x,P[11]=w,P[15]=L,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 p().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/ce.setFromMatrixColumn(t,0).length(),s=1/ce.setFromMatrixColumn(t,1).length(),a=1/ce.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,a=Math.cos(n),c=Math.sin(n),l=Math.cos(i),o=Math.sin(i),u=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let m=a*u,g=a*f,x=c*u,w=c*f;e[0]=l*u,e[4]=-l*f,e[8]=o,e[1]=g+x*o,e[5]=m-w*o,e[9]=-c*l,e[2]=w-m*o,e[6]=x+g*o,e[10]=a*l}else if(t.order==="YXZ"){let m=l*u,g=l*f,x=o*u,w=o*f;e[0]=m+w*c,e[4]=x*c-g,e[8]=a*o,e[1]=a*f,e[5]=a*u,e[9]=-c,e[2]=g*c-x,e[6]=w+m*c,e[10]=a*l}else if(t.order==="ZXY"){let m=l*u,g=l*f,x=o*u,w=o*f;e[0]=m-w*c,e[4]=-a*f,e[8]=x+g*c,e[1]=g+x*c,e[5]=a*u,e[9]=w-m*c,e[2]=-a*o,e[6]=c,e[10]=a*l}else if(t.order==="ZYX"){let m=a*u,g=a*f,x=c*u,w=c*f;e[0]=l*u,e[4]=x*o-g,e[8]=m*o+w,e[1]=l*f,e[5]=w*o+m,e[9]=g*o-x,e[2]=-o,e[6]=c*l,e[10]=a*l}else if(t.order==="YZX"){let m=a*l,g=a*o,x=c*l,w=c*o;e[0]=l*u,e[4]=w-m*f,e[8]=x*f+g,e[1]=f,e[5]=a*u,e[9]=-c*u,e[2]=-o*u,e[6]=g*f+x,e[10]=m-w*f}else if(t.order==="XZY"){let m=a*l,g=a*o,x=c*l,w=c*o;e[0]=l*u,e[4]=-f,e[8]=o*u,e[1]=m*f+w,e[5]=a*u,e[9]=g*f-x,e[2]=x*f-g,e[6]=c*u,e[10]=w*f+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(ss,t,rs)}lookAt(t,e,n){let i=this.elements;return _t.subVectors(t,e),_t.lengthSq()===0&&(_t.z=1),_t.normalize(),$t.crossVectors(n,_t),$t.lengthSq()===0&&(Math.abs(n.z)===1?_t.x+=1e-4:_t.z+=1e-4,_t.normalize(),$t.crossVectors(n,_t)),$t.normalize(),Ve.crossVectors(_t,$t),i[0]=$t.x,i[4]=Ve.x,i[8]=_t.x,i[1]=$t.y,i[5]=Ve.y,i[9]=_t.y,i[2]=$t.z,i[6]=Ve.z,i[10]=_t.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,a=n[0],c=n[4],l=n[8],o=n[12],u=n[1],f=n[5],m=n[9],g=n[13],x=n[2],w=n[6],L=n[10],P=n[14],$=n[3],G=n[7],Y=n[11],O=n[15],K=i[0],V=i[4],Et=i[8],vt=i[12],It=i[1],it=i[5],at=i[9],kt=i[13],xt=i[2],Vt=i[6],mt=i[10],yt=i[14],Lt=i[3],ut=i[7],ft=i[11],Ut=i[15];return s[0]=a*K+c*It+l*xt+o*Lt,s[4]=a*V+c*it+l*Vt+o*ut,s[8]=a*Et+c*at+l*mt+o*ft,s[12]=a*vt+c*kt+l*yt+o*Ut,s[1]=u*K+f*It+m*xt+g*Lt,s[5]=u*V+f*it+m*Vt+g*ut,s[9]=u*Et+f*at+m*mt+g*ft,s[13]=u*vt+f*kt+m*yt+g*Ut,s[2]=x*K+w*It+L*xt+P*Lt,s[6]=x*V+w*it+L*Vt+P*ut,s[10]=x*Et+w*at+L*mt+P*ft,s[14]=x*vt+w*kt+L*yt+P*Ut,s[3]=$*K+G*It+Y*xt+O*Lt,s[7]=$*V+G*it+Y*Vt+O*ut,s[11]=$*Et+G*at+Y*mt+O*ft,s[15]=$*vt+G*kt+Y*yt+O*Ut,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],a=t[1],c=t[5],l=t[9],o=t[13],u=t[2],f=t[6],m=t[10],g=t[14],x=t[3],w=t[7],L=t[11],P=t[15];return x*(+s*l*f-i*o*f-s*c*m+n*o*m+i*c*g-n*l*g)+w*(+e*l*g-e*o*m+s*a*m-i*a*g+i*o*u-s*l*u)+L*(+e*o*f-e*c*g-s*a*f+n*a*g+s*c*u-n*o*u)+P*(-i*c*u-e*l*f+e*c*m+i*a*f-n*a*m+n*l*u)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],a=t[4],c=t[5],l=t[6],o=t[7],u=t[8],f=t[9],m=t[10],g=t[11],x=t[12],w=t[13],L=t[14],P=t[15],$=f*L*o-w*m*o+w*l*g-c*L*g-f*l*P+c*m*P,G=x*m*o-u*L*o-x*l*g+a*L*g+u*l*P-a*m*P,Y=u*w*o-x*f*o+x*c*g-a*w*g-u*c*P+a*f*P,O=x*f*l-u*w*l-x*c*m+a*w*m+u*c*L-a*f*L,K=e*$+n*G+i*Y+s*O;if(K===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let V=1/K;return t[0]=$*V,t[1]=(w*m*s-f*L*s-w*i*g+n*L*g+f*i*P-n*m*P)*V,t[2]=(c*L*s-w*l*s+w*i*o-n*L*o-c*i*P+n*l*P)*V,t[3]=(f*l*s-c*m*s-f*i*o+n*m*o+c*i*g-n*l*g)*V,t[4]=G*V,t[5]=(u*L*s-x*m*s+x*i*g-e*L*g-u*i*P+e*m*P)*V,t[6]=(x*l*s-a*L*s-x*i*o+e*L*o+a*i*P-e*l*P)*V,t[7]=(a*m*s-u*l*s+u*i*o-e*m*o-a*i*g+e*l*g)*V,t[8]=Y*V,t[9]=(x*f*s-u*w*s-x*n*g+e*w*g+u*n*P-e*f*P)*V,t[10]=(a*w*s-x*c*s+x*n*o-e*w*o-a*n*P+e*c*P)*V,t[11]=(u*c*s-a*f*s-u*n*o+e*f*o+a*n*g-e*c*g)*V,t[12]=O*V,t[13]=(u*w*i-x*f*i+x*n*m-e*w*m-u*n*L+e*f*L)*V,t[14]=(x*c*i-a*w*i-x*n*l+e*w*l+a*n*L-e*c*L)*V,t[15]=(a*f*i-u*c*i+u*n*l-e*f*l-a*n*m+e*c*m)*V,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,a=t.x,c=t.y,l=t.z,o=s*a,u=s*c;return this.set(o*a+n,o*c-i*l,o*l+i*c,0,o*c+i*l,u*c+n,u*l-i*a,0,o*l-i*c,u*l+i*a,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,a){return this.set(1,n,s,0,t,1,a,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,a=e._y,c=e._z,l=e._w,o=s+s,u=a+a,f=c+c,m=s*o,g=s*u,x=s*f,w=a*u,L=a*f,P=c*f,$=l*o,G=l*u,Y=l*f,O=n.x,K=n.y,V=n.z;return i[0]=(1-(w+P))*O,i[1]=(g+Y)*O,i[2]=(x-G)*O,i[3]=0,i[4]=(g-Y)*K,i[5]=(1-(m+P))*K,i[6]=(L+$)*K,i[7]=0,i[8]=(x+G)*V,i[9]=(L-$)*V,i[10]=(1-(m+w))*V,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=ce.set(i[0],i[1],i[2]).length(),a=ce.set(i[4],i[5],i[6]).length(),c=ce.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],Tt.copy(this);let o=1/s,u=1/a,f=1/c;return Tt.elements[0]*=o,Tt.elements[1]*=o,Tt.elements[2]*=o,Tt.elements[4]*=u,Tt.elements[5]*=u,Tt.elements[6]*=u,Tt.elements[8]*=f,Tt.elements[9]*=f,Tt.elements[10]*=f,e.setFromRotationMatrix(Tt),n.x=s,n.y=a,n.z=c,this}makePerspective(t,e,n,i,s,a,c=ze){let l=this.elements,o=2*s/(e-t),u=2*s/(n-i),f=(e+t)/(e-t),m=(n+i)/(n-i),g,x;if(c===ze)g=-(a+s)/(a-s),x=-2*a*s/(a-s);else if(c===Kn)g=-a/(a-s),x=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+c);return l[0]=o,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=u,l[9]=m,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=x,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,a,c=ze){let l=this.elements,o=1/(e-t),u=1/(n-i),f=1/(a-s),m=(e+t)*o,g=(n+i)*u,x,w;if(c===ze)x=(a+s)*f,w=-2*f;else if(c===Kn)x=s*f,w=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+c);return l[0]=2*o,l[4]=0,l[8]=0,l[12]=-m,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=w,l[14]=-x,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},ce=new q,Tt=new jt,ss=new q(0,0,0),rs=new q(1,1,1),$t=new q,Ve=new q,_t=new q,ni=new jt,ii=new te,Je=class p{constructor(t=0,e=0,n=0,i=p.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){let i=t.elements,s=i[0],a=i[4],c=i[8],l=i[1],o=i[5],u=i[9],f=i[2],m=i[6],g=i[10];switch(e){case"XYZ":this._y=Math.asin(dt(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,g),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(m,o),this._z=0);break;case"YXZ":this._x=Math.asin(-dt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(c,g),this._z=Math.atan2(l,o)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(dt(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-f,g),this._z=Math.atan2(-a,o)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-dt(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,o));break;case"YZX":this._z=Math.asin(dt(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,o),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(c,g));break;case"XZY":this._z=Math.asin(-dt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(m,o),this._y=Math.atan2(c,s)):(this._x=Math.atan2(-u,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return ni.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ni,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return ii.setFromEuler(this),this.setFromQuaternion(ii,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};Je.DEFAULT_ORDER="XYZ";var mn=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},as=0,si=new q,he=new te,Xt=new jt,He=new q,we=new q,os=new q,ls=new te,ri=new q(1,0,0),ai=new q(0,1,0),oi=new q(0,0,1),li={type:"added"},cs={type:"removed"},ue={type:"childadded",child:null},hn={type:"childremoved",child:null},Ae=class p extends Ze{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:as++}),this.uuid=Rn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=p.DEFAULT_UP.clone();let t=new q,e=new Je,n=new te,i=new q(1,1,1);function s(){n.setFromEuler(e,!1)}function a(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new jt},normalMatrix:{value:new z}}),this.matrix=new jt,this.matrixWorld=new jt,this.matrixAutoUpdate=p.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=p.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new mn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return he.setFromAxisAngle(t,e),this.quaternion.multiply(he),this}rotateOnWorldAxis(t,e){return he.setFromAxisAngle(t,e),this.quaternion.premultiply(he),this}rotateX(t){return this.rotateOnAxis(ri,t)}rotateY(t){return this.rotateOnAxis(ai,t)}rotateZ(t){return this.rotateOnAxis(oi,t)}translateOnAxis(t,e){return si.copy(t).applyQuaternion(this.quaternion),this.position.add(si.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(ri,t)}translateY(t){return this.translateOnAxis(ai,t)}translateZ(t){return this.translateOnAxis(oi,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Xt.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?He.copy(t):He.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),we.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xt.lookAt(we,He,this.up):Xt.lookAt(He,we,this.up),this.quaternion.setFromRotationMatrix(Xt),i&&(Xt.extractRotation(i.matrixWorld),he.setFromRotationMatrix(Xt),this.quaternion.premultiply(he.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(li),ue.child=t,this.dispatchEvent(ue),ue.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(cs),hn.child=t,this.dispatchEvent(hn),hn.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Xt.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),Xt.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xt),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(li),ue.child=t,this.dispatchEvent(ue),ue.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){let a=this.children[n].getObjectByProperty(t,e);if(a!==void 0)return a}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,a=i.length;s<a;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(we,t,os),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(we,ls,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,a=i.length;s<a;s++){let c=i[s];c.matrixWorldAutoUpdate===!0&&c.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(c=>({boxInitialized:c.boxInitialized,boxMin:c.box.min.toArray(),boxMax:c.box.max.toArray(),sphereInitialized:c.sphereInitialized,sphereRadius:c.sphere.radius,sphereCenter:c.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(c,l){return c[l.uuid]===void 0&&(c[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let c=this.geometry.parameters;if(c!==void 0&&c.shapes!==void 0){let l=c.shapes;if(Array.isArray(l))for(let o=0,u=l.length;o<u;o++){let f=l[o];s(t.shapes,f)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let c=[];for(let l=0,o=this.material.length;l<o;l++)c.push(s(t.materials,this.material[l]));i.material=c}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let c=0;c<this.children.length;c++)i.children.push(this.children[c].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let c=0;c<this.animations.length;c++){let l=this.animations[c];i.animations.push(s(t.animations,l))}}if(e){let c=a(t.geometries),l=a(t.materials),o=a(t.textures),u=a(t.images),f=a(t.shapes),m=a(t.skeletons),g=a(t.animations),x=a(t.nodes);c.length>0&&(n.geometries=c),l.length>0&&(n.materials=l),o.length>0&&(n.textures=o),u.length>0&&(n.images=u),f.length>0&&(n.shapes=f),m.length>0&&(n.skeletons=m),g.length>0&&(n.animations=g),x.length>0&&(n.nodes=x)}return n.object=i,n;function a(c){let l=[];for(let o in c){let u=c[o];delete u.metadata,l.push(u)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};Ae.DEFAULT_UP=new q(0,1,0);Ae.DEFAULT_MATRIX_AUTO_UPDATE=!0;Ae.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var mi={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},Kt={h:0,s:0,l:0},Ge={h:0,s:0,l:0};function un(p,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?p+(t-p)*6*e:e<1/2?t:e<2/3?p+(t-p)*6*(2/3-e):p}var ot=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Qt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,At.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=At.workingColorSpace){return this.r=t,this.g=e,this.b=n,At.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=At.workingColorSpace){if(t=ts(t,1),e=dt(e,0,1),n=dt(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,a=2*n-s;this.r=un(a,s,t+1/3),this.g=un(a,s,t),this.b=un(a,s,t-1/3)}return At.toWorkingColorSpace(this,i),this}setStyle(t,e=Qt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\\w+)\\(([^\\)]*)\\)/.exec(t)){let s,a=i[1],c=i[2];switch(a){case"rgb":case"rgba":if(s=/^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*,\\s*(\\d*\\.?\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(c))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(i=/^\\#([A-Fa-f\\d]+)$/.exec(t)){let s=i[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Qt){let n=mi[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=pe(t.r),this.g=pe(t.g),this.b=pe(t.b),this}copyLinearToSRGB(t){return this.r=on(t.r),this.g=on(t.g),this.b=on(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Qt){return At.fromWorkingColorSpace(ht.copy(this),t),Math.round(dt(ht.r*255,0,255))*65536+Math.round(dt(ht.g*255,0,255))*256+Math.round(dt(ht.b*255,0,255))}getHexString(t=Qt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=At.workingColorSpace){At.fromWorkingColorSpace(ht.copy(this),e);let n=ht.r,i=ht.g,s=ht.b,a=Math.max(n,i,s),c=Math.min(n,i,s),l,o,u=(c+a)/2;if(c===a)l=0,o=0;else{let f=a-c;switch(o=u<=.5?f/(a+c):f/(2-a-c),a){case n:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-n)/f+2;break;case s:l=(n-i)/f+4;break}l/=6}return t.h=l,t.s=o,t.l=u,t}getRGB(t,e=At.workingColorSpace){return At.fromWorkingColorSpace(ht.copy(this),e),t.r=ht.r,t.g=ht.g,t.b=ht.b,t}getStyle(t=Qt){At.fromWorkingColorSpace(ht.copy(this),t);let e=ht.r,n=ht.g,i=ht.b;return t!==Qt?\`color(\${t} \${e.toFixed(3)} \${n.toFixed(3)} \${i.toFixed(3)})\`:\`rgb(\${Math.round(e*255)},\${Math.round(n*255)},\${Math.round(i*255)})\`}offsetHSL(t,e,n){return this.getHSL(Kt),this.setHSL(Kt.h+t,Kt.s+e,Kt.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Kt),t.getHSL(Ge);let n=rn(Kt.h,Ge.h,e),i=rn(Kt.s,Ge.s,e),s=rn(Kt.l,Ge.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ht=new ot;ot.NAMES=mi;var Yt=hs();function hs(){let p=new ArrayBuffer(4),t=new Float32Array(p),e=new Uint32Array(p),n=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){let o=l-127;o<-27?(n[l]=0,n[l|256]=32768,i[l]=24,i[l|256]=24):o<-14?(n[l]=1024>>-o-14,n[l|256]=1024>>-o-14|32768,i[l]=-o-1,i[l|256]=-o-1):o<=15?(n[l]=o+15<<10,n[l|256]=o+15<<10|32768,i[l]=13,i[l|256]=13):o<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}let s=new Uint32Array(2048),a=new Uint32Array(64),c=new Uint32Array(64);for(let l=1;l<1024;++l){let o=l<<13,u=0;for(;(o&8388608)===0;)o<<=1,u-=8388608;o&=-8388609,u+=947912704,s[l]=o|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(c[l]=1024);return{floatView:t,uint32View:e,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:c}}function us(p){Math.abs(p)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),p=dt(p,-65504,65504),Yt.floatView[0]=p;let t=Yt.uint32View[0],e=t>>23&511;return Yt.baseTable[e]+((t&8388607)>>Yt.shiftTable[e])}function fs(p){let t=p>>10;return Yt.uint32View[0]=Yt.mantissaTable[Yt.offsetTable[t]+(p&1023)]+Yt.exponentTable[t],Yt.floatView[0]}var Pn={toHalfFloat:us,fromHalfFloat:fs};function ds(p){let t={};for(let e in p){t[e]={};for(let n in p[e]){let i=p[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function pt(p){let t={};for(let e=0;e<p.length;e++){let n=ds(p[e]);for(let i in n)t[i]=n[i]}return t}var ps=\`#ifdef USE_ALPHAHASH
4618
4618
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
4619
4619
  #endif\`,ms=\`#ifdef USE_ALPHAHASH
4620
4620
  const float ALPHA_HASH_SCALE = 0.05;
@@ -18776,7 +18776,7 @@ three/build/three.module.js:
18776
18776
  * SPDX-License-Identifier: MIT
18777
18777
  *)
18778
18778
  */
18779
- `;function j9(e){return e&&typeof e=="object"&&("force16Bit"in e||"hasFloat32Textures"in e||"experimentalWebAssemblyQhdrLoader"in e)}var X9=class{constructor(){this.DB_NAME="TextureDatabase",this.STORE_NAME="textures",this.db=null}async init(){return new Promise((e,t)=>{let i=indexedDB.open(this.DB_NAME,1);i.onupgradeneeded=()=>{let r=i.result;r.objectStoreNames.contains(this.STORE_NAME)||r.createObjectStore(this.STORE_NAME,{keyPath:"url"})},i.onsuccess=async()=>{console.log("Texture database opened successfully"),this.db=i.result,await this.clear(),e()},i.onerror=()=>{console.error("Error opening texture database:",i.error),t(i.error)}})}write(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readwrite"),n=r.objectStore(this.STORE_NAME).put(e);n.onsuccess=()=>t(),n.onerror=()=>i(n.error),r.onabort=()=>i(r.error)})}read(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readonly").objectStore(this.STORE_NAME).get(e);r.onsuccess=()=>{let n=r.result;t(n||null)},r.onerror=()=>i(r.error)})}exists(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readonly").objectStore(this.STORE_NAME).count(e);r.onsuccess=()=>{t(r.result>0)},r.onerror=()=>i(r.error)})}clear(){return new Promise((e,t)=>{let i=this.db.transaction(this.STORE_NAME,"readwrite").objectStore(this.STORE_NAME).clear();i.onsuccess=()=>e(),i.onerror=r=>t(i.error)})}},y3=(C1=class{constructor(){this.options={force16Bit:!1,experimentalWebAssemblyQhdrLoader:!0,hasFloat32Textures:!1}}static get instance(){return C1._instance||(C1._instance=new C1),C1._instance}async initialize(t,i){this.imageDatabase=new X9,await this.imageDatabase.init(),this.setOptions({hasFloat32Textures:(i==null?void 0:i.hasFloat32Textures)??t.renderer.extensions.get("OES_texture_float")!==null,...i||{}}),t.addEventListener(V9.EVENT_NAME,r=>{this.setOptions(r.data),t.resetRenderLayers()})}setOptions(t){this.options={force16Bit:!!t.force16Bit,hasFloat32Textures:t.hasFloat32Textures??this.options.hasFloat32Textures,experimentalWebAssemblyQhdrLoader:t.experimentalWebAssemblyQhdrLoader??this.options.experimentalWebAssemblyQhdrLoader}}async applyDepth(t,i,r,n,o){let s=await B9.fetchArrayBufferWithProgress(t,n),l=new Uint8Array(s),d=z9(l),c=C1.PLAYER_DEPTH_WIDTH*C1.PLAYER_DEPTH_HEIGHT,h=new Float32Array(4*c);for(let _=0;_<c;_++){let g=(d[_*2]|d[_*2+1]<<8)/512;h[_*4]=g}if(r){let _=C1.PLAYER_DEPTH_WIDTH/4,g=new Float32Array(4*c);for(let p=0;p<C1.PLAYER_DEPTH_HEIGHT;p++)for(let y=0;y<C1.PLAYER_DEPTH_WIDTH;y++){let x=y+p*C1.PLAYER_DEPTH_WIDTH,b=(C1.PLAYER_DEPTH_WIDTH-1-y+_)%C1.PLAYER_DEPTH_WIDTH;b<0&&(b+=C1.PLAYER_DEPTH_WIDTH);let N=b+p*C1.PLAYER_DEPTH_WIDTH;g[x*4]=h[N*4]}for(let p=0;p<g.length;p+=4)g[p]=Math.max(g[p],1);h.set(g)}let u=o3.newDataTexture(h,C1.PLAYER_DEPTH_WIDTH,C1.PLAYER_DEPTH_HEIGHT,U1,Q1);u.minFilter=u1,u.magFilter=u1,this.depthShaderMaterial||(this.depthShaderMaterial=new x1({uniforms:{u_texture:{value:null},depthTexture:{value:null}},vertexShader:`
18779
+ `;function j9(e){return e&&typeof e=="object"&&("force16Bit"in e||"hasFloat32Textures"in e||"experimentalWebAssemblyQhdrLoader"in e)}var X9=class{constructor(){this.DB_NAME="TextureDatabase",this.STORE_NAME="textures",this.db=null}async init(){return new Promise((e,t)=>{let i=indexedDB.open(this.DB_NAME,1);i.onupgradeneeded=()=>{let r=i.result;r.objectStoreNames.contains(this.STORE_NAME)||r.createObjectStore(this.STORE_NAME,{keyPath:"url"})},i.onsuccess=async()=>{console.log("Texture database opened successfully"),this.db=i.result,await this.clear(),e()},i.onerror=()=>{console.error("Error opening texture database:",i.error),t(i.error)}})}write(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readwrite"),n=r.objectStore(this.STORE_NAME).put(e);n.onsuccess=()=>t(),n.onerror=()=>i(n.error),r.onabort=()=>i(r.error)})}read(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readonly").objectStore(this.STORE_NAME).get(e);r.onsuccess=()=>{let n=r.result;t(n||null)},r.onerror=()=>i(r.error)})}exists(e){return new Promise((t,i)=>{let r=this.db.transaction(this.STORE_NAME,"readonly").objectStore(this.STORE_NAME).count(e);r.onsuccess=()=>{t(r.result>0)},r.onerror=()=>i(r.error)})}clear(){return new Promise((e,t)=>{let i=this.db.transaction(this.STORE_NAME,"readwrite").objectStore(this.STORE_NAME).clear();i.onsuccess=()=>e(),i.onerror=r=>t(i.error)})}},y3=(b1=class{constructor(){this.options={force16Bit:!1,experimentalWebAssemblyQhdrLoader:!0,hasFloat32Textures:!1}}static get instance(){return b1._instance||(b1._instance=new b1),b1._instance}async initialize(t,i){this.imageDatabase=new X9,await this.imageDatabase.init(),this.setOptions({hasFloat32Textures:(i==null?void 0:i.hasFloat32Textures)??t.renderer.extensions.get("OES_texture_float")!==null,...i||{}}),t.addEventListener(V9.EVENT_NAME,r=>{this.setOptions(r.data),t.resetRenderLayers()})}setOptions(t){this.options={force16Bit:!!t.force16Bit,hasFloat32Textures:t.hasFloat32Textures??this.options.hasFloat32Textures,experimentalWebAssemblyQhdrLoader:t.experimentalWebAssemblyQhdrLoader??this.options.experimentalWebAssemblyQhdrLoader}}async applyDepth(t,i,r,n,o){let s=await B9.fetchArrayBufferWithProgress(t,n),l=new Uint8Array(s),d=z9(l),c=b1.PLAYER_DEPTH_WIDTH*b1.PLAYER_DEPTH_HEIGHT,h=new Float32Array(4*c);for(let _=0;_<c;_++){let g=(d[_*2]|d[_*2+1]<<8)/512;h[_*4]=g}if(r){let _=b1.PLAYER_DEPTH_WIDTH/4,g=new Float32Array(4*c);for(let p=0;p<b1.PLAYER_DEPTH_HEIGHT;p++)for(let y=0;y<b1.PLAYER_DEPTH_WIDTH;y++){let x=y+p*b1.PLAYER_DEPTH_WIDTH,b=(b1.PLAYER_DEPTH_WIDTH-1-y+_)%b1.PLAYER_DEPTH_WIDTH;b<0&&(b+=b1.PLAYER_DEPTH_WIDTH);let N=b+p*b1.PLAYER_DEPTH_WIDTH;g[x*4]=h[N*4]}for(let p=0;p<g.length;p+=4)g[p]=Math.max(g[p],1);h.set(g)}let u=o3.newDataTexture(h,b1.PLAYER_DEPTH_WIDTH,b1.PLAYER_DEPTH_HEIGHT,D1,q1);u.minFilter=u1,u.magFilter=u1,this.depthShaderMaterial||(this.depthShaderMaterial=new x1({uniforms:{u_texture:{value:null},depthTexture:{value:null}},vertexShader:`
18780
18780
  varying vec2 vUv;
18781
18781
  void main() {
18782
18782
  vUv = uv;
@@ -18793,7 +18793,7 @@ three/build/three.module.js:
18793
18793
  //gl_FragColor = vec4(texColor.rgb, 1);
18794
18794
  //gl_FragColor = vec4(texture2D(depthTexture, vUv).r,texColor.g,texColor.b,1);
18795
18795
  }
18796
- `})),this.depthShaderMaterial.uniforms.u_texture.value=i,this.depthShaderMaterial.uniforms.depthTexture.value=u;let m=new v1(new kt(1,1),this.depthShaderMaterial),f=new M2;f.add(m);let v=new S1(i.image.width,i.image.height,{type:ot,wrapS:D1,wrapT:D1});return o==null||o(f,v,new zt(-.5,.5,.5,-.5,0,1)),u.dispose(),i.dispose(),m.geometry.dispose(),v.texture}async createInlineWorker(t){let i=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));return new Worker(i,{type:"module"})}async load(t,i){let r=performance.now(),{url:n,type:o}=t,s=o??n.substr(n.lastIndexOf(".")+1).toLowerCase();if(!Object.values(f4).includes(s))throw new Error(`illegal format supplied to loader: ${JSON.stringify(t)}`);let l,d;switch(s){case"exr":l=F9,d="EXR";break;case"qhdr":l=this.options.experimentalWebAssemblyQhdrLoader?H9:G9,d=this.options.experimentalWebAssemblyQhdrLoader?"QHDR (WASM)":"QHDR";break;default:l=W9,d="default";break}let c=await this.createInlineWorker(l),h;return await this.imageDatabase.exists(n)?h=await this.imageDatabase.read(n):(h=await new Promise(u=>{c.postMessage({url:n,hasFloat32Textures:this.options.hasFloat32Textures}),c.onmessage=m=>{var f;if(m.data.type==="progress")(f=i==null?void 0:i.onProgress)==null||f.call(i,m.data.progress);else if(m.data.type==="error")console.error(`Error loading "${n} [${d}]" texture: ${m.data.message}`),c.terminate();else if(m.data.type==="result"){let{url:v,props:_,buffer:g}=m.data;u({url:v,props:_,buffer:g}),c.terminate()}else throw c.terminate(),new Error(`Unknown message type for "${n} [${d}]": ${m.data.type}`)}}),console.log(`Finished loading "${n} [${d}]": ${((performance.now()-r)/1e3).toFixed(2)} seconds`),await this.imageDatabase.write(h)),h}},C1.PLAYER_DEPTH_WIDTH=512,C1.PLAYER_DEPTH_HEIGHT=256,C1),Y9=(Mr=class extends Event{constructor(t,i){super(Mr.EVENT_NAME),this.width=t,this.height=i}},Mr.EVENT_NAME="initialized",Mr),q9=(wr=class extends Event{constructor(t,i){super(wr.EVENT_NAME),this.width=t,this.height=i}},wr.EVENT_NAME="resized",wr),fa=(jt=class{static convertUnityToThreeCoords(t){return new I(t.x,t.y,-t.z)}static normalizeAngle(t){let i=t%360;return i>180?i-=360:i<-180&&(i+=360),i}static convertUnityToThreeEuler(t){return new O1(-jt.normalizeAngle(t.x)*jt.DEG_TO_RAD,-t.y*jt.DEG_TO_RAD,-t.z*jt.DEG_TO_RAD,"YXZ")}static convertThreeToUnityCoords(t){return new I(t.x,t.y,-t.z)}static toVector3(t){let i=t.split(",").map(Number);return new I(i[0],i[1],i[2])}},jt.DEG_TO_RAD=Math.PI/180,jt.RAD_TO_DEG=180/Math.PI,jt),Z9=class{constructor(e){for(let t in e)this[t]=e[t]}},Q9=(w1=class{constructor(t,i){let r=o3.scaleTextureFast(t,w1.WIDTH,w1.HEIGHT),n=new Float32Array(w1.WIDTH*w1.HEIGHT*4);i.readRenderTargetPixels(r,0,0,w1.WIDTH,w1.HEIGHT,n),this.depth=new Float32Array(w1.WIDTH*w1.HEIGHT);for(let o=0;o<this.depth.length;o++)this.depth[o]=n[o*4+3];r.dispose()}getDepth(t){let i=this.getEquirectangularTexCoord(t),r=this.getPixelUV(i),n=r.x+r.y*w1.WIDTH;return this.depth[n]}getEquirectangularTexCoord(t){let i=t.clone().normalize(),r=Math.acos(-i.y),n=(Math.atan2(-i.z,i.x)+Math.PI)/(2*Math.PI),o=r/Math.PI;return new ye(n,o)}getPixelUV(t){t.x=-t.x+.25;let i=(t.x*w1.WIDTH%w1.WIDTH+w1.WIDTH)%w1.WIDTH,r=(t.y*w1.HEIGHT%w1.HEIGHT+w1.HEIGHT)%w1.HEIGHT;return new ye(Math.floor(i),Math.floor(r))}},w1.WIDTH=512,w1.HEIGHT=256,w1),J9=class{static transmitTexture(e){var s;e.needsUpdate=!0;let t=e.image,i,r="Uint8ClampedArray";if(e instanceof w2&&(t!=null&&t.data)&&t.data.buffer instanceof ArrayBuffer&&(t.data instanceof Float32Array||t.data instanceof Uint16Array||t.data instanceof Uint8ClampedArray||t.data instanceof Uint8Array)){let l=t.data;if(l instanceof Float32Array)r="Float32Array";else if(l instanceof Uint16Array)r="Uint16Array";else if(l instanceof Uint8ClampedArray)r="Uint8ClampedArray";else throw new Error("Unsupported DataTexture pixel type");i=l.buffer}else{let l=e.image.width??e.image.videoWidth,d=e.image.height??e.image.videoHeight,c=new OffscreenCanvas(l,d).getContext("2d");c.drawImage(e.image,0,0),i=c.getImageData(0,0,l,d).data.buffer,r="Uint8ClampedArray"}let n=[];if((s=e.mipmaps)!=null&&s.length)for(let l of e.mipmaps){let d=l.data;n.push({data:d.buffer,width:l.width,height:l.height})}let o=[i];return n.forEach(l=>{o.push(l.data)}),{props:{width:e.image.width,height:e.image.height,format:e.format,type:e.type,flipY:e.flipY,premultiplyAlpha:e.premultiplyAlpha,minFilter:e.minFilter,magFilter:e.magFilter,wrapS:e.wrapS,wrapT:e.wrapT,colorSpace:e.colorSpace,anisotropy:e.anisotropy??0,generateMipmaps:!1,arrayType:r,mipmaps:n},buffer:i,transferables:o}}static reconstructTexture(e){let{props:t,buffer:i}=e,r;switch(t.arrayType){case"Float32Array":r=new Float32Array(i);break;case"Uint16Array":r=new Uint16Array(i);break;case"Uint8ClampedArray":default:r=new Uint8ClampedArray(i);break}let n=new w2(r,t.width,t.height,t.format,t.type);return n.flipY=t.flipY,n.premultiplyAlpha=t.premultiplyAlpha,n.minFilter=t.minFilter,n.magFilter=t.magFilter,n.wrapS=t.wrapS,n.wrapT=t.wrapT,n.colorSpace=t.colorSpace,n.anisotropy=t.anisotropy,n.generateMipmaps=t.generateMipmaps,n.minFilter=m1,n.magFilter=m1,n.wrapS=D1,n.wrapT=D1,t.mipmaps&&t.mipmaps.length>0&&(n.mipmaps=t.mipmaps.map(o=>({data:new Uint8ClampedArray(o.data),width:o.width,height:o.height}))),n.needsUpdate=!0,n}},K9=class{constructor(e){this.main=e,this.textureData=null}setDataPoint(e){this.dataPoint=e}getTexture(){if(!this.texture)throw new Error("Texture is not loaded for texture preloader");return this.texture}getDepth(){return this.depth}async loadTextureData(){if(!this.textureData){if(!this.dataPoint)throw new Error("DataPoint not set for texture preloader");this.main.dispatchEvent(new Zr(this.dataPoint,0,!1)),this.textureData=await y3.instance.load(this.dataPoint,{onProgress:e=>{this.main.dispatchEvent(new Zr(this.dataPoint,Math.min(e,1-Number.EPSILON),!1))}}),this.dataPoint.done=!0,this.main.dispatchEvent(new Zr(this.dataPoint,1,!0))}}async loadTexture(){if(!this.texture){if(!this.dataPoint)throw new Error("DataPoint not set for texture preloader");if(!this.textureData)throw new Error("TextureData is not loaded for texture preloader");let e=J9.reconstructTexture(this.textureData);this.dataPoint.deprecatedVersion&&(e=o3.flipTexture(e,.25,0,!0,!1,!0)),this.dataPoint.depthDataUrl&&(e=await y3.instance.applyDepth(this.dataPoint.depthDataUrl,e,this.dataPoint.deprecatedVersion,void 0,(t,i,r)=>{this.main.runRenderTarget(t,i,r)})),this.depth=new Q9(e,this.main.renderer),this.texture=e}}unloadTexture(){this.texture&&(delete this.depth,this.depth=void 0,this.texture.dispose(),this.texture=null)}},$9=class{constructor(e){this.concurrency=1,this.data=[],this.index=0,this.workStack=[],this.waitStack=[],this._filterPredicate=()=>!0,this.main=e}set filterPredicate(e){this._filterPredicate=e;let t=this.data.filter(r=>!this._filterPredicate(r.labels||{})),i=this.data.filter(r=>this._filterPredicate(r.labels||{}));this.main.dispatchEvent(new t0(t)),this.main.dispatchEvent(new e0(i))}get current(){return this.data[this.index]}get active(){return this.data.filter(e=>this._filterPredicate(e.labels||{}))}get filteredWaitStack(){return this.waitStack.filter(e=>this._filterPredicate(this.data[e].labels))}async load(e,t=()=>!0,i,r=1){if(this.concurrency=r,e.length===0)throw new Error("Loader data length must be > 0");let n=[];this.data=e.map(({url:o,depthDataUrl:s,position:l,rotation:d,floorPositionY:c,floorLevel:h,type:u,navigable:m,deprecatedVersion:f,extra:v,labels:_},g)=>{i!=null&&i(_||{})?n.unshift(g):n.push(g);let p=new K9(this.main),y=new Z9({url:o,depthDataUrl:s,position:fa.convertUnityToThreeCoords(typeof l=="string"?fa.toVector3(l):l),rotation:fa.convertUnityToThreeEuler(typeof d=="string"?fa.toVector3(d):d),floorPositionY:Number(c),floorLevel:Number(h??1),type:u,navigable:m??!0,deprecatedVersion:f,textureHandler:p,done:!1,extra:v||{},labels:_||{}});return p.setDataPoint(y),y});for(let o of n)this.preload(o);this.filterPredicate=t,await this.data[n[0]].textureHandler.loadTextureData(),await this.data[n[0]].textureHandler.loadTexture()}async updateFilter(e){this.filterPredicate=e;for(let t=0;t<this.data.length;t++)!this.data[t].done&&this._filterPredicate(this.data[t].labels||{})&&this.preload(t)}async preload(e){this.data[e].done||this.workStack.includes(e)||(this.workStack.length<this.concurrency?(this.filteredWaitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.workStack.push(e),await this.data[e].textureHandler.loadTextureData(),this.main.isMobile||await this.data[e].textureHandler.loadTexture(),this.workStack=this.workStack.filter(t=>t!==e)):this.waitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.waitStack.unshift(e)):this.waitStack.push(e),this.filteredWaitStack.length>0&&this.preload(this.filteredWaitStack[0])):this.waitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.waitStack.unshift(e)):this.waitStack.push(e))}setIndex(e,t={rotate:!0,animate:!0}){if(e>=this.data.length)throw new Error("Loader index cannot exceed data length");let i=this.index;this.index=e,this.preload(e),this.main.dispatchEvent(new Yn(this.data[i],this.data[e],t.rotate??!0,t.animate??!0))}},ex=class{constructor(e){this.cameraNeedsUpdate=!1,this.lastTimestamp=performance.now(),this.deltaTime=0,this.frameNumber=0,this.time=0,this.main=e}animate(){window.stop=this.stop.bind(this),this.animationId=requestAnimationFrame(this.animate.bind(this));let e=performance.now();this.deltaTime=(e-this.lastTimestamp)*.001,this.time+=this.deltaTime,this.lastTimestamp=e;let t=[{renderTarget:this.main.baseRenderer.getRenderTarget()}],i=[{renderTarget:this.main.postProcessor.getRenderTarget()}],r=[],n=this.main.getPlugins();this.beforeUpdate();for(let o of n)this.applyUpdatableTransform(o.update(),t,i,r);this.afterUpdate(),this.animateCamera(),this.renderBaseRendererLayer(t,r),this.renderPostProcessingLayer(i),this.main.runRenderTarget(),this.renderPostProcessingFinalComposer(),this.frameNumber++;for(let o of n)o.reset();this.main.dispatchStateUpdate()}stop(){cancelAnimationFrame(this.animationId)}beforeUpdate(){this.cameraNeedsUpdate=!1}applyUpdatableTransform(e,t,i,r){if(this.cameraNeedsUpdate=this.cameraNeedsUpdate||!!e.targetCamera||!!e.targetCameraDelta||!!e.camera||!!e.cameraDelta,e.targetCamera&&(e.targetCamera.position&&(this.main.targetCamera.position.x=e.targetCamera.position.x,this.main.targetCamera.position.y=e.targetCamera.position.y,this.main.targetCamera.position.z=e.targetCamera.position.z),e.targetCamera.rotation&&(this.main.targetCamera.rotation.x=e.targetCamera.rotation.x,this.main.targetCamera.rotation.y=e.targetCamera.rotation.y,this.main.targetCamera.rotation.z=e.targetCamera.rotation.z),e.targetCamera.fov!==void 0&&(this.main.targetCamera.fov=e.targetCamera.fov)),e.targetCameraDelta&&(e.targetCameraDelta.position&&(this.main.targetCamera.position.x+=e.targetCameraDelta.position.x,this.main.targetCamera.position.y+=e.targetCameraDelta.position.y,this.main.targetCamera.position.z+=e.targetCameraDelta.position.z),e.targetCameraDelta.rotation&&(this.main.targetCamera.rotation.x+=e.targetCameraDelta.rotation.x,this.main.targetCamera.rotation.y+=e.targetCameraDelta.rotation.y,this.main.targetCamera.rotation.z+=e.targetCameraDelta.rotation.z),e.targetCameraDelta.fov!==void 0&&(this.main.targetCamera.fov+=e.targetCameraDelta.fov)),e.camera&&(e.camera.position&&(this.main.camera.position.x=e.camera.position.x,this.main.camera.position.y=e.camera.position.y,this.main.camera.position.z=e.camera.position.z),e.camera.rotation&&(this.main.camera.rotation.x=e.camera.rotation.x,this.main.camera.rotation.y=e.camera.rotation.y,this.main.camera.rotation.z=e.camera.rotation.z),e.camera.fov!==void 0&&(this.main.camera.fov=e.camera.fov)),e.cameraDelta&&(e.cameraDelta.position&&(this.main.camera.position.x+=e.cameraDelta.position.x,this.main.camera.position.y+=e.cameraDelta.position.y,this.main.camera.position.z+=e.cameraDelta.position.z),e.cameraDelta.rotation&&(this.main.camera.rotation.x+=e.cameraDelta.rotation.x,this.main.camera.rotation.y+=e.cameraDelta.rotation.y,this.main.camera.rotation.z+=e.cameraDelta.rotation.z),e.cameraDelta.fov!==void 0&&(this.main.camera.fov+=e.cameraDelta.fov)),(e.camera||e.cameraDelta)&&(this.main.targetCamera.position.copy(this.main.camera.position),this.main.targetCamera.rotation.copy(this.main.camera.rotation),this.main.targetCamera.aspect=this.main.camera.aspect),e.baseLayerRenderLayer){let n=Array.isArray(e.baseLayerRenderLayer)?e.baseLayerRenderLayer:[e.baseLayerRenderLayer];t.push(...n),this.runRenderTargetWithTransformLayer(n)}if(e.postProcessingRenderLayer){let n=Array.isArray(e.postProcessingRenderLayer)?e.postProcessingRenderLayer:[e.postProcessingRenderLayer];i.push(...n),this.runRenderTargetWithTransformLayer(n)}if(e.layerlessRenderLayer){let n=Array.isArray(e.layerlessRenderLayer)?e.layerlessRenderLayer:[e.layerlessRenderLayer];this.runRenderTargetWithTransformLayer(n)}e.panorama&&r.push(e.panorama)}afterUpdate(){this.cameraNeedsUpdate&&(this.main.targetCamera.rotation.x=pi.clamp(this.main.targetCamera.rotation.x,-this.main.options.maxPitchAngle,this.main.options.maxPitchAngle),this.main.targetCamera.fov=pi.clamp(this.main.targetCamera.fov,this.main.options.minFov,this.main.options.maxFov),this.main.targetCamera.updateProjectionMatrix())}animateCamera(){let e=1-(1-this.main.options.smoothingFactor)**this.deltaTime;this.main.camera.fov+=(this.main.targetCamera.fov-this.main.camera.fov)*e;let t=s3.lerpAngleRadians(this.main.camera.rotation.x,this.main.targetCamera.rotation.x,e),i=s3.lerpAngleRadians(this.main.camera.rotation.y,this.main.targetCamera.rotation.y,e);this.main.camera.rotation.set(t,i,0),this.main.camera.position.copy(this.main.targetCamera.position),this.main.camera.aspect=this.main.aspectRatio,this.main.targetCamera.aspect=this.main.aspectRatio,this.main.camera.updateProjectionMatrix()}renderBaseRendererLayer(e,t){this.main.baseRenderer.setLayers(e.length);let i=this.main.baseRenderer.getShaderMaterial();for(let r of t)r.currentPanorama!==void 0&&(i.uniforms.panoramaCurrent.value=r.currentPanorama),r.nextPanorama!==void 0&&(i.uniforms.panoramaNext.value=r.nextPanorama),r.currentSphere!==void 0&&(i.uniforms.layerPanoramaSphereCurrent.value=r.currentSphere),r.nextSphere!==void 0&&(i.uniforms.layerPanoramaSphereNext.value=r.currentSphere),r.isTransition!==void 0&&(i.uniforms.u_isPanoramaTransition.value=r.isTransition),r.percentage!==void 0&&(i.uniforms.u_transitionPercentage.value=r.percentage),r.currentAlpha!==void 0&&(i.uniforms.u_panoramaCurrentAlpha.value=r.currentAlpha),r.nextAlpha!==void 0&&(i.uniforms.u_panoramaNextAlpha.value=r.nextAlpha),r.rotation!==void 0&&i.uniforms.u_rotation.value.set(r.rotation.x,r.rotation.y),r.fovY!==void 0&&(i.uniforms.u_fovy.value=r.fovY),r.aspectRatio!==void 0&&(i.uniforms.u_aspectratio.value=r.aspectRatio);this.setLayerRenderTextures(i,e),this.main.plane.material=i}renderPostProcessingLayer(e){this.main.postProcessor.setLayers(e.length);let t=this.main.postProcessor.getShaderMaterial();this.setLayerRenderTextures(t,e)}renderPostProcessingFinalComposer(){this.main.postProcessor.renderFinalComposer()}setLayerRenderTextures(e,t){for(let i=0;i<t.length;i++)e.uniforms.layerTextures.value[i]=t[i].renderTarget.texture,e.uniforms.layerInfo.value[i]=new f1(t[i].renderTarget.width,t[i].renderTarget.height,t[i].type||0,t[i].alpha||1),e.uniforms.time.value=this.time}runRenderTargetWithTransformLayer(e){for(let t of e)this.main.runRenderTarget(t.scene,t.renderTarget,t.camera)}},tx=class{constructor(e){this.plugins=[],this.main=e}async registerPlugin(e,t){t!==void 0?this.plugins.splice(this.getPluginIndex(t),0,e):this.plugins.push(e),await e.register(this.main),this.plugins}async unregisterPlugin(e){let t=this.getPluginIndex(e);return await this.plugins[t].dispose(),this.plugins.splice(t,1)}getPlugin(e){return this.plugins[this.getPluginIndex(e)]}getPlugins(){return this.plugins}getPluginIndex(e){let t=this.plugins.findIndex((i,r)=>{if(e instanceof a2){if(e===i)return!0}else if(typeof e=="number"){if(e===r)return!0}else if(e===i.name)return!0;return!1});if(t>=0)return t;throw new Error(`Plugin "${e}" not found`)}},ix=(Ar=class extends Event{constructor(t,i,r,n){super(Ar.EVENT_NAME),this.position=t,this.rotation=i,this.fov=r,this.yRotation=n}},Ar.EVENT_NAME="stateUpdated",Ar),f4=(e=>(e.EXR="exr",e.QHDR="qhdr",e.JPG="jpg",e.PNG="png",e.GIF="gif",e.BMP="bmp",e.PPM="ppm",e.PGM="pgm",e))(f4||{});function rx(e){return e&&typeof e=="object"&&("maxPitchAngle"in e||"defaultFov"in e||"minFov"in e||"maxFov"in e||"smoothingFactor"in e||"targetLuminance"in e||"exposureFovScale"in e||"showArrowAndMarkers"in e)}var ax=class extends EventTarget{constructor(){super(...arguments),this.initialized=!1,this.width=0,this.height=0,this.isTransitioning=!1,this.options={maxPitchAngle:60*pi.DEG2RAD,defaultFov:90,minFov:40,maxFov:100,smoothingFactor:.999,targetLuminance:1,exposureFovScale:.6,showArrowAndMarkers:!0}}get isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}get deltaTime(){return this.renderCycle.deltaTime}async initialize(e="#visuadoCanvasRenderer",t){if(this.canvas=document.querySelector(e),!this.canvas)throw new Error("Need a valid DOM element canvas");this.dataPointLoader=new $9(this),this.renderCycle=new ex(this),this.pluginStack=new tx(this),this.renderer=new jg({canvas:this.canvas,preserveDrawingBuffer:!0}),this.setOptions(t||{}),this.addEventListener(u_.EVENT_NAME,r=>{this.setOptions(r.data),this.resetRenderLayers()}),this.renderer.outputColorSpace=k1,this.camera=new Y1,this.camera.rotation.order="YXZ",this.camera.fov=this.options.defaultFov,this.targetCamera=new Y1,this.targetCamera.rotation.order="YXZ",this.targetCamera.fov=this.options.defaultFov,this.mainCamera=new zt(-1,1,1,-1,1,100),this.mainCamera.position.z=1,this.plane=new v1(new kt(2,2),new lt({color:65280})),this.scene=new M2,this.scene.add(this.plane),o3.renderer=this.renderer,await y3.instance.initialize(this,t||{}),this.baseRenderer=new O8(this),this.baseRenderer.setLayers(1),this.postProcessor=new l7(this,!0,t||{}),this.postProcessor.setLayers(1);let i=new ResizeObserver(r=>{let n=r.filter(o=>!!o);if(n.length===2||n[0].target===this.canvas){let o=n[0],s=o.contentRect.width,l=o.contentRect.height;this.width=s,this.height=l,this.camera.aspect=this.aspectRatio,this.targetCamera.aspect=this.aspectRatio,this.camera.updateProjectionMatrix(),this.targetCamera.updateProjectionMatrix(),this.panoramaRenderTargetFrom=this.createRenderTarget(),this.panoramaRenderTargetTo=this.createRenderTarget(),this.renderer.setSize(s,l),this.baseRenderer.setSize(s,l),this.mainRenderTarget=new S1(s,l,{minFilter:m1,magFilter:m1,format:U1,type:ot}),this.postProcessor.setSize(s,l),this.initialized?this.dispatchEvent(new q9(s,l)):(this.initialized=!0,this.dispatchEvent(new Y9(s,l)))}else{let o=n[0];this.resizeDebounced&&clearTimeout(this.resizeDebounced),this.resizeDebounced=setTimeout(()=>{this.renderer.setSize(o.contentRect.width,o.contentRect.height)},100)}});i.observe(this.canvas),i.observe(this.canvas.parentElement),(t==null?void 0:t.setInitialPlugins)!==!1&&(await this.registerPlugin(new _7),await this.registerPlugin(new v7),await this.registerPlugin(new x7),await this.registerPlugin(new M7),await this.registerPlugin(new A7),await this.registerPlugin(new o_),await this.registerPlugin(new c_),await this.registerPlugin(new h_))}setOptions(e){this.options.maxPitchAngle=e.maxPitchAngle??this.options.maxPitchAngle,this.options.defaultFov=e.defaultFov??this.options.defaultFov,this.options.minFov=e.minFov??this.options.minFov,this.options.maxFov=e.maxFov??this.options.maxFov,this.options.smoothingFactor=e.smoothingFactor??this.options.smoothingFactor,this.options.targetLuminance=e.targetLuminance??this.options.targetLuminance,this.options.exposureFovScale=e.exposureFovScale??this.options.exposureFovScale,this.options.showArrowAndMarkers=e.showArrowAndMarkers??this.options.showArrowAndMarkers}setAllOptions(e){let t=!1;if(rx(e)&&this.setOptions(e),this.postProcessor&&s7(e)&&(this.postProcessor.setOptions(e),t=!0),j9(e)&&(y3.instance.setOptions(e),t=!0),d_(e)){let i=this.getPlugin("autoRotatePlugin");i&&i.setOptions(e)}if(S7(e)){let i=this.getPlugin("panoramaTransitionRendererPlugin");i&&i.setOptions(e),t=!0}if(g7(e)){let i=this.getPlugin("userInputPlugin");i&&i.setOptions(e)}t&&this.resetRenderLayers()}async loadDataPoints(e,t,i,r=1){await this.dataPointLoader.load(e,t,i,r),this.dispatchEvent(new c7(this.dataPointLoader.data)),this.loadDataPoint({rotation:!0,animate:!1})}async updateDataPointFilter(e){this.dataPointLoader.updateFilter(e)}async loadDataPoint({animate:e,rotation:t,fov:i,animateFunction:r}={}){this.isTransitioning=!0,this.dispatchEvent(new C2(this.dataPointLoader.current,0));let n=this.dataPointLoader.current;this.dispatchEvent(new C2(this.dataPointLoader.current,1));let o=n.textureHandler;await o.loadTextureData(),await o.loadTexture(),this.dispatchEvent(new C2(this.dataPointLoader.current,2)),r&&(this.dispatchEvent(new C2(this.dataPointLoader.current,3)),await r({from:{position:this.camera.position,rotation:this.camera.rotation,texture:this.panoramaTextureHandler.getTexture(),depth:this.panoramaTextureHandler.getDepth()},to:{position:n.position,rotation:n.rotation,texture:o.getTexture(),depth:o.getDepth()}}),this.dispatchEvent(new C2(this.dataPointLoader.current,4)));let s=this.panoramaTextureHandler;this.panoramaTextureHandler=o,e||(this.camera.position.set(n.position.x,n.position.y,n.position.z),i&&(this.camera.fov=i)),this.targetCamera.position.copy(this.camera.position),i&&(this.targetCamera.fov=i),t&&(typeof t=="boolean"?t&&this.setRotation(n.rotation,e):this.setRotation(t,e)),this.dispatchEvent(new C2(this.dataPointLoader.current,5)),this.isMobile&&(s==null||s.unloadTexture()),this.isTransitioning=!1}setState({position:e,rotation:t,fov:i,animate:r}){e&&this.setPosition(e,r),t&&this.setRotation(t,r),i!==void 0&&this.setFov(i,r)}setPosition(e,t=!0){let i=e instanceof I?e:new I(e[0],e[1],e[2]);t||this.camera.position.set(i.x,i.y,i.z),this.targetCamera.position.copy(i)}setRotation(e,t=!0){let i=e instanceof O1?e:new O1(e[0],e[1],e[2],e[3]);t||this.camera.rotation.set(i.x,i.y,i.z,i.order),this.targetCamera.rotation.set(i.x,i.y,i.z,i.order)}setFov(e,t=!0){t||(this.camera.fov=e),this.targetCamera.fov=e}get aspectRatio(){return this.width/this.height}getState(){return{position:this.camera.position.clone(),rotation:this.camera.rotation.clone(),fov:this.camera.fov}}getPosition(){return this.camera.position.clone()}getRotation(){return this.camera.rotation.clone()}getFov(){return this.camera.fov}getAllDataPoints(){var e;return(e=this.dataPointLoader)==null?void 0:e.data}getActiveDataPoints(){var e;return(e=this.dataPointLoader)==null?void 0:e.active}getCurrentDataPoint(){var e;return(e=this.dataPointLoader)==null?void 0:e.current}setCurrentDataPoint(e,t={rotate:!0,animate:!0}){let i;if(typeof e=="function"?i=this.getAllDataPoints().findIndex(r=>e(r.labels)):i=this.getAllDataPoints().indexOf(e),i<0)throw new Error("Data point does not exists");this.setCurrentDataPointIndex(i,t)}setCurrentDataPointIndex(e,t={rotate:!0,animate:!0}){this.dataPointLoader.setIndex(e,t)}getCurrentCanvasSize(){return{width:this.width,height:this.height}}getScaledCanvasSize(e=1){let{width:t,height:i}=this.getCurrentCanvasSize(),r=Math.floor(t*e),n=Math.floor(i*e);return{width:r,height:n}}screenToWorld(e){let t=this.canvas.getBoundingClientRect(),i=new ye(e.x-t.left,e.y-t.top);return this.normalizedScreenToWorld(new ye(i.x/t.width*2-1,-(i.y/t.height)*2+1))}normalizedScreenToWorld(e){var t;if(e.x>=-1&&e.x<=1&&e.y>=-1&&e.y<=1){let i=new Pl;i.setFromCamera(e,this.camera);let r=i.ray.direction.clone().normalize(),n=(t=this.getCurrentDataPoint().textureHandler.getDepth())==null?void 0:t.getDepth(r),o=r.multiplyScalar(n);return this.camera.position.clone().add(o)}else throw new Error("Not a normalized screen position")}worldToScreen(e){let t=this.worldToNormalizedScreen(e),i=this.canvas.getBoundingClientRect();return new ye((t.x+1)/2*i.width+i.left,(-t.y+1)/2*i.height+i.top)}worldToNormalizedScreen(e){let t=new I(e.x,e.y,e.z),i=this.camera;t.project(i);let r=this.renderer.domElement.clientWidth/2,n=this.renderer.domElement.clientHeight/2,o=(t.x*r+r)/r-1,s=((-(t.y*n)+n)/n-1)*-1;return new ye(o,s)}async registerPlugin(e,t){this.pluginStack.registerPlugin(e,t)}async unregisterPlugin(e){this.pluginStack.unregisterPlugin(e)}getPlugin(e){return this.pluginStack.getPlugin(e)}getPlugins(){return this.pluginStack.getPlugins()}runRenderTarget(e,t,i){this.renderer.setClearColor(0,0),this.renderer.setRenderTarget(t??this.mainRenderTarget),this.renderer.render(e??this.scene,i??this.mainCamera),this.renderer.setRenderTarget(null)}createRenderTarget(){let{width:e,height:t}=this.getScaledCanvasSize();return new S1(e,t,{type:ot,wrapS:D1,wrapT:D1,minFilter:u1,magFilter:u1})}animate(){if(this.initialized)this.renderCycle.animate();else throw new Error("Main not initialized yet")}dispatchStateUpdate(){this.dispatchEvent(new ix(this.getPosition(),this.getRotation(),this.getFov(),this.getRotation().y*fa.RAD_TO_DEG))}stop(){this.renderCycle.stop()}destroy(){this.stop(),this.canvas.remove()}async takePhoto(){if(this.options.showArrowAndMarkers){this.setOptions({showArrowAndMarkers:!1}),await new Promise(t=>setTimeout(t,10));let e=this.renderer.domElement.toDataURL();return this.setOptions({showArrowAndMarkers:!0}),e}else this.renderer.domElement.toDataURL()}resetRenderLayers(){this.baseRenderer.setLayers(-1),this.postProcessor.setLayers(-1)}};/*! Bundled license information:
18796
+ `})),this.depthShaderMaterial.uniforms.u_texture.value=i,this.depthShaderMaterial.uniforms.depthTexture.value=u;let m=new v1(new kt(1,1),this.depthShaderMaterial),f=new S2;f.add(m);let v=new S1(i.image.width,i.image.height,{type:ot,wrapS:R1,wrapT:R1});return o==null||o(f,v,new zt(-.5,.5,.5,-.5,0,1)),u.dispose(),i.dispose(),m.geometry.dispose(),v.texture}async createInlineWorker(t){let i=URL.createObjectURL(new Blob([t],{type:"application/javascript"}));return new Worker(i,{type:"module"})}async load(t,i){let r=performance.now(),{url:n,type:o}=t,s=o??n.substr(n.lastIndexOf(".")+1).toLowerCase();if(!Object.values(f4).includes(s))throw new Error(`illegal format supplied to loader: ${JSON.stringify(t)}`);let l,d;switch(s){case"exr":l=F9,d="EXR";break;case"qhdr":l=this.options.experimentalWebAssemblyQhdrLoader?H9:G9,d=this.options.experimentalWebAssemblyQhdrLoader?"QHDR (WASM)":"QHDR";break;default:l=W9,d="default";break}let c=await this.createInlineWorker(l),h;return await this.imageDatabase.exists(n)?h=await this.imageDatabase.read(n):(h=await new Promise(u=>{c.postMessage({url:n,hasFloat32Textures:this.options.hasFloat32Textures}),c.onmessage=m=>{var f;if(m.data.type==="progress")(f=i==null?void 0:i.onProgress)==null||f.call(i,m.data.progress);else if(m.data.type==="error")console.error(`Error loading "${n} [${d}]" texture: ${m.data.message}`),c.terminate();else if(m.data.type==="result"){let{url:v,props:_,buffer:g}=m.data;u({url:v,props:_,buffer:g}),c.terminate()}else throw c.terminate(),new Error(`Unknown message type for "${n} [${d}]": ${m.data.type}`)}}),console.log(`Finished loading "${n} [${d}]": ${((performance.now()-r)/1e3).toFixed(2)} seconds`),await this.imageDatabase.write(h)),h}},b1.PLAYER_DEPTH_WIDTH=512,b1.PLAYER_DEPTH_HEIGHT=256,b1),Y9=(Sr=class extends Event{constructor(t,i){super(Sr.EVENT_NAME),this.width=t,this.height=i}},Sr.EVENT_NAME="initialized",Sr),q9=(Mr=class extends Event{constructor(t,i){super(Mr.EVENT_NAME),this.width=t,this.height=i}},Mr.EVENT_NAME="resized",Mr),ma=(jt=class{static convertUnityToThreeCoords(t){return new I(t.x,t.y,-t.z)}static normalizeAngle(t){let i=t%360;return i>180?i-=360:i<-180&&(i+=360),i}static convertUnityToThreeEuler(t){return new k1(-jt.normalizeAngle(t.x)*jt.DEG_TO_RAD,-t.y*jt.DEG_TO_RAD,-t.z*jt.DEG_TO_RAD,"YXZ")}static convertThreeToUnityCoords(t){return new I(t.x,t.y,-t.z)}static toVector3(t){let i=t.split(",").map(Number);return new I(i[0],i[1],i[2])}},jt.DEG_TO_RAD=Math.PI/180,jt.RAD_TO_DEG=180/Math.PI,jt),Z9=class{constructor(e){for(let t in e)this[t]=e[t]}},Q9=(w1=class{constructor(t,i){let r=o3.scaleTextureFast(t,w1.WIDTH,w1.HEIGHT),n=new Float32Array(w1.WIDTH*w1.HEIGHT*4);i.readRenderTargetPixels(r,0,0,w1.WIDTH,w1.HEIGHT,n),this.depth=new Float32Array(w1.WIDTH*w1.HEIGHT);for(let o=0;o<this.depth.length;o++)this.depth[o]=n[o*4+3];r.dispose()}getDepth(t){let i=this.getEquirectangularTexCoord(t),r=this.getPixelUV(i),n=r.x+r.y*w1.WIDTH;return this.depth[n]}getEquirectangularTexCoord(t){let i=t.clone().normalize(),r=Math.acos(-i.y),n=(Math.atan2(-i.z,i.x)+Math.PI)/(2*Math.PI),o=r/Math.PI;return new ye(n,o)}getPixelUV(t){t.x=-t.x+.25;let i=(t.x*w1.WIDTH%w1.WIDTH+w1.WIDTH)%w1.WIDTH,r=(t.y*w1.HEIGHT%w1.HEIGHT+w1.HEIGHT)%w1.HEIGHT;return new ye(Math.floor(i),Math.floor(r))}},w1.WIDTH=512,w1.HEIGHT=256,w1),J9=class{static transmitTexture(e){var s;e.needsUpdate=!0;let t=e.image,i,r="Uint8ClampedArray";if(e instanceof M2&&(t!=null&&t.data)&&t.data.buffer instanceof ArrayBuffer&&(t.data instanceof Float32Array||t.data instanceof Uint16Array||t.data instanceof Uint8ClampedArray||t.data instanceof Uint8Array)){let l=t.data;if(l instanceof Float32Array)r="Float32Array";else if(l instanceof Uint16Array)r="Uint16Array";else if(l instanceof Uint8ClampedArray)r="Uint8ClampedArray";else throw new Error("Unsupported DataTexture pixel type");i=l.buffer}else{let l=e.image.width??e.image.videoWidth,d=e.image.height??e.image.videoHeight,c=new OffscreenCanvas(l,d).getContext("2d");c.drawImage(e.image,0,0),i=c.getImageData(0,0,l,d).data.buffer,r="Uint8ClampedArray"}let n=[];if((s=e.mipmaps)!=null&&s.length)for(let l of e.mipmaps){let d=l.data;n.push({data:d.buffer,width:l.width,height:l.height})}let o=[i];return n.forEach(l=>{o.push(l.data)}),{props:{width:e.image.width,height:e.image.height,format:e.format,type:e.type,flipY:e.flipY,premultiplyAlpha:e.premultiplyAlpha,minFilter:e.minFilter,magFilter:e.magFilter,wrapS:e.wrapS,wrapT:e.wrapT,colorSpace:e.colorSpace,anisotropy:e.anisotropy??0,generateMipmaps:!1,arrayType:r,mipmaps:n},buffer:i,transferables:o}}static reconstructTexture(e){let{props:t,buffer:i}=e,r;switch(t.arrayType){case"Float32Array":r=new Float32Array(i);break;case"Uint16Array":r=new Uint16Array(i);break;case"Uint8ClampedArray":default:r=new Uint8ClampedArray(i);break}let n=new M2(r,t.width,t.height,t.format,t.type);return n.flipY=t.flipY,n.premultiplyAlpha=t.premultiplyAlpha,n.minFilter=t.minFilter,n.magFilter=t.magFilter,n.wrapS=t.wrapS,n.wrapT=t.wrapT,n.colorSpace=t.colorSpace,n.anisotropy=t.anisotropy,n.generateMipmaps=t.generateMipmaps,n.minFilter=m1,n.magFilter=m1,n.wrapS=R1,n.wrapT=R1,t.mipmaps&&t.mipmaps.length>0&&(n.mipmaps=t.mipmaps.map(o=>({data:new Uint8ClampedArray(o.data),width:o.width,height:o.height}))),n.needsUpdate=!0,n}},K9=class{constructor(e){this.main=e,this.textureData=null}setDataPoint(e){this.dataPoint=e}getTexture(){if(!this.texture)throw new Error("Texture is not loaded for texture preloader");return this.texture}getDepth(){return this.depth}async loadTextureData(){if(!this.textureData){if(!this.dataPoint)throw new Error("DataPoint not set for texture preloader");this.main.dispatchEvent(new qr(this.dataPoint,0,!1)),this.textureData=await y3.instance.load(this.dataPoint,{onProgress:e=>{this.main.dispatchEvent(new qr(this.dataPoint,Math.min(e,1-Number.EPSILON),!1))}}),this.dataPoint.done=!0,this.main.dispatchEvent(new qr(this.dataPoint,1,!0))}}async loadTexture(){if(!this.texture){if(!this.dataPoint)throw new Error("DataPoint not set for texture preloader");if(!this.textureData)throw new Error("TextureData is not loaded for texture preloader");let e=J9.reconstructTexture(this.textureData);this.dataPoint.deprecatedVersion&&(e=o3.flipTexture(e,.25,0,!0,!1,!0)),this.dataPoint.depthDataUrl&&(e=await y3.instance.applyDepth(this.dataPoint.depthDataUrl,e,this.dataPoint.deprecatedVersion,void 0,(t,i,r)=>{this.main.runRenderTarget(t,i,r)})),this.depth=new Q9(e,this.main.renderer),this.texture=e}}unloadTexture(){this.texture&&(delete this.depth,this.depth=void 0,this.texture.dispose(),this.texture=null)}},$9=class{constructor(e){this.concurrency=1,this.data=[],this.index=0,this.workStack=[],this.waitStack=[],this._filterPredicate=()=>!0,this.main=e}set filterPredicate(e){this._filterPredicate=e;let t=this.data.filter(r=>!this._filterPredicate(r.labels||{})),i=this.data.filter(r=>this._filterPredicate(r.labels||{}));this.main.dispatchEvent(new t0(t)),this.main.dispatchEvent(new e0(i))}get current(){return this.data[this.index]}get active(){return this.data.filter(e=>this._filterPredicate(e.labels||{}))}get filteredWaitStack(){return this.waitStack.filter(e=>this._filterPredicate(this.data[e].labels))}async load(e,t=()=>!0,i,r=1){if(this.concurrency=r,e.length===0)throw new Error("Loader data length must be > 0");let n=[];this.data=e.map(({url:o,depthDataUrl:s,position:l,rotation:d,floorPositionY:c,floorLevel:h,type:u,navigable:m,deprecatedVersion:f,extra:v,labels:_},g)=>{i!=null&&i(_||{})?n.unshift(g):n.push(g);let p=new K9(this.main),y=new Z9({url:o,depthDataUrl:s,position:ma.convertUnityToThreeCoords(typeof l=="string"?ma.toVector3(l):l),rotation:ma.convertUnityToThreeEuler(typeof d=="string"?ma.toVector3(d):d),floorPositionY:Number(c),floorLevel:Number(h??1),type:u,navigable:m??!0,deprecatedVersion:f,textureHandler:p,done:!1,extra:v||{},labels:_||{}});return p.setDataPoint(y),y});for(let o of n)this.preload(o);this.filterPredicate=t,await this.data[n[0]].textureHandler.loadTextureData(),await this.data[n[0]].textureHandler.loadTexture()}async updateFilter(e){this.filterPredicate=e;for(let t=0;t<this.data.length;t++)!this.data[t].done&&this._filterPredicate(this.data[t].labels||{})&&this.preload(t)}async preload(e){this.data[e].done||this.workStack.includes(e)||(this.workStack.length<this.concurrency?(this.filteredWaitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.workStack.push(e),await this.data[e].textureHandler.loadTextureData(),this.main.isMobile||await this.data[e].textureHandler.loadTexture(),this.workStack=this.workStack.filter(t=>t!==e)):this.waitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.waitStack.unshift(e)):this.waitStack.push(e),this.filteredWaitStack.length>0&&this.preload(this.filteredWaitStack[0])):this.waitStack.includes(e)?(this.waitStack=this.waitStack.filter(t=>t!==e),this.waitStack.unshift(e)):this.waitStack.push(e))}setIndex(e,t={rotate:!0,animate:!0}){if(e>=this.data.length)throw new Error("Loader index cannot exceed data length");let i=this.index;this.index=e,this.preload(e),this.main.dispatchEvent(new Yn(this.data[i],this.data[e],t.rotate??!0,t.animate??!0))}},ex=class{constructor(e){this.cameraNeedsUpdate=!1,this.lastTimestamp=performance.now(),this.deltaTime=0,this.frameNumber=0,this.time=0,this.main=e}animate(){window.stop=this.stop.bind(this),this.animationId=requestAnimationFrame(this.animate.bind(this));let e=performance.now();this.deltaTime=(e-this.lastTimestamp)*.001,this.time+=this.deltaTime,this.lastTimestamp=e;let t=[{renderTarget:this.main.baseRenderer.getRenderTarget()}],i=[{renderTarget:this.main.postProcessor.getRenderTarget()}],r=[],n=this.main.getPlugins();this.beforeUpdate();for(let o of n)this.applyUpdatableTransform(o.update(),t,i,r);this.afterUpdate(),this.animateCamera(),this.renderBaseRendererLayer(t,r),this.renderPostProcessingLayer(i),this.main.runRenderTarget(),this.renderPostProcessingFinalComposer(),this.frameNumber++;for(let o of n)o.reset();this.main.dispatchStateUpdate()}stop(){cancelAnimationFrame(this.animationId)}beforeUpdate(){this.cameraNeedsUpdate=!1}applyUpdatableTransform(e,t,i,r){if(this.cameraNeedsUpdate=this.cameraNeedsUpdate||!!e.targetCamera||!!e.targetCameraDelta||!!e.camera||!!e.cameraDelta,e.targetCamera&&(e.targetCamera.position&&(this.main.targetCamera.position.x=e.targetCamera.position.x,this.main.targetCamera.position.y=e.targetCamera.position.y,this.main.targetCamera.position.z=e.targetCamera.position.z),e.targetCamera.rotation&&(this.main.targetCamera.rotation.x=e.targetCamera.rotation.x,this.main.targetCamera.rotation.y=e.targetCamera.rotation.y,this.main.targetCamera.rotation.z=e.targetCamera.rotation.z),e.targetCamera.fov!==void 0&&(this.main.targetCamera.fov=e.targetCamera.fov)),e.targetCameraDelta&&(e.targetCameraDelta.position&&(this.main.targetCamera.position.x+=e.targetCameraDelta.position.x,this.main.targetCamera.position.y+=e.targetCameraDelta.position.y,this.main.targetCamera.position.z+=e.targetCameraDelta.position.z),e.targetCameraDelta.rotation&&(this.main.targetCamera.rotation.x+=e.targetCameraDelta.rotation.x,this.main.targetCamera.rotation.y+=e.targetCameraDelta.rotation.y,this.main.targetCamera.rotation.z+=e.targetCameraDelta.rotation.z),e.targetCameraDelta.fov!==void 0&&(this.main.targetCamera.fov+=e.targetCameraDelta.fov)),e.camera&&(e.camera.position&&(this.main.camera.position.x=e.camera.position.x,this.main.camera.position.y=e.camera.position.y,this.main.camera.position.z=e.camera.position.z),e.camera.rotation&&(this.main.camera.rotation.x=e.camera.rotation.x,this.main.camera.rotation.y=e.camera.rotation.y,this.main.camera.rotation.z=e.camera.rotation.z),e.camera.fov!==void 0&&(this.main.camera.fov=e.camera.fov)),e.cameraDelta&&(e.cameraDelta.position&&(this.main.camera.position.x+=e.cameraDelta.position.x,this.main.camera.position.y+=e.cameraDelta.position.y,this.main.camera.position.z+=e.cameraDelta.position.z),e.cameraDelta.rotation&&(this.main.camera.rotation.x+=e.cameraDelta.rotation.x,this.main.camera.rotation.y+=e.cameraDelta.rotation.y,this.main.camera.rotation.z+=e.cameraDelta.rotation.z),e.cameraDelta.fov!==void 0&&(this.main.camera.fov+=e.cameraDelta.fov)),(e.camera||e.cameraDelta)&&(this.main.targetCamera.position.copy(this.main.camera.position),this.main.targetCamera.rotation.copy(this.main.camera.rotation),this.main.targetCamera.aspect=this.main.camera.aspect),e.baseLayerRenderLayer){let n=Array.isArray(e.baseLayerRenderLayer)?e.baseLayerRenderLayer:[e.baseLayerRenderLayer];t.push(...n),this.runRenderTargetWithTransformLayer(n)}if(e.postProcessingRenderLayer){let n=Array.isArray(e.postProcessingRenderLayer)?e.postProcessingRenderLayer:[e.postProcessingRenderLayer];i.push(...n),this.runRenderTargetWithTransformLayer(n)}if(e.layerlessRenderLayer){let n=Array.isArray(e.layerlessRenderLayer)?e.layerlessRenderLayer:[e.layerlessRenderLayer];this.runRenderTargetWithTransformLayer(n)}e.panorama&&r.push(e.panorama)}afterUpdate(){this.cameraNeedsUpdate&&(this.main.targetCamera.rotation.x=fi.clamp(this.main.targetCamera.rotation.x,-this.main.options.maxPitchAngle,this.main.options.maxPitchAngle),this.main.targetCamera.fov=fi.clamp(this.main.targetCamera.fov,this.main.options.minFov,this.main.options.maxFov),this.main.targetCamera.updateProjectionMatrix())}animateCamera(){let e=1-(1-this.main.options.smoothingFactor)**this.deltaTime;this.main.camera.fov+=(this.main.targetCamera.fov-this.main.camera.fov)*e;let t=s3.lerpAngleRadians(this.main.camera.rotation.x,this.main.targetCamera.rotation.x,e),i=s3.lerpAngleRadians(this.main.camera.rotation.y,this.main.targetCamera.rotation.y,e);this.main.camera.rotation.set(t,i,0),this.main.camera.position.copy(this.main.targetCamera.position),this.main.camera.aspect=this.main.aspectRatio,this.main.targetCamera.aspect=this.main.aspectRatio,this.main.camera.updateProjectionMatrix()}renderBaseRendererLayer(e,t){this.main.baseRenderer.setLayers(e.length);let i=this.main.baseRenderer.getShaderMaterial();for(let r of t)r.currentPanorama!==void 0&&(i.uniforms.panoramaCurrent.value=r.currentPanorama),r.nextPanorama!==void 0&&(i.uniforms.panoramaNext.value=r.nextPanorama),r.currentSphere!==void 0&&(i.uniforms.layerPanoramaSphereCurrent.value=r.currentSphere),r.nextSphere!==void 0&&(i.uniforms.layerPanoramaSphereNext.value=r.currentSphere),r.isTransition!==void 0&&(i.uniforms.u_isPanoramaTransition.value=r.isTransition),r.percentage!==void 0&&(i.uniforms.u_transitionPercentage.value=r.percentage),r.currentAlpha!==void 0&&(i.uniforms.u_panoramaCurrentAlpha.value=r.currentAlpha),r.nextAlpha!==void 0&&(i.uniforms.u_panoramaNextAlpha.value=r.nextAlpha),r.rotation!==void 0&&i.uniforms.u_rotation.value.set(r.rotation.x,r.rotation.y),r.fovY!==void 0&&(i.uniforms.u_fovy.value=r.fovY),r.aspectRatio!==void 0&&(i.uniforms.u_aspectratio.value=r.aspectRatio);this.setLayerRenderTextures(i,e),this.main.plane.material=i}renderPostProcessingLayer(e){this.main.postProcessor.setLayers(e.length);let t=this.main.postProcessor.getShaderMaterial();this.setLayerRenderTextures(t,e)}renderPostProcessingFinalComposer(){this.main.postProcessor.renderFinalComposer()}setLayerRenderTextures(e,t){for(let i=0;i<t.length;i++)e.uniforms.layerTextures.value[i]=t[i].renderTarget.texture,e.uniforms.layerInfo.value[i]=new f1(t[i].renderTarget.width,t[i].renderTarget.height,t[i].type||0,t[i].alpha||1),e.uniforms.time.value=this.time}runRenderTargetWithTransformLayer(e){for(let t of e)this.main.runRenderTarget(t.scene,t.renderTarget,t.camera)}},tx=class{constructor(e){this.plugins=[],this.main=e}async registerPlugin(e,t){t!==void 0?this.plugins.splice(this.getPluginIndex(t),0,e):this.plugins.push(e),await e.register(this.main),this.plugins}async unregisterPlugin(e){let t=this.getPluginIndex(e);return await this.plugins[t].dispose(),this.plugins.splice(t,1)}getPlugin(e){return this.plugins[this.getPluginIndex(e)]}getPlugins(){return this.plugins}getPluginIndex(e){let t=this.plugins.findIndex((i,r)=>{if(e instanceof a2){if(e===i)return!0}else if(typeof e=="number"){if(e===r)return!0}else if(e===i.name)return!0;return!1});if(t>=0)return t;throw new Error(`Plugin "${e}" not found`)}},ix=(wr=class extends Event{constructor(t,i,r,n){super(wr.EVENT_NAME),this.position=t,this.rotation=i,this.fov=r,this.yRotation=n}},wr.EVENT_NAME="stateUpdated",wr),f4=(e=>(e.EXR="exr",e.QHDR="qhdr",e.JPG="jpg",e.PNG="png",e.GIF="gif",e.BMP="bmp",e.PPM="ppm",e.PGM="pgm",e))(f4||{});function rx(e){return e&&typeof e=="object"&&("maxPitchAngle"in e||"defaultFov"in e||"minFov"in e||"maxFov"in e||"smoothingFactor"in e||"targetLuminance"in e||"exposureFovScale"in e||"showArrowAndMarkers"in e)}var ax=class extends EventTarget{constructor(){super(...arguments),this.initialized=!1,this.width=0,this.height=0,this.isTransitioning=!1,this.options={maxPitchAngle:60*fi.DEG2RAD,defaultFov:90,minFov:40,maxFov:100,smoothingFactor:.999,targetLuminance:1,exposureFovScale:.6,showArrowAndMarkers:!0}}get isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}get deltaTime(){return this.renderCycle.deltaTime}async initialize(e="#visuadoCanvasRenderer",t){if(this.canvas=document.querySelector(e),!this.canvas)throw new Error("Need a valid DOM element canvas");this.dataPointLoader=new $9(this),this.renderCycle=new ex(this),this.pluginStack=new tx(this),this.renderer=new jg({canvas:this.canvas,preserveDrawingBuffer:!0}),this.setOptions(t||{}),this.addEventListener(u_.EVENT_NAME,r=>{this.setOptions(r.data),this.resetRenderLayers()}),this.renderer.outputColorSpace=U1,this.camera=new j1,this.camera.rotation.order="YXZ",this.camera.fov=this.options.defaultFov,this.targetCamera=new j1,this.targetCamera.rotation.order="YXZ",this.targetCamera.fov=this.options.defaultFov,this.mainCamera=new zt(-1,1,1,-1,1,100),this.mainCamera.position.z=1,this.plane=new v1(new kt(2,2),new lt({color:65280})),this.scene=new S2,this.scene.add(this.plane),o3.renderer=this.renderer,await y3.instance.initialize(this,t||{}),this.baseRenderer=new O8(this),this.baseRenderer.setLayers(1),this.postProcessor=new l7(this,!0,t||{}),this.postProcessor.setLayers(1);let i=new ResizeObserver(r=>{let n=r.filter(o=>!!o);if(n.length===2||n[0].target===this.canvas){let o=n[0],s=o.contentRect.width,l=o.contentRect.height;this.width=s,this.height=l,this.camera.aspect=this.aspectRatio,this.targetCamera.aspect=this.aspectRatio,this.camera.updateProjectionMatrix(),this.targetCamera.updateProjectionMatrix(),this.panoramaRenderTargetFrom=this.createRenderTarget(),this.panoramaRenderTargetTo=this.createRenderTarget(),this.renderer.setSize(s,l),this.baseRenderer.setSize(s,l),this.mainRenderTarget=new S1(s,l,{minFilter:m1,magFilter:m1,format:D1,type:ot}),this.postProcessor.setSize(s,l),this.initialized?this.dispatchEvent(new q9(s,l)):(this.initialized=!0,this.dispatchEvent(new Y9(s,l)))}else{let o=n[0];this.resizeDebounced&&clearTimeout(this.resizeDebounced),this.resizeDebounced=setTimeout(()=>{this.renderer.setSize(o.contentRect.width,o.contentRect.height)},100)}});i.observe(this.canvas),i.observe(this.canvas.parentElement),(t==null?void 0:t.setInitialPlugins)!==!1&&(await this.registerPlugin(new _7),await this.registerPlugin(new v7),await this.registerPlugin(new x7),await this.registerPlugin(new M7),await this.registerPlugin(new A7),await this.registerPlugin(new o_),await this.registerPlugin(new c_),await this.registerPlugin(new h_))}setOptions(e){this.options.maxPitchAngle=e.maxPitchAngle??this.options.maxPitchAngle,this.options.defaultFov=e.defaultFov??this.options.defaultFov,this.options.minFov=e.minFov??this.options.minFov,this.options.maxFov=e.maxFov??this.options.maxFov,this.options.smoothingFactor=e.smoothingFactor??this.options.smoothingFactor,this.options.targetLuminance=e.targetLuminance??this.options.targetLuminance,this.options.exposureFovScale=e.exposureFovScale??this.options.exposureFovScale,this.options.showArrowAndMarkers=e.showArrowAndMarkers??this.options.showArrowAndMarkers}setAllOptions(e){let t=!1;if(rx(e)&&this.setOptions(e),this.postProcessor&&s7(e)&&(this.postProcessor.setOptions(e),t=!0),j9(e)&&(y3.instance.setOptions(e),t=!0),d_(e)){let i=this.getPlugin("autoRotatePlugin");i&&i.setOptions(e)}if(S7(e)){let i=this.getPlugin("panoramaTransitionRendererPlugin");i&&i.setOptions(e),t=!0}if(g7(e)){let i=this.getPlugin("userInputPlugin");i&&i.setOptions(e)}t&&this.resetRenderLayers()}async loadDataPoints(e,t,i,r=1){await this.dataPointLoader.load(e,t,i,r),this.dispatchEvent(new c7(this.dataPointLoader.data)),this.loadDataPoint({rotation:!0,animate:!1})}async updateDataPointFilter(e){this.dataPointLoader.updateFilter(e)}async loadDataPoint({animate:e,rotation:t,fov:i,animateFunction:r}={}){this.isTransitioning=!0,this.dispatchEvent(new b2(this.dataPointLoader.current,0));let n=this.dataPointLoader.current;this.dispatchEvent(new b2(this.dataPointLoader.current,1));let o=n.textureHandler;await o.loadTextureData(),await o.loadTexture(),this.dispatchEvent(new b2(this.dataPointLoader.current,2)),r&&(this.dispatchEvent(new b2(this.dataPointLoader.current,3)),await r({from:{position:this.camera.position,rotation:this.camera.rotation,texture:this.panoramaTextureHandler.getTexture(),depth:this.panoramaTextureHandler.getDepth()},to:{position:n.position,rotation:n.rotation,texture:o.getTexture(),depth:o.getDepth()}}),this.dispatchEvent(new b2(this.dataPointLoader.current,4)));let s=this.panoramaTextureHandler;this.panoramaTextureHandler=o,e||(this.camera.position.set(n.position.x,n.position.y,n.position.z),i&&(this.camera.fov=i)),this.targetCamera.position.copy(this.camera.position),i&&(this.targetCamera.fov=i),t&&(typeof t=="boolean"?t&&this.setRotation(n.rotation,e):this.setRotation(t,e)),this.dispatchEvent(new b2(this.dataPointLoader.current,5)),this.isMobile&&(s==null||s.unloadTexture()),this.isTransitioning=!1}setState({position:e,rotation:t,fov:i,animate:r}){e&&this.setPosition(e,r),t&&this.setRotation(t,r),i!==void 0&&this.setFov(i,r)}setPosition(e,t=!0){let i=e instanceof I?e:new I(e[0],e[1],e[2]);t||this.camera.position.set(i.x,i.y,i.z),this.targetCamera.position.copy(i)}setRotation(e,t=!0){let i=e instanceof k1?e:new k1(e[0],e[1],e[2],e[3]);t||this.camera.rotation.set(i.x,i.y,i.z,i.order),this.targetCamera.rotation.set(i.x,i.y,i.z,i.order)}setFov(e,t=!0){t||(this.camera.fov=e),this.targetCamera.fov=e}get aspectRatio(){return this.width/this.height}getState(){return{position:this.camera.position.clone(),rotation:this.camera.rotation.clone(),fov:this.camera.fov}}getPosition(){return this.camera.position.clone()}getRotation(){return this.camera.rotation.clone()}getFov(){return this.camera.fov}getAllDataPoints(){var e;return(e=this.dataPointLoader)==null?void 0:e.data}getActiveDataPoints(){var e;return(e=this.dataPointLoader)==null?void 0:e.active}getCurrentDataPoint(){var e;return(e=this.dataPointLoader)==null?void 0:e.current}setCurrentDataPoint(e,t={rotate:!0,animate:!0}){let i;if(typeof e=="function"?i=this.getAllDataPoints().findIndex(r=>e(r.labels)):i=this.getAllDataPoints().indexOf(e),i<0)throw new Error("Data point does not exists");this.setCurrentDataPointIndex(i,t)}setCurrentDataPointIndex(e,t={rotate:!0,animate:!0}){this.dataPointLoader.setIndex(e,t)}getCurrentCanvasSize(){return{width:this.width,height:this.height}}getScaledCanvasSize(e=1){let{width:t,height:i}=this.getCurrentCanvasSize(),r=Math.floor(t*e),n=Math.floor(i*e);return{width:r,height:n}}screenToWorld(e){let t=this.canvas.getBoundingClientRect(),i=new ye(e.x-t.left,e.y-t.top);return this.normalizedScreenToWorld(new ye(i.x/t.width*2-1,-(i.y/t.height)*2+1))}normalizedScreenToWorld(e){var t;if(e.x>=-1&&e.x<=1&&e.y>=-1&&e.y<=1){let i=new Pl;i.setFromCamera(e,this.camera);let r=i.ray.direction.clone().normalize(),n=(t=this.getCurrentDataPoint().textureHandler.getDepth())==null?void 0:t.getDepth(r),o=r.multiplyScalar(n);return this.camera.position.clone().add(o)}else throw new Error("Not a normalized screen position")}worldToScreen(e){let t=this.worldToNormalizedScreen(e),i=this.canvas.getBoundingClientRect();return new ye((t.x+1)/2*i.width+i.left,(-t.y+1)/2*i.height+i.top)}worldToNormalizedScreen(e){let t=new I(e.x,e.y,e.z),i=this.camera;t.project(i);let r=this.renderer.domElement.clientWidth/2,n=this.renderer.domElement.clientHeight/2,o=(t.x*r+r)/r-1,s=((-(t.y*n)+n)/n-1)*-1;return new ye(o,s)}async registerPlugin(e,t){this.pluginStack.registerPlugin(e,t)}async unregisterPlugin(e){this.pluginStack.unregisterPlugin(e)}getPlugin(e){return this.pluginStack.getPlugin(e)}getPlugins(){return this.pluginStack.getPlugins()}runRenderTarget(e,t,i){this.renderer.setClearColor(0,0),this.renderer.setRenderTarget(t??this.mainRenderTarget),this.renderer.render(e??this.scene,i??this.mainCamera),this.renderer.setRenderTarget(null)}createRenderTarget(){let{width:e,height:t}=this.getScaledCanvasSize();return new S1(e,t,{type:ot,wrapS:R1,wrapT:R1,minFilter:u1,magFilter:u1})}animate(){if(this.initialized)this.renderCycle.animate();else throw new Error("Main not initialized yet")}dispatchStateUpdate(){this.dispatchEvent(new ix(this.getPosition(),this.getRotation(),this.getFov(),this.getRotation().y*ma.RAD_TO_DEG))}stop(){this.renderCycle.stop()}destroy(){this.stop(),this.canvas.remove()}async takePhoto(){if(this.options.showArrowAndMarkers){this.setOptions({showArrowAndMarkers:!1}),await new Promise(t=>setTimeout(t,10));let e=this.renderer.domElement.toDataURL();return this.setOptions({showArrowAndMarkers:!0}),e}else this.renderer.domElement.toDataURL()}resetRenderLayers(){this.baseRenderer.setLayers(-1),this.postProcessor.setLayers(-1)}};/*! Bundled license information:
18797
18797
 
18798
18798
  three/build/three.module.js:
18799
18799
  (**
@@ -18804,4 +18804,4 @@ three/build/three.module.js:
18804
18804
 
18805
18805
  pako/dist/pako.esm.mjs:
18806
18806
  (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
18807
- */const nx=e=>(a.pushScopeId("data-v-27cf4d11"),e=e(),a.popScopeId(),e),ox={id:"player-wrapper"},sx={id:"player-sizer"},lx={class:"player-control",id:"controls-top-left"},cx={class:"player-control",id:"controls-top-center"},dx={class:"player-control",id:"controls-top-right"},hx={class:"player-control",id:"controls-center-left"},ux={class:"player-control",id:"controls-center-center"},mx={class:"player-control",id:"controls-center-right"},fx={class:"player-control",id:"controls-bottom-left"},px={class:"player-control",id:"controls-bottom-center"},gx={class:"player-control",id:"controls-bottom-right"},_x=nx(()=>a.createElementVNode("div",{id:"main-canvas"},[a.createElementVNode("canvas",{id:"qpc"})],-1)),vx=ke(a.defineComponent({__name:"VPlayer",props:{data:{},cameraId:{},interiorId:{},day:{},time:{},isAutoPlaying:{type:Boolean}},emits:["autoRotatePluginOptions","dataPointChanged","dataPointLoad","dataPointsLoaded","dataPointsActivated","dataPointsDeactivated","dataPointTextureLoad","frontendMarkersUpdate","imageLoaderOptions","initialized","keyDown","key","keyUp","mainOptions","mouseDown","mouse","mouseMove","mousePick","mouseScroll","mouseUp","panoramaTransitionRendererPluginOptions","postProcessorOptions","resized","stateUpdated","userInputPluginOptions","playerCoreAccessible"],setup(e,{expose:t,emit:i}){const r=e,{data:n,cameraId:o,interiorId:s,day:l,time:d,isAutoPlaying:c}=a.toRefs(r),h=a.ref();t({playerCore:h});const u=i;a.watch(c,()=>{var f;(f=h.value)==null||f.setAllOptions({autoRotate:c.value})},{immediate:!0}),a.watch([s,l],()=>{h.value.updateDataPointFilter(f=>f.interiorId===s.value&&(!l.value&&f.dayOfYear===void 0||!!l.value&&f.dayOfYear===l.value.dayOfYear)),h.value.setCurrentDataPoint(f=>f.interiorId===s.value&&f.cameraId===o.value&&(!l.value&&f.dayOfYear===void 0||!!l.value&&f.dayOfYear===l.value.dayOfYear),{rotate:!1,animate:!1})}),a.watch([o,d],([f],[v])=>{f===v&&h.value.setCurrentDataPoint(_=>_.interiorId===s.value&&_.cameraId===o.value&&((!l.value||!d.value)&&_.dayOfYear===void 0||!!l.value&&!!d.value&&_.dayOfYear===l.value.dayOfYear&&_.timeInHours===d.value.timeInHours),{rotate:!1,animate:!1})}),a.onMounted(async()=>{await m(),G0&&(h.value=new ax,h.value.addEventListener("autoRotatePluginOptions",f=>{u("autoRotatePluginOptions",f)}),h.value.addEventListener("dataPointChanged",f=>{u("dataPointChanged",f)}),h.value.addEventListener("dataPointLoad",f=>{u("dataPointLoad",f)}),h.value.addEventListener("dataPointsLoaded",f=>{u("dataPointsLoaded",f)}),h.value.addEventListener("dataPointsActivated",f=>{u("dataPointsActivated",f)}),h.value.addEventListener("dataPointsDeactivated",f=>{u("dataPointsDeactivated",f)}),h.value.addEventListener("dataPointTextureLoad",f=>{u("dataPointTextureLoad",f)}),h.value.addEventListener("frontendMarkersUpdate",f=>{u("frontendMarkersUpdate",f)}),h.value.addEventListener("imageLoaderOptions",f=>{u("imageLoaderOptions",f)}),h.value.addEventListener("initialized",f=>{u("initialized",f)}),h.value.addEventListener("keyDown",f=>{u("keyDown",f)}),h.value.addEventListener("key",f=>{u("key",f)}),h.value.addEventListener("keyUp",f=>{u("keyUp",f)}),h.value.addEventListener("mainOptions",f=>{u("mainOptions",f)}),h.value.addEventListener("mouseDown",f=>{u("mouseDown",f)}),h.value.addEventListener("mouse",f=>{u("mouse",f)}),h.value.addEventListener("mouseMove",f=>{u("mouseMove",f)}),h.value.addEventListener("mousePick",f=>{u("mousePick",f)}),h.value.addEventListener("mouseScroll",f=>{u("mouseScroll",f)}),h.value.addEventListener("mouseUp",f=>{u("mouseUp",f)}),h.value.addEventListener("panoramaTransitionRendererPluginOptions",f=>{u("panoramaTransitionRendererPluginOptions",f)}),h.value.addEventListener("postProcessorOptions",f=>{u("postProcessorOptions",f)}),h.value.addEventListener("resized",f=>{u("resized",f)}),h.value.addEventListener("stateUpdated",f=>{u("stateUpdated",f)}),h.value.addEventListener("userInputPluginOptions",f=>{u("userInputPluginOptions",f)}),await h.value.initialize("#qpc"),await h.value.loadDataPoints(n.value,f=>f.interiorId===s.value&&!f.dayOfYear&&!f.timeInHours,f=>f.interiorId===s.value&&f.cameraId===o.value&&!f.dayOfYear&&!f.timeInHours),h.value.animate(),u("playerCoreAccessible",h.value))});async function m(){h.value&&(h.value=void 0)}return a.onBeforeUnmount(()=>{m()}),(f,v)=>(a.openBlock(),a.createElementBlock("div",ox,[a.createElementVNode("div",sx,[a.renderSlot(f.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",lx,[a.renderSlot(f.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",cx,[a.renderSlot(f.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",dx,[a.renderSlot(f.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",hx,[a.renderSlot(f.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",ux,[a.renderSlot(f.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",mx,[a.renderSlot(f.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",fx,[a.renderSlot(f.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",px,[a.renderSlot(f.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",gx,[a.renderSlot(f.$slots,"bottom-right",{},void 0,!0)]),_x])]))}}),[["__scopeId","data-v-27cf4d11"]]),p4=ke(a.defineComponent({__name:"VAutoplay",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));return(r,n)=>{const o=a.resolveComponent("v-icon"),s=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(s,{size:"x-small",class:a.normalizeClass(["autoplay-btn",{mobile:i.value,"mt-1":i.value,"mx-1":i.value}]),onClick:n[0]||(n[0]=l=>t.value=!t.value)},{default:a.withCtx(()=>[a.createVNode(o,{icon:t.value?"mdi-pause":"mdi-play",size:"x-large",class:"pa-0 ma-0"},null,8,["icon"])]),_:1},8,["class"])}}}),[["__scopeId","data-v-707c11f6"]]),L0=e=>(a.pushScopeId("data-v-c1d52554"),e=e(),a.popScopeId(),e),xx={key:0,width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},yx=[L0(()=>a.createElementVNode("path",{d:"M5.38544 13C3.30939 13.9424 2 15.3211 2 16.8571C2 19.6975 6.47715 22 12 22C17.5228 22 22 19.6975 22 16.8571C22 15.3211 20.6906 13.9424 18.6146 13",class:"fill-grey"},null,-1)),L0(()=>a.createElementVNode("path",{d:"M8 9C8 7.89543 8.89543 7 10 7H14C15.1046 7 16 7.89543 16 9V12.875C16 13.4273 15.5523 13.875 15 13.875H14V17C14 17.5523 13.5523 18 13 18H11C10.4477 18 10 17.5523 10 17V13.875H9C8.44772 13.875 8 13.4273 8 12.875V9Z"},null,-1)),L0(()=>a.createElementVNode("path",{d:"M15 4C15 5.65685 13.6569 7 12 7C10.3431 7 9 5.65685 9 4C9 2.34315 10.3431 1 12 1C13.6569 1 15 2.34315 15 4Z"},null,-1))],Sx=ke(a.defineComponent({__name:"VViewModeToggle",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.inject(H1),r=a.computed(()=>{let n="virtualTour";return t.value||(n="slideShow"),n});return(n,o)=>{const s=a.resolveComponent("v-icon"),l=a.resolveComponent("v-btn"),d=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(d,{location:"top"},{activator:a.withCtx(({props:c})=>[a.createVNode(l,a.mergeProps({density:"comfortable",elevation:"1",icon:"",onClick:o[0]||(o[0]=h=>t.value=!t.value)},c),{default:a.withCtx(()=>[r.value==="virtualTour"?(a.openBlock(),a.createElementBlock("svg",xx,yx)):(a.openBlock(),a.createBlock(s,{key:1},{default:a.withCtx(()=>[a.createTextVNode("mdi-image-multiple")]),_:1}))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(i).getLabel(r.value)),1)]),_:1})}}}),[["__scopeId","data-v-c1d52554"]]),Mx={id:"share-btns-wrapper",class:"text-center"},wx=ke(a.defineComponent({__name:"VSocialShare",setup(e){const t=a.inject(H1),i=a.ref(!1),r=a.ref(location.href);function n(){return window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href),"facebook-share-dialog","width=626,height=436"),!1}function o(){return window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(location.href),"twitter-share-dialog","width=626,height=436"),!1}function s(){return window.open("https://www.linkedin.com/sharing/share-offsite/?url="+encodeURIComponent(location.href),"linkedin-share-dialog","width=626,height=736"),!1}function l(){navigator.clipboard.writeText(location.href)}return(d,c)=>{const h=a.resolveComponent("v-btn"),u=a.resolveComponent("v-tooltip"),m=a.resolveComponent("v-toolbar-title"),f=a.resolveComponent("v-spacer"),v=a.resolveComponent("v-toolbar"),_=a.resolveComponent("v-card-text"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-dialog");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(u,{elevation:"2",top:"",attach:""},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({density:"comfortable",elevation:"1",icon:"mdi-share-variant",onClick:c[0]||(c[0]=x=>i.value=!i.value)},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(p,{id:"share-box",width:"400",modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=y=>i.value=y)},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(v,{elevation:"0"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small",icon:"mdi-close",onClick:c[1]||(c[1]=y=>i.value=!1)}),a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(f)]),_:1}),a.createVNode(_,{class:"mt-5"},{default:a.withCtx(()=>[a.createElementVNode("p",Mx,[a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-facebook"},y,{onClick:n}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToFacebook")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-linkedin"},y,{onClick:s}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToLinkedin")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-twitter"},y,{onClick:o}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToTwitter")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-email",link:"",href:`mailto:?body=${r.value}`},y),null,16,["href"])]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareViaEmail")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-content-copy",onClick:l},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("copyLink")),1)]),_:1}),a.createVNode(f)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-3435be74"]]),ti=e=>(a.pushScopeId("data-v-5918102f"),e=e(),a.popScopeId(),e),Ax={key:0,class:"desktop-content"},Ex={class:"d-flex align-center justify-center"},bx={class:"box col d-flex flex-column align-bottom justify-center"},Cx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M72 30H86.9736M86.9736 30L81 36M86.9736 30L81 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M27.9736 30H13M13 30L18.9736 36M13 30L18.9736 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M36 30H64V40C64 47.732 57.732 54 50 54V54C42.268 54 36 47.732 36 40V30Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 25C36 17.268 42.268 11 50 11V11V30H36V25Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 25C64 17.268 57.732 11 50 11V11V30H64V25Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 23V30C53.25 31.7949 51.7949 33.25 50 33.25C48.2051 33.25 46.75 31.7949 46.75 30V23C46.75 21.2051 48.2051 19.75 50 19.75C51.7949 19.75 53.25 21.2051 53.25 23Z",fill:"white",stroke:"black","stroke-width":"1.5"})])],-1)),Tx={class:"text-div text-center text mt-2"},Ix={class:"box col d-flex flex-column align-bottom justify-center"},Px=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9936 27.0175C79.9881 19.276 66.3321 13.0323 49.492 13.0719C32.652 13.1116 19.0049 19.4194 19.0105 27.1609C19.016 34.9025 32.6721 41.1461 49.5121 41.1065C66.3521 41.0669 79.9992 34.759 79.9936 27.0175Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M61.8032 45.179L56.543 50.3218V28.0361L72.543 43.4647H65.0909L67.9402 50.3218L64.6526 52.0361L61.8032 45.179Z",fill:"white",stroke:"black","stroke-width":"1.5","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"})])],-1)),Nx={class:"text-div text-center text mt-2"},Lx={class:"box col d-flex flex-column align-bottom justify-center"},Rx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M36 33H64V43C64 50.732 57.732 57 50 57V57C42.268 57 36 50.732 36 43V33Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 28C36 20.268 42.268 14 50 14V14V33H36V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 28C64 20.268 57.732 14 50 14V14V33H64V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 26V33C53.25 34.7949 51.7949 36.25 50 36.25C48.2051 36.25 46.75 34.7949 46.75 33V26C46.75 24.2051 48.2051 22.75 50 22.75C51.7949 22.75 53.25 24.2051 53.25 26Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M74.5352 20.7593L80.3458 26.5699C80.9316 27.1557 80.9316 28.1055 80.3458 28.6913C79.76 29.277 78.8103 29.277 78.2245 28.6913L72.4138 22.8806L74.5352 20.7593Z",fill:"black",stroke:"black","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("circle",{cx:"66.5",cy:"15.5",r:"9.75",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"66",y:"11",width:"1",height:"9",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"}),a.createElementVNode("rect",{x:"71",y:"15",width:"1",height:"9",transform:"rotate(90 71 15)",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"})])],-1)),Dx={class:"text-div text-center text mt-2"},Ux={class:"box col d-flex flex-column align-bottom justify-center"},kx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("rect",{x:"65.0967",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"39.5488",y:"29.6777",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-90 39.5488 29.6777)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"60.4512",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(90 60.4512 34.3228)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"34.9033",y:"55.2261",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-180 34.9033 55.2261)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M77.7025 44.3796C77.9599 44.5798 77.9599 44.9688 77.7025 45.169L74.6621 47.5338C74.3337 47.7892 73.8551 47.5552 73.8551 47.1391L73.8551 42.4095C73.8551 41.9935 74.3337 41.7594 74.6621 42.0149L77.7025 44.3796Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M49.6047 17.0724C49.8049 16.815 50.1939 16.815 50.3941 17.0724L52.7589 20.1128C53.0143 20.4412 52.7803 20.9198 52.3642 20.9198L47.6346 20.9198C47.2185 20.9198 46.9845 20.4412 47.2399 20.1128L49.6047 17.0724Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M50.3953 46.9281C50.1951 47.1855 49.8061 47.1855 49.6059 46.9281L47.2411 43.8877C46.9857 43.5592 47.2197 43.0807 47.6358 43.0807L52.3654 43.0807C52.7815 43.0807 53.0155 43.5592 52.7601 43.8877L50.3953 46.9281Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M22.2975 45.1692C22.0401 44.969 22.0401 44.58 22.2975 44.3798L25.3379 42.0151C25.6663 41.7596 26.1449 41.9937 26.1449 42.4097L26.1449 47.1393C26.1449 47.5554 25.6663 47.7894 25.3379 47.534L22.2975 45.1692Z",fill:"#FF3E3E"})])],-1)),Ox={class:"text-div text-center text mt-2"},zx={key:1,class:"d-flex tablet-mobile-content"},Vx={class:"box col my-1"},Bx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50.5",height:"32.5",viewBox:"0 0 101 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M68 28H87.9736M87.9736 28L82 34M87.9736 28L82 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M33.9727 28H13.999M13.999 28L19.9727 34M13.999 28L19.9727 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.0361 33.0479C60.7502 31.9809 59.6536 31.3478 58.5866 31.6337C57.5197 31.9195 56.8865 33.0162 57.1724 34.0831L56.7195 32.3928C56.3979 31.1925 55.1641 30.4802 53.9638 30.8018C52.7635 31.1234 52.0512 32.3572 52.3728 33.5575L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M53.7316 38.6286L52.6963 34.7649M52.6963 34.7649L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233V25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516V39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176V43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779V33.0779V33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.942 36.4286M52.6963 34.7649L52.3728 33.5575C52.0512 32.3572 52.7635 31.1234 53.9638 30.8018V30.8018C55.1641 30.4802 56.3979 31.1925 56.7195 32.3928L57.3018 34.5661M58.2077 37.9469L57.3018 34.5661M57.3018 34.5661L57.1724 34.0831C56.8865 33.0162 57.5197 31.9195 58.5866 31.6337V31.6337C59.6536 31.3478 60.7502 31.9809 61.0361 33.0479L61.942 36.4286M62.3302 37.8775L61.942 36.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Fx={class:"text text-col text-center"},Hx={class:"box col my-1"},Gx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9927 29.9814C79.9871 22.2398 66.3311 15.9962 49.491 16.0358C32.651 16.0754 19.0039 22.3833 19.0095 30.1248C19.015 37.8663 32.6711 44.11 49.5111 44.0704C66.3512 44.0308 79.9982 37.7229 79.9927 29.9814Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L68.5361 36.0479C68.2502 34.9809 67.1536 34.3478 66.0866 34.6337C65.0197 34.9195 64.3865 36.0162 64.6724 37.0831L64.2195 35.3928C63.8979 34.1925 62.6641 33.4802 61.4638 33.8018C60.2635 34.1234 59.5512 35.3572 59.8728 36.5575L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M61.2316 41.6286L60.1963 37.7649M60.1963 37.7649L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233V28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516V42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176V46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779V36.0779V36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L69.442 39.4286M60.1963 37.7649L59.8728 36.5575C59.5512 35.3572 60.2635 34.1234 61.4638 33.8018V33.8018C62.6641 33.4802 63.8979 34.1925 64.2195 35.3928L64.8018 37.5661M65.7077 40.9469L64.8018 37.5661M64.8018 37.5661L64.6724 37.0831C64.3865 36.0162 65.0197 34.9195 66.0866 34.6337V34.6337C67.1536 34.3478 68.2502 34.9809 68.5361 36.0479L69.442 39.4286M69.8302 40.8775L69.442 39.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Wx={class:"text text-col text-center"},jx={class:"box col my-1"},Xx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M31 24.9736L31 10M31 10L25 15.9736M31 10L37 15.9736",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M31 40L31 54.9736M31 54.9736L25 49M31 54.9736L37 49",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L56.0348 26.8433C55.4825 25.8867 54.2593 25.5589 53.3027 26.1112C52.3462 26.6635 52.0184 27.8867 52.5707 28.8433L51.6957 27.3277C51.0744 26.2516 49.6983 25.8828 48.6221 26.5042C47.546 27.1255 47.1773 28.5016 47.7986 29.5777L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852Z",fill:"white"}),a.createElementVNode("path",{d:"M50.4236 34.1244L48.4236 30.6603M48.4236 30.6603L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23V23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728V42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442V35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013V26.4013V26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L57.7848 29.8744M48.4236 30.6603L47.7986 29.5777C47.1773 28.5016 47.546 27.1255 48.6221 26.5042V26.5042C49.6983 25.8828 51.0744 26.2516 51.6957 27.3277L52.8207 29.2763M54.5707 32.3074L52.8207 29.2763M52.8207 29.2763L52.5707 28.8433C52.0184 27.8867 52.3462 26.6635 53.3027 26.1112V26.1112C54.2593 25.5589 55.4825 25.8867 56.0348 26.8433L57.7848 29.8744M58.5348 31.1734L57.7848 29.8744",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Yx={class:"text text-col text-center"},qx={class:"text-h6 text-capitalize"},Zx={class:"mt-2"},Qx={class:"d-flex justify-center align-center checkbox-container"},Jx={class:"text-caption"},Kx=ke(a.defineComponent({__name:"VTutorial",emits:["closeTutorial"],setup(e,{emit:t}){const i=t,r=a.inject(H1),n=a.ref(!1),o=a.ref(!1),s=a.computed(()=>[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(c=>navigator.userAgent.match(c)));function l(){i("closeTutorial",n.value)}return(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-card-title"),m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-divider"),v=a.resolveComponent("v-card-text"),_=a.resolveComponent("v-card-actions"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-expand-transition"),y=a.resolveComponent("v-checkbox");return a.openBlock(),a.createBlock(a.Transition,{name:"fade-transition"},{default:a.withCtx(()=>[a.createVNode(g,{class:"mx-auto",elevation:"16"},{default:a.withCtx(()=>[a.createVNode(u,{class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small"},{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),_:1}),a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",null,a.toDisplayString(a.unref(r).getLabel("disclaimerTextShort")),1),a.createVNode(m,{variant:"tonal",size:"small",onClick:c[0]||(c[0]=x=>o.value=!0),class:"text-capitalize mt-2"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("learnMore"))+" ",1),a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-right")]),_:1})]),_:1}),a.createVNode(f,{class:"my-3"}),s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ax,[a.createElementVNode("div",Ex,[a.createElementVNode("div",bx,[Cx,a.createElementVNode("div",Tx,a.toDisplayString(a.unref(r).getLabel("clickAndDragToLookAround")),1)]),a.createElementVNode("div",Ix,[Px,a.createElementVNode("div",Nx,a.toDisplayString(a.unref(r).getLabel("clickOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",Lx,[Rx,a.createElementVNode("div",Dx,a.toDisplayString(a.unref(r).getLabel("useTheMouseWheelToZoom")),1)]),a.createElementVNode("div",Ux,[kx,a.createElementVNode("div",Ox,a.toDisplayString(a.unref(r).getLabel("youCanAlsoUseTheArrowKeysToMoveAround")),1)])])])),s.value?(a.openBlock(),a.createElementBlock("div",zx,[a.createElementVNode("div",Vx,[Bx,a.createElementVNode("div",Fx,a.toDisplayString(a.unref(r).getLabel("tapAndDragToLookAround")),1)]),a.createElementVNode("div",Hx,[Gx,a.createElementVNode("div",Wx,a.toDisplayString(a.unref(r).getLabel("tapOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",jx,[Xx,a.createElementVNode("div",Yx,a.toDisplayString(a.unref(r).getLabel("useTwoFingersToZoom")),1)])])):a.createCommentVNode("",!0),a.createVNode(f,{class:"my-1"})]),_:1}),a.createVNode(p,null,{default:a.withCtx(()=>[o.value?(a.openBlock(),a.createBlock(g,{key:0,class:"position-absolute w-100 bg-white",height:"100%",style:{bottom:"0"}},{default:a.withCtx(()=>[a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",qx,[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),a.createElementVNode("p",Zx,a.toDisplayString(a.unref(r).getLabel("disclaimerText")),1)]),_:1}),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",size:"small",onClick:c[1]||(c[1]=x=>o.value=!1),class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-left")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("back")),1)]),_:1})]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",Qx,[a.createVNode(y,{density:"compact",modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=x=>n.value=x),"hide-details":""},{label:a.withCtx(()=>[a.createElementVNode("span",Jx,a.toDisplayString(a.unref(r).getLabel("dontShowAgain")),1)]),_:1},8,["modelValue"])]),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",onClick:c[3]||(c[3]=x=>l()),block:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("iUnderstand")),1)]),_:1})]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-5918102f"]]),$x={class:"top-left"},ey={class:"top-right"},ty={class:"header-slot anchor elevation-5"},iy={id:"moveableBody",class:"body-slot moveable-body d-flex justify-center align-center position-relative"},ry={class:"moveable-footer elevation-5"},ay=ke(a.defineComponent({__name:"VMoveable",props:{size:{}},setup(e,{expose:t}){const i=a.ref(void 0),r=a.ref(void 0);t({bodyWidth:i,bodyHeight:r}),a.onMounted(()=>{o(document.getElementById("moveableDiv")),n(document.querySelector("#moveableDiv"))});const n=s=>{new ResizeObserver(()=>{const d=document.getElementById("moveableBody");d&&(i.value=d.clientWidth,r.value=d.clientHeight)}).observe(s)},o=s=>{const l=document.getElementsByClassName("anchor");for(let _=0;_<l.length;_++){const g=l[_];g.addEventListener("touchstart",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!1}),g.addEventListener("mousedown",m,{passive:!1}),g.addEventListener("mouseup",v,{passive:!1})}let d=0,c=0,h=0,u=0;function m(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchstart"&&(g=_.touches[0]),h=g.clientX,u=g.clientY,document.addEventListener("mouseup",v,{passive:!1}),document.addEventListener("touchend",v,{passive:!1}),document.addEventListener("mousemove",f,{passive:!1}),document.addEventListener("touchmove",f,{passive:!1})}function f(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchmove"&&(g=_.touches[0]),d=h-g.clientX,c=u-g.clientY,h=g.clientX,u=g.clientY,s.style.top=s.offsetTop-c+"px",s.style.left=s.offsetLeft-d+"px"}function v(){document.removeEventListener("mouseup",v,!1),document.removeEventListener("mousemove",f,!1),document.removeEventListener("touchend",v,!1),document.removeEventListener("touchmove",f,!1)}};return(s,l)=>(a.openBlock(),a.createElementBlock("div",{id:"moveableDiv",class:a.normalizeClass([s.size,"sizer rounded"])},[a.createElementVNode("div",$x,[a.renderSlot(s.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",ey,[a.renderSlot(s.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",ty,[a.renderSlot(s.$slots,"header",{},void 0,!0)]),a.createElementVNode("div",iy,[a.renderSlot(s.$slots,"body",{},void 0,!0)]),a.createElementVNode("div",ry,[a.renderSlot(s.$slots,"footer",{},void 0,!0)])],2))}}),[["__scopeId","data-v-8ff55f5b"]]),ny=e=>(a.pushScopeId("data-v-d4be854c"),e=e(),a.popScopeId(),e),oy={class:"left"},sy={class:"right"},ly=ny(()=>a.createElementVNode("div",{class:"d-flex justify-space-between pa-1"},[a.createElementVNode("div",{class:"center"}," ")],-1)),cy={class:"map-container"},g4=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},currentCamera:{},level:{},rotation:{}},emits:["close","goToCamera"],setup(e,{emit:t}){const i=a.ref(null),r=e,n=t,o=a.ref(),s=a.ref(0),l=a.computed(()=>r.minimapJson.storeys[r.level]),d=a.ref(0);a.watch(()=>r.apartmentJson,()=>{d.value=d.value+1}),a.watch(l,()=>{o.value=l.value.defaultSunsimFile?`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/sunsim0_13.jpg`:`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/${l.value.defaultSunsimFile}`},{immediate:!0,once:!0});const c=a.computed(()=>{let p=1;return s.value!==0&&(Math.abs(s.value)%180===0?p=1:p=-1),f.value==="small"&&(p=.6),p});function h(p){o.value=p}const u=["big","bigger","small"];function m(){const y=(u.indexOf(f.value)+1)%u.length;f.value=u[y]}const f=a.ref("big");function v(){s.value=s.value+90}const _=()=>{n("close")};function g(p){n("goToCamera",p)}return(p,y)=>{const x=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(ay,{ref_key:"minimapMoveable",ref:i,size:f.value},{"top-left":a.withCtx(()=>[a.createElementVNode("div",oy,[a.createVNode(x,{icon:"mdi-window-close",size:"x-small",onClick:_})])]),"top-right":a.withCtx(()=>[a.createElementVNode("div",sy,[a.createVNode(x,{class:"rotate-icon",size:"x-small",icon:"mdi mdi-rotate-right",onClick:a.withModifiers(v,["stop"]),title:"Rotate"}),a.createVNode(x,{class:"resize-icon ml-1",icon:"mdi-image-size-select-small",size:"x-small",onClick:m,title:"Resize"})])]),header:a.withCtx(()=>[ly]),body:a.withCtx(()=>[a.createVNode(T3,{scale:c.value,rotation:l.value.rotation.y,"transform-angle":s.value},null,8,["scale","rotation","transform-angle"]),a.createElementVNode("div",cy,[a.createVNode(C3,{"transform-angle":s.value,"all-cameras":p.apartmentJson.cameras,"background-image":o.value,rotation:p.rotation,"current-camera":p.currentCamera,storey:l.value,containerWidth:i.value&&i.value.bodyWidth||512,containerHeight:i.value&&i.value.bodyHeight||384,onGoToCamera:g},null,8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey","containerWidth","containerHeight"])])]),footer:a.withCtx(()=>[(a.openBlock(),a.createBlock(I3,{key:d.value,"cdn-file-resolver":r.cdnFileResolver,"minimap-json":r.minimapJson,"apartment-json":r.apartmentJson,level:r.level,onSetBackgroundImage:h},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"]))]),_:1},8,["size"])}}}),[["__scopeId","data-v-d4be854c"]]),dy={id:"btn-magic",class:"btn-placeholder mr-2"},hy=a.defineComponent({__name:"VVisuadoCreateButton",emits:["onSnapshot"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",dy,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:"mdi-creation",onClick:n[0]||(n[0]=s=>i("onSnapshot"))})])}}}),uy={id:"btn-fullscreen",class:"btn-placeholder mr-2"},my=a.defineComponent({__name:"VFullScreenButton",props:{isFullScreen:{type:Boolean}},emits:["toggleFullscreen"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",uy,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:r.isFullScreen?"mdi-fullscreen-exit":"mdi-fullscreen",onClick:n[0]||(n[0]=s=>i("toggleFullscreen"))},null,8,["icon"])])}}}),fy={class:"d-none d-md-inline"},py={class:"interior-selector-list"},gy=["onClick"],_y={class:"d-flex align-center justify-left pa-0 ma-0"},vy={class:"pa-0 ma-0"},xy={class:"text-caption ma-2 no-wrap"},yy=ke(a.defineComponent({__name:"VInteriorSelector",props:{cdnFileResolver:{type:[String,Function]},archetypes:{},currentDataPoint:{}},emits:["selectInterior"],setup(e,{emit:t}){const i=e,{currentDataPoint:r,archetypes:n,cdnFileResolver:o}=a.toRefs(i),s=a.reactive({}),l=t;a.watch(r,async()=>{var h,u,m,f;for(const v of n.value){const _=l1(o.value,`/${v.archetypeID}/${(u=(h=r==null?void 0:r.value)==null?void 0:h.labels)==null?void 0:u.apartmentId}/thumbs/200/${(f=(m=r==null?void 0:r.value)==null?void 0:m.labels)==null?void 0:f.cameraId}.jpg`);await d(_)&&(s[v.archetypeID]=_)}},{immediate:!0});function d(h){return new Promise(u=>{const m=new Image;m.onload=()=>u(!0),m.onerror=()=>u(!1),m.src=h})}const c=a.inject(H1);return(h,u)=>{const m=a.resolveComponent("v-icon"),f=a.resolveComponent("v-btn"),v=a.resolveComponent("v-img"),_=a.resolveComponent("v-menu");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(_,{transition:"slide-x-reverse-transition",location:"top end",origin:"end bottom",elevation:"0",attach:""},{activator:a.withCtx(({props:g})=>[a.createVNode(f,a.mergeProps({rounded:""},g,{class:"text-capitalize"}),{default:a.withCtx(()=>[a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-palette-outline")]),_:1}),a.createElementVNode("span",fy,a.toDisplayString(a.unref(c).getLabel("interior")),1)]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("div",py,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),g=>{var p,y;return a.openBlock(),a.createElementBlock("div",{key:`at-menuitem-${g.archetypeID}`,onClick:x=>l("selectInterior",g.archetypeID),class:a.normalizeClass(["interior-selector-list-item",{active:g.archetypeID===((y=(p=a.unref(r))==null?void 0:p.labels)==null?void 0:y.interiorId)}])},[a.createElementVNode("div",_y,[a.createElementVNode("div",vy,[a.createVNode(v,{src:s[g.archetypeID],width:"100","max-width":"100",height:"66",class:"pa-0 ma-0"},null,8,["src"])]),a.createElementVNode("div",xy,a.toDisplayString(a.unref(c).get(g.title)),1)])],10,gy)}),128))])]),_:1})])}}}),[["__scopeId","data-v-c148316d"]]),Sy=a.defineComponent({__name:"VSunStudyToggle",props:a.mergeModels({showUi:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.inject(H1);return(r,n)=>{const o=a.resolveComponent("v-btn");return!t.value&&r.showUi?(a.openBlock(),a.createBlock(o,{key:0,size:"small",varient:"tonal",prependIcon:"mdi-white-balance-sunny",class:"sun-study-toggle text-capitalize rounded-xl",onClick:n[0]||(n[0]=s=>t.value=!t.value)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i).getLabel("openSunStudy")),1)]),_:1})):a.createCommentVNode("",!0)}}}),My={class:"d-flex align-center"},wy={class:"d-block mr-1"},Ay={class:"small"},Ey={class:"small"},_4=ke(a.defineComponent({__name:"VSunsimSlider",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{},time:{required:!0},timeModifiers:{},day:{required:!0},dayModifiers:{}},emits:["update:modelValue","update:time","update:day"],setup(e){const t=a.useModel(e,"modelValue"),i=a.useModel(e,"time"),r=a.useModel(e,"day");function n(o){i.value=r.value.timeSamples.find(s=>s.timeInHours===o)}return(o,s)=>{const l=a.resolveComponent("v-icon"),d=a.resolveComponent("v-slider"),c=a.resolveComponent("v-field"),h=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",My,[a.createElementVNode("div",wy,[a.createVNode(c,{class:"ss-slider-field",style:{},variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[r.value.timeSamples.length>1?(a.openBlock(),a.createBlock(d,{key:0,class:"pa-2 pr-2",modelValue:i.value.timeInHours,min:r.value.startTime,max:r.value.endTime,step:r.value.interval,"onUpdate:modelValue":n,density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(l,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Ay,a.toDisplayString(a.unref(ni)(i.value.timeInHours)),1)]),_:1},8,["modelValue","min","max","step"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(l,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Ey,a.toDisplayString(a.unref(ni)(i.value.timeInHours)),1)],64))]),_:1})]),a.createElementVNode("div",null,[a.createVNode(h,{size:"small",class:"sun-study-toggle text-capitalize rounded-xl",icon:"mdi-close",onClick:s[0]||(s[0]=u=>t.value=!t.value)})])])}}}),[["__scopeId","data-v-489d2d0e"]]),by={key:1,class:"sun-icon-wrapper"},Cy=37,Ty=39,v4=ke(a.defineComponent({__name:"VWaypointCarousel",props:{thumbnails:{},currentThumbnail:{}},emits:["go"],setup(e,{expose:t,emit:i}){const r=e,{thumbnails:n,currentThumbnail:o}=a.toRefs(r),s=i;t({updateLoadProgress:_});const l=a.ref();a.watch(o,()=>{l.value=n.value.findIndex(g=>g===o.value)},{immediate:!0});const d=a.ref();a.watch(n,()=>{const g=[];for(let p=0;p<n.value.length;p++)g.push(n.value[p].done?1:0);d.value=g},{immediate:!0});const c=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));a.onMounted(()=>{window.addEventListener("keydown",h)}),a.onBeforeUnmount(()=>{window.removeEventListener("keydown",h)});function h(g){switch(g.keyCode){case g.keyCode===Cy:u();break;case g.keyCode===Ty:m();break;default:return}}function u(){const g=n.value.findIndex(p=>p===o.value);g>=1&&v(n.value[g-1])}function m(){const g=n.value.findIndex(p=>p===o.value);g<n.value.length-1&&v(n.value[g+1])}function f(g,p){p(),v(n.value.find(y=>y===g))}function v(g){s("go",g)}function _(g){const p=n.value.findIndex(y=>g.dataPoint.labels.cameraId===y.labels.cameraId&&g.dataPoint.labels.interiorId===y.labels.interiorId);if(p>=0){const y=[...d.value];y[p]=g.progress,d.value=y}}return(g,p)=>{const y=a.resolveComponent("v-btn"),x=a.resolveComponent("v-img"),b=a.resolveComponent("v-icon"),N=a.resolveComponent("v-card"),A=a.resolveComponent("v-slide-group-item"),C=a.resolveComponent("v-slide-group");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["d-flex align-center justify-center",{mobileWaypointWrapper:c.value,desktopWaypointWrapper:!c.value," waypoint-carousel":!0}])},[a.renderSlot(g.$slots,"before",{},void 0,!0),a.createVNode(C,{modelValue:l.value,"onUpdate:modelValue":p[2]||(p[2]=U=>l.value=U),class:a.normalizeClass({mobileWaypoint:c.value}),"active-class":"active-apt","selected-class":"active-apt","show-arrows":!c.value,"center-active":"",mandatory:""},{prev:a.withCtx(()=>[c.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(y,{key:0,class:a.normalizeClass(["carousel-button",{mobile:c.value}]),icon:"mdi-chevron-left",varient:"tonal",size:"small",onClick:p[0]||(p[0]=U=>u())},null,8,["class"]))]),next:a.withCtx(()=>[c.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(y,{key:0,class:a.normalizeClass(["carousel-button",{mobile:c.value}]),icon:"mdi-chevron-right",varient:"tonal",size:"small",onClick:p[1]||(p[1]=U=>m())},null,8,["class"]))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),(U,S)=>(a.openBlock(),a.createBlock(A,{key:U.labels.cameraId},{default:a.withCtx(({toggle:M,selectedClass:k})=>[a.createVNode(N,{class:a.normalizeClass(["position-relative",[c.value?"ma-0":"ma-1",k,"single-waypoint"]]),align:"center",justify:"center",style:{overflow:"hidden"},onClick:R=>f(U,M)},{default:a.withCtx(()=>[a.createVNode(x,{cover:"","aspect-ratio":1,src:U.labels.thumbnailUrl},null,8,["src"]),d.value[S]<1?(a.openBlock(),a.createElementBlock("div",{key:0,class:"w-100 h-100 top-0 left-0 position-absolute",style:a.normalizeStyle(`opacity: 0.85; background: conic-gradient(gray 0deg, gray ${Math.round((1-d.value[S])*360)}deg, transparent ${Math.round((1-d.value[S])*360)}deg, transparent 360deg);`)},null,4)):a.createCommentVNode("",!0),U.labels.hasSunSim?(a.openBlock(),a.createElementBlock("div",by,[a.createVNode(b,{class:"sun-icon",icon:"mdi-white-balance-sunny"})])):a.createCommentVNode("",!0)]),_:2},1032,["class","onClick"])]),_:2},1024))),128))]),_:1},8,["modelValue","class","show-arrows"]),a.renderSlot(g.$slots,"after",{},void 0,!0)],2)}}}),[["__scopeId","data-v-9e5e229c"]]),Iy={class:"d-flex flex-column align-center justify-center clock-face"},Py={class:"clock-icon"},Ny={class:"clock-value grey--text text--darken-3"},Ly=ke(a.defineComponent({__name:"VTimeOfDay",props:{hours:{default:0},minutes:{default:0}},setup(e){const t=e,i=a.computed(()=>[r(t.hours),":",r(t.minutes)].join(""));function r(n){return("0"+n).slice(-2)}return(n,o)=>{const s=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",Iy,[a.createElementVNode("div",Py,[a.createVNode(s,{src:a.unref(X0),"aspect-ratio":"1"},null,8,["src"])]),a.createElementVNode("div",Ny,a.toDisplayString(i.value),1)])}}}),[["__scopeId","data-v-a758a375"]]),Ry=a.defineComponent({__name:"VCompass",props:{rotation:{}},setup(e){const t=e,i=a.ref(j0),r=a.ref({backgroundImage:`url(${W0})`,backgroundSize:"contain"}),n=a.computed(()=>({transform:`rotate(${-t.rotation+180}deg)`}));return(o,s)=>{const l=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(r.value),class:"compass-wrapper"},[a.createVNode(l,{class:"compass-needle",src:i.value,style:a.normalizeStyle(n.value)},null,8,["src","style"])],4)}}}),Dy=e=>(a.pushScopeId("data-v-2a9a63da"),e=e(),a.popScopeId(),e),Uy={class:"player-settings-ui"},ky={id:"settings-ui-form"},Oy={class:"form-inputs"},zy={class:"setting-label"},Vy={class:"setting-label"},By=["max","min","step"],Fy={class:"setting-label"},Hy={class:"flex-grow-1 flex-shrink-0"},Gy=["onUpdate:modelValue"],Wy={key:3,"d-block":"",class:"mt-3"},jy={class:"d-flex justify-space-between"},Xy={class:"setting-label"},Yy={class:"mt-5 d-block",style:{width:"300px"}},qy=Dy(()=>a.createElementVNode("div",{class:"setting-label"},"Enter Lut URL:",-1)),Zy={class:"d-block",style:{width:"300px"}},Qy={class:"form-buttons"},Jy=ke(a.defineComponent({__name:"VPlayerSettingsUi",props:{initialSettings:{}},emits:["updateSettings","saveSettings"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(f(i.initialSettings));a.watch(n,()=>{s()},{deep:!0});const o=a.computed(()=>{let v={};for(const[_,g]of Object.entries(n.value))_==="whitePoint"?v[_]=h(g.value):v[_]=g.value;return v});function s(){r("updateSettings",o.value)}function l(){const v=document.createElement("a");v.href=URL.createObjectURL(new Blob([JSON.stringify(o.value,null,2)]));const _=`player-settings-${Date.now()}.json`;v.download=_,v.style.display="none",document.body.appendChild(v),v.click(),document.body.removeChild(v)}function d(){r("saveSettings",o.value)}function c(){n.value=f(),r("updateSettings",o.value)}function h(v){const _=parseInt(v.substr(1,2),16)/255,g=parseInt(v.substr(3,2),16)/255,p=parseInt(v.substr(5,2),16)/255;return[_,g,p]}function u(v){var _=v.toString(16);return _.length==1?"0"+_:_}function m([v,_,g]){return"#"+u(parseInt((v*255).toString()))+u(parseInt((_*255).toString()))+u(parseInt((g*255).toString()))}function f(v={}){const _=["Cool 5","Cool 10","Cool 15","Cool 20","Cool 25","Warm 20","Warm 25","Warm 10","Warm 15","Warm 5","bw"];let g={temperature:6500,targetLuminance:1,exposureFovScale:.6,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:"",...v};return{exposureFovScale:{label:"Exposure Fov Scale",type:"slider",min:0,max:1,step:.01,value:g.exposureFovScale},targetLuminance:{label:"Target Luminance",type:"slider",min:0,max:15,step:.1,value:g.targetLuminance},sharpenFilter_amount:{label:"Sharpen Filter Amount",type:"slider",min:0,max:100,step:.1,value:g.sharpenFilter_amount},UNREAL_BLOOM_ENABLED:{label:"Enable Bloom?",type:"boolean",value:g.UNREAL_BLOOM_ENABLED},UNREAL_BLOOM_STRENGTH:{label:"Bloom Strength",type:"slider",min:0,max:1,step:.01,value:g.UNREAL_BLOOM_STRENGTH},TRANSITION_MOVEMENT_SCALE:{label:"Transition Movement Speed",type:"slider",min:.2,max:25,step:.1,value:g.TRANSITION_MOVEMENT_SCALE},temperature:{label:"Temperature / White Balance",type:"slider",min:1e3,max:12e3,step:1,value:g.temperature},whitePoint:{label:"White Point",type:"color",value:m(g.whitePoint)},lut:{label:"Lut",type:"lut",items:_.map(p=>({text:p,value:`https://cdn.visuado.com/luts/${p}.png`})),value:g.lut}}}return(v,_)=>{const g=a.resolveComponent("v-text-field"),p=a.resolveComponent("v-slider"),y=a.resolveComponent("v-checkbox"),x=a.resolveComponent("v-btn"),b=a.resolveComponent("v-select"),N=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",Uy,[a.createElementVNode("form",ky,[a.createElementVNode("div",Oy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(A,C,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,"d-block":""},[A.type==="slider"?(a.openBlock(),a.createBlock(p,{key:0,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s,max:A.max,min:A.min,step:A.step},{prepend:a.withCtx(()=>[a.createElementVNode("div",zy,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",type:"number",max:A.max,min:A.min,step:A.step,style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue","max","min","step"])])]),_:2},1032,["modelValue","onUpdate:modelValue","max","min","step"])):a.createCommentVNode("",!0),A.type==="boolean"?(a.openBlock(),a.createBlock(y,{key:1,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s},{prepend:a.withCtx(()=>[a.createElementVNode("div",Vy,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,a.toDisplayString(A.value),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.createCommentVNode("",!0),A.type==="color"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"d-flex",max:A.max,min:A.min,step:A.step},[a.createElementVNode("div",Fy,a.toDisplayString(A.label),1),a.createElementVNode("div",Hy,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S=>n.value[C].value=S,type:"color",onChange:s},null,40,Gy),[[a.vModelText,n.value[C].value]])]),a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",readonly:"",type:"text",style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue"])])],8,By)):a.createCommentVNode("",!0),A.type==="lut"?(a.openBlock(),a.createElementBlock("div",Wy,[a.createElementVNode("div",jy,[a.createElementVNode("div",Xy,a.toDisplayString(A.label),1),a.createElementVNode("div",null,[a.createVNode(x,{class:"ml-2","x-small":"",onClick:S=>n.value[C].value=null},{default:a.withCtx(()=>[a.createTextVNode(" Clear Lut ")]),_:2},1032,["onClick"])])]),a.createElementVNode("div",null,[a.createElementVNode("div",Yy,[a.createElementVNode("div",null,[a.createVNode(b,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,items:A.items,"item-title":"title","item-value":"value",dense:"",label:"Select Lut",onChange:s},null,8,["modelValue","onUpdate:modelValue","items"])])]),a.createElementVNode("div",null,[qy,a.createElementVNode("div",Zy,[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",type:"url",onChange:s},null,8,["modelValue","onUpdate:modelValue"])])])])])])):a.createCommentVNode("",!0)]))),128))]),a.createElementVNode("div",Qy,[a.createVNode(x,{onClick:_[0]||(_[0]=A=>c())},{default:a.withCtx(()=>[a.createTextVNode("Reset")]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[1]||(_[1]=A=>l())},{default:a.withCtx(()=>[a.createTextVNode(" Download Json "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-download")]),_:1})]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[2]||(_[2]=A=>d())},{default:a.withCtx(()=>[a.createTextVNode(" Save Settings "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-save")]),_:1})]),_:1})])])])}}}),[["__scopeId","data-v-2a9a63da"]]),Ky={style:{width:"24px",height:"24px"},viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg"},$y=["stroke"],eS=["stroke"],tS={class:"floor-level-label"},iS=ke(a.defineComponent({__name:"VFloorLevel",props:a.mergeModels({floorLevels:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=e,r=a.inject(H1),n=a.computed(()=>{const c=i.floorLevels;return c.sort(),c}),o=a.computed(()=>n.value.indexOf(t.value)+1<=n.value.length/2?"lower":"upper"),s=a.computed(()=>o.value==="lower"),l=a.computed(()=>o.value==="upper");function d(){const c=t.value+1;c>=n.value.length?t.value=n.value[0]:t.value=n.value[c]}return(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(m,{right:"",attach:""},{activator:a.withCtx(({props:f})=>[a.createVNode(u,a.mergeProps({style:{cursor:"pointer"},density:"comfortable",elevation:"1",icon:""},f,{onClick:d}),{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock("svg",Ky,[a.createElementVNode("path",{d:"M8.98034 10.3472L1.54055 5.8855L8.98034 1.42384L16.4201 5.8855L8.98034 10.3472Z",fill:"white",stroke:l.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,$y),a.createElementVNode("path",{d:"M8.98034 14.7993L1.54055 10.3376L8.98034 5.87599L16.4201 10.3376L8.98034 14.7993Z",fill:"white",stroke:s.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,eS)]))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",tS,a.toDisplayString(a.unref(r).getLabel(o.value))+" "+a.toDisplayString(a.unref(r).getLabel("floor")),1)]),_:1})}}}),[["__scopeId","data-v-ae461ac7"]]);class ii{static async loadText(t){return new ii().loadText(t)}static async loadJson(t){return new ii().loadJson(t)}static async loadImage(t){return new ii().loadImage(t)}static async loadImageData(t){return new ii().loadImageData(t)}async loadText(t){try{return(await Pt.get(t)).data}catch(i){throw Pt.isAxiosError(i)&&i.response?new Error(`Failed to load resource from ${t}: ${i.response.status} ${i.response.statusText}`):i}}async loadJson(t){return(await Pt.get(t)).data}async loadImage(t){return new Promise((i,r)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{i(n)},n.onerror=r,n.src=t})}async loadImageData(t){const i=await this.loadImage(t),r=document.createElement("canvas");try{const n=r.getContext("2d");return r.width=i.width,r.height=i.height,n.drawImage(i,0,0),r.toDataURL("image/png")}finally{r.remove()}}}function pa(e){return("0"+e).slice(-2)}function rS(){const e=new Date;return[e.getFullYear().toString(),pa(e.getMonth()+1),pa(e.getDate())," ",pa(e.getHours()),pa(e.getMinutes()),pa(e.getSeconds())].join("")}function aS(){return"Visuado-Snapshot-"+rS()}class x4{constructor(t){D2(this,"data");this.data=t}download(t=null){t=t||aS();const i=document.createElement("a");typeof i.download=="string"?(document.body.appendChild(i),i.download=t,i.href=this.data,i.click(),document.body.removeChild(i)):location.replace(this.data)}}const nS={key:0,class:"player-error"},oS={class:"player-and-components-wrapper"},sS={key:3,class:"settings-panel"},lS={key:0,class:"compass-wrapper"},cS={key:1,class:"btn-placeholder mr-2"},dS={class:"btn-placeholder mr-2"},hS={key:2,class:"btn-placeholder mr-2"},uS={key:3,class:"btn-placeholder mr-2"},mS={class:"d-flex flex-column align-end"},fS={key:1,class:"d-flex align-center flex-column sun-study mt-2"},pS={key:2,class:"render-version"},y4=ke(a.defineComponent({__name:"VVirtualTour",props:{i18nConfig:{},cdnFileResolver:{},apartmentId:{},type:{default:"qhdr"},displayViewModeSwitch:{type:Boolean,default:!0},version:{},adminMode:{type:Boolean},playerSettings:{default:()=>({temperature:6500,targetLuminance:1,exposureFovScale:.3,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:""})},defaultViewMode:{default:"virtualTour"},showCarousel:{type:Boolean,default:!0},showTimeOfDay:{type:Boolean,default:!0},showCompass:{type:Boolean,default:!0},showFullScreen:{type:Boolean,default:!0},showSnapshot:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},showInteriorOptions:{type:Boolean,default:!0},showMiniMap:{type:Boolean,default:!0},showFloorLevel:{type:Boolean,default:!0},showVersion:{type:Boolean,default:!0},showVisuadoCreateButton:{type:Boolean,default:!1},enableAutoplay:{type:Boolean,default:!1}},emits:["snapshot","visuadoCreateButtonClicked","interiorUpdate","cameraUpdate","sunsimUpdate","frontendMarkersUpdate","initialized","saveSettings","error"],setup(e,{expose:t,emit:i}){const r=e,n=i;t();const{i18nConfig:o,cdnFileResolver:s,apartmentId:l,type:d,displayViewModeSwitch:c,version:h,adminMode:u,playerSettings:m,defaultViewMode:f,showCarousel:v,showTimeOfDay:_,showCompass:g,showFullScreen:p,showSnapshot:y,showShare:x,showInteriorOptions:b,showMiniMap:N,showFloorLevel:A,showVersion:C,showVisuadoCreateButton:U,enableAutoplay:S}=a.toRefs(r);a.provide(H1,o.value?new h2(o.value):new h2);const M=a.ref(),k=a.ref(),R=a.ref(),D=a.ref(),V=a.ref({}),q=a.ref({}),W=a.ref({}),Q=a.ref(!1),z=a.ref(),J=a.ref(),j=a.ref(),de=a.ref(),oe=a.ref(),X=a.ref(0),K=a.ref(!1),le=a.ref(!1),ce=a.ref(!1),ae=a.ref(!1),Me=a.ref(!1),Be=a.ref(!1),O=a.ref(!1),Ee=a.ref(),ve=a.ref(),Re=a.ref(),we=a.ref(),Je=a.ref(0),Te=a.ref(0),T=a.ref(new P3(document,"player-wrapper"));a.onMounted(async()=>{try{fe.value?(K.value=!1,ce.value=!0):setTimeout(()=>{K.value=!0},1e3)}catch(ue){Q.value=!0,n("error",ue)}}),a.watch(f,()=>{f.value==="virtualTour"&&(le.value=!1),f.value==="slideShow"&&(le.value=!0,ce.value=!0)},{immediate:!0}),a.watch(oe,()=>{de.value=oe.value.labels.thumbnailUrl?oe.value:null}),a.watch([s,l,d],async()=>{var ue;if(s.value!==void 0&&l.value!==void 0){const me=[],s1=l1(s.value,"/config.json");R.value=await(await fetch(s1)).json(),D.value=R.value.archetypes;const P1=R.value.archetypes.map($e=>$e.archetypeID);for(const $e of P1){const Ye=l1(s.value,`/${$e}/${l.value}/apartment.json`);try{V.value[$e]=await(await fetch(Ye)).json()}catch{if(P1[0]!==$e)V.value[$e]=V.value[P1[0]];else throw new Error(`Failed to load apartment.json for the default interior: ${Ye}`)}const c2=l1(s.value,`/${$e}/${l.value}/thumbs.json`);try{q.value[$e]=await(await fetch(c2)).json()}catch{q.value[$e]=q.value[P1[0]]}const vt=l1(s.value,`/${$e}/${l.value}/minimap/minimap.json`);try{W.value[$e]=await(await fetch(vt)).json()}catch{W.value[$e]=void 0}for(const B1 of V.value[$e].cameras){const E1=B1.id,ri=(ue=B1.sunsimDayOfYear)==null?void 0:ue.filter(xt=>{var d2;return((d2=xt.timeSamples)==null?void 0:d2.length)>1});me.push({url:l1(s.value,`/${$e}/${l.value}/360/4096x2048/${E1}.${d.value||"qhdr"}`),position:B1.uposition,rotation:B1.urotation,floorPositionY:Number(B1.floor_vertical_position),floorLevel:B1.floorLevel,type:d.value,depthDataUrl:d.value==="jpg"?l1(s.value,`/${$e}/${l.value}/data/${E1}_depth.raw.z`):void 0,labels:{apartmentId:l.value,interiorId:$e,cameraId:E1,hasSunSim:!!ri.length,daysOfYear:ri,thumbnailUrl:q.value[$e].cameras.find(xt=>xt.id===E1)?l1(s.value,`/${$e}/${l.value}/thumbs/200/${E1}.jpg`):void 0,imageUrl:q.value[$e].cameras.find(xt=>xt.id===E1)?l1(s.value,`/${$e}/${l.value}/thumbs/1600/${E1}.jpg`):void 0}});for(const xt of ri)for(const d2 of xt.timeSamples)me.push({url:l1(s.value,`/${$e}/${l.value}${d2.filename}`),position:B1.uposition,rotation:B1.urotation,floorPositionY:Number(B1.floor_vertical_position),floorLevel:B1.floorLevel,type:"jpg",labels:{apartmentId:l.value,interiorId:$e,cameraId:E1,hasSunSim:!0,dayOfYear:xt.dayOfYear,timeInHours:d2.timeInHours}})}}z.value=me}},{immediate:!0}),a.watch(z,()=>{z.value&&z.value.length>0&&(Ee.value=z.value[0].labels.cameraId,ve.value=z.value[0].labels.interiorId)},{immediate:!0}),a.watch(O,()=>{var ue;O.value?(ce.value=!1,Re.value=oe.value.labels.daysOfYear[0],we.value=(ue=oe.value.labels.daysOfYear[0].timeSamples)==null?void 0:ue.find(me=>me.timeInHours===oe.value.labels.daysOfYear[0].defaultHour)):(ce.value=!0,Re.value=void 0,we.value=void 0)}),a.watch(ve,()=>{n("interiorUpdate",ve.value)}),a.watch(Ee,()=>{n("cameraUpdate",Ee.value,V.value[ve.value])}),a.watch(oe,()=>{n("sunsimUpdate",oe.value.labels.daysOfYear)});const w=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent)),G=a.computed(()=>w.value?"platform-mobile":"platform-desktop"),$=a.computed(()=>V.value[ve.value]),re=a.computed(()=>W.value[ve.value]),L=a.computed(()=>{if($.value){const ue=$.value.cameras.map(s1=>s1.floorLevel);let me=[...new Set(ue)];return me=me.sort(),me}else return[]}),ie=a.computed(()=>{let ue=0;if($.value){const me=$.value.cameras.map($e=>$e.floorLevel);let s1=[...new Set(me)];s1=s1.sort();const P1=s1.findIndex($e=>$e===Te.value);P1!==-1&&(ue=P1)}return ue}),ee=a.computed(()=>{if(re.value&&re.value.storeys&&ie.value in re.value.storeys)return re.value.storeys[ie.value]}),he=a.computed(()=>{if($.value&&$.value.timeInHours&&r.showTimeOfDay)return Oe($.value.timeInHours)}),fe=a.computed(()=>{const ue=l1(s.value,"/config.json");return localStorage.getItem(`${ue}-dont-show-tutorial`)});function ne(ue){de.value=ue,k.value.setCurrentDataPoint(a.toRaw(de.value))}function Se(){if(de.value){let ue=j.value.findIndex(me=>me===de.value)+1;ue>=j.value.length&&(ue=0),de.value=j.value[ue]}else de.value=j.value[0]}function be(){if(de.value){let ue=j.value.findIndex(me=>me===de.value)-1;ue<0&&(ue=j.value.length-1),de.value=j.value[ue]}else de.value=j.value[0]}function Ie(ue){ve.value=ue}function Ae(ue){j.value=ue.data.filter(me=>me.labels.thumbnailUrl)}function Xe(ue){ue.state===Yl.Finished&&(oe.value=ue.dataPoint,Ee.value=ue.dataPoint.labels.cameraId,ve.value=ue.dataPoint.labels.interiorId)}function ze(ue){J.value=ue.data}function e1(ue){M.value&&M.value.updateLoadProgress(ue)}function i1(ue){O.value=!1}async function p1(){const ue=await k.value.takePhoto(),me=k.value.getState(),s1=new x4(ue);return n("snapshot",s1,me),s1}async function xe(){console.log("Here onVisuadoCreateButtonClicked");const ue=await k.value.takePhoto(),me=new x4(ue);n("visuadoCreateButtonClicked",me)}function P(ue=!1){ce.value=!0,K.value=!1,ue&&pe()}function pe(){const ue=l1(r.cdnFileResolver,"/config.json");localStorage.setItem(`${ue}-dont-show-tutorial`,"true")}function se(ue){Ee.value=ue}function Oe(ue){if(ue===void 0)return null;const me=Math.floor(ue),s1=Math.floor((me-ue)*60);return{hours:me,minutes:s1}}function Pe(){T.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function Ke(ue){k.value.setAllOptions({unrealBloomEnabled:ue.UNREAL_BLOOM_ENABLED,unrealBloomStrength:ue.UNREAL_BLOOM_STRENGTH,sharpenFilterAmount:ue.sharpenFilter_amount,whitePoint:ue.whitePoint,temperature:ue.temperature,targetLuminance:ue.targetLuminance,exposureFovScale:ue.exposureFovScale,transitionMovementScale:ue.TRANSITION_MOVEMENT_SCALE}),ue.lut&&ue.lut}function r1(ue){n("saveSettings",ue)}function o1(){T.value.setup()}function A1(ue){k.value=ue,n("initialized",k.value)}function a1(ue){Je.value=ue.yRotation}return(ue,me)=>{var P1,$e;const s1=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["virtual-tour-wrapper",[G.value]])},[Q.value?(a.openBlock(),a.createElementBlock("div",nS,"Error loading the player!!")):a.createCommentVNode("",!0),a.createElementVNode("div",oS,[!T.value.isActive&&a.unref(N)&&re.value&&Ee.value&&ee.value&&ve.value&&ae.value?(a.openBlock(),a.createBlock(g4,{key:0,"cdn-file-resolver":a.unref(s),"apartment-json":$.value,level:ie.value,"minimap-json":re.value,rotation:Je.value,"current-camera":Ee.value,onGoToCamera:se,onClose:me[0]||(me[0]=Ye=>ae.value=!1)},null,8,["cdn-file-resolver","apartment-json","level","minimap-json","rotation","current-camera"])):a.createCommentVNode("",!0),ve.value&&Ee.value?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["v-player",[G.value]])},[z.value?(a.openBlock(),a.createBlock(vx,{key:0,data:z.value,cameraId:Ee.value,interiorId:ve.value,day:Re.value,time:we.value,isAutoPlaying:Be.value,isFullScreen:T.value.isActive,onInitialized:o1,onDataPointsActivated:Ae,onDataPointLoad:Xe,onDataPointsLoaded:ze,onDataPointTextureLoad:e1,onMousePick:i1,onStateUpdated:a1,onPlayerCoreAccessible:A1,onFrontendMarkersUpdate:me[14]||(me[14]=Ye=>n("frontendMarkersUpdate",Ye.data))},{"slideshow-image":a.withCtx(()=>{var Ye;return[le.value?(a.openBlock(),a.createBlock(J0,{key:0,image:(Ye=de.value)==null?void 0:Ye.labels.imageUrl},null,8,["image"])):a.createCommentVNode("",!0)]}),"top-left":a.withCtx(()=>[a.unref(u)?(a.openBlock(),a.createBlock(s1,{key:0,density:"comfortable",icon:"mdi-cog-outline",elevation:"3",class:"mr-2",onClick:me[1]||(me[1]=Ye=>Me.value=!Me.value)})):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(s1,{density:"comfortable",icon:"mdi-alert-outline",elevation:"3",class:"mr-2",onClick:me[2]||(me[2]=Ye=>K.value=!K.value)},null,512),[[a.vShow,ce.value]]),re.value&&Ee.value&&ee.value?a.withDirectives((a.openBlock(),a.createBlock(s1,{key:1,density:"comfortable",elevation:"3",icon:"mdi-floor-plan",class:"mr-2",onClick:me[3]||(me[3]=Ye=>ae.value=!ae.value)},null,512)),[[a.vShow,ce.value]]):a.createCommentVNode("",!0),ce.value&&a.unref(A)&&L.value.length>1?(a.openBlock(),a.createBlock(iS,{key:2,modelValue:X.value,"onUpdate:modelValue":me[4]||(me[4]=Ye=>X.value=Ye),"floor-levels":L.value},null,8,["modelValue","floor-levels"])):a.createCommentVNode("",!0),a.unref(u)&&Me.value?(a.openBlock(),a.createElementBlock("div",sS,[a.createVNode(Jy,{"initial-settings":a.unref(m),onUpdateSettings:Ke,onSaveSettings:r1},null,8,["initial-settings"])])):a.createCommentVNode("",!0)]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[$.value&&a.unref(g)?a.withDirectives((a.openBlock(),a.createElementBlock("div",lS,[a.createVNode(Ry,{rotation:Je.value},null,8,["rotation"])],512)),[[a.vShow,ce.value]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:me[5]||(me[5]=Ye=>ae.value=!ae.value)},[ce.value&&$.value&&$.value.timeInHours&&a.unref(_)?(a.openBlock(),a.createBlock(Ly,{key:0,hours:he.value.hours,minutes:he.value.minutes,class:"time-of-day",style:a.normalizeStyle({cursor:re.value&&Ee.value&&ee.value?"pointer":"default"})},null,8,["hours","minutes","style"])):a.createCommentVNode("",!0)])]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[le.value?(a.openBlock(),a.createBlock(s1,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:be})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[K.value?(a.openBlock(),a.createBlock(Kx,{key:0,onCloseTutorial:me[6]||(me[6]=Ye=>P(Ye))})):a.createCommentVNode("",!0),T.value.isActive&&re.value&&oe.value&&ee.value&&ae.value?(a.openBlock(),a.createBlock(g4,{key:1,"cdn-file-resolver":a.unref(s),"apartment-json":$.value,"minimap-json":re.value,rotation:Je.value,"current-camera":oe.value.labels.cameraId,level:Te.value,onClose:me[7]||(me[7]=Ye=>ae.value=!1),onGoToCamera:se},null,8,["cdn-file-resolver","apartment-json","minimap-json","rotation","current-camera","level"])):a.createCommentVNode("",!0)]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[le.value?(a.openBlock(),a.createBlock(s1,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:Se})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(my,{key:0,"is-full-screen":T.value.isActive,class:"btn-fullscreen",onToggleFullscreen:Pe},null,8,["is-full-screen"])):a.createCommentVNode("",!0),a.unref(y)?(a.openBlock(),a.createElementBlock("div",cS,[a.createVNode(s1,{density:"comfortable",elevation:"3",icon:"mdi-camera",onClick:p1})])):a.createCommentVNode("",!0),a.createElementVNode("div",dS,[a.unref(c)&&ce.value?(a.openBlock(),a.createBlock(Sx,{key:0,modelValue:le.value,"onUpdate:modelValue":me[8]||(me[8]=Ye=>le.value=Ye)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),ce.value&&a.unref(x)&&!T.value.isActive?(a.openBlock(),a.createElementBlock("div",hS,[a.createVNode(wx)])):a.createCommentVNode("",!0),ce.value&&a.unref(U)?(a.openBlock(),a.createElementBlock("div",uS,[a.createVNode(hy,{onOnSnapshot:xe})])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createVNode(a.Transition,null,{default:a.withCtx(()=>{var Ye,c2,vt,B1;return[a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(["d-flex justify-center",{"mb-2":!w.value}])},[!Be.value&&((c2=(Ye=oe.value)==null?void 0:Ye.labels)!=null&&c2.hasSunSim)?(a.openBlock(),a.createBlock(Sy,{key:0,modelValue:O.value,"onUpdate:modelValue":me[9]||(me[9]=E1=>O.value=E1),"show-ui":ce.value,class:"ml-2"},null,8,["modelValue","show-ui"])):a.createCommentVNode("",!0)],2),!w.value&&!Be.value&&((B1=(vt=oe.value)==null?void 0:vt.labels)!=null&&B1.hasSunSim)&&we.value?(a.openBlock(),a.createBlock(_4,{key:0,modelValue:O.value,"onUpdate:modelValue":me[10]||(me[10]=E1=>O.value=E1),time:we.value,"onUpdate:time":me[11]||(me[11]=E1=>we.value=E1),day:Re.value,"onUpdate:day":me[12]||(me[12]=E1=>Re.value=E1),class:"sunsim-slider-desktop"},null,8,["modelValue","time","day"])):a.createCommentVNode("",!0),!w.value&&a.unref(v)&&ce.value&&j.value?(a.openBlock(),a.createBlock(v4,{key:1,ref_key:"carousel",ref:M,class:a.normalizeClass([T.value.isActive?"full-screen":""]),currentThumbnail:de.value,thumbnails:j.value,onGo:ne},{before:a.withCtx(()=>[a.unref(S)?(a.openBlock(),a.createBlock(p4,{key:0,modelValue:Be.value,"onUpdate:modelValue":me[13]||(me[13]=E1=>Be.value=E1)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),_:1},8,["class","currentThumbnail","thumbnails"])):a.createCommentVNode("",!0)])]}),_:1})]),"bottom-right":a.withCtx(()=>[a.createElementVNode("div",mS,[ce.value&&a.unref(b)?(a.openBlock(),a.createBlock(yy,{key:0,"cdn-file-resolver":a.unref(s),archetypes:D.value,"current-data-point":oe.value,onSelectInterior:Ie},null,8,["cdn-file-resolver","archetypes","current-data-point"])):a.createCommentVNode("",!0)])]),_:1},8,["data","cameraId","interiorId","day","time","isAutoPlaying","isFullScreen"])):a.createCommentVNode("",!0),a.createVNode(a.Transition,null,{default:a.withCtx(()=>[w.value&&a.unref(v)&&ce.value&&j.value?(a.openBlock(),a.createBlock(v4,{key:0,ref_key:"carousel",ref:M,class:"waypoint-carousel below-player",currentThumbnail:de.value,thumbnails:j.value,onGo:ne},{before:a.withCtx(()=>[a.unref(S)?(a.openBlock(),a.createBlock(p4,{key:0,modelValue:Be.value,"onUpdate:modelValue":me[15]||(me[15]=Ye=>Be.value=Ye)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),_:1},8,["currentThumbnail","thumbnails"])):a.createCommentVNode("",!0)]),_:1}),w.value?(a.openBlock(),a.createElementBlock("div",fS,[Be.value&&(($e=(P1=oe.value)==null?void 0:P1.labels)!=null&&$e.hasSunSim)&&we.value?(a.openBlock(),a.createBlock(_4,{key:0,modelValue:O.value,"onUpdate:modelValue":me[16]||(me[16]=Ye=>O.value=Ye),time:we.value,"onUpdate:time":me[17]||(me[17]=Ye=>we.value=Ye),day:Re.value,"onUpdate:day":me[18]||(me[18]=Ye=>Re.value=Ye),class:"mt-1"},null,8,["modelValue","time","day"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),a.unref(h)&&a.unref(C)?(a.openBlock(),a.createElementBlock("div",pS," version: "+a.toDisplayString(a.unref(h)),1)):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-2de19c19"]]),gS={id:"player-wrapper"},_S={id:"player-sizer"},vS={class:"player-control",id:"controls-top-left"},xS={class:"player-control",id:"controls-top-center"},yS={class:"player-control",id:"controls-top-right"},SS={class:"player-control",id:"controls-center-left"},MS={class:"player-control",id:"controls-center-center"},wS={class:"player-control",id:"controls-center-right"},AS={class:"player-control",id:"controls-bottom-left"},ES={class:"player-control",id:"controls-bottom-center"},bS={class:"player-control",id:"controls-bottom-right"},CS=ke(a.defineComponent({__name:"VManualSlideShowPlayer",props:{isFullScreen:{type:Boolean}},emits:["newSizeCallback"],setup(e,{emit:t}){return(i,r)=>(a.openBlock(),a.createElementBlock("div",gS,[a.createElementVNode("div",_S,[a.renderSlot(i.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",vS,[a.renderSlot(i.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",xS,[a.renderSlot(i.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",yS,[a.renderSlot(i.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",SS,[a.renderSlot(i.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",MS,[a.renderSlot(i.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",wS,[a.renderSlot(i.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",AS,[a.renderSlot(i.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",ES,[a.renderSlot(i.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",bS,[a.renderSlot(i.$slots,"bottom-right",{},void 0,!0)])])]))}}),[["__scopeId","data-v-5fdd1e05"]]),TS={class:"virtual-tour-wrapper"},IS={class:"player-and-components-wrapper"},PS={class:"mss-image"},NS={key:1,class:"btn-placeholder"},S4=ke(a.defineComponent({__name:"VManualSlideShow",props:{images:{},websiteUrl:{},i18nConfig:{},showFullScreen:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},defaultWaypointIndex:{default:0}},setup(e){const t=e;a.provide(H1,t.i18nConfig?new h2(t.i18nConfig):new h2);const i=a.ref(0),r=a.ref(new P3(document,"player-wrapper")),n=a.computed(()=>t.images.map((h,u)=>({id:`image-${u}`,thumbnailUrl:h}))),o=a.computed(()=>n.value[i.value]);a.onMounted(()=>{r.value.setup()});function s(){r.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function l(){let h=i.value+1;h>=n.value.length&&(h=0),i.value=h}function d(){let h=i.value-1;h<0&&(h=n.value.length-1),i.value=h}function c(h,u=!0){let m=n.value.findIndex(f=>f.id===h);m!=-1&&(i.value=m)}return(h,u)=>{const m=a.resolveComponent("v-img"),f=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",TS,[a.createElementVNode("div",IS,[a.createElementVNode("div",null,[a.createVNode(CS,{"is-full-screen":r.value.isActive},{"slideshow-image":a.withCtx(()=>[a.createElementVNode("div",PS,[a.createVNode(m,{src:o.value.thumbnailUrl},null,8,["src"])])]),"top-left":a.withCtx(()=>[]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[n.value.length>1?(a.openBlock(),a.createBlock(f,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:d})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[n.value.length>1?(a.openBlock(),a.createBlock(f,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:l})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[h.showFullScreen?(a.openBlock(),a.createBlock(K0,{key:0,"is-full-screen":r.value.isActive,class:"btn-fullscreen",onToggleFullscreen:s},null,8,["is-full-screen"])):a.createCommentVNode("",!0),h.showShare?(a.openBlock(),a.createElementBlock("div",NS,[a.createVNode(Q0)])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createElementVNode("div",null,[r.value.isActive&&n.value.length>1?(a.openBlock(),a.createBlock(xa,{key:0,class:a.normalizeClass([r.value.isActive?"full-screen":""]),thumbnails:n.value,active:i.value,onNext:l,onPrevious:d,onGoto:c},null,8,["class","thumbnails","active"])):a.createCommentVNode("",!0)])]),"bottom-right":a.withCtx(()=>[]),_:1},8,["is-full-screen"]),n.value.length>1?(a.openBlock(),a.createBlock(xa,{key:0,thumbnails:n.value,active:i.value,onNext:l,onPrevious:d,onGoto:c},null,8,["thumbnails","active"])):a.createCommentVNode("",!0)])])])}}}),[["__scopeId","data-v-373ac320"]]),LS=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},currentCamera:{},level:{},rotation:{},hideCompass:{type:Boolean},hideSlider:{type:Boolean},compassScale:{}},emits:["apartmentJsonLoaded","minimapJsonLoaded","cameraSet"],setup(e,{emit:t}){const i=e,r=a.toRefs(i),n=t,o=a.ref(),s=a.ref(),l=a.ref(),d=a.ref(0),c=a.ref(),h=a.ref(1),u=a.computed(()=>r.currentCamera.value?r.currentCamera.value:o.value?o.value.cameras[0].id:null),m=a.computed(()=>({transformOrigin:"top left",transform:`scale(${h.value})`}));a.watch(c,()=>{c.value&&new ResizeObserver(([p])=>{const y=p.target.parentElement,x=y.parentElement;h.value=x.clientWidth/512,y.style.height=`${p.contentRect.height*h.value}px`}).observe(c.value)}),a.watch(u,()=>{n("cameraSet",u.value)});const f=a.computed(()=>{const p=l1(r.cdnFileResolver.value,"").replace(`/${o.value.type}/${o.value.id}`,"");return y=>`${p}${y}`}),v=a.computed(()=>{var g;return(g=s.value)==null?void 0:g.storeys[r.level.value||0]});a.watch(r.cdnFileResolver,async()=>{o.value=await(await fetch(l1(r.cdnFileResolver.value,"/apartment.json"))).json(),n("apartmentJsonLoaded",o.value),s.value=await(await fetch(l1(r.cdnFileResolver.value,"/minimap/minimap.json"))).json(),n("minimapJsonLoaded",s.value)},{immediate:!0}),a.watch([v,r.cdnFileResolver],()=>{r.cdnFileResolver.value&&v.value&&(l.value=v.value.defaultSunsimFile?l1(r.cdnFileResolver.value,"/minimap/sunsim0_13.jpg"):l1(r.cdnFileResolver.value,`/minimap/${v.value.defaultSunsimFile}`))},{immediate:!0});function _(g){l.value=g}return(g,p)=>{const y=a.resolveComponent("v-skeleton-loader");return a.openBlock(),a.createBlock(y,{loading:!o.value||!s.value},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createElementVNode("div",{style:a.normalizeStyle({...m.value,position:"relative"}),ref_key:"fitContainer",ref:c},[g.hideCompass!==!0?(a.openBlock(),a.createBlock(T3,{key:0,scale:g.compassScale||1,rotation:v.value.rotation.y,"transform-angle":d.value},null,8,["scale","rotation","transform-angle"])):a.createCommentVNode("",!0),a.createVNode(C3,{"transform-angle":d.value,"all-cameras":o.value.cameras,"background-image":l.value,rotation:g.rotation||0,"current-camera":u.value,storey:v.value,containerWidth:512,containerHeight:384,fit:""},{default:a.withCtx(({id:x,camera:b,active:N,style:A})=>[a.renderSlot(g.$slots,"default",{id:x,camera:b,active:N,style:a.normalizeStyle(A)},void 0,!0)]),_:3},8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey"]),g.hideSlider!==!0?(a.openBlock(),a.createBlock(I3,{key:1,"cdn-file-resolver":f.value,"minimap-json":s.value,"apartment-json":o.value,level:g.level||0,onSetBackgroundImage:_},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"])):a.createCommentVNode("",!0)],4)])]),_:3},8,["loading"])}}}),[["__scopeId","data-v-8077dfb5"]]),RS=["src"],DS=ke(a.defineComponent({__name:"VStructureChooserCameraDayTimeSample",props:{timeSampleData:{},cdnFileResolver:{type:[String,Function]},currentTime:{}},setup(e){const t=e,{timeSampleData:i,cdnFileResolver:r,currentTime:n}=a.toRefs(t),o=a.ref(),s=a.inject("registerImage"),l=a.inject("completeImage");a.watch(o,()=>{o.value&&(s(o.value),o.value.onload=()=>{l(o.value)},o.value.onerror=()=>{l(o.value)})});const d=a.computed(()=>l1(r.value,i.value.filename));return(c,h)=>(a.openBlock(),a.createElementBlock("img",{ref_key:"image",ref:o,style:a.normalizeStyle({visibility:a.unref(n)&&a.unref(i)===a.unref(n)?"visible":"hidden"}),src:d.value},null,12,RS))}}),[["__scopeId","data-v-c4a08195"]]),US=a.defineComponent({__name:"VStructureChooserCameraDay",props:{dayData:{},cdnFileResolver:{type:[String,Function]},currentDay:{},currentTime:{}},setup(e){const t=e,{dayData:i,cdnFileResolver:r,currentTime:n}=a.toRefs(t);return(o,s)=>(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i).timeSamples,(l,d)=>(a.openBlock(),a.createBlock(DS,{key:d,"time-sample-data":l,"cdn-file-resolver":a.unref(r),"current-time":a.unref(n)},null,8,["time-sample-data","cdn-file-resolver","current-time"]))),128))}}),kS=["src"],OS=ke(a.defineComponent({__name:"VStructureChooserCamera",props:{cameraData:{},cdnFileResolver:{type:[String,Function]},currentCamera:{},currentDay:{},currentTime:{}},setup(e){const t=e,{cameraData:i,cdnFileResolver:r,currentCamera:n,currentTime:o}=a.toRefs(t),s=a.ref(),l=a.inject("registerImage"),d=a.inject("completeImage");a.watch(s,()=>{s.value&&(l(s.value),s.value.onload=()=>{d(s.value)},s.value.onerror=()=>{d(s.value)})});const c=a.computed(()=>l1(r.value,i.value.defaultFilename));return(h,u)=>a.unref(i).sunsimDayOfYear?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(a.unref(i).sunsimDayOfYear,(m,f)=>(a.openBlock(),a.createBlock(US,{key:f,"day-data":m,"cdn-file-resolver":a.unref(r),"current-day":h.currentDay,"current-time":a.unref(o)},null,8,["day-data","cdn-file-resolver","current-day","current-time"]))),128)):(a.openBlock(),a.createElementBlock("img",{key:1,ref_key:"image",ref:s,style:a.normalizeStyle({visibility:a.unref(n)===a.unref(i)?"visible":"hidden"}),src:c.value},null,12,kS))}}),[["__scopeId","data-v-da694d37"]]),zS=["src"],VS=ke(a.defineComponent({__name:"VStructureChooserTransition",props:{transitionData:{},cdnFileResolver:{type:[String,Function]},currentTransition:{}},setup(e){const t=e,{transitionData:i,cdnFileResolver:r,currentTransition:n}=a.toRefs(t),o=a.ref(),s=a.inject("registerImage"),l=a.inject("completeImage");a.watch(o,()=>{o.value&&(s(o.value),o.value.onload=()=>{l(o.value)},o.value.onerror=()=>{l(o.value)})});const d=a.computed(()=>l1(r.value,i.value.filename));return(c,h)=>(a.openBlock(),a.createElementBlock("img",{ref_key:"image",ref:o,style:a.normalizeStyle({visibility:a.unref(i)===a.unref(n)?"visible":"hidden"}),src:d.value},null,12,zS))}}),[["__scopeId","data-v-d592c198"]]);function M4(e){const t=new Date(0);return t.setUTCDate(e),t.toLocaleString("en-no",{month:"short",day:"numeric"})}const BS={key:0,class:"d-inline-block",style:{"vertical-align":"top"}},FS=ke(a.defineComponent({__name:"VStructureChooserUiDayButton",props:{isMobileSized:{type:Boolean},currentCamera:{},currentDay:{},disabled:{type:Boolean}},emits:["onDayChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,currentCamera:n,currentDay:o,disabled:s}=a.toRefs(i),l=t,d=a.ref(o.value.dayOfYear);return a.watch(o,()=>{d.value=o.value.dayOfYear}),a.watch(d,()=>{l("onDayChange",n.value.sunsimDayOfYear.find(c=>c.dayOfYear===d.value))}),(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-field"),f=a.resolveComponent("v-list-item-title"),v=a.resolveComponent("v-list-item"),_=a.resolveComponent("v-list"),g=a.resolveComponent("v-menu");return a.unref(n).sunsimDayOfYear&&a.unref(n).sunsimDayOfYear.length>0?(a.openBlock(),a.createElementBlock("div",BS,[a.createVNode(g,null,{activator:a.withCtx(({props:p})=>[a.createVNode(m,{variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.createVNode(u,a.mergeProps({variant:"text",rounded:"",flat:"",readonly:a.unref(n).sunsimDayOfYear.length===1,"prepend-icon":"mdi-calendar-blank","append-icon":a.unref(n).sunsimDayOfYear.length>1?"mdi-menu-down":void 0,disabled:a.unref(s),size:a.unref(r)?"small":void 0},p),{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(M4)(d.value)),1)]),_:2},1040,["readonly","append-icon","disabled","size"])]),_:2},1024)]),default:a.withCtx(()=>[a.createVNode(_,null,{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n).sunsimDayOfYear,(p,y)=>(a.openBlock(),a.createBlock(v,{key:y,value:y,onClick:x=>d.value=p.dayOfYear},{default:a.withCtx(()=>[a.createVNode(f,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(M4)(p.dayOfYear)),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})])):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743f5faf"]]),HS=["onClick"],GS={key:0,class:"camera-name text-caption text-capitalize"},WS={key:1,class:"icon-wrapper"},jS=ke(a.defineComponent({__name:"VStructureChooserUiCameraThumbnails",props:{isMobileSized:{type:Boolean},stillCameras:{},currentCamera:{},cdnFileResolver:{type:[String,Function]},disabled:{type:Boolean}},emits:["onCameraChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,stillCameras:n,currentCamera:o,cdnFileResolver:s,disabled:l}=a.toRefs(i),d=a.ref(o.value),c=a.ref(),h=a.ref(),u=a.ref(!1),m=t;a.watch([c,h],()=>{if(c.value&&h.value){const v=new ResizeObserver(([_,g])=>{var p,y;u.value=((p=g==null?void 0:g.contentRect)==null?void 0:p.width)>((y=_==null?void 0:_.contentRect)==null?void 0:y.width)});v.observe(c.value),v.observe(h.value)}},{immediate:!0}),a.watch(o,()=>{d.value=o.value},{immediate:!0}),a.watch(d,()=>{m("onCameraChange",n.value.find(v=>v===d.value))});function f(v){l.value||(d.value=v)}return(v,_)=>{const g=a.resolveComponent("v-btn"),p=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",{ref_key:"parent",ref:c,class:a.normalizeClass({"d-flex parent-container":!0,mobile:a.unref(r),disabled:a.unref(l),enabled:!a.unref(l)})},[u.value?(a.openBlock(),a.createBlock(g,{key:0,style:{left:"0"},class:"thumbnail-nav-button",onClick:_[0]||(_[0]=y=>c.value.scrollLeft-=70)},{default:a.withCtx(()=>[a.createTextVNode(" ❮ ")]),_:1})):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"child",ref:h,class:"still-camera-thumbnails-wrapper d-flex justify-center",style:a.normalizeStyle({paddingLeft:u.value?"28px":0,paddingRight:u.value?"28px":0})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),(y,x)=>(a.openBlock(),a.createElementBlock("div",{key:x,class:a.normalizeClass(["still-camera-image d-flex flex-column flex-reverse align-center",{"elevation-2":!a.unref(r),"active-camera":y===d.value}]),onClick:b=>f(y)},[a.createElementVNode("div",{class:"camera-thumbnail-image",style:a.normalizeStyle({backgroundImage:`url(${a.unref(l1)(a.unref(s),y.defaultFilename)})`})},null,4),y.cameraName?(a.openBlock(),a.createElementBlock("div",GS,a.toDisplayString(y.cameraName),1)):a.createCommentVNode("",!0),y.sunsimDayOfYear&&y.sunsimDayOfYear.length>1?(a.openBlock(),a.createElementBlock("div",WS,[a.createVNode(p,{size:"x-small",color:"warning",style:{opacity:"0.6"}},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1})])):a.createCommentVNode("",!0)],10,HS))),128))],4),u.value?(a.openBlock(),a.createBlock(g,{key:1,style:{right:"0"},class:"thumbnail-nav-button",onClick:_[1]||(_[1]=y=>c.value.scrollLeft+=70)},{default:a.withCtx(()=>[a.createTextVNode(" ❯ ")]),_:1})):a.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-cbc592ae"]]),XS={class:"small"},YS={class:"small"},qS=ke(a.defineComponent({__name:"VStructureChooserUiTimeSampleSlider",props:{isMobileSized:{type:Boolean},currentDay:{},currentTime:{},disabled:{type:Boolean}},emits:["onTimeChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,currentDay:n,currentTime:o,disabled:s}=a.toRefs(i),l=t,d=a.ref(o.value.timeInHours);return a.watch(o,()=>{d.value=o.value.timeInHours}),a.watch(d,()=>{l("onTimeChange",n.value.timeSamples.find(c=>c.timeInHours===d.value))}),(c,h)=>{const u=a.resolveComponent("v-icon"),m=a.resolveComponent("v-slider"),f=a.resolveComponent("v-field");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"d-inline-block":!0,mobile:a.unref(r)}),style:a.normalizeStyle({flex:a.unref(r)&&a.unref(n).timeSamples.length>1?1:void 0,verticalAlign:"top"})},[a.createVNode(f,{style:a.normalizeStyle(a.unref(n).timeSamples.length>1?{width:a.unref(r)?"100%":"300px",height:a.unref(r)?"28px":"36px"}:{height:a.unref(r)?"28px":"36px",paddingLeft:"12px",paddingRight:"12px",paddingTop:a.unref(r)?"5px":"9px",paddingBottom:a.unref(r)?"5px":"9px"}),variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.unref(n).timeSamples.length>1?(a.openBlock(),a.createBlock(m,{key:0,class:"pa-2 pr-2",modelValue:d.value,"onUpdate:modelValue":h[0]||(h[0]=v=>d.value=v),min:a.unref(n).startTime,max:a.unref(n).endTime,step:a.unref(n).interval,disabled:!!a.unref(s),density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(u,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",XS,a.toDisplayString(a.unref(ni)(d.value)),1)]),_:1},8,["modelValue","min","max","step","disabled"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(u,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",YS,a.toDisplayString(a.unref(ni)(d.value)),1)],64))]),_:1},8,["style"])],6)}}}),[["__scopeId","data-v-5a7478fc"]]),ZS={class:"d-inline-block",style:{"vertical-align":"top"}},QS=a.createElementVNode("hr",{style:{"border-top":"1px solid #999"}},null,-1),JS=a.defineComponent({__name:"VStructureChooserUiZoomButtons",props:{isMobileSized:{type:Boolean},canZoomIn:{type:Boolean},canZoomOut:{type:Boolean},disabled:{type:Boolean}},emits:["onZoomIn","onZoomOut"],setup(e,{emit:t}){const i=e,{isMobileSized:r,canZoomIn:n,canZoomOut:o,disabled:s}=a.toRefs(i),l=t;return(d,c)=>{const h=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",ZS,[a.createVNode(h,{disabled:a.unref(s)||!a.unref(n),size:a.unref(r)?"x-small":"small",flat:"",icon:"mdi-plus",onClick:c[0]||(c[0]=u=>l("onZoomIn")),style:{"border-bottom-left-radius":"0","border-bottom-right-radius":"0"}},null,8,["disabled","size"]),QS,a.createVNode(h,{disabled:a.unref(s)||!a.unref(o),size:a.unref(r)?"x-small":"small",flat:"",icon:"mdi-minus",onClick:c[1]||(c[1]=u=>l("onZoomOut")),style:{"border-top-left-radius":"0","border-top-right-radius":"0"}},null,8,["disabled","size"])])}}}),KS=["innerHTML"],$S=ke(a.defineComponent({__name:"VStructureChooserOverlay",props:{cdnFileResolver:{type:[String,Function]},colorCallback:{type:Function},currentCamera:{},selectedId:{},activeStructureIds:{}},emits:["onClick","onHoverOver","onHoverOut","updateSvgContainer","onError","onBoundingBoxesUpdate"],setup(e,{emit:t}){const i=e,{cdnFileResolver:r,colorCallback:n,currentCamera:o,selectedId:s}=a.toRefs(i),l=t,d=a.ref(!0),c=a.ref({}),h=a.ref(),u=a.reactive({}),m=a.computed(()=>l1(r.value,o.value.overlayFilename));a.watchEffect(()=>{for(const _ in u){const{element:g,state:p}=u[_],{r:y,g:x,b,a:N,s:A}=n.value(_,p)||{r:0,g:0,b:0,a:0,s:0};g.style.fill=`rgba(${y}, ${x}, ${b}, ${N/255})`,g.style.stroke=`rgb(${y}, ${x}, ${b})`,g.style.strokeWidth=A.toString(),g.style.cursor="pointer"}}),a.watch(s,()=>{for(const _ in u)u[_].state==="selected"&&_!==s.value?u[_].state="idle":u[_].state!=="selected"&&_===s.value&&(u[_].state="selected")}),a.watchEffect(async()=>{try{d.value=!1,c.value[m.value]||(c.value[m.value]=await ii.loadText(m.value)),v()}catch(_){l("onError",_)}finally{d.value=!0}}),a.watch(()=>h.value,()=>{h.value&&new ResizeObserver(f).observe(h.value)});function f(){a.nextTick(()=>{var g;const _=(g=h.value)==null?void 0:g.firstChild;if(_){if(!_.hasAttribute("viewBox")){const p=`0 0 ${_.getAttribute("width")} ${_.getAttribute("height")}`;_.setAttribute("viewBox",p)}_.setAttribute("width",h.value.offsetWidth.toString()),_.setAttribute("height",h.value.offsetHeight.toString())}})}a.watch(()=>i.activeStructureIds,()=>{v()},{immediate:!0,deep:!0});function v(){a.nextTick(()=>{var g;const _=(g=h.value)==null?void 0:g.firstChild;if(_){l("updateSvgContainer",_),f();let p,y="data-structure-id";p=_.querySelectorAll(`[${y}]`),p.length===0&&(y="data-apartment-id",p=_.querySelectorAll(`[${y}]`),p.length===0&&(y="data-building-id",p=_.querySelectorAll(`[${y}]`))),p.forEach(x=>{const b=x.cloneNode(!0);x.parentNode.replaceChild(b,x),b.style.strokeWidth="0",b.style.stroke="rgba(255,255,255,0)",b.style.fill="rgba(255,255,255,0)",b.querySelectorAll("path").forEach(A=>{A.style.stroke="inherit",A.style.fill="inherit"});const N=b.getAttribute(y);u[N]={element:b,state:s.value===N?"selected":"idle",boundingBox:b.getBoundingClientRect().toJSON()},i.activeStructureIds&&!i.activeStructureIds.includes(N)&&(b.style.display="none"),b.addEventListener("mouseover",()=>{u[N].state==="idle"&&(u[N].state="hover"),l("onHoverOver",N)}),b.addEventListener("mouseout",()=>{u[N].state==="hover"&&(u[N].state="idle"),l("onHoverOut",N)}),b.addEventListener("click",()=>{l("onClick",N)})}),l("onBoundingBoxesUpdate",Object.entries(u).map(([x,b])=>({id:x,boundingBox:b.boundingBox})))}})}return(_,g)=>(a.openBlock(),a.createBlock(a.Transition,null,{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"svgContainer",ref:h,style:a.normalizeStyle([{visibility:d.value?"visible":"hidden"},{"z-index":"5"}]),class:"w-100 h-100 position-absolute top-left structure-chooser-overlay-svg",innerHTML:c.value[m.value]},null,12,KS)]),_:1}))}}),[["__scopeId","data-v-4638ecbd"]]);function eM(e){if(!e)return!1;const t=["version","latitude","longitude","structures","stillCameraIndices","stillCameraData","loopable","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function tM(e){return!("filename"in e)&&"defaultFilename"in e}function R0(e){return"filename"in e}function iM(e){if(!e)return!1;const t=["version","latitude","longitude","buildings","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function rM(e){if(!e)return!1;const t=["version","latitude","longitude","building","scenes","loopable","unitData","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function aM(e){return!("filename"in e)}function $i(e){return e.startsWith("/")?e:`/${e}`}function nM(e){return e?"version"in e:!1}function oM(e){if(!e)return!1;const t=["version","buildings","cameraPosition","cameraRotation","cameraFov","lookupFilename"];for(const i of t)if(!(i in e))return!1;return!0}function w4(e){var t,i,r,n;if(eM(e))return e;if(iM(e)){if(!e.buildings)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'buildings' is missing");return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.buildings.map(({id:o,name:s})=>({id:o,name:s,type:"building"})),stillCameraIndices:e.cameras.map((o,s)=>s),stillCameraData:e.buildings.map(({id:o})=>({bestIndex:0,id:o})),loopable:!1,cameras:e.cameras.map(o=>{var l;if(o.sunsimDayOfYear){if(o.sunsimDayOfYear.length===0)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear' is empty");if(o.sunsimDayOfYear[0].timeSamples){if(o.sunsimDayOfYear[0].timeSamples.length===0)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear.timeSamples' is empty")}else throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear[0].timeSamples' is missing")}else throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear' is missing");const s={...o};return s.sunsimDayOfYear&&s.sunsimDayOfYear.forEach(d=>{d.timeSamples&&d.timeSamples.forEach(c=>{c.filename=$i(c.filename)})}),{...s,defaultFilename:s.sunsimDayOfYear[0]?$i(((l=s.sunsimDayOfYear[0].timeSamples.find(d=>d.timeInHours===s.sunsimDayOfYear[0].defaultHour))==null?void 0:l.filename)||s.sunsimDayOfYear[0].timeSamples[0].filename):void 0}})}}else if(oM(e)){if(!e.days&&!e.timeSamples)throw new Error("cannot convert BuildingChooserDataLegacy to StructureChooser: 'days' and 'timeSamples' are empty");const o=e.days||[{dayOfYear:180,timeSamples:e.timeSamples}];return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.buildings.map(({id:s,name:l})=>({id:s,name:l,type:"building"})),stillCameraIndices:[0],stillCameraData:e.buildings.map(({id:s})=>({bestIndex:0,id:s})),loopable:!1,cameras:[{cameraName:"",cameraPosition:e.cameraPosition,cameraRotation:A4(e.cameraRotation.normalized||e.cameraRotation),cameraFov:e.cameraFov,overlayFilename:"/BuildingChooserV5.svg",defaultFilename:$i((i=(t=o[0])==null?void 0:t.timeSamples[0])==null?void 0:i.filename),sunsimDayOfYear:o.map(s=>({dayOfYear:s.dayOfYear,startTime:0,endTime:23.5,interval:.5,defaultHour:14,timeSamples:s.timeSamples.map(({timeInHours:l,filename:d})=>({timeInHours:l,filename:$i(d)}))}))}]}}else{if(rM(e))return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:{id:e.building.id,name:e.building.name,type:"building"},structures:e.unitData.map(({unitId:o})=>({id:o,name:o,type:"unit"})),stillCameraIndices:e.scenes,stillCameraData:e.unitData.map(({bestScene:o,unitId:s})=>({bestIndex:o,id:s})),loopable:e.loopable,cameras:e.cameras.map(o=>{var s;if(aM(o)){if(o.sunsimDayOfYear){if(o.sunsimDayOfYear.length===0)throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear' is empty");if(o.sunsimDayOfYear[0].timeSamples){if(o.sunsimDayOfYear[0].timeSamples.length===0)throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear.timeSamples' is empty")}else throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear[0].timeSamples' is missing")}else throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear' is missing");const l={...o};return l.sunsimDayOfYear&&l.sunsimDayOfYear.forEach(d=>{d.timeSamples&&d.timeSamples.forEach(c=>{c.filename=$i(c.filename)})}),{...l,defaultFilename:l.sunsimDayOfYear[0]?$i(((s=l.sunsimDayOfYear[0].timeSamples.find(d=>d.timeInHours===l.sunsimDayOfYear[0].defaultHour))==null?void 0:s.filename)||l.sunsimDayOfYear[0].timeSamples[0].filename):void 0}}else return o})};if(nM(e)){if(!e.sceneData)throw new Error("cannot convert ApartmentChooserDataLegacy to StructureChooser: key 'sceneData' is missing");if(!e.scenes)throw new Error("cannot convert ApartmentChooserDataLegacy to StructureChooser: key 'scenes' is missing");const o=[...Array(64).keys()].map(l=>({filename:`/1280/${(l+1).toString().padStart(4,"0")+".jpg"}`})),s=[4,1,2,3];for(let l=0;l<e.scenes.length;l++){let d=e.scenes[l],c,h;c=o[d].filename,h={cameraName:`Camera ${l+1}`,cameraPosition:void 0,cameraRotation:e.sceneCameras&&(r=e.sceneCameras.find(u=>u.scene===l))!=null&&r.cameraRotation?A4((n=e.sceneCameras.find(u=>u.scene===l))==null?void 0:n.cameraRotation):void 0,cameraFov:0,overlayFilename:`/scenedata${s[l]}V5Overlay.svg`,defaultFilename:c,sunsimDayOfYear:void 0},R0(o[d])&&(o[d]=h)}return{version:"5.0",latitude:0,longitude:0,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.sceneData.map(({apartmentID:l})=>({id:l,name:l,type:"unit"})),stillCameraIndices:e.scenes,stillCameraData:e.sceneData.map(({apartmentID:l,bestScene:d})=>({bestIndex:s.findIndex(c=>c===d)in e.scenes?e.scenes[s.findIndex(c=>c===d)]:null,id:l})).filter(({bestIndex:l})=>l!==null),loopable:!0,cameras:o}}else throw new Error("cannot convert data, no conversion source type found")}}function A4({x:e,y:t,z:i}){return{x:e,y:t,z:i,w:0}}const sM={key:0,class:"position-absolute w-100 h-100 bg-grey-lighten-2 justify-center align-center d-flex",style:{"z-index":"10"}},lM=["innerHTML"],cM={style:{"z-index":"7"}},dM={key:4,class:"render-version"},D0=ke(a.defineComponent({__name:"VStructureChooser",props:{structureChooserData:{},cdnFileResolver:{},colorCallback:{type:Function,default:()=>({r:0,g:0,b:0,a:0,s:0})},i18nConfig:{},customOverlayContent:{},selectedId:{},defaultCamera:{},defaultDay:{},defaultTime:{},mobileBreakpoint:{default:600},version:{},showVersion:{type:Boolean,default:!0},showUi:{type:Boolean,default:!0},activeStructureIds:{}},emits:["onClick","onHoverOver","onHoverOut","onMouseMove","onBoundingBoxesUpdate","onInitialize","onError"],setup(e,{expose:t,emit:i}){const r=e,{structureChooserData:n,cdnFileResolver:o,colorCallback:s,i18nConfig:l,customOverlayContent:d,selectedId:c,defaultCamera:h,defaultDay:u,defaultTime:m,mobileBreakpoint:f}=a.toRefs(r),v=i,_=a.ref(),g=a.ref(),p=a.ref(),y=a.ref(null),x=a.ref(4),b=a.ref(),N=a.ref(!1),A=a.ref(!1),C=a.ref(),U=a.computed(()=>C.value.isHoverEnabled),S=a.ref({x:0,y:0,width:0,height:0}),M=a.ref(),k=a.ref(),R=a.ref(),D=a.ref(!1),V=a.ref(1),q=a.ref(0),W=a.ref([]),Q=a.ref(),z=a.ref({current:100,min:100,max:1e3}),J=a.ref(!1),j=a.ref();a.provide(H1,l.value?new h2(l.value):new h2),a.provide("registerImage",L=>{a.nextTick(()=>{W.value.find(ie=>ie.image===L)||(L.decode(),W.value=[...W.value,{image:L,loaded:!1}])})}),a.provide("completeImage",L=>{a.nextTick(()=>{const ie=W.value.findIndex(ee=>ee.image===L);ie>=0&&(W.value[ie].loaded=!0,W.value=[...W.value])})}),t({getState:()=>({currentCameraIndex:_.value?K.value.findIndex(L=>L===_.value):null,currentDayIndex:g.value?_.value.sunsimDayOfYear.findIndex(L=>L===g.value):null,currentTimeIndex:p.value?g.value.timeSamples.findIndex(L=>L===p.value):null,currentTransitionIndex:y.value?le.value.findIndex(L=>L===y.value):null,currentScene:x.value}),setState:({currentCameraIndex:L,currentDayIndex:ie,currentTimeIndex:ee,currentTransitionIndex:he,currentScene:fe})=>{typeof L=="number"&&(_.value=K.value[L]),typeof ie=="number"&&(g.value=_.value.sunsimDayOfYear[ie]),typeof ee=="number"&&(p.value=g.value.timeSamples[ee]),typeof he=="number"&&(y.value=le.value[he]),typeof fe=="number"&&(x.value=fe)},resolveCoordinates:(L,ie)=>j.value?j.value(L,ie):{x:0,y:0}}),a.onMounted(()=>{N.value=!0,J.value=!1}),a.watch(k,()=>{k.value&&new ResizeObserver(([])=>{const ie=W.value.find(ee=>ee.loaded);ie&&(q.value=ie.image.width/V.value)}).observe(k.value)}),a.watch(W,()=>{if(q.value===0){const L=W.value.find(ie=>ie.loaded);L&&(V.value=L.image.naturalWidth/L.image.naturalHeight,q.value=L.image.width/V.value)}});const de=a.computed(()=>W.value.every(L=>L.loaded)),oe=a.computed(()=>Math.round(W.value.filter(L=>L.loaded).length/W.value.length*100));a.watch(n,L=>{try{J.value=!1,R.value=w4(L)}catch(ie){J.value=!0,v("onError",ie)}},{immediate:!0}),a.watch(N,L=>{L&&v("onInitialize")});const X=a.ref();a.watch(()=>r.activeStructureIds,()=>{X.value=r.activeStructureIds},{immediate:!0,deep:!0}),a.watch(()=>k.value,()=>{k.value&&new ResizeObserver(([ie])=>{D.value=ie.contentRect.width<f.value}).observe(k.value)});const K=a.computed(()=>R.value?R.value.cameras.filter(tM):[]),le=a.computed(()=>R.value?R.value.cameras.filter(R0):[]);a.watch([R,o],()=>{R.value&&o.value&&(W.value=[])},{immediate:!0}),a.watch([R,o,h],async()=>{o.value&&K.value.length>0&&(h.value?_.value=K.value.find(L=>L.cameraName===h.value)||K.value[0]:_.value=K.value[0],x.value=R.value.cameras.findIndex(L=>L===_.value),x.value=Math.max(0,x.value))},{immediate:!0}),a.watch([R,o,u],()=>{R.value&&o.value&&_.value&&_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>0&&(u.value?g.value=_.value.sunsimDayOfYear.find(L=>L.dayOfYear===u.value)||_.value.sunsimDayOfYear[0]:g.value=_.value.sunsimDayOfYear[0])},{immediate:!0}),a.watch([R,o,m],()=>{R.value&&o.value&&g.value&&g.value.timeSamples&&g.value.timeSamples.length>0&&(m.value?p.value=g.value.timeSamples.find(L=>L.timeInHours===m.value)||g.value.timeSamples[0]:p.value=g.value.timeSamples.find(L=>L.timeInHours===g.value.defaultHour)||g.value.timeSamples[0])},{immediate:!0});function ce(L){_.value!==L&&w(R.value.cameras.findIndex(ie=>ie===L))}function ae(L){x.value=L,R0(R.value.cameras[x.value])?y.value=R.value.cameras[x.value]:(a.nextTick(()=>{Me(R.value.cameras[x.value])}),y.value=null)}function Me(L){const ie=g.value;_.value=L,x.value=R.value.cameras.findIndex(ee=>ee===_.value),a.nextTick(()=>{_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>0&&Be(_.value.sunsimDayOfYear.find(ee=>ee.dayOfYear===ie.dayOfYear)||_.value.sunsimDayOfYear[0])})}function Be(L){const ie=p.value;g.value=L,a.nextTick(()=>{O(g.value.timeSamples.find(ee=>ee.timeInHours===ie.timeInHours)||g.value.timeSamples.find(ee=>ee.timeInHours===g.value.defaultHour)||g.value.timeSamples[0])})}function O(L){p.value=L}function Ee(L){v("onClick",L,()=>{const ie=R.value.stillCameraData.find(ee=>ee.id===L);ie&&w(ie.bestIndex)})}a.watch(c,L=>{var ie;if(L&&R.value){const ee=R.value.stillCameraData.find(he=>he.id===L);ee&&((ie=R.value.stillCameraIndices)!=null&&ie.includes(ee.bestIndex))&&w(ee.bestIndex)}});function ve(L){v("onHoverOver",L),b.value=L}function Re(L){v("onHoverOut",L),b.value=void 0}function we(L){const{layerX:ie,layerY:ee}=L;let he=L.target,fe=!1;for(;he;)if(he===M.value){fe=!0;break}else he=he.parentElement;if(fe){const ne=L.currentTarget;S.value={x:ie,y:ee,width:ne.clientWidth,height:ne.clientHeight}}else S.value=void 0;v("onMouseMove",L,S.value)}function Je({min:L,max:ie,current:ee,resolve:he}){j.value=he,z.value={min:L,max:ie,current:ee}}function Te(L){Q.value.adjustZoom(L?10:-10)}function T(L){return R.value.stillCameraIndices.findIndex(ie=>ie===L)}async function w(L){const ie=x.value;if(R.value.loopable){const ee=R.value.stillCameraIndices.length,he=T(ie),fe=T(L);let ne=0,Se=0,be=he;for(;be++,be>=ee&&(be=0),be!==fe;)ne++;for(be=he;be--,be<0&&(be+=ee),be!==fe;)Se++;ne===Se?G(ie,L):ne<Se?he<fe?G(ie,L):G(ie,L+R.value.cameras.length):he>=fe?G(ie,L):G(ie+R.value.cameras.length,L)}else G(ie,L)}function G(L,ie){return new Promise(ee=>{A.value=!0;let he,fe=L;he=setInterval(()=>{fe<ie?(fe++,x.value=Math.abs(fe%R.value.cameras.length),ae(x.value)):fe>ie?(fe--,x.value=Math.abs(fe%R.value.cameras.length),ae(x.value)):(clearInterval(he),A.value=!1,ee())},12)})}function $(L){J.value=!0,v("onError",L)}const re=L=>L*(180/Math.PI);return(L,ie)=>{const ee=a.resolveComponent("v-progress-circular"),he=a.resolveComponent("v-skeleton-loader");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(he,{type:"image",class:"w-100 h-100 position-relative",loading:!N.value||!R.value},{default:a.withCtx(()=>[de.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",sM,[a.createVNode(ee,{"model-value":oe.value,size:128,width:12},null,8,["model-value"])])),a.createVNode(a.Transition,{class:"w-100 h-100"},{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"container",ref:k,class:a.normalizeClass({mobile:D.value}),style:{"min-height":"160px"},onMousemove:we},[L.showUi?(a.openBlock(),a.createElementBlock("div",{key:0,class:"persistent actions-bar top-right pa-2",style:a.normalizeStyle({zIndex:7,top:D.value&&K.value.length>1?"60px":0})},[_.value.cameraRotation?(a.openBlock(),a.createBlock(E3,{key:0,class:"mb-2",style:a.normalizeStyle({zIndex:7,width:D.value?32:40,height:D.value?32:40}),longitude:re(_.value.cameraRotation.y)+270},null,8,["style","longitude"])):a.createCommentVNode("",!0),a.createVNode(JS,{"is-mobile-sized":D.value,"can-zoom-out":z.value.min<z.value.current,"can-zoom-in":z.value.max>z.value.current,disabled:A.value,onOnZoomIn:ie[0]||(ie[0]=fe=>Te(!0)),onOnZoomOut:ie[1]||(ie[1]=fe=>Te(!1))},null,8,["is-mobile-sized","can-zoom-out","can-zoom-in","disabled"])],4)):a.createCommentVNode("",!0),L.showUi&&K.value.length>1?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([{"actions-bar bottom-center pb-2":!0,"px-0":D.value},"still-cameras-wrapper"]),style:{"z-index":"7"}},[a.createVNode(jS,{"is-mobile-sized":D.value,"still-cameras":K.value,"current-camera":_.value,disabled:A.value,"cdn-file-resolver":a.unref(o),onOnCameraChange:ce},null,8,["is-mobile-sized","still-cameras","current-camera","disabled","cdn-file-resolver"])],2)):a.createCommentVNode("",!0),a.createVNode(H0,{ref_key:"zoomBox",ref:Q,position:"relative",onUpdate:Je},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"w-100 position-relative",style:a.normalizeStyle({height:`${q.value}px`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K.value,(fe,ne)=>(a.openBlock(),a.createBlock(OS,{key:`camera${ne}`,"camera-data":fe,"cdn-file-resolver":a.unref(o),"current-camera":_.value,"current-day":g.value,"current-time":p.value},null,8,["camera-data","cdn-file-resolver","current-camera","current-day","current-time"]))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(le.value,(fe,ne)=>(a.openBlock(),a.createBlock(VS,{key:`transition${ne}`,"transition-data":fe,"cdn-file-resolver":a.unref(o),"current-transition":y.value},null,8,["transition-data","cdn-file-resolver","current-transition"]))),128)),a.unref(d)?(a.openBlock(),a.createElementBlock("div",{key:0,class:"w-100 h-100 position-absolute top-left",style:{"z-index":"6","pointer-events":"none"},innerHTML:a.unref(d)},null,8,lM)):a.createCommentVNode("",!0),_.value.overlayFilename&&!J.value?a.withDirectives((a.openBlock(),a.createBlock($S,{key:1,"cdn-file-resolver":a.unref(o),"color-callback":a.unref(s),"current-camera":_.value,"selected-id":a.unref(c),activeStructureIds:X.value,onOnClick:Ee,onOnHoverOver:ve,onOnHoverOut:Re,onUpdateSvgContainer:ie[2]||(ie[2]=fe=>M.value=fe),onOnError:$,onOnBoundingBoxesUpdate:ie[3]||(ie[3]=fe=>v("onBoundingBoxesUpdate",fe))},null,8,["cdn-file-resolver","color-callback","current-camera","selected-id","activeStructureIds"])),[[a.vShow,y.value===null]]):a.createCommentVNode("",!0),a.renderSlot(L.$slots,"default",{},void 0,!0)],4)]),_:3},512),L.showUi&&(g.value&&g.value.timeSamples&&g.value.timeSamples.length>1||_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>1)?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass({"actions-bar top-left pa-2 d-flex":!0,"px-0":D.value}),style:{"z-index":"7"}},[a.createVNode(FS,{class:"pr-2","is-mobile-sized":D.value,"current-camera":_.value,"current-day":g.value,disabled:A.value,onOnDayChange:Be},null,8,["is-mobile-sized","current-camera","current-day","disabled"]),a.createVNode(qS,{"is-mobile-sized":D.value,"current-day":g.value,"current-time":p.value,disabled:A.value,onOnTimeChange:O},null,8,["is-mobile-sized","current-day","current-time","disabled"])],2)):a.createCommentVNode("",!0),L.$slots.popup&&S.value&&b.value?(a.openBlock(),a.createBlock(B0,{key:3,"is-hoverable":U.value,pos:S.value},{default:a.withCtx(()=>[a.createElementVNode("div",cM,[a.renderSlot(L.$slots,"popup",a.normalizeProps(a.guardReactiveProps({hoverId:b.value,hoverable:U.value})),void 0,!0)])]),_:3},8,["is-hoverable","pos"])):a.createCommentVNode("",!0),L.version&&L.showVersion?(a.openBlock(),a.createElementBlock("div",dM," version: "+a.toDisplayString(L.version),1)):a.createCommentVNode("",!0)],34)]),_:3})]),_:3},8,["loading"]),a.createVNode(F0,{ref_key:"hoverProbe",ref:C},null,512)],64)}}}),[["__scopeId","data-v-57d83a24"]]),hM={install:function(t){t.component("VStructureChooser",D0),t.component("VVirtualTour",eo),t.component("VVirtualTour2",y4),t.component("VManualSlideShow",S4),t.component("VStructureChooser",D0)}};h1.ResourceLoader=ii,h1.VFloatingCard=B0,h1.VHoverProbe=F0,h1.VManualSlideShow=S4,h1.VMiniMap=LS,h1.VNorthDirection=E3,h1.VStructureChooser=D0,h1.VVirtualTour=eo,h1.VVirtualTour2=y4,h1.VZoomBox=H0,h1.convertStructureChooserDataLegacyToV5=w4,h1.default=hM,Object.defineProperties(h1,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
18807
+ */const nx=e=>(a.pushScopeId("data-v-27cf4d11"),e=e(),a.popScopeId(),e),ox={id:"player-wrapper"},sx={id:"player-sizer"},lx={class:"player-control",id:"controls-top-left"},cx={class:"player-control",id:"controls-top-center"},dx={class:"player-control",id:"controls-top-right"},hx={class:"player-control",id:"controls-center-left"},ux={class:"player-control",id:"controls-center-center"},mx={class:"player-control",id:"controls-center-right"},fx={class:"player-control",id:"controls-bottom-left"},px={class:"player-control",id:"controls-bottom-center"},gx={class:"player-control",id:"controls-bottom-right"},_x=nx(()=>a.createElementVNode("div",{id:"main-canvas"},[a.createElementVNode("canvas",{id:"qpc"})],-1)),vx=ke(a.defineComponent({__name:"VPlayer",props:{data:{},cameraId:{},interiorId:{},day:{},time:{},isAutoPlaying:{type:Boolean}},emits:["autoRotatePluginOptions","dataPointChanged","dataPointLoad","dataPointsLoaded","dataPointsActivated","dataPointsDeactivated","dataPointTextureLoad","frontendMarkersUpdate","imageLoaderOptions","initialized","keyDown","key","keyUp","mainOptions","mouseDown","mouse","mouseMove","mousePick","mouseScroll","mouseUp","panoramaTransitionRendererPluginOptions","postProcessorOptions","resized","stateUpdated","userInputPluginOptions","playerCoreAccessible"],setup(e,{expose:t,emit:i}){const r=e,{data:n,cameraId:o,interiorId:s,day:l,time:d,isAutoPlaying:c}=a.toRefs(r),h=a.ref();t({playerCore:h});const u=i;a.watch(c,()=>{var f;(f=h.value)==null||f.setAllOptions({autoRotate:c.value})},{immediate:!0}),a.watch([s,l],()=>{h.value.updateDataPointFilter(f=>f.interiorId===s.value&&(!l.value&&f.dayOfYear===void 0||!!l.value&&f.dayOfYear===l.value.dayOfYear)),h.value.setCurrentDataPoint(f=>f.interiorId===s.value&&f.cameraId===o.value&&(!l.value&&f.dayOfYear===void 0||!!l.value&&f.dayOfYear===l.value.dayOfYear),{rotate:!1,animate:!1})}),a.watch([o,d],([f],[v])=>{f===v&&h.value.setCurrentDataPoint(_=>_.interiorId===s.value&&_.cameraId===o.value&&((!l.value||!d.value)&&_.dayOfYear===void 0||!!l.value&&!!d.value&&_.dayOfYear===l.value.dayOfYear&&_.timeInHours===d.value.timeInHours),{rotate:!1,animate:!1})}),a.onMounted(async()=>{await m(),G0&&(h.value=new ax,h.value.addEventListener("autoRotatePluginOptions",f=>{u("autoRotatePluginOptions",f)}),h.value.addEventListener("dataPointChanged",f=>{u("dataPointChanged",f)}),h.value.addEventListener("dataPointLoad",f=>{u("dataPointLoad",f)}),h.value.addEventListener("dataPointsLoaded",f=>{u("dataPointsLoaded",f)}),h.value.addEventListener("dataPointsActivated",f=>{u("dataPointsActivated",f)}),h.value.addEventListener("dataPointsDeactivated",f=>{u("dataPointsDeactivated",f)}),h.value.addEventListener("dataPointTextureLoad",f=>{u("dataPointTextureLoad",f)}),h.value.addEventListener("frontendMarkersUpdate",f=>{u("frontendMarkersUpdate",f)}),h.value.addEventListener("imageLoaderOptions",f=>{u("imageLoaderOptions",f)}),h.value.addEventListener("initialized",f=>{u("initialized",f)}),h.value.addEventListener("keyDown",f=>{u("keyDown",f)}),h.value.addEventListener("key",f=>{u("key",f)}),h.value.addEventListener("keyUp",f=>{u("keyUp",f)}),h.value.addEventListener("mainOptions",f=>{u("mainOptions",f)}),h.value.addEventListener("mouseDown",f=>{u("mouseDown",f)}),h.value.addEventListener("mouse",f=>{u("mouse",f)}),h.value.addEventListener("mouseMove",f=>{u("mouseMove",f)}),h.value.addEventListener("mousePick",f=>{u("mousePick",f)}),h.value.addEventListener("mouseScroll",f=>{u("mouseScroll",f)}),h.value.addEventListener("mouseUp",f=>{u("mouseUp",f)}),h.value.addEventListener("panoramaTransitionRendererPluginOptions",f=>{u("panoramaTransitionRendererPluginOptions",f)}),h.value.addEventListener("postProcessorOptions",f=>{u("postProcessorOptions",f)}),h.value.addEventListener("resized",f=>{u("resized",f)}),h.value.addEventListener("stateUpdated",f=>{u("stateUpdated",f)}),h.value.addEventListener("userInputPluginOptions",f=>{u("userInputPluginOptions",f)}),await h.value.initialize("#qpc"),await h.value.loadDataPoints(n.value,f=>f.interiorId===s.value&&!f.dayOfYear&&!f.timeInHours,f=>f.interiorId===s.value&&f.cameraId===o.value&&!f.dayOfYear&&!f.timeInHours),h.value.animate(),u("playerCoreAccessible",h.value))});async function m(){h.value&&(h.value=void 0)}return a.onBeforeUnmount(()=>{m()}),(f,v)=>(a.openBlock(),a.createElementBlock("div",ox,[a.createElementVNode("div",sx,[a.renderSlot(f.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",lx,[a.renderSlot(f.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",cx,[a.renderSlot(f.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",dx,[a.renderSlot(f.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",hx,[a.renderSlot(f.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",ux,[a.renderSlot(f.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",mx,[a.renderSlot(f.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",fx,[a.renderSlot(f.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",px,[a.renderSlot(f.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",gx,[a.renderSlot(f.$slots,"bottom-right",{},void 0,!0)]),_x])]))}}),[["__scopeId","data-v-27cf4d11"]]),p4=ke(a.defineComponent({__name:"VAutoplay",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));return(r,n)=>{const o=a.resolveComponent("v-icon"),s=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(s,{size:"x-small",class:a.normalizeClass(["autoplay-btn",{mobile:i.value,"mt-1":i.value,"mx-1":i.value}]),onClick:n[0]||(n[0]=l=>t.value=!t.value)},{default:a.withCtx(()=>[a.createVNode(o,{icon:t.value?"mdi-pause":"mdi-play",size:"x-large",class:"pa-0 ma-0"},null,8,["icon"])]),_:1},8,["class"])}}}),[["__scopeId","data-v-707c11f6"]]),L0=e=>(a.pushScopeId("data-v-c1d52554"),e=e(),a.popScopeId(),e),xx={key:0,width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},yx=[L0(()=>a.createElementVNode("path",{d:"M5.38544 13C3.30939 13.9424 2 15.3211 2 16.8571C2 19.6975 6.47715 22 12 22C17.5228 22 22 19.6975 22 16.8571C22 15.3211 20.6906 13.9424 18.6146 13",class:"fill-grey"},null,-1)),L0(()=>a.createElementVNode("path",{d:"M8 9C8 7.89543 8.89543 7 10 7H14C15.1046 7 16 7.89543 16 9V12.875C16 13.4273 15.5523 13.875 15 13.875H14V17C14 17.5523 13.5523 18 13 18H11C10.4477 18 10 17.5523 10 17V13.875H9C8.44772 13.875 8 13.4273 8 12.875V9Z"},null,-1)),L0(()=>a.createElementVNode("path",{d:"M15 4C15 5.65685 13.6569 7 12 7C10.3431 7 9 5.65685 9 4C9 2.34315 10.3431 1 12 1C13.6569 1 15 2.34315 15 4Z"},null,-1))],Sx=ke(a.defineComponent({__name:"VViewModeToggle",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.inject(B1),r=a.computed(()=>{let n="virtualTour";return t.value||(n="slideShow"),n});return(n,o)=>{const s=a.resolveComponent("v-icon"),l=a.resolveComponent("v-btn"),d=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(d,{location:"top"},{activator:a.withCtx(({props:c})=>[a.createVNode(l,a.mergeProps({density:"comfortable",elevation:"1",icon:"",onClick:o[0]||(o[0]=h=>t.value=!t.value)},c),{default:a.withCtx(()=>[r.value==="virtualTour"?(a.openBlock(),a.createElementBlock("svg",xx,yx)):(a.openBlock(),a.createBlock(s,{key:1},{default:a.withCtx(()=>[a.createTextVNode("mdi-image-multiple")]),_:1}))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(i).getLabel(r.value)),1)]),_:1})}}}),[["__scopeId","data-v-c1d52554"]]),Mx={id:"share-btns-wrapper",class:"text-center"},wx=ke(a.defineComponent({__name:"VSocialShare",setup(e){const t=a.inject(B1),i=a.ref(!1),r=a.ref(location.href);function n(){return window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(location.href),"facebook-share-dialog","width=626,height=436"),!1}function o(){return window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(location.href),"twitter-share-dialog","width=626,height=436"),!1}function s(){return window.open("https://www.linkedin.com/sharing/share-offsite/?url="+encodeURIComponent(location.href),"linkedin-share-dialog","width=626,height=736"),!1}function l(){navigator.clipboard.writeText(location.href)}return(d,c)=>{const h=a.resolveComponent("v-btn"),u=a.resolveComponent("v-tooltip"),m=a.resolveComponent("v-toolbar-title"),f=a.resolveComponent("v-spacer"),v=a.resolveComponent("v-toolbar"),_=a.resolveComponent("v-card-text"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-dialog");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(u,{elevation:"2",top:"",attach:""},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({density:"comfortable",elevation:"1",icon:"mdi-share-variant",onClick:c[0]||(c[0]=x=>i.value=!i.value)},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(p,{id:"share-box",width:"400",modelValue:i.value,"onUpdate:modelValue":c[2]||(c[2]=y=>i.value=y)},{default:a.withCtx(()=>[a.createVNode(g,null,{default:a.withCtx(()=>[a.createVNode(v,{elevation:"0"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small",icon:"mdi-close",onClick:c[1]||(c[1]=y=>i.value=!1)}),a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(t).getLabel("share")),1)]),_:1}),a.createVNode(f)]),_:1}),a.createVNode(_,{class:"mt-5"},{default:a.withCtx(()=>[a.createElementVNode("p",Mx,[a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-facebook"},y,{onClick:n}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToFacebook")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-linkedin"},y,{onClick:s}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToLinkedin")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-twitter"},y,{onClick:o}),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareToTwitter")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-email",link:"",href:`mailto:?body=${r.value}`},y),null,16,["href"])]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("shareViaEmail")),1)]),_:1}),a.createVNode(u,{location:"top"},{activator:a.withCtx(({props:y})=>[a.createVNode(h,a.mergeProps({depressed:"",fab:"",light:"",icon:"mdi-content-copy",onClick:l},y),null,16)]),default:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(t).getLabel("copyLink")),1)]),_:1}),a.createVNode(f)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-3435be74"]]),ti=e=>(a.pushScopeId("data-v-5918102f"),e=e(),a.popScopeId(),e),Ax={key:0,class:"desktop-content"},Ex={class:"d-flex align-center justify-center"},bx={class:"box col d-flex flex-column align-bottom justify-center"},Cx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M72 30H86.9736M86.9736 30L81 36M86.9736 30L81 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M27.9736 30H13M13 30L18.9736 36M13 30L18.9736 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M36 30H64V40C64 47.732 57.732 54 50 54V54C42.268 54 36 47.732 36 40V30Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 25C36 17.268 42.268 11 50 11V11V30H36V25Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 25C64 17.268 57.732 11 50 11V11V30H64V25Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 23V30C53.25 31.7949 51.7949 33.25 50 33.25C48.2051 33.25 46.75 31.7949 46.75 30V23C46.75 21.2051 48.2051 19.75 50 19.75C51.7949 19.75 53.25 21.2051 53.25 23Z",fill:"white",stroke:"black","stroke-width":"1.5"})])],-1)),Tx={class:"text-div text-center text mt-2"},Ix={class:"box col d-flex flex-column align-bottom justify-center"},Px=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9936 27.0175C79.9881 19.276 66.3321 13.0323 49.492 13.0719C32.652 13.1116 19.0049 19.4194 19.0105 27.1609C19.016 34.9025 32.6721 41.1461 49.5121 41.1065C66.3521 41.0669 79.9992 34.759 79.9936 27.0175Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M61.8032 45.179L56.543 50.3218V28.0361L72.543 43.4647H65.0909L67.9402 50.3218L64.6526 52.0361L61.8032 45.179Z",fill:"white",stroke:"black","stroke-width":"1.5","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.502 28.0361L46.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.502 28.0361L62.502 28.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 24.0361L49.1582 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.502 24.0361L63.502 21.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.502 22.0361L56.502 18.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1582 32.0361L49.1582 35.0361",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"})])],-1)),Nx={class:"text-div text-center text mt-2"},Lx={class:"box col d-flex flex-column align-bottom justify-center"},Rx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M36 33H64V43C64 50.732 57.732 57 50 57V57C42.268 57 36 50.732 36 43V33Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M36 28C36 20.268 42.268 14 50 14V14V33H36V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M64 28C64 20.268 57.732 14 50 14V14V33H64V28Z",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M53.25 26V33C53.25 34.7949 51.7949 36.25 50 36.25C48.2051 36.25 46.75 34.7949 46.75 33V26C46.75 24.2051 48.2051 22.75 50 22.75C51.7949 22.75 53.25 24.2051 53.25 26Z",fill:"#FF3E3E",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M74.5352 20.7593L80.3458 26.5699C80.9316 27.1557 80.9316 28.1055 80.3458 28.6913C79.76 29.277 78.8103 29.277 78.2245 28.6913L72.4138 22.8806L74.5352 20.7593Z",fill:"black",stroke:"black","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("circle",{cx:"66.5",cy:"15.5",r:"9.75",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"66",y:"11",width:"1",height:"9",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"}),a.createElementVNode("rect",{x:"71",y:"15",width:"1",height:"9",transform:"rotate(90 71 15)",fill:"black",stroke:"black","stroke-width":"0.75","stroke-linejoin":"round"})])],-1)),Dx={class:"text-div text-center text mt-2"},Ux={class:"box col d-flex flex-column align-bottom justify-center"},kx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50",height:"32.5",viewBox:"0 0 100 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("rect",{x:"65.0967",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"39.5488",y:"29.6777",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-90 39.5488 29.6777)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"60.4512",y:"34.3228",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(90 60.4512 34.3228)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("rect",{x:"34.9033",y:"55.2261",width:"20.9032",height:"20.9032",rx:"2",transform:"rotate(-180 34.9033 55.2261)",fill:"white",stroke:"black","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M77.7025 44.3796C77.9599 44.5798 77.9599 44.9688 77.7025 45.169L74.6621 47.5338C74.3337 47.7892 73.8551 47.5552 73.8551 47.1391L73.8551 42.4095C73.8551 41.9935 74.3337 41.7594 74.6621 42.0149L77.7025 44.3796Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M49.6047 17.0724C49.8049 16.815 50.1939 16.815 50.3941 17.0724L52.7589 20.1128C53.0143 20.4412 52.7803 20.9198 52.3642 20.9198L47.6346 20.9198C47.2185 20.9198 46.9845 20.4412 47.2399 20.1128L49.6047 17.0724Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M50.3953 46.9281C50.1951 47.1855 49.8061 47.1855 49.6059 46.9281L47.2411 43.8877C46.9857 43.5592 47.2197 43.0807 47.6358 43.0807L52.3654 43.0807C52.7815 43.0807 53.0155 43.5592 52.7601 43.8877L50.3953 46.9281Z",fill:"#FF3E3E"}),a.createElementVNode("path",{d:"M22.2975 45.1692C22.0401 44.969 22.0401 44.58 22.2975 44.3798L25.3379 42.0151C25.6663 41.7596 26.1449 41.9937 26.1449 42.4097L26.1449 47.1393C26.1449 47.5554 25.6663 47.7894 25.3379 47.534L22.2975 45.1692Z",fill:"#FF3E3E"})])],-1)),Ox={class:"text-div text-center text mt-2"},zx={key:1,class:"d-flex tablet-mobile-content"},Vx={class:"box col my-1"},Bx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"50.5",height:"32.5",viewBox:"0 0 101 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M68 28H87.9736M87.9736 28L82 34M87.9736 28L82 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M33.9727 28H13.999M13.999 28L19.9727 34M13.999 28L19.9727 22",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.0361 33.0479C60.7502 31.9809 59.6536 31.3478 58.5866 31.6337C57.5197 31.9195 56.8865 33.0162 57.1724 34.0831L56.7195 32.3928C56.3979 31.1925 55.1641 30.4802 53.9638 30.8018C52.7635 31.1234 52.0512 32.3572 52.3728 33.5575L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M53.7316 38.6286L52.6963 34.7649M52.6963 34.7649L50.6258 27.0375C50.3399 25.9705 49.2432 25.3374 48.1763 25.6233V25.6233C47.1094 25.9091 46.4762 27.0058 46.7621 28.0727L50.3855 41.5957C49.2796 40.7276 47.5926 39.524 46.3279 38.6369C45.3814 37.9729 44.0801 38.2068 43.4137 39.1516V39.1516C42.8107 40.0066 42.9238 41.1741 43.6798 41.8975L51.8691 49.7332C53.3154 51.1171 55.3791 51.6457 57.3126 51.1276L62.5533 49.7234C65.3195 48.9822 67.2473 46.4813 67.2601 43.6176V43.6176C67.2626 43.0532 67.1898 42.4909 67.0438 41.9457L64.9992 34.3153C64.7491 33.3818 63.7895 32.8278 62.8559 33.0779V33.0779V33.0779C61.9223 33.328 61.3683 34.2876 61.6185 35.2212L61.942 36.4286M52.6963 34.7649L52.3728 33.5575C52.0512 32.3572 52.7635 31.1234 53.9638 30.8018V30.8018C55.1641 30.4802 56.3979 31.1925 56.7195 32.3928L57.3018 34.5661M58.2077 37.9469L57.3018 34.5661M57.3018 34.5661L57.1724 34.0831C56.8865 33.0162 57.5197 31.9195 58.5866 31.6337V31.6337C59.6536 31.3478 60.7502 31.9809 61.0361 33.0479L61.942 36.4286M62.3302 37.8775L61.942 36.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Fx={class:"text text-col text-center"},Hx={class:"box col my-1"},Gx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M79.9927 29.9814C79.9871 22.2398 66.3311 15.9962 49.491 16.0358C32.651 16.0754 19.0039 22.3833 19.0095 30.1248C19.015 37.8663 32.6711 44.11 49.5111 44.0704C66.3512 44.0308 79.9982 37.7229 79.9927 29.9814Z",fill:"white",stroke:"#B3B3B3","stroke-width":"1.5"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M50.5 31L46.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M66.5 31L62.5 31",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 27L49.1562 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M60.5 27L63.5 24",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M56.5 25L56.5 21",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M52.1562 35L49.1562 38",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L68.5361 36.0479C68.2502 34.9809 67.1536 34.3478 66.0866 34.6337C65.0197 34.9195 64.3865 36.0162 64.6724 37.0831L64.2195 35.3928C63.8979 34.1925 62.6641 33.4802 61.4638 33.8018C60.2635 34.1234 59.5512 35.3572 59.8728 36.5575L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276Z",fill:"white"}),a.createElementVNode("path",{d:"M61.2316 41.6286L60.1963 37.7649M60.1963 37.7649L58.1258 30.0375C57.8399 28.9705 56.7432 28.3374 55.6763 28.6233V28.6233C54.6094 28.9091 53.9762 30.0058 54.2621 31.0727L57.8855 44.5957C56.7796 43.7276 55.0926 42.524 53.8279 41.6369C52.8814 40.9729 51.5801 41.2068 50.9137 42.1516V42.1516C50.3107 43.0066 50.4238 44.1741 51.1798 44.8975L59.3691 52.7332C60.8154 54.1171 62.8791 54.6457 64.8126 54.1276L70.0533 52.7234C72.8195 51.9822 74.7473 49.4813 74.7601 46.6176V46.6176C74.7626 46.0532 74.6898 45.4909 74.5438 44.9457L72.4992 37.3153C72.2491 36.3818 71.2895 35.8278 70.3559 36.0779V36.0779V36.0779C69.4223 36.328 68.8683 37.2876 69.1185 38.2212L69.442 39.4286M60.1963 37.7649L59.8728 36.5575C59.5512 35.3572 60.2635 34.1234 61.4638 33.8018V33.8018C62.6641 33.4802 63.8979 34.1925 64.2195 35.3928L64.8018 37.5661M65.7077 40.9469L64.8018 37.5661M64.8018 37.5661L64.6724 37.0831C64.3865 36.0162 65.0197 34.9195 66.0866 34.6337V34.6337C67.1536 34.3478 68.2502 34.9809 68.5361 36.0479L69.442 39.4286M69.8302 40.8775L69.442 39.4286",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Wx={class:"text text-col text-center"},jx={class:"box col my-1"},Xx=ti(()=>a.createElementVNode("div",{class:"tutorial-icon justify-center"},[a.createElementVNode("svg",{width:"49.5",height:"32.5",viewBox:"0 0 99 65",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[a.createElementVNode("path",{d:"M31 24.9736L31 10M31 10L25 15.9736M31 10L37 15.9736",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M31 40L31 54.9736M31 54.9736L25 49M31 54.9736L37 49",stroke:"#FF3E3E","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L56.0348 26.8433C55.4825 25.8867 54.2593 25.5589 53.3027 26.1112C52.3462 26.6635 52.0184 27.8867 52.5707 28.8433L51.6957 27.3277C51.0744 26.2516 49.6983 25.8828 48.6221 26.5042C47.546 27.1255 47.1773 28.5016 47.7986 29.5777L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852Z",fill:"white"}),a.createElementVNode("path",{d:"M50.4236 34.1244L48.4236 30.6603M48.4236 30.6603L44.4236 23.7321C43.8713 22.7755 42.6481 22.4477 41.6915 23V23C40.7349 23.5523 40.4072 24.7755 40.9595 25.7321L48.4595 38.7224L41.0923 40.5062C40.3398 40.6884 39.7721 41.3073 39.6555 42.0728V42.0728C39.4961 43.1196 40.2199 44.096 41.268 44.2476L49.7609 45.4766L51.251 45.7252C53.7985 46.1503 56.4146 45.6766 58.6512 44.3852L61.8162 42.5579C64.2963 41.126 65.5112 38.2114 64.7823 35.442V35.442C64.6387 34.8961 64.4229 34.3719 64.1407 33.883L60.1909 27.0418C59.7076 26.2048 58.6374 25.918 57.8003 26.4013V26.4013V26.4013C56.9633 26.8845 56.6765 27.9548 57.1598 28.7918L57.7848 29.8744M48.4236 30.6603L47.7986 29.5777C47.1773 28.5016 47.546 27.1255 48.6221 26.5042V26.5042C49.6983 25.8828 51.0744 26.2516 51.6957 27.3277L52.8207 29.2763M54.5707 32.3074L52.8207 29.2763M52.8207 29.2763L52.5707 28.8433C52.0184 27.8867 52.3462 26.6635 53.3027 26.1112V26.1112C54.2593 25.5589 55.4825 25.8867 56.0348 26.8433L57.7848 29.8744M58.5348 31.1734L57.7848 29.8744",stroke:"black","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),Yx={class:"text text-col text-center"},qx={class:"text-h6 text-capitalize"},Zx={class:"mt-2"},Qx={class:"d-flex justify-center align-center checkbox-container"},Jx={class:"text-caption"},Kx=ke(a.defineComponent({__name:"VTutorial",emits:["closeTutorial"],setup(e,{emit:t}){const i=t,r=a.inject(B1),n=a.ref(!1),o=a.ref(!1),s=a.computed(()=>[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(c=>navigator.userAgent.match(c)));function l(){i("closeTutorial",n.value)}return(d,c)=>{const h=a.resolveComponent("v-icon"),u=a.resolveComponent("v-card-title"),m=a.resolveComponent("v-btn"),f=a.resolveComponent("v-divider"),v=a.resolveComponent("v-card-text"),_=a.resolveComponent("v-card-actions"),g=a.resolveComponent("v-card"),p=a.resolveComponent("v-expand-transition"),y=a.resolveComponent("v-checkbox");return a.openBlock(),a.createBlock(a.Transition,{name:"fade-transition"},{default:a.withCtx(()=>[a.createVNode(g,{class:"mx-auto",elevation:"16"},{default:a.withCtx(()=>[a.createVNode(u,{class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,{size:"x-small"},{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),_:1}),a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",null,a.toDisplayString(a.unref(r).getLabel("disclaimerTextShort")),1),a.createVNode(m,{variant:"tonal",size:"small",onClick:c[0]||(c[0]=x=>o.value=!0),class:"text-capitalize mt-2"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("learnMore"))+" ",1),a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-right")]),_:1})]),_:1}),a.createVNode(f,{class:"my-3"}),s.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ax,[a.createElementVNode("div",Ex,[a.createElementVNode("div",bx,[Cx,a.createElementVNode("div",Tx,a.toDisplayString(a.unref(r).getLabel("clickAndDragToLookAround")),1)]),a.createElementVNode("div",Ix,[Px,a.createElementVNode("div",Nx,a.toDisplayString(a.unref(r).getLabel("clickOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",Lx,[Rx,a.createElementVNode("div",Dx,a.toDisplayString(a.unref(r).getLabel("useTheMouseWheelToZoom")),1)]),a.createElementVNode("div",Ux,[kx,a.createElementVNode("div",Ox,a.toDisplayString(a.unref(r).getLabel("youCanAlsoUseTheArrowKeysToMoveAround")),1)])])])),s.value?(a.openBlock(),a.createElementBlock("div",zx,[a.createElementVNode("div",Vx,[Bx,a.createElementVNode("div",Fx,a.toDisplayString(a.unref(r).getLabel("tapAndDragToLookAround")),1)]),a.createElementVNode("div",Hx,[Gx,a.createElementVNode("div",Wx,a.toDisplayString(a.unref(r).getLabel("tapOnTheCirclesToMoveAround")),1)]),a.createElementVNode("div",jx,[Xx,a.createElementVNode("div",Yx,a.toDisplayString(a.unref(r).getLabel("useTwoFingersToZoom")),1)])])):a.createCommentVNode("",!0),a.createVNode(f,{class:"my-1"})]),_:1}),a.createVNode(p,null,{default:a.withCtx(()=>[o.value?(a.openBlock(),a.createBlock(g,{key:0,class:"position-absolute w-100 bg-white",height:"100%",style:{bottom:"0"}},{default:a.withCtx(()=>[a.createVNode(v,{class:"pb-0"},{default:a.withCtx(()=>[a.createElementVNode("p",qx,[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-alert-outline")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("disclaimer")),1)]),a.createElementVNode("p",Zx,a.toDisplayString(a.unref(r).getLabel("disclaimerText")),1)]),_:1}),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",size:"small",onClick:c[1]||(c[1]=x=>o.value=!1),class:"text-capitalize"},{default:a.withCtx(()=>[a.createVNode(h,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-chevron-left")]),_:1}),a.createTextVNode(" "+a.toDisplayString(a.unref(r).getLabel("back")),1)]),_:1})]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createElementVNode("div",Qx,[a.createVNode(y,{density:"compact",modelValue:n.value,"onUpdate:modelValue":c[2]||(c[2]=x=>n.value=x),"hide-details":""},{label:a.withCtx(()=>[a.createElementVNode("span",Jx,a.toDisplayString(a.unref(r).getLabel("dontShowAgain")),1)]),_:1},8,["modelValue"])]),a.createVNode(_,null,{default:a.withCtx(()=>[a.createVNode(m,{variant:"tonal",onClick:c[3]||(c[3]=x=>l()),block:""},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r).getLabel("iUnderstand")),1)]),_:1})]),_:1})]),_:1})]),_:1})}}}),[["__scopeId","data-v-5918102f"]]),$x={class:"top-left"},ey={class:"top-right"},ty={class:"header-slot anchor elevation-5"},iy={id:"moveableBody",class:"body-slot moveable-body d-flex justify-center align-center position-relative"},ry={class:"moveable-footer elevation-5"},ay=ke(a.defineComponent({__name:"VMoveable",props:{size:{}},setup(e,{expose:t}){const i=a.ref(void 0),r=a.ref(void 0);t({bodyWidth:i,bodyHeight:r}),a.onMounted(()=>{o(document.getElementById("moveableDiv")),n(document.querySelector("#moveableDiv"))});const n=s=>{new ResizeObserver(()=>{const d=document.getElementById("moveableBody");d&&(i.value=d.clientWidth,r.value=d.clientHeight)}).observe(s)},o=s=>{const l=document.getElementsByClassName("anchor");for(let _=0;_<l.length;_++){const g=l[_];g.addEventListener("touchstart",m,{passive:!1}),g.addEventListener("touchend",v,{passive:!1}),g.addEventListener("mousedown",m,{passive:!1}),g.addEventListener("mouseup",v,{passive:!1})}let d=0,c=0,h=0,u=0;function m(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchstart"&&(g=_.touches[0]),h=g.clientX,u=g.clientY,document.addEventListener("mouseup",v,{passive:!1}),document.addEventListener("touchend",v,{passive:!1}),document.addEventListener("mousemove",f,{passive:!1}),document.addEventListener("touchmove",f,{passive:!1})}function f(_){_=_||window.event,_.preventDefault();let g=_;_.type==="touchmove"&&(g=_.touches[0]),d=h-g.clientX,c=u-g.clientY,h=g.clientX,u=g.clientY,s.style.top=s.offsetTop-c+"px",s.style.left=s.offsetLeft-d+"px"}function v(){document.removeEventListener("mouseup",v,!1),document.removeEventListener("mousemove",f,!1),document.removeEventListener("touchend",v,!1),document.removeEventListener("touchmove",f,!1)}};return(s,l)=>(a.openBlock(),a.createElementBlock("div",{id:"moveableDiv",class:a.normalizeClass([s.size,"sizer rounded"])},[a.createElementVNode("div",$x,[a.renderSlot(s.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",ey,[a.renderSlot(s.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",ty,[a.renderSlot(s.$slots,"header",{},void 0,!0)]),a.createElementVNode("div",iy,[a.renderSlot(s.$slots,"body",{},void 0,!0)]),a.createElementVNode("div",ry,[a.renderSlot(s.$slots,"footer",{},void 0,!0)])],2))}}),[["__scopeId","data-v-8ff55f5b"]]),ny=e=>(a.pushScopeId("data-v-d4be854c"),e=e(),a.popScopeId(),e),oy={class:"left"},sy={class:"right"},ly=ny(()=>a.createElementVNode("div",{class:"d-flex justify-space-between pa-1"},[a.createElementVNode("div",{class:"center"}," ")],-1)),cy={class:"map-container"},g4=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},minimapJson:{},apartmentJson:{},currentCamera:{},level:{},rotation:{}},emits:["close","goToCamera"],setup(e,{emit:t}){const i=a.ref(null),r=e,n=t,o=a.ref(),s=a.ref(0),l=a.computed(()=>r.minimapJson.storeys[r.level]),d=a.ref(0);a.watch(()=>r.apartmentJson,()=>{d.value=d.value+1}),a.watch(l,()=>{o.value=l.value.defaultSunsimFile?`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/sunsim0_13.jpg`:`/${r.apartmentJson.type}/${r.apartmentJson.id}/minimap/${l.value.defaultSunsimFile}`},{immediate:!0,once:!0});const c=a.computed(()=>{let p=1;return s.value!==0&&(Math.abs(s.value)%180===0?p=1:p=-1),f.value==="small"&&(p=.6),p});function h(p){o.value=p}const u=["big","bigger","small"];function m(){const y=(u.indexOf(f.value)+1)%u.length;f.value=u[y]}const f=a.ref("big");function v(){s.value=s.value+90}const _=()=>{n("close")};function g(p){n("goToCamera",p)}return(p,y)=>{const x=a.resolveComponent("v-btn");return a.openBlock(),a.createBlock(ay,{ref_key:"minimapMoveable",ref:i,size:f.value},{"top-left":a.withCtx(()=>[a.createElementVNode("div",oy,[a.createVNode(x,{icon:"mdi-window-close",size:"x-small",onClick:_})])]),"top-right":a.withCtx(()=>[a.createElementVNode("div",sy,[a.createVNode(x,{class:"rotate-icon",size:"x-small",icon:"mdi mdi-rotate-right",onClick:a.withModifiers(v,["stop"]),title:"Rotate"}),a.createVNode(x,{class:"resize-icon ml-1",icon:"mdi-image-size-select-small",size:"x-small",onClick:m,title:"Resize"})])]),header:a.withCtx(()=>[ly]),body:a.withCtx(()=>[a.createVNode(T3,{scale:c.value,rotation:l.value.rotation.y,"transform-angle":s.value},null,8,["scale","rotation","transform-angle"]),a.createElementVNode("div",cy,[a.createVNode(C3,{"transform-angle":s.value,"all-cameras":p.apartmentJson.cameras,"background-image":o.value,rotation:p.rotation,"current-camera":p.currentCamera,storey:l.value,containerWidth:i.value&&i.value.bodyWidth||512,containerHeight:i.value&&i.value.bodyHeight||384,onGoToCamera:g},null,8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey","containerWidth","containerHeight"])])]),footer:a.withCtx(()=>[(a.openBlock(),a.createBlock(I3,{key:d.value,"cdn-file-resolver":r.cdnFileResolver,"minimap-json":r.minimapJson,"apartment-json":r.apartmentJson,level:r.level,onSetBackgroundImage:h},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"]))]),_:1},8,["size"])}}}),[["__scopeId","data-v-d4be854c"]]),dy={id:"btn-magic",class:"btn-placeholder mr-2"},hy=a.defineComponent({__name:"VVisuadoCreateButton",emits:["onSnapshot"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",dy,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:"mdi-creation",onClick:n[0]||(n[0]=s=>i("onSnapshot"))})])}}}),uy={id:"btn-fullscreen",class:"btn-placeholder mr-2"},my=a.defineComponent({__name:"VFullScreenButton",props:{isFullScreen:{type:Boolean}},emits:["toggleFullscreen"],setup(e,{emit:t}){const i=t;return(r,n)=>{const o=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",uy,[a.createVNode(o,{density:"comfortable",elevation:"3",icon:r.isFullScreen?"mdi-fullscreen-exit":"mdi-fullscreen",onClick:n[0]||(n[0]=s=>i("toggleFullscreen"))},null,8,["icon"])])}}}),fy={class:"d-none d-md-inline"},py={class:"interior-selector-list"},gy=["onClick"],_y={class:"d-flex align-center justify-left pa-0 ma-0"},vy={class:"pa-0 ma-0"},xy={class:"text-caption ma-2 no-wrap"},yy=ke(a.defineComponent({__name:"VInteriorSelector",props:{cdnFileResolver:{type:[String,Function]},archetypes:{},currentDataPoint:{}},emits:["selectInterior"],setup(e,{emit:t}){const i=e,{currentDataPoint:r,archetypes:n,cdnFileResolver:o}=a.toRefs(i),s=a.reactive({}),l=t;a.watch(r,async()=>{var h,u,m,f;for(const v of n.value){const _=s1(o.value,`/${v.archetypeID}/${(u=(h=r==null?void 0:r.value)==null?void 0:h.labels)==null?void 0:u.apartmentId}/thumbs/200/${(f=(m=r==null?void 0:r.value)==null?void 0:m.labels)==null?void 0:f.cameraId}.jpg`);await d(_)&&(s[v.archetypeID]=_)}},{immediate:!0});function d(h){return new Promise(u=>{const m=new Image;m.onload=()=>u(!0),m.onerror=()=>u(!1),m.src=h})}const c=a.inject(B1);return(h,u)=>{const m=a.resolveComponent("v-icon"),f=a.resolveComponent("v-btn"),v=a.resolveComponent("v-img"),_=a.resolveComponent("v-menu");return a.openBlock(),a.createElementBlock("div",null,[a.createVNode(_,{transition:"slide-x-reverse-transition",location:"top end",origin:"end bottom",elevation:"0",attach:""},{activator:a.withCtx(({props:g})=>[a.createVNode(f,a.mergeProps({rounded:""},g,{class:"text-capitalize"}),{default:a.withCtx(()=>[a.createVNode(m,null,{default:a.withCtx(()=>[a.createTextVNode("mdi-palette-outline")]),_:1}),a.createElementVNode("span",fy,a.toDisplayString(a.unref(c).getLabel("interior")),1)]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("div",py,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),g=>{var p,y;return a.openBlock(),a.createElementBlock("div",{key:`at-menuitem-${g.archetypeID}`,onClick:x=>l("selectInterior",g.archetypeID),class:a.normalizeClass(["interior-selector-list-item",{active:g.archetypeID===((y=(p=a.unref(r))==null?void 0:p.labels)==null?void 0:y.interiorId)}])},[a.createElementVNode("div",_y,[a.createElementVNode("div",vy,[a.createVNode(v,{src:s[g.archetypeID],width:"100","max-width":"100",height:"66",class:"pa-0 ma-0"},null,8,["src"])]),a.createElementVNode("div",xy,a.toDisplayString(a.unref(c).get(g.title)),1)])],10,gy)}),128))])]),_:1})])}}}),[["__scopeId","data-v-c148316d"]]),Sy=a.defineComponent({__name:"VSunStudyToggle",props:a.mergeModels({showUi:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=a.inject(B1);return(r,n)=>{const o=a.resolveComponent("v-btn");return!t.value&&r.showUi?(a.openBlock(),a.createBlock(o,{key:0,size:"small",varient:"tonal",prependIcon:"mdi-white-balance-sunny",class:"sun-study-toggle text-capitalize rounded-xl",onClick:n[0]||(n[0]=s=>t.value=!t.value)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(i).getLabel("openSunStudy")),1)]),_:1})):a.createCommentVNode("",!0)}}}),My={class:"d-flex align-center"},wy={class:"d-block mr-1"},Ay={class:"small"},Ey={class:"small"},_4=ke(a.defineComponent({__name:"VSunsimSlider",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{},time:{required:!0},timeModifiers:{},day:{required:!0},dayModifiers:{}},emits:["update:modelValue","update:time","update:day"],setup(e){const t=a.useModel(e,"modelValue"),i=a.useModel(e,"time"),r=a.useModel(e,"day");function n(o){i.value=r.value.timeSamples.find(s=>s.timeInHours===o)}return(o,s)=>{const l=a.resolveComponent("v-icon"),d=a.resolveComponent("v-slider"),c=a.resolveComponent("v-field"),h=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",My,[a.createElementVNode("div",wy,[a.createVNode(c,{class:"ss-slider-field",style:{},variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[r.value.timeSamples.length>1?(a.openBlock(),a.createBlock(d,{key:0,class:"pa-2 pr-2",modelValue:i.value.timeInHours,min:r.value.startTime,max:r.value.endTime,step:r.value.interval,"onUpdate:modelValue":n,density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(l,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Ay,a.toDisplayString(a.unref(ai)(i.value.timeInHours)),1)]),_:1},8,["modelValue","min","max","step"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(l,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",Ey,a.toDisplayString(a.unref(ai)(i.value.timeInHours)),1)],64))]),_:1})]),a.createElementVNode("div",null,[a.createVNode(h,{size:"small",class:"sun-study-toggle text-capitalize rounded-xl",icon:"mdi-close",onClick:s[0]||(s[0]=u=>t.value=!t.value)})])])}}}),[["__scopeId","data-v-489d2d0e"]]),by={key:1,class:"sun-icon-wrapper"},Cy=37,Ty=39,v4=ke(a.defineComponent({__name:"VWaypointCarousel",props:{thumbnails:{},currentThumbnail:{}},emits:["go"],setup(e,{expose:t,emit:i}){const r=e,{thumbnails:n,currentThumbnail:o}=a.toRefs(r),s=i;t({updateLoadProgress:_});const l=a.ref();a.watch(o,()=>{l.value=n.value.findIndex(g=>g===o.value)},{immediate:!0});const d=a.ref();a.watch(n,()=>{const g=[];for(let p=0;p<n.value.length;p++)g.push(n.value[p].done?1:0);d.value=g},{immediate:!0});const c=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent));a.onMounted(()=>{window.addEventListener("keydown",h)}),a.onBeforeUnmount(()=>{window.removeEventListener("keydown",h)});function h(g){switch(g.keyCode){case g.keyCode===Cy:u();break;case g.keyCode===Ty:m();break;default:return}}function u(){const g=n.value.findIndex(p=>p===o.value);g>=1&&v(n.value[g-1])}function m(){const g=n.value.findIndex(p=>p===o.value);g<n.value.length-1&&v(n.value[g+1])}function f(g,p){p(),v(n.value.find(y=>y===g))}function v(g){s("go",g)}function _(g){const p=n.value.findIndex(y=>g.dataPoint.labels.cameraId===y.labels.cameraId&&g.dataPoint.labels.interiorId===y.labels.interiorId);if(p>=0){const y=[...d.value];y[p]=g.progress,d.value=y}}return(g,p)=>{const y=a.resolveComponent("v-btn"),x=a.resolveComponent("v-img"),b=a.resolveComponent("v-icon"),N=a.resolveComponent("v-card"),A=a.resolveComponent("v-slide-group-item"),C=a.resolveComponent("v-slide-group");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["d-flex align-center justify-center",{mobileWaypointWrapper:c.value,desktopWaypointWrapper:!c.value," waypoint-carousel":!0}])},[a.renderSlot(g.$slots,"before",{},void 0,!0),a.createVNode(C,{modelValue:l.value,"onUpdate:modelValue":p[2]||(p[2]=U=>l.value=U),class:a.normalizeClass({mobileWaypoint:c.value}),"active-class":"active-apt","selected-class":"active-apt","show-arrows":!c.value,"center-active":"",mandatory:""},{prev:a.withCtx(()=>[c.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(y,{key:0,class:a.normalizeClass(["carousel-button",{mobile:c.value}]),icon:"mdi-chevron-left",varient:"tonal",size:"small",onClick:p[0]||(p[0]=U=>u())},null,8,["class"]))]),next:a.withCtx(()=>[c.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(y,{key:0,class:a.normalizeClass(["carousel-button",{mobile:c.value}]),icon:"mdi-chevron-right",varient:"tonal",size:"small",onClick:p[1]||(p[1]=U=>m())},null,8,["class"]))]),default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),(U,S)=>(a.openBlock(),a.createBlock(A,{key:U.labels.cameraId},{default:a.withCtx(({toggle:M,selectedClass:k})=>[a.createVNode(N,{class:a.normalizeClass(["position-relative",[c.value?"ma-0":"ma-1",k,"single-waypoint"]]),align:"center",justify:"center",style:{overflow:"hidden"},onClick:R=>f(U,M)},{default:a.withCtx(()=>[a.createVNode(x,{cover:"","aspect-ratio":1,src:U.labels.thumbnailUrl},null,8,["src"]),d.value[S]<1?(a.openBlock(),a.createElementBlock("div",{key:0,class:"w-100 h-100 top-0 left-0 position-absolute",style:a.normalizeStyle(`opacity: 0.85; background: conic-gradient(gray 0deg, gray ${Math.round((1-d.value[S])*360)}deg, transparent ${Math.round((1-d.value[S])*360)}deg, transparent 360deg);`)},null,4)):a.createCommentVNode("",!0),U.labels.hasSunSim?(a.openBlock(),a.createElementBlock("div",by,[a.createVNode(b,{class:"sun-icon",icon:"mdi-white-balance-sunny"})])):a.createCommentVNode("",!0)]),_:2},1032,["class","onClick"])]),_:2},1024))),128))]),_:1},8,["modelValue","class","show-arrows"]),a.renderSlot(g.$slots,"after",{},void 0,!0)],2)}}}),[["__scopeId","data-v-9e5e229c"]]),Iy={class:"d-flex flex-column align-center justify-center clock-face"},Py={class:"clock-icon"},Ny={class:"clock-value grey--text text--darken-3"},Ly=ke(a.defineComponent({__name:"VTimeOfDay",props:{hours:{default:0},minutes:{default:0}},setup(e){const t=e,i=a.computed(()=>[r(t.hours),":",r(t.minutes)].join(""));function r(n){return("0"+n).slice(-2)}return(n,o)=>{const s=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",Iy,[a.createElementVNode("div",Py,[a.createVNode(s,{src:a.unref(X0),"aspect-ratio":"1"},null,8,["src"])]),a.createElementVNode("div",Ny,a.toDisplayString(i.value),1)])}}}),[["__scopeId","data-v-a758a375"]]),Ry=a.defineComponent({__name:"VCompass",props:{rotation:{}},setup(e){const t=e,i=a.ref(j0),r=a.ref({backgroundImage:`url(${W0})`,backgroundSize:"contain"}),n=a.computed(()=>({transform:`rotate(${-t.rotation+180}deg)`}));return(o,s)=>{const l=a.resolveComponent("v-img");return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(r.value),class:"compass-wrapper"},[a.createVNode(l,{class:"compass-needle",src:i.value,style:a.normalizeStyle(n.value)},null,8,["src","style"])],4)}}}),Dy=e=>(a.pushScopeId("data-v-2a9a63da"),e=e(),a.popScopeId(),e),Uy={class:"player-settings-ui"},ky={id:"settings-ui-form"},Oy={class:"form-inputs"},zy={class:"setting-label"},Vy={class:"setting-label"},By=["max","min","step"],Fy={class:"setting-label"},Hy={class:"flex-grow-1 flex-shrink-0"},Gy=["onUpdate:modelValue"],Wy={key:3,"d-block":"",class:"mt-3"},jy={class:"d-flex justify-space-between"},Xy={class:"setting-label"},Yy={class:"mt-5 d-block",style:{width:"300px"}},qy=Dy(()=>a.createElementVNode("div",{class:"setting-label"},"Enter Lut URL:",-1)),Zy={class:"d-block",style:{width:"300px"}},Qy={class:"form-buttons"},Jy=ke(a.defineComponent({__name:"VPlayerSettingsUi",props:{initialSettings:{}},emits:["updateSettings","saveSettings"],setup(e,{emit:t}){const i=e,r=t,n=a.ref(f(i.initialSettings));a.watch(n,()=>{s()},{deep:!0});const o=a.computed(()=>{let v={};for(const[_,g]of Object.entries(n.value))_==="whitePoint"?v[_]=h(g.value):v[_]=g.value;return v});function s(){r("updateSettings",o.value)}function l(){const v=document.createElement("a");v.href=URL.createObjectURL(new Blob([JSON.stringify(o.value,null,2)]));const _=`player-settings-${Date.now()}.json`;v.download=_,v.style.display="none",document.body.appendChild(v),v.click(),document.body.removeChild(v)}function d(){r("saveSettings",o.value)}function c(){n.value=f(),r("updateSettings",o.value)}function h(v){const _=parseInt(v.substr(1,2),16)/255,g=parseInt(v.substr(3,2),16)/255,p=parseInt(v.substr(5,2),16)/255;return[_,g,p]}function u(v){var _=v.toString(16);return _.length==1?"0"+_:_}function m([v,_,g]){return"#"+u(parseInt((v*255).toString()))+u(parseInt((_*255).toString()))+u(parseInt((g*255).toString()))}function f(v={}){const _=["Cool 5","Cool 10","Cool 15","Cool 20","Cool 25","Warm 20","Warm 25","Warm 10","Warm 15","Warm 5","bw"];let g={temperature:6500,targetLuminance:1,exposureFovScale:.6,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:"",...v};return{exposureFovScale:{label:"Exposure Fov Scale",type:"slider",min:0,max:1,step:.01,value:g.exposureFovScale},targetLuminance:{label:"Target Luminance",type:"slider",min:0,max:15,step:.1,value:g.targetLuminance},sharpenFilter_amount:{label:"Sharpen Filter Amount",type:"slider",min:0,max:100,step:.1,value:g.sharpenFilter_amount},UNREAL_BLOOM_ENABLED:{label:"Enable Bloom?",type:"boolean",value:g.UNREAL_BLOOM_ENABLED},UNREAL_BLOOM_STRENGTH:{label:"Bloom Strength",type:"slider",min:0,max:1,step:.01,value:g.UNREAL_BLOOM_STRENGTH},TRANSITION_MOVEMENT_SCALE:{label:"Transition Movement Speed",type:"slider",min:.2,max:25,step:.1,value:g.TRANSITION_MOVEMENT_SCALE},temperature:{label:"Temperature / White Balance",type:"slider",min:1e3,max:12e3,step:1,value:g.temperature},whitePoint:{label:"White Point",type:"color",value:m(g.whitePoint)},lut:{label:"Lut",type:"lut",items:_.map(p=>({text:p,value:`https://cdn.visuado.com/luts/${p}.png`})),value:g.lut}}}return(v,_)=>{const g=a.resolveComponent("v-text-field"),p=a.resolveComponent("v-slider"),y=a.resolveComponent("v-checkbox"),x=a.resolveComponent("v-btn"),b=a.resolveComponent("v-select"),N=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",Uy,[a.createElementVNode("form",ky,[a.createElementVNode("div",Oy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(A,C,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,"d-block":""},[A.type==="slider"?(a.openBlock(),a.createBlock(p,{key:0,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s,max:A.max,min:A.min,step:A.step},{prepend:a.withCtx(()=>[a.createElementVNode("div",zy,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",type:"number",max:A.max,min:A.min,step:A.step,style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue","max","min","step"])])]),_:2},1032,["modelValue","onUpdate:modelValue","max","min","step"])):a.createCommentVNode("",!0),A.type==="boolean"?(a.openBlock(),a.createBlock(y,{key:1,modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,onChange:s},{prepend:a.withCtx(()=>[a.createElementVNode("div",Vy,a.toDisplayString(A.label),1)]),append:a.withCtx(()=>[a.createElementVNode("div",null,a.toDisplayString(A.value),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])):a.createCommentVNode("",!0),A.type==="color"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"d-flex",max:A.max,min:A.min,step:A.step},[a.createElementVNode("div",Fy,a.toDisplayString(A.label),1),a.createElementVNode("div",Hy,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":S=>n.value[C].value=S,type:"color",onChange:s},null,40,Gy),[[a.vModelText,n.value[C].value]])]),a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",outlined:"",readonly:"",type:"text",style:{width:"90px"},onChange:s},null,8,["modelValue","onUpdate:modelValue"])])],8,By)):a.createCommentVNode("",!0),A.type==="lut"?(a.openBlock(),a.createElementBlock("div",Wy,[a.createElementVNode("div",jy,[a.createElementVNode("div",Xy,a.toDisplayString(A.label),1),a.createElementVNode("div",null,[a.createVNode(x,{class:"ml-2","x-small":"",onClick:S=>n.value[C].value=null},{default:a.withCtx(()=>[a.createTextVNode(" Clear Lut ")]),_:2},1032,["onClick"])])]),a.createElementVNode("div",null,[a.createElementVNode("div",Yy,[a.createElementVNode("div",null,[a.createVNode(b,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,items:A.items,"item-title":"title","item-value":"value",dense:"",label:"Select Lut",onChange:s},null,8,["modelValue","onUpdate:modelValue","items"])])]),a.createElementVNode("div",null,[qy,a.createElementVNode("div",Zy,[a.createElementVNode("div",null,[a.createVNode(g,{modelValue:n.value[C].value,"onUpdate:modelValue":S=>n.value[C].value=S,"hide-details":"",dense:"",type:"url",onChange:s},null,8,["modelValue","onUpdate:modelValue"])])])])])])):a.createCommentVNode("",!0)]))),128))]),a.createElementVNode("div",Qy,[a.createVNode(x,{onClick:_[0]||(_[0]=A=>c())},{default:a.withCtx(()=>[a.createTextVNode("Reset")]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[1]||(_[1]=A=>l())},{default:a.withCtx(()=>[a.createTextVNode(" Download Json "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-download")]),_:1})]),_:1}),a.createVNode(x,{class:"ml-2",onClick:_[2]||(_[2]=A=>d())},{default:a.withCtx(()=>[a.createTextVNode(" Save Settings "),a.createVNode(N,{color:"black darken-1"},{default:a.withCtx(()=>[a.createTextVNode("mdi-save")]),_:1})]),_:1})])])])}}}),[["__scopeId","data-v-2a9a63da"]]),Ky={style:{width:"24px",height:"24px"},viewBox:"0 0 18 16",xmlns:"http://www.w3.org/2000/svg"},$y=["stroke"],eS=["stroke"],tS={class:"floor-level-label"},iS=ke(a.defineComponent({__name:"VFloorLevel",props:a.mergeModels({floorLevels:{default:()=>[]}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=a.useModel(e,"modelValue"),i=e,r=a.inject(B1),n=a.computed(()=>{const c=i.floorLevels;return c.sort(),c}),o=a.computed(()=>n.value.indexOf(t.value)+1<=n.value.length/2?"lower":"upper"),s=a.computed(()=>o.value==="lower"),l=a.computed(()=>o.value==="upper");function d(){const c=t.value+1;c>=n.value.length?t.value=n.value[0]:t.value=n.value[c]}return(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-tooltip");return a.openBlock(),a.createBlock(m,{right:"",attach:""},{activator:a.withCtx(({props:f})=>[a.createVNode(u,a.mergeProps({style:{cursor:"pointer"},density:"comfortable",elevation:"1",icon:""},f,{onClick:d}),{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock("svg",Ky,[a.createElementVNode("path",{d:"M8.98034 10.3472L1.54055 5.8855L8.98034 1.42384L16.4201 5.8855L8.98034 10.3472Z",fill:"white",stroke:l.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,$y),a.createElementVNode("path",{d:"M8.98034 14.7993L1.54055 10.3376L8.98034 5.87599L16.4201 10.3376L8.98034 14.7993Z",fill:"white",stroke:s.value?"black":"#999999","stroke-width":"1.5","stroke-linejoin":"round"},null,8,eS)]))]),_:2},1040)]),default:a.withCtx(()=>[a.createElementVNode("span",tS,a.toDisplayString(a.unref(r).getLabel(o.value))+" "+a.toDisplayString(a.unref(r).getLabel("floor")),1)]),_:1})}}}),[["__scopeId","data-v-ae461ac7"]]);class ii{static async loadText(t){return new ii().loadText(t)}static async loadJson(t){return new ii().loadJson(t)}static async loadImage(t){return new ii().loadImage(t)}static async loadImageData(t){return new ii().loadImageData(t)}async loadText(t){try{return(await Pt.get(t)).data}catch(i){throw Pt.isAxiosError(i)&&i.response?new Error(`Failed to load resource from ${t}: ${i.response.status} ${i.response.statusText}`):i}}async loadJson(t){return(await Pt.get(t)).data}async loadImage(t){return new Promise((i,r)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>{i(n)},n.onerror=r,n.src=t})}async loadImageData(t){const i=await this.loadImage(t),r=document.createElement("canvas");try{const n=r.getContext("2d");return r.width=i.width,r.height=i.height,n.drawImage(i,0,0),r.toDataURL("image/png")}finally{r.remove()}}}function fa(e){return("0"+e).slice(-2)}function rS(){const e=new Date;return[e.getFullYear().toString(),fa(e.getMonth()+1),fa(e.getDate())," ",fa(e.getHours()),fa(e.getMinutes()),fa(e.getSeconds())].join("")}function aS(){return"Visuado-Snapshot-"+rS()}class x4{constructor(t){D2(this,"data");this.data=t}download(t=null){t=t||aS();const i=document.createElement("a");typeof i.download=="string"?(document.body.appendChild(i),i.download=t,i.href=this.data,i.click(),document.body.removeChild(i)):location.replace(this.data)}}const nS={key:0,class:"player-error"},oS={class:"player-and-components-wrapper"},sS={key:3,class:"settings-panel"},lS={key:0,class:"compass-wrapper"},cS={key:1,class:"btn-placeholder mr-2"},dS={class:"btn-placeholder mr-2"},hS={key:2,class:"btn-placeholder mr-2"},uS={key:3,class:"btn-placeholder mr-2"},mS={class:"d-flex flex-column align-end"},fS={key:1,class:"d-flex align-center flex-column sun-study mt-2"},pS={key:2,class:"render-version"},y4=ke(a.defineComponent({__name:"VVirtualTour",props:{i18nConfig:{},cdnFileResolver:{},apartmentId:{},type:{default:"qhdr"},displayViewModeSwitch:{type:Boolean,default:!0},version:{},adminMode:{type:Boolean},playerSettings:{default:()=>({temperature:6500,targetLuminance:1,exposureFovScale:.3,UNREAL_BLOOM_ENABLED:!0,sharpenFilter_amount:.6,UNREAL_BLOOM_STRENGTH:.3,TRANSITION_MOVEMENT_SCALE:1.3,whitePoint:[1,1,1],lut:""})},defaultViewMode:{default:"virtualTour"},showCarousel:{type:Boolean,default:!0},showTimeOfDay:{type:Boolean,default:!0},showCompass:{type:Boolean,default:!0},showFullScreen:{type:Boolean,default:!0},showSnapshot:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},showInteriorOptions:{type:Boolean,default:!0},showMiniMap:{type:Boolean,default:!0},showFloorLevel:{type:Boolean,default:!0},showVersion:{type:Boolean,default:!0},showVisuadoCreateButton:{type:Boolean,default:!1},enableAutoplay:{type:Boolean,default:!1}},emits:["snapshot","visuadoCreateButtonClicked","interiorUpdate","cameraUpdate","sunsimUpdate","frontendMarkersUpdate","initialized","saveSettings","error"],setup(e,{expose:t,emit:i}){const r=e,n=i,{i18nConfig:o,cdnFileResolver:s,apartmentId:l,type:d,displayViewModeSwitch:c,version:h,adminMode:u,playerSettings:m,defaultViewMode:f,showCarousel:v,showTimeOfDay:_,showCompass:g,showFullScreen:p,showSnapshot:y,showShare:x,showInteriorOptions:b,showMiniMap:N,showFloorLevel:A,showVersion:C,showVisuadoCreateButton:U,enableAutoplay:S}=a.toRefs(r);a.provide(B1,o.value?new d2(o.value):new d2);const M=a.ref(),k=a.ref(),R=a.ref(),D=a.ref(),B=a.ref({}),Z=a.ref({}),j=a.ref({}),Q=a.ref(!1),V=a.ref(),J=a.ref(),Y=a.ref(),he=a.ref(),ne=a.ref(),q=a.ref(0),K=a.ref(!1),le=a.ref(!1),de=a.ref(!1),ae=a.ref(!1),Me=a.ref(!1),Be=a.ref(!1),z=a.ref(!1),Ee=a.ref(),ve=a.ref(),Le=a.ref(),we=a.ref(),Qe=a.ref(0),Ce=a.ref(0),T=a.ref(new P3(document,"player-wrapper"));t({playerCore:k,setCurrentCameraId:at,setCurrentInteriorId:L1,setCurrentDay:vt,setCurrentTimeSample:It,setCurrentRotation:pa,setCurrentFloorLevel:c2}),a.onMounted(async()=>{try{fe.value?(K.value=!1,de.value=!0):setTimeout(()=>{K.value=!0},1e3)}catch(ce){Q.value=!0,n("error",ce)}}),a.watch(f,()=>{f.value==="virtualTour"&&(le.value=!1),f.value==="slideShow"&&(le.value=!0,de.value=!0)},{immediate:!0}),a.watch(ne,()=>{he.value=ne.value.labels.thumbnailUrl?ne.value:null}),a.watch([s,l,d],async()=>{var ce;if(s.value!==void 0&&l.value!==void 0){const ge=[],d1=s1(s.value,"/config.json");R.value=await(await fetch(d1)).json(),D.value=R.value.archetypes;const $1=R.value.archetypes.map($e=>$e.archetypeID);for(const $e of $1){const Je=s1(s.value,`/${$e}/${l.value}/apartment.json`);try{B.value[$e]=await(await fetch(Je)).json()}catch{if($1[0]!==$e)B.value[$e]=B.value[$1[0]];else throw new Error(`Failed to load apartment.json for the default interior: ${Je}`)}const L2=s1(s.value,`/${$e}/${l.value}/thumbs.json`);try{Z.value[$e]=await(await fetch(L2)).json()}catch{Z.value[$e]=Z.value[$1[0]]}const E=s1(s.value,`/${$e}/${l.value}/minimap/minimap.json`);try{j.value[$e]=await(await fetch(E)).json()}catch{j.value[$e]=void 0}for(const O of B.value[$e].cameras){const H=O.id,X=(ce=O.sunsimDayOfYear)==null?void 0:ce.filter(F=>{var ue;return((ue=F.timeSamples)==null?void 0:ue.length)>1});ge.push({url:s1(s.value,`/${$e}/${l.value}/360/4096x2048/${H}.${d.value||"qhdr"}`),position:O.uposition,rotation:O.urotation,floorPositionY:Number(O.floor_vertical_position),floorLevel:O.floorLevel,type:d.value,depthDataUrl:d.value==="jpg"?s1(s.value,`/${$e}/${l.value}/data/${H}_depth.raw.z`):void 0,labels:{apartmentId:l.value,interiorId:$e,cameraId:H,hasSunSim:!!X.length,daysOfYear:X,thumbnailUrl:Z.value[$e].cameras.find(F=>F.id===H)?s1(s.value,`/${$e}/${l.value}/thumbs/200/${H}.jpg`):void 0,imageUrl:Z.value[$e].cameras.find(F=>F.id===H)?s1(s.value,`/${$e}/${l.value}/thumbs/1600/${H}.jpg`):void 0}});for(const F of X)for(const ue of F.timeSamples)ge.push({url:s1(s.value,`/${$e}/${l.value}${ue.filename}`),position:O.uposition,rotation:O.urotation,floorPositionY:Number(O.floor_vertical_position),floorLevel:O.floorLevel,type:"jpg",labels:{apartmentId:l.value,interiorId:$e,cameraId:H,hasSunSim:!0,dayOfYear:F.dayOfYear,timeInHours:ue.timeInHours}})}}V.value=ge}},{immediate:!0}),a.watch(V,()=>{V.value&&V.value.length>0&&(Ee.value=V.value[0].labels.cameraId,ve.value=V.value[0].labels.interiorId)},{immediate:!0}),a.watch(z,()=>{var ce;z.value?(de.value=!1,Le.value=ne.value.labels.daysOfYear[0],we.value=(ce=ne.value.labels.daysOfYear[0].timeSamples)==null?void 0:ce.find(ge=>ge.timeInHours===ne.value.labels.daysOfYear[0].defaultHour)):(de.value=!0,Le.value=void 0,we.value=void 0)}),a.watch(ve,()=>{n("interiorUpdate",ve.value)}),a.watch(Ee,()=>{n("cameraUpdate",Ee.value,$.value)}),a.watch(ne,()=>{n("sunsimUpdate",ne.value.labels.daysOfYear)});const w=a.computed(()=>/Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(window.navigator.userAgent)),W=a.computed(()=>w.value?"platform-mobile":"platform-desktop"),$=a.computed(()=>B.value[ve.value]),re=a.computed(()=>j.value[ve.value]),L=a.computed(()=>{if($.value){const ce=$.value.cameras.map(d1=>d1.floorLevel);let ge=[...new Set(ce)];return ge=ge.sort(),ge}else return[]}),ie=a.computed(()=>{let ce=0;if($.value){const ge=$.value.cameras.map($e=>$e.floorLevel);let d1=[...new Set(ge)];d1=d1.sort();const $1=d1.findIndex($e=>$e===Ce.value);$1!==-1&&(ce=$1)}return ce}),ee=a.computed(()=>{if(re.value&&re.value.storeys&&ie.value in re.value.storeys)return re.value.storeys[ie.value]}),me=a.computed(()=>{if($.value&&$.value.timeInHours&&r.showTimeOfDay)return Oe($.value.timeInHours)}),fe=a.computed(()=>{const ce=s1(s.value,"/config.json");return localStorage.getItem(`${ce}-dont-show-tutorial`)});function oe(ce){he.value=ce,k.value.setCurrentDataPoint(a.toRaw(he.value))}function Se(){if(he.value){let ce=Y.value.findIndex(ge=>ge===he.value)+1;ce>=Y.value.length&&(ce=0),he.value=Y.value[ce]}else he.value=Y.value[0]}function be(){if(he.value){let ce=Y.value.findIndex(ge=>ge===he.value)-1;ce<0&&(ce=Y.value.length-1),he.value=Y.value[ce]}else he.value=Y.value[0]}function Ie(ce){ve.value=ce}function Ae(ce){Y.value=ce.data.filter(ge=>ge.labels.thumbnailUrl)}function Xe(ce){ce.state===Yl.Finished&&(ne.value=ce.dataPoint,Ee.value=ce.dataPoint.labels.cameraId,ve.value=ce.dataPoint.labels.interiorId)}function ze(ce){J.value=ce.data}function e1(ce){M.value&&M.value.updateLoadProgress(ce)}function i1(ce){z.value=!1}async function p1(){const ce=await k.value.takePhoto(),ge=k.value.getState(),d1=new x4(ce);return n("snapshot",d1,ge),d1}async function xe(){console.log("Here onVisuadoCreateButtonClicked");const ce=await k.value.takePhoto(),ge=new x4(ce);n("visuadoCreateButtonClicked",ge)}function P(ce=!1){de.value=!0,K.value=!1,ce&&pe()}function pe(){const ce=s1(r.cdnFileResolver,"/config.json");localStorage.setItem(`${ce}-dont-show-tutorial`,"true")}function se(ce){Ee.value=ce}function Oe(ce){if(ce===void 0)return null;const ge=Math.floor(ce),d1=Math.floor((ge-ce)*60);return{hours:ge,minutes:d1}}function Pe(){T.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function Ke(ce){k.value.setAllOptions({unrealBloomEnabled:ce.UNREAL_BLOOM_ENABLED,unrealBloomStrength:ce.UNREAL_BLOOM_STRENGTH,sharpenFilterAmount:ce.sharpenFilter_amount,whitePoint:ce.whitePoint,temperature:ce.temperature,targetLuminance:ce.targetLuminance,exposureFovScale:ce.exposureFovScale,transitionMovementScale:ce.TRANSITION_MOVEMENT_SCALE}),ce.lut&&ce.lut}function r1(ce){n("saveSettings",ce)}function o1(){T.value.setup()}function A1(ce){k.value=ce,n("initialized",k.value)}function a1(ce){Qe.value=ce.yRotation}function at(ce){Ee.value=ce}function L1(ce){ve.value=ce}function vt(ce){const ge=ne.value.labels.daysOfYear.find(d1=>d1.dayOfYear===ce);Le.value=ge}function It(ce){const ge=Le.value.timeSamples.find(d1=>d1.timeInHours===ce);we.value=ge}function pa(ce){Qe.value=ce}function c2(ce){Ce.value=ce}return(ce,ge)=>{var $1,$e;const d1=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["virtual-tour-wrapper",[W.value]])},[Q.value?(a.openBlock(),a.createElementBlock("div",nS,"Error loading the player!!")):a.createCommentVNode("",!0),a.createElementVNode("div",oS,[!T.value.isActive&&a.unref(N)&&re.value&&Ee.value&&ee.value&&ve.value&&ae.value?(a.openBlock(),a.createBlock(g4,{key:0,"cdn-file-resolver":a.unref(s),"apartment-json":$.value,level:ie.value,"minimap-json":re.value,rotation:Qe.value,"current-camera":Ee.value,onGoToCamera:se,onClose:ge[0]||(ge[0]=Je=>ae.value=!1)},null,8,["cdn-file-resolver","apartment-json","level","minimap-json","rotation","current-camera"])):a.createCommentVNode("",!0),ve.value&&Ee.value?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["v-player",[W.value]])},[V.value?(a.openBlock(),a.createBlock(vx,{key:0,data:V.value,cameraId:Ee.value,interiorId:ve.value,day:Le.value,time:we.value,isAutoPlaying:Be.value,isFullScreen:T.value.isActive,onInitialized:o1,onDataPointsActivated:Ae,onDataPointLoad:Xe,onDataPointsLoaded:ze,onDataPointTextureLoad:e1,onMousePick:i1,onStateUpdated:a1,onPlayerCoreAccessible:A1,onFrontendMarkersUpdate:ge[14]||(ge[14]=Je=>n("frontendMarkersUpdate",Je.data))},{"slideshow-image":a.withCtx(()=>{var Je;return[le.value?(a.openBlock(),a.createBlock(J0,{key:0,image:(Je=he.value)==null?void 0:Je.labels.imageUrl},null,8,["image"])):a.createCommentVNode("",!0)]}),"top-left":a.withCtx(()=>[a.unref(u)?(a.openBlock(),a.createBlock(d1,{key:0,density:"comfortable",icon:"mdi-cog-outline",elevation:"3",class:"mr-2",onClick:ge[1]||(ge[1]=Je=>Me.value=!Me.value)})):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(d1,{density:"comfortable",icon:"mdi-alert-outline",elevation:"3",class:"mr-2",onClick:ge[2]||(ge[2]=Je=>K.value=!K.value)},null,512),[[a.vShow,de.value]]),re.value&&Ee.value&&ee.value?a.withDirectives((a.openBlock(),a.createBlock(d1,{key:1,density:"comfortable",elevation:"3",icon:"mdi-floor-plan",class:"mr-2",onClick:ge[3]||(ge[3]=Je=>ae.value=!ae.value)},null,512)),[[a.vShow,de.value]]):a.createCommentVNode("",!0),de.value&&a.unref(A)&&L.value.length>1?(a.openBlock(),a.createBlock(iS,{key:2,modelValue:q.value,"onUpdate:modelValue":ge[4]||(ge[4]=Je=>q.value=Je),"floor-levels":L.value},null,8,["modelValue","floor-levels"])):a.createCommentVNode("",!0),a.unref(u)&&Me.value?(a.openBlock(),a.createElementBlock("div",sS,[a.createVNode(Jy,{"initial-settings":a.unref(m),onUpdateSettings:Ke,onSaveSettings:r1},null,8,["initial-settings"])])):a.createCommentVNode("",!0)]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[$.value&&a.unref(g)?a.withDirectives((a.openBlock(),a.createElementBlock("div",lS,[a.createVNode(Ry,{rotation:Qe.value},null,8,["rotation"])],512)),[[a.vShow,de.value]]):a.createCommentVNode("",!0),a.createElementVNode("div",{onClick:ge[5]||(ge[5]=Je=>ae.value=!ae.value)},[de.value&&$.value&&$.value.timeInHours&&a.unref(_)?(a.openBlock(),a.createBlock(Ly,{key:0,hours:me.value.hours,minutes:me.value.minutes,class:"time-of-day",style:a.normalizeStyle({cursor:re.value&&Ee.value&&ee.value?"pointer":"default"})},null,8,["hours","minutes","style"])):a.createCommentVNode("",!0)])]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[le.value?(a.openBlock(),a.createBlock(d1,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:be})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[K.value?(a.openBlock(),a.createBlock(Kx,{key:0,onCloseTutorial:ge[6]||(ge[6]=Je=>P(Je))})):a.createCommentVNode("",!0),T.value.isActive&&re.value&&ne.value&&ee.value&&ae.value?(a.openBlock(),a.createBlock(g4,{key:1,"cdn-file-resolver":a.unref(s),"apartment-json":$.value,"minimap-json":re.value,rotation:Qe.value,"current-camera":ne.value.labels.cameraId,level:Ce.value,onClose:ge[7]||(ge[7]=Je=>ae.value=!1),onGoToCamera:se},null,8,["cdn-file-resolver","apartment-json","minimap-json","rotation","current-camera","level"])):a.createCommentVNode("",!0)]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[le.value?(a.openBlock(),a.createBlock(d1,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:Se})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(my,{key:0,"is-full-screen":T.value.isActive,class:"btn-fullscreen",onToggleFullscreen:Pe},null,8,["is-full-screen"])):a.createCommentVNode("",!0),a.unref(y)?(a.openBlock(),a.createElementBlock("div",cS,[a.createVNode(d1,{density:"comfortable",elevation:"3",icon:"mdi-camera",onClick:p1})])):a.createCommentVNode("",!0),a.createElementVNode("div",dS,[a.unref(c)&&de.value?(a.openBlock(),a.createBlock(Sx,{key:0,modelValue:le.value,"onUpdate:modelValue":ge[8]||(ge[8]=Je=>le.value=Je)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),de.value&&a.unref(x)&&!T.value.isActive?(a.openBlock(),a.createElementBlock("div",hS,[a.createVNode(wx)])):a.createCommentVNode("",!0),de.value&&a.unref(U)?(a.openBlock(),a.createElementBlock("div",uS,[a.createVNode(hy,{onOnSnapshot:xe})])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createVNode(a.Transition,null,{default:a.withCtx(()=>{var Je,L2,E,O;return[a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(["d-flex justify-center",{"mb-2":!w.value}])},[!Be.value&&((L2=(Je=ne.value)==null?void 0:Je.labels)!=null&&L2.hasSunSim)?(a.openBlock(),a.createBlock(Sy,{key:0,modelValue:z.value,"onUpdate:modelValue":ge[9]||(ge[9]=H=>z.value=H),"show-ui":de.value,class:"ml-2"},null,8,["modelValue","show-ui"])):a.createCommentVNode("",!0)],2),!w.value&&!Be.value&&((O=(E=ne.value)==null?void 0:E.labels)!=null&&O.hasSunSim)&&we.value?(a.openBlock(),a.createBlock(_4,{key:0,modelValue:z.value,"onUpdate:modelValue":ge[10]||(ge[10]=H=>z.value=H),time:we.value,"onUpdate:time":ge[11]||(ge[11]=H=>we.value=H),day:Le.value,"onUpdate:day":ge[12]||(ge[12]=H=>Le.value=H),class:"sunsim-slider-desktop"},null,8,["modelValue","time","day"])):a.createCommentVNode("",!0),!w.value&&a.unref(v)&&de.value&&Y.value?(a.openBlock(),a.createBlock(v4,{key:1,ref_key:"carousel",ref:M,class:a.normalizeClass([T.value.isActive?"full-screen":""]),currentThumbnail:he.value,thumbnails:Y.value,onGo:oe},{before:a.withCtx(()=>[a.unref(S)?(a.openBlock(),a.createBlock(p4,{key:0,modelValue:Be.value,"onUpdate:modelValue":ge[13]||(ge[13]=H=>Be.value=H)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),_:1},8,["class","currentThumbnail","thumbnails"])):a.createCommentVNode("",!0)])]}),_:1})]),"bottom-right":a.withCtx(()=>[a.createElementVNode("div",mS,[de.value&&a.unref(b)?(a.openBlock(),a.createBlock(yy,{key:0,"cdn-file-resolver":a.unref(s),archetypes:D.value,"current-data-point":ne.value,onSelectInterior:Ie},null,8,["cdn-file-resolver","archetypes","current-data-point"])):a.createCommentVNode("",!0)])]),_:1},8,["data","cameraId","interiorId","day","time","isAutoPlaying","isFullScreen"])):a.createCommentVNode("",!0),a.createVNode(a.Transition,null,{default:a.withCtx(()=>[w.value&&a.unref(v)&&de.value&&Y.value?(a.openBlock(),a.createBlock(v4,{key:0,ref_key:"carousel",ref:M,class:"waypoint-carousel below-player",currentThumbnail:he.value,thumbnails:Y.value,onGo:oe},{before:a.withCtx(()=>[a.unref(S)?(a.openBlock(),a.createBlock(p4,{key:0,modelValue:Be.value,"onUpdate:modelValue":ge[15]||(ge[15]=Je=>Be.value=Je)},null,8,["modelValue"])):a.createCommentVNode("",!0)]),_:1},8,["currentThumbnail","thumbnails"])):a.createCommentVNode("",!0)]),_:1}),w.value?(a.openBlock(),a.createElementBlock("div",fS,[Be.value&&(($e=($1=ne.value)==null?void 0:$1.labels)!=null&&$e.hasSunSim)&&we.value?(a.openBlock(),a.createBlock(_4,{key:0,modelValue:z.value,"onUpdate:modelValue":ge[16]||(ge[16]=Je=>z.value=Je),time:we.value,"onUpdate:time":ge[17]||(ge[17]=Je=>we.value=Je),day:Le.value,"onUpdate:day":ge[18]||(ge[18]=Je=>Le.value=Je),class:"mt-1"},null,8,["modelValue","time","day"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),a.unref(h)&&a.unref(C)?(a.openBlock(),a.createElementBlock("div",pS," version: "+a.toDisplayString(a.unref(h)),1)):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-6fe1a492"]]),gS={id:"player-wrapper"},_S={id:"player-sizer"},vS={class:"player-control",id:"controls-top-left"},xS={class:"player-control",id:"controls-top-center"},yS={class:"player-control",id:"controls-top-right"},SS={class:"player-control",id:"controls-center-left"},MS={class:"player-control",id:"controls-center-center"},wS={class:"player-control",id:"controls-center-right"},AS={class:"player-control",id:"controls-bottom-left"},ES={class:"player-control",id:"controls-bottom-center"},bS={class:"player-control",id:"controls-bottom-right"},CS=ke(a.defineComponent({__name:"VManualSlideShowPlayer",props:{isFullScreen:{type:Boolean}},emits:["newSizeCallback"],setup(e,{emit:t}){return(i,r)=>(a.openBlock(),a.createElementBlock("div",gS,[a.createElementVNode("div",_S,[a.renderSlot(i.$slots,"slideshow-image",{},void 0,!0),a.createElementVNode("div",vS,[a.renderSlot(i.$slots,"top-left",{},void 0,!0)]),a.createElementVNode("div",xS,[a.renderSlot(i.$slots,"top-center",{},void 0,!0)]),a.createElementVNode("div",yS,[a.renderSlot(i.$slots,"top-right",{},void 0,!0)]),a.createElementVNode("div",SS,[a.renderSlot(i.$slots,"center-left",{},void 0,!0)]),a.createElementVNode("div",MS,[a.renderSlot(i.$slots,"center-center",{},void 0,!0)]),a.createElementVNode("div",wS,[a.renderSlot(i.$slots,"center-right",{},void 0,!0)]),a.createElementVNode("div",AS,[a.renderSlot(i.$slots,"bottom-left",{},void 0,!0)]),a.createElementVNode("div",ES,[a.renderSlot(i.$slots,"bottom-center",{},void 0,!0)]),a.createElementVNode("div",bS,[a.renderSlot(i.$slots,"bottom-right",{},void 0,!0)])])]))}}),[["__scopeId","data-v-5fdd1e05"]]),TS={class:"virtual-tour-wrapper"},IS={class:"player-and-components-wrapper"},PS={class:"mss-image"},NS={key:1,class:"btn-placeholder"},S4=ke(a.defineComponent({__name:"VManualSlideShow",props:{images:{},websiteUrl:{},i18nConfig:{},showFullScreen:{type:Boolean,default:!0},showShare:{type:Boolean,default:!0},defaultWaypointIndex:{default:0}},setup(e){const t=e;a.provide(B1,t.i18nConfig?new d2(t.i18nConfig):new d2);const i=a.ref(0),r=a.ref(new P3(document,"player-wrapper")),n=a.computed(()=>t.images.map((h,u)=>({id:`image-${u}`,thumbnailUrl:h}))),o=a.computed(()=>n.value[i.value]);a.onMounted(()=>{r.value.setup()});function s(){r.value.toggle(),window.scrollTo({top:150,behavior:"smooth"})}function l(){let h=i.value+1;h>=n.value.length&&(h=0),i.value=h}function d(){let h=i.value-1;h<0&&(h=n.value.length-1),i.value=h}function c(h,u=!0){let m=n.value.findIndex(f=>f.id===h);m!=-1&&(i.value=m)}return(h,u)=>{const m=a.resolveComponent("v-img"),f=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",TS,[a.createElementVNode("div",IS,[a.createElementVNode("div",null,[a.createVNode(CS,{"is-full-screen":r.value.isActive},{"slideshow-image":a.withCtx(()=>[a.createElementVNode("div",PS,[a.createVNode(m,{src:o.value.thumbnailUrl},null,8,["src"])])]),"top-left":a.withCtx(()=>[]),"top-center":a.withCtx(()=>[]),"top-right":a.withCtx(()=>[]),"center-left":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-transition"},{default:a.withCtx(()=>[n.value.length>1?(a.openBlock(),a.createBlock(f,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-left",onClick:d})):a.createCommentVNode("",!0)]),_:1})]),"center-center":a.withCtx(()=>[]),"center-right":a.withCtx(()=>[a.createVNode(a.Transition,{name:"slide-x-reverse-transition"},{default:a.withCtx(()=>[n.value.length>1?(a.openBlock(),a.createBlock(f,{key:0,density:"comfortable",elevation:"3",icon:"mdi-chevron-right",onClick:l})):a.createCommentVNode("",!0)]),_:1})]),"bottom-left":a.withCtx(()=>[h.showFullScreen?(a.openBlock(),a.createBlock(K0,{key:0,"is-full-screen":r.value.isActive,class:"btn-fullscreen",onToggleFullscreen:s},null,8,["is-full-screen"])):a.createCommentVNode("",!0),h.showShare?(a.openBlock(),a.createElementBlock("div",NS,[a.createVNode(Q0)])):a.createCommentVNode("",!0)]),"bottom-center":a.withCtx(()=>[a.createElementVNode("div",null,[r.value.isActive&&n.value.length>1?(a.openBlock(),a.createBlock(xa,{key:0,class:a.normalizeClass([r.value.isActive?"full-screen":""]),thumbnails:n.value,active:i.value,onNext:l,onPrevious:d,onGoto:c},null,8,["class","thumbnails","active"])):a.createCommentVNode("",!0)])]),"bottom-right":a.withCtx(()=>[]),_:1},8,["is-full-screen"]),n.value.length>1?(a.openBlock(),a.createBlock(xa,{key:0,thumbnails:n.value,active:i.value,onNext:l,onPrevious:d,onGoto:c},null,8,["thumbnails","active"])):a.createCommentVNode("",!0)])])])}}}),[["__scopeId","data-v-373ac320"]]),LS=ke(a.defineComponent({__name:"VMiniMap",props:{cdnFileResolver:{type:[String,Function]},currentCamera:{},level:{},rotation:{},hideCompass:{type:Boolean},hideSlider:{type:Boolean},compassScale:{}},emits:["apartmentJsonLoaded","minimapJsonLoaded","cameraSet"],setup(e,{emit:t}){const i=e,r=a.toRefs(i),n=t,o=a.ref(),s=a.ref(),l=a.ref(),d=a.ref(0),c=a.ref(),h=a.ref(1),u=a.computed(()=>r.currentCamera.value?r.currentCamera.value:o.value?o.value.cameras[0].id:null),m=a.computed(()=>({transformOrigin:"top left",transform:`scale(${h.value})`}));a.watch(c,()=>{c.value&&new ResizeObserver(([p])=>{const y=p.target.parentElement,x=y.parentElement;h.value=x.clientWidth/512,y.style.height=`${p.contentRect.height*h.value}px`}).observe(c.value)}),a.watch(u,()=>{n("cameraSet",u.value)});const f=a.computed(()=>{const p=s1(r.cdnFileResolver.value,"").replace(`/${o.value.type}/${o.value.id}`,"");return y=>`${p}${y}`}),v=a.computed(()=>{var g;return(g=s.value)==null?void 0:g.storeys[r.level.value||0]});a.watch(r.cdnFileResolver,async()=>{o.value=await(await fetch(s1(r.cdnFileResolver.value,"/apartment.json"))).json(),n("apartmentJsonLoaded",o.value),s.value=await(await fetch(s1(r.cdnFileResolver.value,"/minimap/minimap.json"))).json(),n("minimapJsonLoaded",s.value)},{immediate:!0}),a.watch([v,r.cdnFileResolver],()=>{r.cdnFileResolver.value&&v.value&&(l.value=v.value.defaultSunsimFile?s1(r.cdnFileResolver.value,"/minimap/sunsim0_13.jpg"):s1(r.cdnFileResolver.value,`/minimap/${v.value.defaultSunsimFile}`))},{immediate:!0});function _(g){l.value=g}return(g,p)=>{const y=a.resolveComponent("v-skeleton-loader");return a.openBlock(),a.createBlock(y,{loading:!o.value||!s.value},{default:a.withCtx(()=>[a.createElementVNode("div",null,[a.createElementVNode("div",{style:a.normalizeStyle({...m.value,position:"relative"}),ref_key:"fitContainer",ref:c},[g.hideCompass!==!0?(a.openBlock(),a.createBlock(T3,{key:0,scale:g.compassScale||1,rotation:v.value.rotation.y,"transform-angle":d.value},null,8,["scale","rotation","transform-angle"])):a.createCommentVNode("",!0),a.createVNode(C3,{"transform-angle":d.value,"all-cameras":o.value.cameras,"background-image":l.value,rotation:g.rotation||0,"current-camera":u.value,storey:v.value,containerWidth:512,containerHeight:384,fit:""},{default:a.withCtx(({id:x,camera:b,active:N,style:A})=>[a.renderSlot(g.$slots,"default",{id:x,camera:b,active:N,style:a.normalizeStyle(A)},void 0,!0)]),_:3},8,["transform-angle","all-cameras","background-image","rotation","current-camera","storey"]),g.hideSlider!==!0?(a.openBlock(),a.createBlock(I3,{key:1,"cdn-file-resolver":f.value,"minimap-json":s.value,"apartment-json":o.value,level:g.level||0,onSetBackgroundImage:_},null,8,["cdn-file-resolver","minimap-json","apartment-json","level"])):a.createCommentVNode("",!0)],4)])]),_:3},8,["loading"])}}}),[["__scopeId","data-v-8077dfb5"]]),RS=["src"],DS=ke(a.defineComponent({__name:"VStructureChooserCameraDayTimeSample",props:{timeSampleData:{},cdnFileResolver:{type:[String,Function]},currentTime:{}},setup(e){const t=e,{timeSampleData:i,cdnFileResolver:r,currentTime:n}=a.toRefs(t),o=a.ref(),s=a.inject("registerImage"),l=a.inject("completeImage");a.watch(o,()=>{o.value&&(s(o.value),o.value.onload=()=>{l(o.value)},o.value.onerror=()=>{l(o.value)})});const d=a.computed(()=>s1(r.value,i.value.filename));return(c,h)=>(a.openBlock(),a.createElementBlock("img",{ref_key:"image",ref:o,style:a.normalizeStyle({visibility:a.unref(n)&&a.unref(i)===a.unref(n)?"visible":"hidden"}),src:d.value},null,12,RS))}}),[["__scopeId","data-v-c4a08195"]]),US=a.defineComponent({__name:"VStructureChooserCameraDay",props:{dayData:{},cdnFileResolver:{type:[String,Function]},currentDay:{},currentTime:{}},setup(e){const t=e,{dayData:i,cdnFileResolver:r,currentTime:n}=a.toRefs(t);return(o,s)=>(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i).timeSamples,(l,d)=>(a.openBlock(),a.createBlock(DS,{key:d,"time-sample-data":l,"cdn-file-resolver":a.unref(r),"current-time":a.unref(n)},null,8,["time-sample-data","cdn-file-resolver","current-time"]))),128))}}),kS=["src"],OS=ke(a.defineComponent({__name:"VStructureChooserCamera",props:{cameraData:{},cdnFileResolver:{type:[String,Function]},currentCamera:{},currentDay:{},currentTime:{}},setup(e){const t=e,{cameraData:i,cdnFileResolver:r,currentCamera:n,currentTime:o}=a.toRefs(t),s=a.ref(),l=a.inject("registerImage"),d=a.inject("completeImage");a.watch(s,()=>{s.value&&(l(s.value),s.value.onload=()=>{d(s.value)},s.value.onerror=()=>{d(s.value)})});const c=a.computed(()=>s1(r.value,i.value.defaultFilename));return(h,u)=>a.unref(i).sunsimDayOfYear?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(a.unref(i).sunsimDayOfYear,(m,f)=>(a.openBlock(),a.createBlock(US,{key:f,"day-data":m,"cdn-file-resolver":a.unref(r),"current-day":h.currentDay,"current-time":a.unref(o)},null,8,["day-data","cdn-file-resolver","current-day","current-time"]))),128)):(a.openBlock(),a.createElementBlock("img",{key:1,ref_key:"image",ref:s,style:a.normalizeStyle({visibility:a.unref(n)===a.unref(i)?"visible":"hidden"}),src:c.value},null,12,kS))}}),[["__scopeId","data-v-da694d37"]]),zS=["src"],VS=ke(a.defineComponent({__name:"VStructureChooserTransition",props:{transitionData:{},cdnFileResolver:{type:[String,Function]},currentTransition:{}},setup(e){const t=e,{transitionData:i,cdnFileResolver:r,currentTransition:n}=a.toRefs(t),o=a.ref(),s=a.inject("registerImage"),l=a.inject("completeImage");a.watch(o,()=>{o.value&&(s(o.value),o.value.onload=()=>{l(o.value)},o.value.onerror=()=>{l(o.value)})});const d=a.computed(()=>s1(r.value,i.value.filename));return(c,h)=>(a.openBlock(),a.createElementBlock("img",{ref_key:"image",ref:o,style:a.normalizeStyle({visibility:a.unref(i)===a.unref(n)?"visible":"hidden"}),src:d.value},null,12,zS))}}),[["__scopeId","data-v-d592c198"]]);function M4(e){const t=new Date(0);return t.setUTCDate(e),t.toLocaleString("en-no",{month:"short",day:"numeric"})}const BS={key:0,class:"d-inline-block",style:{"vertical-align":"top"}},FS=ke(a.defineComponent({__name:"VStructureChooserUiDayButton",props:{isMobileSized:{type:Boolean},currentCamera:{},currentDay:{},disabled:{type:Boolean}},emits:["onDayChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,currentCamera:n,currentDay:o,disabled:s}=a.toRefs(i),l=t,d=a.ref(o.value.dayOfYear);return a.watch(o,()=>{d.value=o.value.dayOfYear}),a.watch(d,()=>{l("onDayChange",n.value.sunsimDayOfYear.find(c=>c.dayOfYear===d.value))}),(c,h)=>{const u=a.resolveComponent("v-btn"),m=a.resolveComponent("v-field"),f=a.resolveComponent("v-list-item-title"),v=a.resolveComponent("v-list-item"),_=a.resolveComponent("v-list"),g=a.resolveComponent("v-menu");return a.unref(n).sunsimDayOfYear&&a.unref(n).sunsimDayOfYear.length>0?(a.openBlock(),a.createElementBlock("div",BS,[a.createVNode(g,null,{activator:a.withCtx(({props:p})=>[a.createVNode(m,{variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.createVNode(u,a.mergeProps({variant:"text",rounded:"",flat:"",readonly:a.unref(n).sunsimDayOfYear.length===1,"prepend-icon":"mdi-calendar-blank","append-icon":a.unref(n).sunsimDayOfYear.length>1?"mdi-menu-down":void 0,disabled:a.unref(s),size:a.unref(r)?"small":void 0},p),{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(M4)(d.value)),1)]),_:2},1040,["readonly","append-icon","disabled","size"])]),_:2},1024)]),default:a.withCtx(()=>[a.createVNode(_,null,{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n).sunsimDayOfYear,(p,y)=>(a.openBlock(),a.createBlock(v,{key:y,value:y,onClick:x=>d.value=p.dayOfYear},{default:a.withCtx(()=>[a.createVNode(f,null,{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(M4)(p.dayOfYear)),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})])):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743f5faf"]]),HS=["onClick"],GS={key:0,class:"camera-name text-caption text-capitalize"},WS={key:1,class:"icon-wrapper"},jS=ke(a.defineComponent({__name:"VStructureChooserUiCameraThumbnails",props:{isMobileSized:{type:Boolean},stillCameras:{},currentCamera:{},cdnFileResolver:{type:[String,Function]},disabled:{type:Boolean}},emits:["onCameraChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,stillCameras:n,currentCamera:o,cdnFileResolver:s,disabled:l}=a.toRefs(i),d=a.ref(o.value),c=a.ref(),h=a.ref(),u=a.ref(!1),m=t;a.watch([c,h],()=>{if(c.value&&h.value){const v=new ResizeObserver(([_,g])=>{var p,y;u.value=((p=g==null?void 0:g.contentRect)==null?void 0:p.width)>((y=_==null?void 0:_.contentRect)==null?void 0:y.width)});v.observe(c.value),v.observe(h.value)}},{immediate:!0}),a.watch(o,()=>{d.value=o.value},{immediate:!0}),a.watch(d,()=>{m("onCameraChange",n.value.find(v=>v===d.value))});function f(v){l.value||(d.value=v)}return(v,_)=>{const g=a.resolveComponent("v-btn"),p=a.resolveComponent("v-icon");return a.openBlock(),a.createElementBlock("div",{ref_key:"parent",ref:c,class:a.normalizeClass({"d-flex parent-container":!0,mobile:a.unref(r),disabled:a.unref(l),enabled:!a.unref(l)})},[u.value?(a.openBlock(),a.createBlock(g,{key:0,style:{left:"0"},class:"thumbnail-nav-button",onClick:_[0]||(_[0]=y=>c.value.scrollLeft-=70)},{default:a.withCtx(()=>[a.createTextVNode(" ❮ ")]),_:1})):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"child",ref:h,class:"still-camera-thumbnails-wrapper d-flex justify-center",style:a.normalizeStyle({paddingLeft:u.value?"28px":0,paddingRight:u.value?"28px":0})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(n),(y,x)=>(a.openBlock(),a.createElementBlock("div",{key:x,class:a.normalizeClass(["still-camera-image d-flex flex-column flex-reverse align-center",{"elevation-2":!a.unref(r),"active-camera":y===d.value}]),onClick:b=>f(y)},[a.createElementVNode("div",{class:"camera-thumbnail-image",style:a.normalizeStyle({backgroundImage:`url(${a.unref(s1)(a.unref(s),y.defaultFilename)})`})},null,4),y.cameraName?(a.openBlock(),a.createElementBlock("div",GS,a.toDisplayString(y.cameraName),1)):a.createCommentVNode("",!0),y.sunsimDayOfYear&&y.sunsimDayOfYear.length>1?(a.openBlock(),a.createElementBlock("div",WS,[a.createVNode(p,{size:"x-small",color:"warning",style:{opacity:"0.6"}},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1})])):a.createCommentVNode("",!0)],10,HS))),128))],4),u.value?(a.openBlock(),a.createBlock(g,{key:1,style:{right:"0"},class:"thumbnail-nav-button",onClick:_[1]||(_[1]=y=>c.value.scrollLeft+=70)},{default:a.withCtx(()=>[a.createTextVNode(" ❯ ")]),_:1})):a.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-cbc592ae"]]),XS={class:"small"},YS={class:"small"},qS=ke(a.defineComponent({__name:"VStructureChooserUiTimeSampleSlider",props:{isMobileSized:{type:Boolean},currentDay:{},currentTime:{},disabled:{type:Boolean}},emits:["onTimeChange"],setup(e,{emit:t}){const i=e,{isMobileSized:r,currentDay:n,currentTime:o,disabled:s}=a.toRefs(i),l=t,d=a.ref(o.value.timeInHours);return a.watch(o,()=>{d.value=o.value.timeInHours}),a.watch(d,()=>{l("onTimeChange",n.value.timeSamples.find(c=>c.timeInHours===d.value))}),(c,h)=>{const u=a.resolveComponent("v-icon"),m=a.resolveComponent("v-slider"),f=a.resolveComponent("v-field");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"d-inline-block":!0,mobile:a.unref(r)}),style:a.normalizeStyle({flex:a.unref(r)&&a.unref(n).timeSamples.length>1?1:void 0,verticalAlign:"top"})},[a.createVNode(f,{style:a.normalizeStyle(a.unref(n).timeSamples.length>1?{width:a.unref(r)?"100%":"300px",height:a.unref(r)?"28px":"36px"}:{height:a.unref(r)?"28px":"36px",paddingLeft:"12px",paddingRight:"12px",paddingTop:a.unref(r)?"5px":"9px",paddingBottom:a.unref(r)?"5px":"9px"}),variant:"solo-filled",rounded:"",flat:""},{default:a.withCtx(()=>[a.unref(n).timeSamples.length>1?(a.openBlock(),a.createBlock(m,{key:0,class:"pa-2 pr-2",modelValue:d.value,"onUpdate:modelValue":h[0]||(h[0]=v=>d.value=v),min:a.unref(n).startTime,max:a.unref(n).endTime,step:a.unref(n).interval,disabled:!!a.unref(s),density:"compact","thumb-size":"16","thumb-color":"white","hide-details":""},{prepend:a.withCtx(()=>[a.createVNode(u,{style:{"vertical-align":"baseline","font-size":"20px"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",XS,a.toDisplayString(a.unref(ai)(d.value)),1)]),_:1},8,["modelValue","min","max","step","disabled"])):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createVNode(u,{style:{"vertical-align":"baseline","font-size":"20px","margin-top":"-1px",opacity:"0.6"},class:"mr-2 icon",color:"warning"},{default:a.withCtx(()=>[a.createTextVNode(" mdi-white-balance-sunny ")]),_:1}),a.createElementVNode("span",YS,a.toDisplayString(a.unref(ai)(d.value)),1)],64))]),_:1},8,["style"])],6)}}}),[["__scopeId","data-v-5a7478fc"]]),ZS={class:"d-inline-block",style:{"vertical-align":"top"}},QS=a.createElementVNode("hr",{style:{"border-top":"1px solid #999"}},null,-1),JS=a.defineComponent({__name:"VStructureChooserUiZoomButtons",props:{isMobileSized:{type:Boolean},canZoomIn:{type:Boolean},canZoomOut:{type:Boolean},disabled:{type:Boolean}},emits:["onZoomIn","onZoomOut"],setup(e,{emit:t}){const i=e,{isMobileSized:r,canZoomIn:n,canZoomOut:o,disabled:s}=a.toRefs(i),l=t;return(d,c)=>{const h=a.resolveComponent("v-btn");return a.openBlock(),a.createElementBlock("div",ZS,[a.createVNode(h,{disabled:a.unref(s)||!a.unref(n),size:a.unref(r)?"x-small":"small",flat:"",icon:"mdi-plus",onClick:c[0]||(c[0]=u=>l("onZoomIn")),style:{"border-bottom-left-radius":"0","border-bottom-right-radius":"0"}},null,8,["disabled","size"]),QS,a.createVNode(h,{disabled:a.unref(s)||!a.unref(o),size:a.unref(r)?"x-small":"small",flat:"",icon:"mdi-minus",onClick:c[1]||(c[1]=u=>l("onZoomOut")),style:{"border-top-left-radius":"0","border-top-right-radius":"0"}},null,8,["disabled","size"])])}}}),KS=["innerHTML"],$S=ke(a.defineComponent({__name:"VStructureChooserOverlay",props:{cdnFileResolver:{type:[String,Function]},colorCallback:{type:Function},currentCamera:{},selectedId:{},activeStructureIds:{}},emits:["onClick","onHoverOver","onHoverOut","updateSvgContainer","onError","onBoundingBoxesUpdate"],setup(e,{emit:t}){const i=e,{cdnFileResolver:r,colorCallback:n,currentCamera:o,selectedId:s}=a.toRefs(i),l=t,d=a.ref(!0),c=a.ref({}),h=a.ref(),u=a.reactive({}),m=a.computed(()=>s1(r.value,o.value.overlayFilename));a.watchEffect(()=>{for(const _ in u){const{element:g,state:p}=u[_],{r:y,g:x,b,a:N,s:A}=n.value(_,p)||{r:0,g:0,b:0,a:0,s:0};g.style.fill=`rgba(${y}, ${x}, ${b}, ${N/255})`,g.style.stroke=`rgb(${y}, ${x}, ${b})`,g.style.strokeWidth=A.toString(),g.style.cursor="pointer"}}),a.watch(s,()=>{for(const _ in u)u[_].state==="selected"&&_!==s.value?u[_].state="idle":u[_].state!=="selected"&&_===s.value&&(u[_].state="selected")}),a.watchEffect(async()=>{try{d.value=!1,c.value[m.value]||(c.value[m.value]=await ii.loadText(m.value)),v()}catch(_){l("onError",_)}finally{d.value=!0}}),a.watch(()=>h.value,()=>{h.value&&new ResizeObserver(f).observe(h.value)});function f(){a.nextTick(()=>{var g;const _=(g=h.value)==null?void 0:g.firstChild;if(_){if(!_.hasAttribute("viewBox")){const p=`0 0 ${_.getAttribute("width")} ${_.getAttribute("height")}`;_.setAttribute("viewBox",p)}_.setAttribute("width",h.value.offsetWidth.toString()),_.setAttribute("height",h.value.offsetHeight.toString())}})}a.watch(()=>i.activeStructureIds,()=>{v()},{immediate:!0,deep:!0});function v(){a.nextTick(()=>{var g;const _=(g=h.value)==null?void 0:g.firstChild;if(_){l("updateSvgContainer",_),f();let p,y="data-structure-id";p=_.querySelectorAll(`[${y}]`),p.length===0&&(y="data-apartment-id",p=_.querySelectorAll(`[${y}]`),p.length===0&&(y="data-building-id",p=_.querySelectorAll(`[${y}]`))),p.forEach(x=>{const b=x.cloneNode(!0);x.parentNode.replaceChild(b,x),b.style.strokeWidth="0",b.style.stroke="rgba(255,255,255,0)",b.style.fill="rgba(255,255,255,0)",b.querySelectorAll("path").forEach(A=>{A.style.stroke="inherit",A.style.fill="inherit"});const N=b.getAttribute(y);u[N]={element:b,state:s.value===N?"selected":"idle",boundingBox:b.getBoundingClientRect().toJSON()},i.activeStructureIds&&!i.activeStructureIds.includes(N)&&(b.style.display="none"),b.addEventListener("mouseover",()=>{u[N].state==="idle"&&(u[N].state="hover"),l("onHoverOver",N)}),b.addEventListener("mouseout",()=>{u[N].state==="hover"&&(u[N].state="idle"),l("onHoverOut",N)}),b.addEventListener("click",()=>{l("onClick",N)})}),l("onBoundingBoxesUpdate",Object.entries(u).map(([x,b])=>({id:x,boundingBox:b.boundingBox})))}})}return(_,g)=>(a.openBlock(),a.createBlock(a.Transition,null,{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"svgContainer",ref:h,style:a.normalizeStyle([{visibility:d.value?"visible":"hidden"},{"z-index":"5"}]),class:"w-100 h-100 position-absolute top-left structure-chooser-overlay-svg",innerHTML:c.value[m.value]},null,12,KS)]),_:1}))}}),[["__scopeId","data-v-4638ecbd"]]);function eM(e){if(!e)return!1;const t=["version","latitude","longitude","structures","stillCameraIndices","stillCameraData","loopable","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function tM(e){return!("filename"in e)&&"defaultFilename"in e}function R0(e){return"filename"in e}function iM(e){if(!e)return!1;const t=["version","latitude","longitude","buildings","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function rM(e){if(!e)return!1;const t=["version","latitude","longitude","building","scenes","loopable","unitData","cameras"];for(const i of t)if(!(i in e))return!1;return!0}function aM(e){return!("filename"in e)}function Ki(e){return e.startsWith("/")?e:`/${e}`}function nM(e){return e?"version"in e:!1}function oM(e){if(!e)return!1;const t=["version","buildings","cameraPosition","cameraRotation","cameraFov","lookupFilename"];for(const i of t)if(!(i in e))return!1;return!0}function w4(e){var t,i,r,n;if(eM(e))return e;if(iM(e)){if(!e.buildings)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'buildings' is missing");return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.buildings.map(({id:o,name:s})=>({id:o,name:s,type:"building"})),stillCameraIndices:e.cameras.map((o,s)=>s),stillCameraData:e.buildings.map(({id:o})=>({bestIndex:0,id:o})),loopable:!1,cameras:e.cameras.map(o=>{var l;if(o.sunsimDayOfYear){if(o.sunsimDayOfYear.length===0)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear' is empty");if(o.sunsimDayOfYear[0].timeSamples){if(o.sunsimDayOfYear[0].timeSamples.length===0)throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear.timeSamples' is empty")}else throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear[0].timeSamples' is missing")}else throw new Error("cannot convert BuildingChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear' is missing");const s={...o};return s.sunsimDayOfYear&&s.sunsimDayOfYear.forEach(d=>{d.timeSamples&&d.timeSamples.forEach(c=>{c.filename=Ki(c.filename)})}),{...s,defaultFilename:s.sunsimDayOfYear[0]?Ki(((l=s.sunsimDayOfYear[0].timeSamples.find(d=>d.timeInHours===s.sunsimDayOfYear[0].defaultHour))==null?void 0:l.filename)||s.sunsimDayOfYear[0].timeSamples[0].filename):void 0}})}}else if(oM(e)){if(!e.days&&!e.timeSamples)throw new Error("cannot convert BuildingChooserDataLegacy to StructureChooser: 'days' and 'timeSamples' are empty");const o=e.days||[{dayOfYear:180,timeSamples:e.timeSamples}];return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.buildings.map(({id:s,name:l})=>({id:s,name:l,type:"building"})),stillCameraIndices:[0],stillCameraData:e.buildings.map(({id:s})=>({bestIndex:0,id:s})),loopable:!1,cameras:[{cameraName:"",cameraPosition:e.cameraPosition,cameraRotation:A4(e.cameraRotation.normalized||e.cameraRotation),cameraFov:e.cameraFov,overlayFilename:"/BuildingChooserV5.svg",defaultFilename:Ki((i=(t=o[0])==null?void 0:t.timeSamples[0])==null?void 0:i.filename),sunsimDayOfYear:o.map(s=>({dayOfYear:s.dayOfYear,startTime:0,endTime:23.5,interval:.5,defaultHour:14,timeSamples:s.timeSamples.map(({timeInHours:l,filename:d})=>({timeInHours:l,filename:Ki(d)}))}))}]}}else{if(rM(e))return{version:"5.0",latitude:e.latitude,longitude:e.longitude,renderVersion:e.renderVersion,parentStructure:{id:e.building.id,name:e.building.name,type:"building"},structures:e.unitData.map(({unitId:o})=>({id:o,name:o,type:"unit"})),stillCameraIndices:e.scenes,stillCameraData:e.unitData.map(({bestScene:o,unitId:s})=>({bestIndex:o,id:s})),loopable:e.loopable,cameras:e.cameras.map(o=>{var s;if(aM(o)){if(o.sunsimDayOfYear){if(o.sunsimDayOfYear.length===0)throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear' is empty");if(o.sunsimDayOfYear[0].timeSamples){if(o.sunsimDayOfYear[0].timeSamples.length===0)throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: 'cameras.sunsimDayOfYear.timeSamples' is empty")}else throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear[0].timeSamples' is missing")}else throw new Error("cannot convert ApartmentChooserDataV5 to StructureChooser: key 'cameras.sunsimDayOfYear' is missing");const l={...o};return l.sunsimDayOfYear&&l.sunsimDayOfYear.forEach(d=>{d.timeSamples&&d.timeSamples.forEach(c=>{c.filename=Ki(c.filename)})}),{...l,defaultFilename:l.sunsimDayOfYear[0]?Ki(((s=l.sunsimDayOfYear[0].timeSamples.find(d=>d.timeInHours===l.sunsimDayOfYear[0].defaultHour))==null?void 0:s.filename)||l.sunsimDayOfYear[0].timeSamples[0].filename):void 0}}else return o})};if(nM(e)){if(!e.sceneData)throw new Error("cannot convert ApartmentChooserDataLegacy to StructureChooser: key 'sceneData' is missing");if(!e.scenes)throw new Error("cannot convert ApartmentChooserDataLegacy to StructureChooser: key 'scenes' is missing");const o=[...Array(64).keys()].map(l=>({filename:`/1280/${(l+1).toString().padStart(4,"0")+".jpg"}`})),s=[4,1,2,3];for(let l=0;l<e.scenes.length;l++){let d=e.scenes[l],c,h;c=o[d].filename,h={cameraName:`Camera ${l+1}`,cameraPosition:void 0,cameraRotation:e.sceneCameras&&(r=e.sceneCameras.find(u=>u.scene===l))!=null&&r.cameraRotation?A4((n=e.sceneCameras.find(u=>u.scene===l))==null?void 0:n.cameraRotation):void 0,cameraFov:0,overlayFilename:`/scenedata${s[l]}V5Overlay.svg`,defaultFilename:c,sunsimDayOfYear:void 0},R0(o[d])&&(o[d]=h)}return{version:"5.0",latitude:0,longitude:0,renderVersion:e.renderVersion,parentStructure:void 0,structures:e.sceneData.map(({apartmentID:l})=>({id:l,name:l,type:"unit"})),stillCameraIndices:e.scenes,stillCameraData:e.sceneData.map(({apartmentID:l,bestScene:d})=>({bestIndex:s.findIndex(c=>c===d)in e.scenes?e.scenes[s.findIndex(c=>c===d)]:null,id:l})).filter(({bestIndex:l})=>l!==null),loopable:!0,cameras:o}}else throw new Error("cannot convert data, no conversion source type found")}}function A4({x:e,y:t,z:i}){return{x:e,y:t,z:i,w:0}}const sM={key:0,class:"position-absolute w-100 h-100 bg-grey-lighten-2 justify-center align-center d-flex",style:{"z-index":"10"}},lM=["innerHTML"],cM={style:{"z-index":"7"}},dM={key:4,class:"render-version"},D0=ke(a.defineComponent({__name:"VStructureChooser",props:{structureChooserData:{},cdnFileResolver:{},colorCallback:{type:Function,default:()=>({r:0,g:0,b:0,a:0,s:0})},i18nConfig:{},customOverlayContent:{},selectedId:{},defaultCamera:{},defaultDay:{},defaultTime:{},mobileBreakpoint:{default:600},version:{},showVersion:{type:Boolean,default:!0},showUi:{type:Boolean,default:!0},activeStructureIds:{}},emits:["onClick","onHoverOver","onHoverOut","onMouseMove","onBoundingBoxesUpdate","onInitialize","onError"],setup(e,{expose:t,emit:i}){const r=e,{structureChooserData:n,cdnFileResolver:o,colorCallback:s,i18nConfig:l,customOverlayContent:d,selectedId:c,defaultCamera:h,defaultDay:u,defaultTime:m,mobileBreakpoint:f}=a.toRefs(r),v=i,_=a.ref(),g=a.ref(),p=a.ref(),y=a.ref(null),x=a.ref(4),b=a.ref(),N=a.ref(!1),A=a.ref(!1),C=a.ref(),U=a.computed(()=>C.value.isHoverEnabled),S=a.ref({x:0,y:0,width:0,height:0}),M=a.ref(),k=a.ref(),R=a.ref(),D=a.ref(!1),B=a.ref(1),Z=a.ref(0),j=a.ref([]),Q=a.ref(),V=a.ref({current:100,min:100,max:1e3}),J=a.ref(!1),Y=a.ref();a.provide(B1,l.value?new d2(l.value):new d2),a.provide("registerImage",L=>{a.nextTick(()=>{j.value.find(ie=>ie.image===L)||(L.decode(),j.value=[...j.value,{image:L,loaded:!1}])})}),a.provide("completeImage",L=>{a.nextTick(()=>{const ie=j.value.findIndex(ee=>ee.image===L);ie>=0&&(j.value[ie].loaded=!0,j.value=[...j.value])})}),t({getState:()=>({currentCameraIndex:_.value?K.value.findIndex(L=>L===_.value):null,currentDayIndex:g.value?_.value.sunsimDayOfYear.findIndex(L=>L===g.value):null,currentTimeIndex:p.value?g.value.timeSamples.findIndex(L=>L===p.value):null,currentTransitionIndex:y.value?le.value.findIndex(L=>L===y.value):null,currentScene:x.value}),setState:({currentCameraIndex:L,currentDayIndex:ie,currentTimeIndex:ee,currentTransitionIndex:me,currentScene:fe})=>{typeof L=="number"&&(_.value=K.value[L]),typeof ie=="number"&&(g.value=_.value.sunsimDayOfYear[ie]),typeof ee=="number"&&(p.value=g.value.timeSamples[ee]),typeof me=="number"&&(y.value=le.value[me]),typeof fe=="number"&&(x.value=fe)},resolveCoordinates:(L,ie)=>Y.value?Y.value(L,ie):{x:0,y:0}}),a.onMounted(()=>{N.value=!0,J.value=!1}),a.watch(k,()=>{k.value&&new ResizeObserver(([])=>{const ie=j.value.find(ee=>ee.loaded);ie&&(Z.value=ie.image.width/B.value)}).observe(k.value)}),a.watch(j,()=>{if(Z.value===0){const L=j.value.find(ie=>ie.loaded);L&&(B.value=L.image.naturalWidth/L.image.naturalHeight,Z.value=L.image.width/B.value)}});const he=a.computed(()=>j.value.every(L=>L.loaded)),ne=a.computed(()=>Math.round(j.value.filter(L=>L.loaded).length/j.value.length*100));a.watch(n,L=>{try{J.value=!1,R.value=w4(L)}catch(ie){J.value=!0,v("onError",ie)}},{immediate:!0}),a.watch(N,L=>{L&&v("onInitialize")});const q=a.ref();a.watch(()=>r.activeStructureIds,()=>{q.value=r.activeStructureIds},{immediate:!0,deep:!0}),a.watch(()=>k.value,()=>{k.value&&new ResizeObserver(([ie])=>{D.value=ie.contentRect.width<f.value}).observe(k.value)});const K=a.computed(()=>R.value?R.value.cameras.filter(tM):[]),le=a.computed(()=>R.value?R.value.cameras.filter(R0):[]);a.watch([R,o],()=>{R.value&&o.value&&(j.value=[])},{immediate:!0}),a.watch([R,o,h],async()=>{o.value&&K.value.length>0&&(h.value?_.value=K.value.find(L=>L.cameraName===h.value)||K.value[0]:_.value=K.value[0],x.value=R.value.cameras.findIndex(L=>L===_.value),x.value=Math.max(0,x.value))},{immediate:!0}),a.watch([R,o,u],()=>{R.value&&o.value&&_.value&&_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>0&&(u.value?g.value=_.value.sunsimDayOfYear.find(L=>L.dayOfYear===u.value)||_.value.sunsimDayOfYear[0]:g.value=_.value.sunsimDayOfYear[0])},{immediate:!0}),a.watch([R,o,m],()=>{R.value&&o.value&&g.value&&g.value.timeSamples&&g.value.timeSamples.length>0&&(m.value?p.value=g.value.timeSamples.find(L=>L.timeInHours===m.value)||g.value.timeSamples[0]:p.value=g.value.timeSamples.find(L=>L.timeInHours===g.value.defaultHour)||g.value.timeSamples[0])},{immediate:!0});function de(L){_.value!==L&&w(R.value.cameras.findIndex(ie=>ie===L))}function ae(L){x.value=L,R0(R.value.cameras[x.value])?y.value=R.value.cameras[x.value]:(a.nextTick(()=>{Me(R.value.cameras[x.value])}),y.value=null)}function Me(L){const ie=g.value;_.value=L,x.value=R.value.cameras.findIndex(ee=>ee===_.value),a.nextTick(()=>{_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>0&&Be(_.value.sunsimDayOfYear.find(ee=>ee.dayOfYear===ie.dayOfYear)||_.value.sunsimDayOfYear[0])})}function Be(L){const ie=p.value;g.value=L,a.nextTick(()=>{z(g.value.timeSamples.find(ee=>ee.timeInHours===ie.timeInHours)||g.value.timeSamples.find(ee=>ee.timeInHours===g.value.defaultHour)||g.value.timeSamples[0])})}function z(L){p.value=L}function Ee(L){v("onClick",L,()=>{const ie=R.value.stillCameraData.find(ee=>ee.id===L);ie&&w(ie.bestIndex)})}a.watch(c,L=>{var ie;if(L&&R.value){const ee=R.value.stillCameraData.find(me=>me.id===L);ee&&((ie=R.value.stillCameraIndices)!=null&&ie.includes(ee.bestIndex))&&w(ee.bestIndex)}});function ve(L){v("onHoverOver",L),b.value=L}function Le(L){v("onHoverOut",L),b.value=void 0}function we(L){const{layerX:ie,layerY:ee}=L;let me=L.target,fe=!1;for(;me;)if(me===M.value){fe=!0;break}else me=me.parentElement;if(fe){const oe=L.currentTarget;S.value={x:ie,y:ee,width:oe.clientWidth,height:oe.clientHeight}}else S.value=void 0;v("onMouseMove",L,S.value)}function Qe({min:L,max:ie,current:ee,resolve:me}){Y.value=me,V.value={min:L,max:ie,current:ee}}function Ce(L){Q.value.adjustZoom(L?10:-10)}function T(L){return R.value.stillCameraIndices.findIndex(ie=>ie===L)}async function w(L){const ie=x.value;if(R.value.loopable){const ee=R.value.stillCameraIndices.length,me=T(ie),fe=T(L);let oe=0,Se=0,be=me;for(;be++,be>=ee&&(be=0),be!==fe;)oe++;for(be=me;be--,be<0&&(be+=ee),be!==fe;)Se++;oe===Se?W(ie,L):oe<Se?me<fe?W(ie,L):W(ie,L+R.value.cameras.length):me>=fe?W(ie,L):W(ie+R.value.cameras.length,L)}else W(ie,L)}function W(L,ie){return new Promise(ee=>{A.value=!0;let me,fe=L;me=setInterval(()=>{fe<ie?(fe++,x.value=Math.abs(fe%R.value.cameras.length),ae(x.value)):fe>ie?(fe--,x.value=Math.abs(fe%R.value.cameras.length),ae(x.value)):(clearInterval(me),A.value=!1,ee())},12)})}function $(L){J.value=!0,v("onError",L)}const re=L=>L*(180/Math.PI);return(L,ie)=>{const ee=a.resolveComponent("v-progress-circular"),me=a.resolveComponent("v-skeleton-loader");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(me,{type:"image",class:"w-100 h-100 position-relative",loading:!N.value||!R.value},{default:a.withCtx(()=>[he.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",sM,[a.createVNode(ee,{"model-value":ne.value,size:128,width:12},null,8,["model-value"])])),a.createVNode(a.Transition,{class:"w-100 h-100"},{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"container",ref:k,class:a.normalizeClass({mobile:D.value}),style:{"min-height":"160px"},onMousemove:we},[L.showUi?(a.openBlock(),a.createElementBlock("div",{key:0,class:"persistent actions-bar top-right pa-2",style:a.normalizeStyle({zIndex:7,top:D.value&&K.value.length>1?"60px":0})},[_.value.cameraRotation?(a.openBlock(),a.createBlock(E3,{key:0,class:"mb-2",style:a.normalizeStyle({zIndex:7,width:D.value?32:40,height:D.value?32:40}),longitude:re(_.value.cameraRotation.y)+270},null,8,["style","longitude"])):a.createCommentVNode("",!0),a.createVNode(JS,{"is-mobile-sized":D.value,"can-zoom-out":V.value.min<V.value.current,"can-zoom-in":V.value.max>V.value.current,disabled:A.value,onOnZoomIn:ie[0]||(ie[0]=fe=>Ce(!0)),onOnZoomOut:ie[1]||(ie[1]=fe=>Ce(!1))},null,8,["is-mobile-sized","can-zoom-out","can-zoom-in","disabled"])],4)):a.createCommentVNode("",!0),L.showUi&&K.value.length>1?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([{"actions-bar bottom-center pb-2":!0,"px-0":D.value},"still-cameras-wrapper"]),style:{"z-index":"7"}},[a.createVNode(jS,{"is-mobile-sized":D.value,"still-cameras":K.value,"current-camera":_.value,disabled:A.value,"cdn-file-resolver":a.unref(o),onOnCameraChange:de},null,8,["is-mobile-sized","still-cameras","current-camera","disabled","cdn-file-resolver"])],2)):a.createCommentVNode("",!0),a.createVNode(H0,{ref_key:"zoomBox",ref:Q,position:"relative",onUpdate:Qe},{default:a.withCtx(()=>[a.createElementVNode("div",{class:"w-100 position-relative",style:a.normalizeStyle({height:`${Z.value}px`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K.value,(fe,oe)=>(a.openBlock(),a.createBlock(OS,{key:`camera${oe}`,"camera-data":fe,"cdn-file-resolver":a.unref(o),"current-camera":_.value,"current-day":g.value,"current-time":p.value},null,8,["camera-data","cdn-file-resolver","current-camera","current-day","current-time"]))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(le.value,(fe,oe)=>(a.openBlock(),a.createBlock(VS,{key:`transition${oe}`,"transition-data":fe,"cdn-file-resolver":a.unref(o),"current-transition":y.value},null,8,["transition-data","cdn-file-resolver","current-transition"]))),128)),a.unref(d)?(a.openBlock(),a.createElementBlock("div",{key:0,class:"w-100 h-100 position-absolute top-left",style:{"z-index":"6","pointer-events":"none"},innerHTML:a.unref(d)},null,8,lM)):a.createCommentVNode("",!0),_.value.overlayFilename&&!J.value?a.withDirectives((a.openBlock(),a.createBlock($S,{key:1,"cdn-file-resolver":a.unref(o),"color-callback":a.unref(s),"current-camera":_.value,"selected-id":a.unref(c),activeStructureIds:q.value,onOnClick:Ee,onOnHoverOver:ve,onOnHoverOut:Le,onUpdateSvgContainer:ie[2]||(ie[2]=fe=>M.value=fe),onOnError:$,onOnBoundingBoxesUpdate:ie[3]||(ie[3]=fe=>v("onBoundingBoxesUpdate",fe))},null,8,["cdn-file-resolver","color-callback","current-camera","selected-id","activeStructureIds"])),[[a.vShow,y.value===null]]):a.createCommentVNode("",!0),a.renderSlot(L.$slots,"default",{},void 0,!0)],4)]),_:3},512),L.showUi&&(g.value&&g.value.timeSamples&&g.value.timeSamples.length>1||_.value.sunsimDayOfYear&&_.value.sunsimDayOfYear.length>1)?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass({"actions-bar top-left pa-2 d-flex":!0,"px-0":D.value}),style:{"z-index":"7"}},[a.createVNode(FS,{class:"pr-2","is-mobile-sized":D.value,"current-camera":_.value,"current-day":g.value,disabled:A.value,onOnDayChange:Be},null,8,["is-mobile-sized","current-camera","current-day","disabled"]),a.createVNode(qS,{"is-mobile-sized":D.value,"current-day":g.value,"current-time":p.value,disabled:A.value,onOnTimeChange:z},null,8,["is-mobile-sized","current-day","current-time","disabled"])],2)):a.createCommentVNode("",!0),L.$slots.popup&&S.value&&b.value?(a.openBlock(),a.createBlock(B0,{key:3,"is-hoverable":U.value,pos:S.value},{default:a.withCtx(()=>[a.createElementVNode("div",cM,[a.renderSlot(L.$slots,"popup",a.normalizeProps(a.guardReactiveProps({hoverId:b.value,hoverable:U.value})),void 0,!0)])]),_:3},8,["is-hoverable","pos"])):a.createCommentVNode("",!0),L.version&&L.showVersion?(a.openBlock(),a.createElementBlock("div",dM," version: "+a.toDisplayString(L.version),1)):a.createCommentVNode("",!0)],34)]),_:3})]),_:3},8,["loading"]),a.createVNode(F0,{ref_key:"hoverProbe",ref:C},null,512)],64)}}}),[["__scopeId","data-v-57d83a24"]]),hM={install:function(t){t.component("VStructureChooser",D0),t.component("VVirtualTour",eo),t.component("VVirtualTour2",y4),t.component("VManualSlideShow",S4),t.component("VStructureChooser",D0)}};h1.ResourceLoader=ii,h1.VFloatingCard=B0,h1.VHoverProbe=F0,h1.VManualSlideShow=S4,h1.VMiniMap=LS,h1.VNorthDirection=E3,h1.VStructureChooser=D0,h1.VVirtualTour=eo,h1.VVirtualTour2=y4,h1.VZoomBox=H0,h1.convertStructureChooserDataLegacyToV5=w4,h1.default=hM,Object.defineProperties(h1,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});