@vsleem-realsee-viewer/realsee-plugin 2.0.27 → 2.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.mjs +4861 -4850
  2. package/dist/index.umd.js +33 -33
  3. package/package.json +3 -3
package/dist/index.umd.js CHANGED
@@ -1,21 +1,21 @@
1
- (function(Ce,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],y):(Ce=typeof globalThis<"u"?globalThis:Ce||self,y(Ce.RealseePlugin={},Ce.Vue,Ce.VSLeemShared))})(this,(function(Ce,y,Mt){"use strict";const $g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAABWCAMAAACO0TaWAAABgFBMVEUAAACDqYtj031j135k0H2DpYxj0X1k1n6CpY1j2H5jy3tj2X+EpYuEpYxhz3qFpo1kzXxi2XyEpYxhyHpf0Hllzn2EpYuEpYxczneEpYuEpYyFpo1JwWWEp4uEpYyEpYxf0npfxXdGvWJBu15QxWtf13tVyG+EpYyEpYtSuGmEpYxd03mEpYxawXJg0nuFpYxTyW9cw3ROtGVGrV5YzHNZz3Rhy3pXy3JPtGZYvm+BpopdvnI/uFtex3ZMxWhNw2lEvWBVu2yEpYxeyHdXvG5LwWaCpItLsmNGt19jvHiDpYxrtHtew3VXzHJOtWVJtWGFpoxYvW5Jr2JWz3JTs2pauW9dwnRfvHRttX9NrGJSs2hQt2ldv3Neu3NQtGZ5rYRpsnp4rYRexXZhvXVQyGxxs4FOrmRdzHdit3db03dZrG1ls3dMtWRRs2dXtW9ftXRQrmZgu3VnuHlBt1xTsWhUt2pTt2pju3dUtGlWtWxUtmpJq2BmtndNrmNXsGthvXUz4I0rAAAAgHRSTlMABaymsRKuqQmjt6EMDq4YtKAduKq0USWnQkw9myE4NaW4mpegnqMuMbNVoki3qimet7GvpqGzo8e2K9KWtJqfmbRdvLWfRrCmpFmIxqC/s0XFr5uX1cvCgMeji8vJtGomW8Gzm3XAtqydXTe6rFJG1LuSndfQwJt9cWO5acuKqei/uqUAAA69SURBVGje7NdtUxJxFAXwYlWCSkk0VMDIIDANqBFaoaWSZEgUcoBqxKesJkvEMYPSafrsnXvvbn+NnEqyetEhSKDkx/Gwwpn/+Z/Tydkf5Mw/kq+gc4dygXP4ln/ArZjsu3jxYvcxwV1f/X9DLVRxmspGY79Wq6yurt7e1g+luI2bKrXafqOxLnBh/0G0RRXpzgEpdb1Uyufze3etXLt27e61r9dwV6lU1Ene2CE21KduVlahbh3UVuvk3AOPc58zJqcx+ZuD++QJ7OVLdX11u0Zls/k0yaYV1HVQi/VSXooEkeKTzB6Nz8wYx2w9XyoWtz/unKZZsFTr/hJaBVWgvjEQgbyHBHHiSxW+TW73+TImG30Tuq6LWcingm1UYN0jKqxcpgm8/k3u4ESXXxO/Lv57sxlpmweSrxeXDtYV+bdiD5aK9TxZx5gKKUEFh0xNTd0ZwsXQ1NAQzupE90zhH4g7Hgc66EPEvFfSt/etln+L1sKW9qhXsQZFSlAhmhmQ0FdyDWfrvinlBjoYzFg975WKSw0idyzmanHQqmAFXCysQWCpU5FSgDo2UT7hD9HFDXTCQtM47hO5XvxIu+hoFma1+6vFPGFprtIrqCIVEl9EB3qRnt62DFBsNpvJjg4FBC1mTJp6xjDyemVLxJ1o12vF0n3GylpBvXO4095oz0BPj0AVt0fO6jqduGkbP7doIAA29bwQZzKPOa8vnVgs2i1oqVpebLytV0VScWez2Y15SvZqNvta3YGKe/HMbMTWxAx1AuQFGgbImIUSn6xbDAHVKixZuSW0CisEZKAY2fkn6eWVlU2kIMFXL1ZWltPzG1kRE5rcUZxg1qLUMsjcsswiX6xhxwD/Ihe7reklGYKJFSqGylRA6dxFkOx8emV3s/BqhjNHuXGDLuWGwrvNlfSTjaT8NGwSkAc0iGEm8gLIMou8ftDdTRX/Srn41UBLgDYYDy4wNmBh0ZNgu/A3WzcLUJHxxmVkRIWu4laCv/qwm16mntFwD04mWjN3McHiIIuL21LxL5S7vl28z1q8xBKM5RlEe2mEnC6q1phP775bgxVS8CYnc7lhjtfrlS9yuclJuKGG+dmL9LJBLZtgO11ADDJaZjF2TBU3aMU/BeZy3+p5aDPBeJyGEAhEiRu10WFJsJTejfTTd7CiVFAZOTo6eoUSofBXuIXojyfZPDPzbjed5eMFQmI7naNagJNIQIwdX7uvf+RN/NwW+io6fjVQtwvULbiaDdoj2GRyI/3ilWDRKaRAhlOpWCzmUcG1VDgMOdBsRsuvWNzVRWBzFpqmBYg8MUTil1RxcamPwD+1hdWSlLtwJwFsYECjXuksWMSVzKY316AdAdYLKqQej9/v70f6VOiq3w93CuhR9ExkEidNsTULjcgOiLFjGUVpfJ3AP+bu1POsvS5avMS4WnRBWuk2mX66NoPJTjI2FfP4mXnkE5u6Qm5Ch4n8mMSF6kZvsks6ltgJHNAcExAnuOK8NPxDri7cBdFqmg1R3coUqoWZOdoBYcUqyCMfitUHURPtZ/JwbuTy3NrKPMCIOQq7gEGeQASsJvEDrjUFRDO9X3frAnc+jXJHcqg2HPOL9SJDz34/5AZayCSeRMVP0wxWqyBxwBRjEwSuKfBx26V2X5rlalE7uHZoyUtYV9KVTC7vrs1dnkS3VC2wP/zwKGiYQWaxd3jkxszufJeALS7AHG4YLzvfWLMB8HHflrktaTcRkHIVl7uFF+2uYLmPvVfCHlQLrFh/+m0/xLHIKMBr1WyyrWHEoU1cAriMhmdb/fSL49jjbv9SaSxD7U5YWuZyuVa72erajZHh0QiW0P0rb1iFLGJPmMCFtJFMulwCZm4buF7rNxfR/r1w3D3QfeCSlr12+5F2B50up9tIF4hL5Z78jVS/n8Bz1awBr2qYHs8OrwmmDTf9fd3f957r7vMvzvrAhVfjdomLWFz06zY20nPMRbknfqOKigF+fHlz2TCcRxvW7FTweQKHEuWXmdZHVXDbGmotXya+gLU7WAsuvIrrdDqTxvKjyzlwUe5JtOqxPBHvyDMexJGGEQI7HPCi4cxsy2MW3F6vpzmbQbvgHm63V7zMdSeNamHEG/Gol8HJwJhEajT3rGpgEIMWWDXsQNAwTbi51S+HiPbv8LFFa6B2HcRFDq3Bxd6rRvV5bjTVEReh14rnynCBvHhRMFj9auaCz6PhN4lyZvHA38cP1r7e8fEMcycw+KPrhXbQSV63UX02fMX6EXVScJ8nMry5yF403OVSYB6Edv48FvGm/HK6gkdr92JRsWbmZRneS47z7LW4PVa90m/BG8Ez7tzrj3irNw3D7URUwTRhVXCoHJ+uxGgQ35nDThNrCIGLeinCFe+gzAH9Lj70hv3dF8926O1Gv5+b08ZVN8BoWLw96hgM8CUsovxgPMXe9v//aRH1hi5Z9X577CUv+p2uPu+4X/lx7jQfTBtu1a/1Bl5ecVwwBjFdCbc/HLz98JbLsgbxqjlQv6b35nSrJfvtdA5begveq043XnDSLyL9UrjfUEh5254vvIlQ6BK4ANupX+XFHAbNfh80H8U6Oj6c5fVt6fr49E2Z7yBecOoIIUdgCu1hcT9yvPcN5sBg6deu+rXAt24+GH//2cPv8zrlwnvVDa1zEP2yt22/oTLm931v6kv7dv+TVByFAXy9rVkbhBUlLq0fGr7WlHIK8wcHoxGsgUNeHGbIhGVvxNiomfmv95xz7rmH2+0WUa7WOthKc+6zx+d+L1/uRbzgitd7dpM+cCHmV/u7d8Y5v9lrBZMf+89W5zPLK/BiLF7Nd4K96O+j0kw8wDuz8818GYwEON8r91aWM/Or6+vvJsd/thOOv+k+ARfxIgFobf297K6/jrfUm0nScvSN43U2s8n5XtUDzrZBtkCgEBtb86uv++V4eMxnk/Fytw3u1sbyynUkgJF4tQ7sBfcqDrfHO9FZXX993nzpJY435vLQr0bByID7q+DtuopHIp/DyP7iVblfTyhXVjNrr+d0Ae/Lg8H0HK9Gfu+t2Xc7vD4Q2FZgA18RMDWCwIl6f/cV7YZG3gxB+/FNt53YXp3nMqAN3F7jyuFm9b2dilp9feeb6UHp/jAYa5o2WBPGEHgDHX6ynWh31z8zGWZM8GbTxZ4cJxKrHO7yCrisRXs9XKvDYupwSupgXlvAkzPRnUXxDp8yDIwfjb4pmMWJend990g385igzfzbz8/7J4h2m6qAcKEFFzsWStdOxhj24tyG9pZOizNxq4OvwNP5BgImroEtYcxNTZhKvAXxk0Qi0T7prr/5fPSC1P4Jvzj6sNvuwpqAFtlSuNoF+p0JF8Pd1fYSt1Ndmp61c5OvENiitNJ8hhsCc8YKpl8eIuYSo8XImMiY43a922+3d8vlD0c6H8rl3Xa72z2pHycwSJa0Ga6CrLsI17iWrrM2bJaaU9ReWR18heCAm6VNAssarGBvh3HqIDBnrORtNIPZx8d1m/YxQcXKWDQho8WF1tLV7oKLcbnFmYCdjDzjp03rp9Qmr8ETNMLVFhtYSkEZb6AWRAYaamKLXJ3bkIpVsStahWue07Av3XSpmaU2WHv9AWOJyB4y2LtGeJ6pXZSEJWMiI2VCO2x9yL8BpVi3cIhtDGFBvQashUuhXJATm3T3oNpEeZPcBngD9vNoxJKBLWIhW4tlaXPJLhpszwgVlYUVWGiFa821cDHuQnY3dRpVbtDLO9qIpWYpbQlzi7USKrYnQEx20cTeyGQgzJCSMqVUOVdYCSu7CTxcrcSLddfSxWsyMXDjVt7ARhA42qpEZBkGWcH6bMLEkjHQauZZZjuUOmIVqiWrWmuuPYksVJuxLNJV7g/BsV4qhHWYxtkccYt1LQZZmwyyoqGG2zeAKhWtpYdiLdsLNLoF6qR60dgUlYG53/E64NnpbGz/fWVRz3R63PlDlpRhNvVXI1DDXrRo2WrZognU3FCq1Ywt8cuJ4WCuVRjgJL08G83vcYsx3rVYxUZmCEDi9g8KwK/hDGE9R5lpI6FK9TAaK07Tuqvc74Mp4Ydz1IlmrrHmFV/Gh7/KmjOGWDcxqqTPuQBKNathyYsiiLYWRbhcXV4ZRro8FJ58GOeIm6cpEluPda3gx9c5W9r6R5lGlc5KDRhsvY10oF0grby0rAvZKGB0AhHjQs5+K9WJQMxgC1nmvAXtY/uhkPI4UMNeJexiJ9Xax/WmLLRJ7gJOE6PvB8N3OGKIm7m9gxsUsp1AtMqSkjaa3L4xqFi/kSyvt4XGoBnl4mLRlXCZO5pYLjIk5yDO4mJZ732ls6ghC9nMBv/eKFL+1uWLf1zkAa6T1vhSnl5vGn0naxFzKUSMWgz2CmsO2VLmcrjcgIf+n0BBVSs+0LS1g0YrvxAd1v5UuNZiFcs1VCJXOg+sy4y2IYolKGM9daHaWO7sg06BsBwtHWXjaA3MpcDaxpd9s0zuvW8crN29b2ZGG9lg3q+ZlK0TYk1VB4ecbBFYvkwqWuGOKQ5DHBcy38RQy1UbhU4IZkKzW9kBo1D95shd3OHRqOZqC4ZFtLcmx9aaWC9IJuN6PwAOv4XDQWuvUkiHOGmXrYHbKFKg9L2hTrqSqp72DtmKGiiWorVXX8YGq1jIcj8AmQndy1X3KpU07mSIyExEXJ4lj69iboTW0gVIW7n8/gJbOVjD/rLWMtaQ70gxYKY2Mxrq2iDXquJeIuSN6YRsQMQUKrhnqlrN5fK1pyRlanaKrejsENan/bWQJeWHSTEzWtRgY57WMLmvJo+v7RNToJAyla0SrIO1aH+T2CGb2UFPFYtgkzt4YgItyv09TEWujL3kw/5Ospr1/hZSg81u5F1E4t7JAomRSEUqVCoBY8/uhvBzGrPm7KjBhhtyohPeBp+zEk6GipQ7wFZfZ8+EDLOgoRa23AUFOs2cDAkJ6d4vBShJhYpcA4I9KzOXg9nidujCxzifTCqToCI9wzcyBJtNLWEr3caMBv0T724xtKoZLnT/2NuI/vi7h4ytdP/8hW/PcuevfhPZ//k35wuxQsdAOb0aZQAAAABJRU5ErkJggg==",t_="data:image/png;base64,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",Fh={...Mt.APP_SETTING,obsType:"hs"},zh=["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],el={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:zh,pathPin:$g,pathRedPin:t_},Hh={viewMode:1,navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,defaultTransition:{speed:900,rotation:!0},moveInertia:!1,moveThresh:0,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},nl=[{url:"https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"],attribution:"© 天地图 GS(2022)3124号"}},{url:"https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],Vh={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},go={showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,minSize:200,maxSize:500,size:200,yaw:0,tileLayers:nl,rotation:!0},Gh={},_o={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1,rotation:{slider:!0,play:!0,backward:!1,forward:!1}},Wh={appSetting:Fh,realseeSetting:el,playbar:_o,map:go,immediate:!0},{cloneDeep:Zh,deepMergeProps:e_,getDiffProps:n_}=Mt.utils;function i_(n,t,e,s,r,a){const l=y.ref(Zh(go)),h=y.computed(()=>({...l.value,radarAngle:d.value})),u=y.computed(()=>{const{minSize:M=0,size:k=200}=y.unref(h)||{},Z=k>M?1:.6;return{width:`${k}px`,height:`${k}px`,opacity:Z}}),d=y.computed(()=>{const{currentPoint:M}=t.value||{},k=l.value?.radarYaw||0,Z=M?.point.yaw||0;return Mt.Point.toDegrees(Z+k)}),p=y.computed(()=>{const{dataSource:M,coordinateTree:k,mappedCoordinateTree:Z,currentSpace:J,currentModel:V,currentRecord:$,currentPoint:K,currentMarker:ut,currentPointMarkers:G}=t.value||{};return{dataSource:M,coordinateTree:k,mappedCoordinateTree:Z,currentSpace:J,currentModel:V,currentRecord:$,currentPoint:K,currentPointMarkers:G,currentMarker:ut,state:h.value}});y.watch(()=>Zh(n.value?.map),m,{immediate:!0,deep:!0}),y.watch(()=>d.value,B);function m(M,k){const Z=n_(M,k);E(Z)}function _(){return h.value}function E(M){M&&e_(l.value,M)}function S(M){y.unref(e)?.collapse(M)}function w(M){E({size:M})}function v(M){E({radarYaw:M})}function g(M){E({radarHFov:M})}function I(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function C(){try{return E({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{E({showMarker:!0})}}function T(){a("ready")}function U(M){a("collapse",M)}function N(M){E({size:M}),a("dragger")}function B(M){a("angle-updated",M)}async function z(M,k){await h.value?.onPointChange?.(M,k),k?.length&&t.value?.selectMarker(k[0]),t.value?.selectPoint(M),a("select-point",M,k)}return{getProps:h,getSize:u,getBindValue:p,mapAction:{getState:_,setState:E,setSize:w,setCollapse:S,setRadarYaw:v,setRadarHFov:g,needUpdate:I,domElement:C},handleReady:T,handleDragger:N,handleCollapse:U,handleAngleUpdated:B,handleSelectPoint:z}}const s_=["width","height","href"],r_=["x"],o_={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},a_=y.defineComponent({name:"MapCadMarker",__name:"MapCadMarker",props:{point:{},markers:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.ref(30),s=y.ref(30),r=y.computed(()=>t.markers?.sort((p,m)=>p.sort-m.sort)),a=y.computed(()=>y.unref(r)?.[0]),l=y.computed(()=>y.unref(r)?.length||0),h=y.computed(()=>{const{x:p=0,y:m=0}=t.point.point||{},{imgScale:_=0}=t;return{x:p*_,y:m*_}}),u=y.computed(()=>{const p=Math.min((t.imgZoom-1)/10*3+1,2),m=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*p*m}),d=y.computed(()=>{const{x:p=0,y:m=0}=y.unref(h),_=p-y.unref(u)*y.unref(e)/2,E=m-y.unref(u)*y.unref(s);return{transform:`translate(${_}px,${E}px) scale(${u.value})`}});return(p,m)=>a.value?(y.openBlock(),y.createElementBlock("g",{key:0,style:y.normalizeStyle(d.value),class:"vsleem-map-marker"},[y.createElementVNode("image",{width:e.value,height:s.value,href:a.value?.markerIcon,class:"map-marker-img"},null,8,s_),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",o_,y.toDisplayString(l.value),1)],8,r_)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),Pn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},l_=Pn(a_,[["__scopeId","data-v-79e5c590"]]),c_=["cx","cy","r","stroke-width","fill"],h_=Pn(y.defineComponent({name:"MapCadPoint",__name:"MapCadPoint",props:{point:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:a=0,y:l=0}=t.point.point||{},{imgScale:h=0}=t;return{x:a*h,y:l*h}}),s=y.computed(()=>1/(t.imgZoom||1)),r=y.computed(()=>{const a=Math.min((t.imgZoom-1)/10*3+1,2),l=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*2*a*l});return(a,l)=>a.point?(y.openBlock(),y.createElementBlock("circle",{key:0,cx:e.value.x,cy:e.value.y,r:r.value,"stroke-width":2*s.value,stroke:"transparent","vector-effect":"non-scaling-stroke",fill:a.point.color||"#5bb36f","fill-opacity":.8,class:"vsleem-map-point"},null,8,c_)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),u_=["d"],d_=y.defineComponent({name:"MapCadRadar",__name:"MapCadRadar",props:{point:{},radarAngle:{},radarHFov:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:l=0,y:h=0}=t.point?.point||{},{imgScale:u=0}=t;return{x:l*u,y:h*u}}),s=y.computed(()=>{const l=Math.min((t.imgZoom-1)/10*3+1,2),h=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*l*h}),r=y.computed(()=>{const{radarAngle:l=0}=t,{x:h=0,y:u=0}=y.unref(e);return{transform:`translate(${h}px,${u}px) rotate(${l}deg) scale(${s.value})`}}),a=y.computed(()=>{if(!t.point)return"";const l=18,h=0,u=0,{radarHFov:d=90}=t,p=d/2,m=-p,_=p,E=m*Math.PI/180,S=_*Math.PI/180,w=h+l*Math.cos(E),v=u+l*Math.sin(E),g=h+l*Math.cos(S),I=u+l*Math.sin(S),C=d>180?1:0;return`M ${h} ${u} L ${w} ${v} A ${l} ${l} 0 ${C} 1 ${g} ${I} Z`});return(l,h)=>l.point?(y.openBlock(),y.createElementBlock("g",{key:0,class:"vsleem-map-radar",style:y.normalizeStyle(r.value)},[h[0]||(h[0]=y.createElementVNode("defs",null,[y.createElementVNode("linearGradient",{id:"gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%"},[y.createElementVNode("stop",{offset:"0%",style:{"stop-color":"#108ee9","stop-opacity":"1"}}),y.createElementVNode("stop",{offset:"100%",style:{"stop-color":"transparent","stop-opacity":"1"}})])],-1)),y.createElementVNode("path",{d:a.value,fill:"url(#gradient)"},null,8,u_)],4)):y.createCommentVNode("",!0)}}),f_=["width","height"],p_=["width","height","href"],m_=1.2,g_=1.05,__=Pn(y.defineComponent({name:"MapCadWrapper",__name:"MapCadWrapper",props:{url:{}},emits:["ready","resize","zoom-updated","screenshot"],setup(n,{expose:t,emit:e}){const s={x:0,y:0,zoom:1},r={x:0,y:0,width:0,height:0,naturalWidth:0,naturalHeight:0,scale:1},a={width:0,height:0},l={min:1,max:50},h=n,u=e,d=y.ref(),p=y.ref(),m=y.ref(),_=y.ref(!1),E=y.ref(!1),S=y.ref({x:0,y:0,zoom:1,pageX:0,pageY:0}),w=y.ref(0),v=y.ref(!1),g=y.ref({...s}),I=y.ref({...r}),C=y.ref(),T=y.ref(),U=y.ref({...a});let N;const B=y.computed(()=>{const{x:P,y:lt,zoom:at}=y.unref(g);return{transform:`translate(${P}px, ${lt}px) scale(${at})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,G),y.onMounted(()=>{G(h.url),Tt()}),y.onBeforeUnmount(()=>{ot()});const z=P=>{P.preventDefault(),P.stopPropagation();const lt=y.unref(p)?.getBoundingClientRect();if(!lt)return;const at=P.clientX-lt.left,vt=P.clientY-lt.top,gt=P.deltaY>0?-1:1;pt(at,vt,gt,m_)},D=P=>{if(P.button!==0)return;P.preventDefault(),P.stopPropagation(),_.value=!0;const{pageX:lt,pageY:at}=P,{x:vt,y:gt,zoom:Bt}=y.unref(g);S.value={x:vt,y:gt,zoom:Bt,pageX:lt,pageY:at}},M=P=>{if(!_.value)return;P.preventDefault(),P.stopPropagation();const{pageX:lt,pageY:at}=P,{pageX:vt,pageY:gt,x:Bt,y:bt}=S.value;g.value.x=Math.round(Bt+(lt-vt)),g.value.y=Math.round(bt+(at-gt))},k=P=>{_.value&&(P.preventDefault(),P.stopPropagation(),_.value=!1)},Z=P=>{_.value&&k(P)},J=P=>{P.preventDefault(),P.stopPropagation(),Gt()},V=P=>{const lt=P.touches;lt.length===1?Lt(lt[0]):lt.length===2&&Y(lt[0],lt[1])},$=P=>{P.preventDefault(),P.stopPropagation();const lt=P.touches;_.value&&lt.length===1?it(lt[0]):E.value&&lt.length===2&&ft(lt[0],lt[1])},K=P=>{P.touches.length===0?kt():P.touches.length===1&&Ot(P.touches[0])};function ut(){v.value=!1,g.value={...s},I.value={...r},C.value=void 0,T.value=void 0,U.value={...a}}async function G(P){if(!P)return;ut();const lt=new Image;lt.crossOrigin="Anonymous",lt.src=P,lt.onload=()=>{const{naturalWidth:at,naturalHeight:vt}=lt;v.value=!0,I.value.naturalWidth=at,I.value.naturalHeight=vt,T.value=lt,St(),u("ready",y.unref(I.value),y.unref(g))},lt.onerror=at=>{console.error("图片加载失败:",at)}}function Tt(){N=new ResizeObserver(St);const P=y.unref(p);P&&N.observe(P)}function ot(){N&&N.disconnect()}function St(){if(!y.unref(v))return;const{naturalWidth:P,naturalHeight:lt}=y.unref(I),{clientWidth:at=0,clientHeight:vt=0}=y.unref(p)||{},gt=Math.min(at/P,vt/lt),Bt=P*gt,bt=lt*gt,Zt={...y.unref(g)},ve=U.value,Ae=ve.width===0&&ve.height===0,O=ve.width!==at||ve.height!==vt;if(Ae){const A=(at-Bt)/2,j=(vt-bt)/2;I.value={...I.value,width:Bt,height:bt,scale:gt},g.value.x=A,g.value.y=j,g.value.zoom=1}else if(O){const A=Zt.x+I.value.width*Zt.zoom/2,j=Zt.y+I.value.height*Zt.zoom/2,rt=A/ve.width,_t=j/ve.height,st=rt*at,Xt=_t*vt,At=st-Bt*Zt.zoom/2,Ht=Xt-bt*Zt.zoom/2;I.value={...I.value,width:Bt,height:bt,scale:gt},g.value.x=Math.round(At),g.value.y=Math.round(Ht)}U.value={width:at,height:vt},u("resize",y.unref(I))}function Gt(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:P=0,clientHeight:lt=0}=y.unref(p)||{},{width:at,height:vt}=y.unref(I),gt=(P-at)/2,Bt=(lt-vt)/2;g.value.x=gt,g.value.y=Bt,g.value.zoom=1,U.value={width:P,height:lt},u("zoom-updated",y.unref(g))}function pt(P,lt,at,vt){const{x:gt,y:Bt,zoom:bt}=y.unref(g);let Zt=bt*(at>0?vt:1/vt);Zt=Math.max(l.min,Math.min(l.max,Zt));const ve=(P-gt)/bt,Ae=(lt-Bt)/bt,O=P-ve*Zt,A=lt-Ae*Zt;g.value.x=Math.round(O),g.value.y=Math.round(A),g.value.zoom=Zt,u("zoom-updated",y.unref(g))}function Lt(P){_.value=!0;const{pageX:lt,pageY:at}=P,{x:vt,y:gt,zoom:Bt}=y.unref(g);S.value={x:vt,y:gt,zoom:Bt,pageX:lt,pageY:at}}function Y(P,lt){E.value=!0,_.value=!1,w.value=zt(P,lt)}function it(P){const{pageX:lt,pageY:at}=P,{pageX:vt,pageY:gt,x:Bt,y:bt}=S.value;g.value.x=Math.round(Bt+(lt-vt)),g.value.y=Math.round(bt+(at-gt))}function ft(P,lt){const at=y.unref(p)?.getBoundingClientRect();if(!at)return;const vt=zt(P,lt);if(w.value>0){const gt=(P.clientX+lt.clientX)/2-at.left,Bt=(P.clientY+lt.clientY)/2-at.top,Zt=vt/w.value>1?1:-1;pt(gt,Bt,Zt,g_)}w.value=vt}function kt(){_.value=!1,E.value=!1,w.value=0}function Ot(P){E.value=!1,_.value=!0;const{pageX:lt,pageY:at}=P,{x:vt,y:gt,zoom:Bt}=y.unref(g);S.value={x:vt,y:gt,zoom:Bt,pageX:lt,pageY:at}}function zt(P,lt){const at=P.clientX-lt.clientX,vt=P.clientY-lt.clientY;return Math.sqrt(at*at+vt*vt)}async function ct(){if(!T.value){console.warn("图片实例未找到");return}const P=d.value;if(!P){console.error("未找到 SVG 元素");return}try{const lt=document.createElement("canvas"),at=lt.getContext("2d");if(!at)throw new Error("无法获取 Canvas 2D 上下文");lt.width=T.value.width,lt.height=T.value.height,at.drawImage(T.value,0,0),C.value=lt.toDataURL("image/webp",1),await new Promise(bt=>setTimeout(bt,500));const vt=new XMLSerializer().serializeToString(P),gt=new Blob([vt],{type:"image/svg+xml;charset=utf-8"}),Bt=URL.createObjectURL(gt);return await ht(Bt)}catch(lt){console.error("导出 SVG 到 PNG 失败:",lt)}finally{C.value=""}}function ht(P){return new Promise((lt,at)=>{const vt=new Image;vt.src=P,vt.onload=()=>{try{URL.revokeObjectURL(P);const gt=document.createElement("canvas"),Bt=gt.getContext("2d");if(!Bt)throw new Error("无法获取 Canvas 2D 上下文");const bt=y.unref(p),{width:Zt,height:ve}=bt?.getBoundingClientRect()||{width:800,height:600},{zoom:Ae=1,x:O=0,y:A=0}=y.unref(g);gt.width=Zt,gt.height=ve,Bt.setTransform(Ae,0,0,Ae,O,A),Bt.drawImage(vt,0,0),lt(gt)}catch(gt){at(gt)}},vt.onerror=()=>{URL.revokeObjectURL(P),at(new Error("SVG 图像加载失败"))}})}return t({domElement:ct}),(P,lt)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:J,onWheel:z,onMousedown:D,onMousemove:M,onMouseup:k,onMouseleave:Z,onTouchstart:V,onTouchmove:$,onTouchend:K},[y.createElementVNode("div",{ref_key:"transformWrapperRef",ref:m,style:y.normalizeStyle(B.value)},[(y.openBlock(),y.createElementBlock("svg",{id:"svgElement",ref_key:"svgRef",ref:d,width:I.value?.width,height:I.value?.height,overflow:"hidden",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[v.value?(y.openBlock(),y.createElementBlock("image",{key:0,x:0,y:0,width:I.value?.width,height:I.value?.height,href:C.value||P.url,crossOrigin:"anonymous"},null,8,p_)):y.createCommentVNode("",!0),y.renderSlot(P.$slots,"default",{},void 0,!0)],8,f_))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),v_={class:"vsleem-map-cad"},y_=Pn(y.defineComponent({name:"MapCad",__name:"MapCad",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(1),h=y.ref(1),u=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));function d(v,g){p(v),m(g),r("ready")}function p(v){h.value=v.scale??1}function m(v){l.value=v.zoom??1}async function _(v){r("select-point",v)}function E(v,g){r("select-point",v,g)}function S(){}async function w(){return await a.value?.domElement()}return t({needUpdate:S,domElement:w}),(v,g)=>(y.openBlock(),y.createElementBlock("div",v_,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(__,{key:0,url:v.store?.currentModel?.modelValue,ref_key:"wrapperElRef",ref:a,onReady:d,onResize:p,onZoomUpdated:m},{default:y.withCtx(()=>[v.map?.showPoint?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:0},y.renderList(v.store.dataSource,([I,C])=>(y.openBlock(),y.createElementBlock("g",{key:I},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(C.trackPoints,([T,U])=>(y.openBlock(),y.createBlock(h_,{key:T,point:U,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,stroke:v.store.currentPoint?.id==U.id?"#108ee9":"transparent",onClick:y.withModifiers(N=>_(U),["stop","prevent"])},null,8,["point","imgZoom","imgScale","wrapScale","stroke","onClick"]))),128))]))),128)):y.createCommentVNode("",!0),v.map?.showRadar?(y.openBlock(),y.createBlock(d_,{key:1,point:v.store.currentPoint,radarAngle:v.map.radarAngle,radarHFov:v.map.radarHFov,imgZoom:l.value,imgScale:h.value,wrapScale:u.value},null,8,["point","radarAngle","radarHFov","imgZoom","imgScale","wrapScale"])):y.createCommentVNode("",!0),v.map?.showMarker?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:2},y.renderList(v.store.groupedMarkers,([I,C])=>(y.openBlock(),y.createBlock(l_,{key:I.id,point:I,markers:C,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(T=>E(I,C),["stop","prevent"])},null,8,["point","markers","imgZoom","imgScale","wrapScale","onClick"]))),128)):y.createCommentVNode("",!0)]),_:1},8,["url"])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-4f491d69"]]),E_="data:image/png;base64,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",x_="data:image/png;base64,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",w_="data:image/png;base64,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",S_={class:"vsleem-map-dragger"},M_=["src"],T_=["src"],b_=Pn(y.defineComponent({name:"MapDragger",__name:"MapDragger",props:{min:{},max:{},size:{}},emits:["collapse","dragger"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(!0),l=y.ref();function h(I){y.unref(a)!=I&&u()}function u(){const{min:I,max:C}=s,T=y.unref(a)?C:I;a.value=!y.unref(a),r("collapse",y.unref(a)),r("dragger",T)}function d(I){const{size:C}=s;l.value={x:I.pageX,y:I.pageY,size:C}}function p(I){if(y.unref(l)){const{min:C=0,max:T=0}=s,{x:U=0,size:N=0}=y.unref(l)||{};let B=Math.min(Math.max(N-(I.pageX-U),C),T);r("dragger",B)}}function m(){l.value=void 0}function _(I){d(I),document.addEventListener("mousemove",E),document.addEventListener("mouseup",S)}function E(I){p(I)}function S(){m(),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S)}function w(I){d(I.touches[0]),document.addEventListener("touchmove",v),document.addEventListener("touchend",g)}function v(I){p(I.touches[0])}function g(){m(),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",g)}return t({collapse:h}),(I,C)=>(y.openBlock(),y.createElementBlock("div",S_,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:u},[y.createElementVNode("img",{src:a.value?y.unref(E_):y.unref(x_)},null,8,M_)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:_,onTouchstart:w},[y.createElementVNode("img",{src:y.unref(w_)},null,8,T_)],32)]))}}),[["__scopeId","data-v-f432df8d"]]);function A_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mr={exports:{}};/* @preserve
1
+ (function(Ce,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue"),require("@vsleem-realsee-viewer/shared")):typeof define=="function"&&define.amd?define(["exports","vue","@vsleem-realsee-viewer/shared"],y):(Ce=typeof globalThis<"u"?globalThis:Ce||self,y(Ce.RealseePlugin={},Ce.Vue,Ce.VSLeemShared))})(this,(function(Ce,y,xt){"use strict";const $g="data:image/png;base64,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",t_="data:image/png;base64,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",Fh={...xt.APP_SETTING,obsType:"hs"},zh=["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],el={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:zh,pathPin:$g,pathRedPin:t_},Hh={viewMode:1,navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,defaultTransition:{speed:900,rotation:!0},moveInertia:!1,moveThresh:0,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},nl=[{url:"https://t{s}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"],attribution:"© 天地图 GS(2022)3124号"}},{url:"https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk=99d9995c80e5ae67e043d659b748eb4b",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],Vh={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},go={showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,minSize:200,maxSize:500,size:200,yaw:0,tileLayers:nl,rotation:!0},Gh={},_o={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1,rotation:{slider:!0,play:!0,backward:!1,forward:!1}},Wh={appSetting:Fh,realseeSetting:el,playbar:_o,map:go,immediate:!0},{cloneDeep:Zh,deepMergeProps:e_,getDiffProps:n_}=xt.utils;function i_(n,t,e,s,r,a){const l=y.ref(Zh(go)),h=y.computed(()=>({...l.value,radarAngle:d.value})),u=y.computed(()=>{const{minSize:M=0,size:k=200}=y.unref(h)||{},Z=k>M?1:.6;return{width:`${k}px`,height:`${k}px`,opacity:Z}}),d=y.computed(()=>{const{currentPoint:M}=t.value||{},k=l.value?.radarYaw||0,Z=M?.point.yaw||0;return xt.Point.toDegrees(Z+k)}),p=y.computed(()=>{const{dataSource:M,coordinateTree:k,mappedCoordinateTree:Z,currentSpace:J,currentModel:V,currentRecord:$,currentPoint:K,currentMarker:ut,currentPointMarkers:G}=t.value||{};return{dataSource:M,coordinateTree:k,mappedCoordinateTree:Z,currentSpace:J,currentModel:V,currentRecord:$,currentPoint:K,currentPointMarkers:G,currentMarker:ut,state:h.value}});y.watch(()=>Zh(n.value?.map),m,{immediate:!0,deep:!0}),y.watch(()=>d.value,N);function m(M,k){const Z=n_(M,k);E(Z)}function _(){return h.value}function E(M){M&&e_(l.value,M)}function w(M){y.unref(e)?.collapse(M)}function S(M){E({size:M})}function v(M){E({radarYaw:M})}function g(M){E({radarHFov:M})}function R(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function P(){try{return E({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{E({showMarker:!0})}}function T(){a("ready")}function U(M){a("collapse",M)}function B(M){E({size:M}),a("dragger")}function N(M){a("angle-updated",M)}async function z(M,k){await h.value?.onPointChange?.(M,k),k?.length&&t.value?.selectMarker(k[0]),t.value?.selectPoint(M),a("select-point",M,k)}return{getProps:h,getSize:u,getBindValue:p,mapAction:{getState:_,setState:E,setSize:S,setCollapse:w,setRadarYaw:v,setRadarHFov:g,needUpdate:R,domElement:P},handleReady:T,handleDragger:B,handleCollapse:U,handleAngleUpdated:N,handleSelectPoint:z}}const s_=["width","height","href"],r_=["x"],o_={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},a_=y.defineComponent({name:"MapCadMarker",__name:"MapCadMarker",props:{point:{},markers:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.ref(30),s=y.ref(30),r=y.computed(()=>t.markers?.sort((p,m)=>p.sort-m.sort)),a=y.computed(()=>y.unref(r)?.[0]),l=y.computed(()=>y.unref(r)?.length||0),h=y.computed(()=>{const{x:p=0,y:m=0}=t.point.point||{},{imgScale:_=0}=t;return{x:p*_,y:m*_}}),u=y.computed(()=>{const p=Math.min((t.imgZoom-1)/10*3+1,2),m=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*p*m}),d=y.computed(()=>{const{x:p=0,y:m=0}=y.unref(h),_=p-y.unref(u)*y.unref(e)/2,E=m-y.unref(u)*y.unref(s);return{transform:`translate(${_}px,${E}px) scale(${u.value})`}});return(p,m)=>a.value?(y.openBlock(),y.createElementBlock("g",{key:0,style:y.normalizeStyle(d.value),class:"vsleem-map-marker"},[y.createElementVNode("image",{width:e.value,height:s.value,href:a.value?.markerIcon,class:"map-marker-img"},null,8,s_),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",o_,y.toDisplayString(l.value),1)],8,r_)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),Pn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},l_=Pn(a_,[["__scopeId","data-v-79e5c590"]]),c_=["cx","cy","r","stroke-width","fill"],h_=Pn(y.defineComponent({name:"MapCadPoint",__name:"MapCadPoint",props:{point:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:a=0,y:l=0}=t.point.point||{},{imgScale:h=0}=t;return{x:a*h,y:l*h}}),s=y.computed(()=>1/(t.imgZoom||1)),r=y.computed(()=>{const a=Math.min((t.imgZoom-1)/10*3+1,2),l=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*2*a*l});return(a,l)=>a.point?(y.openBlock(),y.createElementBlock("circle",{key:0,cx:e.value.x,cy:e.value.y,r:r.value,"stroke-width":2*s.value,stroke:"transparent","vector-effect":"non-scaling-stroke",fill:a.point.color||"#5bb36f","fill-opacity":.8,class:"vsleem-map-point"},null,8,c_)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),u_=["d"],d_=y.defineComponent({name:"MapCadRadar",__name:"MapCadRadar",props:{point:{},radarAngle:{},radarHFov:{},imgZoom:{},imgScale:{},wrapScale:{}},setup(n){const t=n,e=y.computed(()=>{const{x:l=0,y:h=0}=t.point?.point||{},{imgScale:u=0}=t;return{x:l*u,y:h*u}}),s=y.computed(()=>{const l=Math.min((t.imgZoom-1)/10*3+1,2),h=Math.max(t.wrapScale*.6,1);return 1/t.imgZoom*l*h}),r=y.computed(()=>{const{radarAngle:l=0}=t,{x:h=0,y:u=0}=y.unref(e);return{transform:`translate(${h}px,${u}px) rotate(${l}deg) scale(${s.value})`}}),a=y.computed(()=>{if(!t.point)return"";const l=18,h=0,u=0,{radarHFov:d=90}=t,p=d/2,m=-p,_=p,E=m*Math.PI/180,w=_*Math.PI/180,S=h+l*Math.cos(E),v=u+l*Math.sin(E),g=h+l*Math.cos(w),R=u+l*Math.sin(w),P=d>180?1:0;return`M ${h} ${u} L ${S} ${v} A ${l} ${l} 0 ${P} 1 ${g} ${R} Z`});return(l,h)=>l.point?(y.openBlock(),y.createElementBlock("g",{key:0,class:"vsleem-map-radar",style:y.normalizeStyle(r.value)},[h[0]||(h[0]=y.createElementVNode("defs",null,[y.createElementVNode("linearGradient",{id:"gradient",x1:"0%",y1:"100%",x2:"100%",y2:"0%"},[y.createElementVNode("stop",{offset:"0%",style:{"stop-color":"#108ee9","stop-opacity":"1"}}),y.createElementVNode("stop",{offset:"100%",style:{"stop-color":"transparent","stop-opacity":"1"}})])],-1)),y.createElementVNode("path",{d:a.value,fill:"url(#gradient)"},null,8,u_)],4)):y.createCommentVNode("",!0)}}),f_=["width","height"],p_=["width","height","href"],m_=1.2,g_=1.05,__=Pn(y.defineComponent({name:"MapCadWrapper",__name:"MapCadWrapper",props:{url:{}},emits:["ready","resize","zoom-updated","screenshot"],setup(n,{expose:t,emit:e}){const s={x:0,y:0,zoom:1},r={x:0,y:0,width:0,height:0,naturalWidth:0,naturalHeight:0,scale:1},a={width:0,height:0},l={min:1,max:50},h=n,u=e,d=y.ref(),p=y.ref(),m=y.ref(),_=y.ref(!1),E=y.ref(!1),w=y.ref({x:0,y:0,zoom:1,pageX:0,pageY:0}),S=y.ref(0),v=y.ref(!1),g=y.ref({...s}),R=y.ref({...r}),P=y.ref(),T=y.ref(),U=y.ref({...a});let B;const N=y.computed(()=>{const{x:C,y:it,zoom:ct}=y.unref(g);return{transform:`translate(${C}px, ${it}px) scale(${ct})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,G),y.onMounted(()=>{G(h.url),Tt()}),y.onBeforeUnmount(()=>{lt()});const z=C=>{C.preventDefault(),C.stopPropagation();const it=y.unref(p)?.getBoundingClientRect();if(!it)return;const ct=C.clientX-it.left,_t=C.clientY-it.top,ht=C.deltaY>0?-1:1;pt(ct,_t,ht,m_)},D=C=>{if(C.button!==0)return;C.preventDefault(),C.stopPropagation(),_.value=!0;const{pageX:it,pageY:ct}=C,{x:_t,y:ht,zoom:Ot}=y.unref(g);w.value={x:_t,y:ht,zoom:Ot,pageX:it,pageY:ct}},M=C=>{if(!_.value)return;C.preventDefault(),C.stopPropagation();const{pageX:it,pageY:ct}=C,{pageX:_t,pageY:ht,x:Ot,y:yt}=w.value;g.value.x=Math.round(Ot+(it-_t)),g.value.y=Math.round(yt+(ct-ht))},k=C=>{_.value&&(C.preventDefault(),C.stopPropagation(),_.value=!1)},Z=C=>{_.value&&k(C)},J=C=>{C.preventDefault(),C.stopPropagation(),Gt()},V=C=>{const it=C.touches;it.length===1?Rt(it[0]):it.length===2&&Y(it[0],it[1])},$=C=>{C.preventDefault(),C.stopPropagation();const it=C.touches;_.value&&it.length===1?st(it[0]):E.value&&it.length===2&&ft(it[0],it[1])},K=C=>{C.touches.length===0?Dt():C.touches.length===1&&Ut(C.touches[0])};function ut(){v.value=!1,g.value={...s},R.value={...r},P.value=void 0,T.value=void 0,U.value={...a}}async function G(C){if(!C)return;ut();const it=new Image;it.crossOrigin="Anonymous",it.src=C,it.onload=()=>{const{naturalWidth:ct,naturalHeight:_t}=it;v.value=!0,R.value.naturalWidth=ct,R.value.naturalHeight=_t,T.value=it,Mt(),u("ready",y.unref(R.value),y.unref(g))},it.onerror=ct=>{console.error("图片加载失败:",ct)}}function Tt(){B=new ResizeObserver(Mt);const C=y.unref(p);C&&B.observe(C)}function lt(){B&&B.disconnect()}function Mt(){if(!y.unref(v))return;const{naturalWidth:C,naturalHeight:it}=y.unref(R),{clientWidth:ct=0,clientHeight:_t=0}=y.unref(p)||{},ht=Math.min(ct/C,_t/it),Ot=C*ht,yt=it*ht,Nt={...y.unref(g)},pe=U.value,ge=pe.width===0&&pe.height===0,O=pe.width!==ct||pe.height!==_t;if(ge){const b=(ct-Ot)/2,Q=(_t-yt)/2;R.value={...R.value,width:Ot,height:yt,scale:ht},g.value.x=b,g.value.y=Q,g.value.zoom=1}else if(O){const b=Nt.x+R.value.width*Nt.zoom/2,Q=Nt.y+R.value.height*Nt.zoom/2,ot=b/pe.width,gt=Q/pe.height,rt=ot*ct,Zt=gt*_t,bt=rt-Ot*Nt.zoom/2,Ht=Zt-yt*Nt.zoom/2;R.value={...R.value,width:Ot,height:yt,scale:ht},g.value.x=Math.round(bt),g.value.y=Math.round(Ht)}U.value={width:ct,height:_t},u("resize",y.unref(R))}function Gt(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:C=0,clientHeight:it=0}=y.unref(p)||{},{width:ct,height:_t}=y.unref(R),ht=(C-ct)/2,Ot=(it-_t)/2;g.value.x=ht,g.value.y=Ot,g.value.zoom=1,U.value={width:C,height:it},u("zoom-updated",y.unref(g))}function pt(C,it,ct,_t){const{x:ht,y:Ot,zoom:yt}=y.unref(g);let Nt=yt*(ct>0?_t:1/_t);Nt=Math.max(l.min,Math.min(l.max,Nt));const pe=(C-ht)/yt,ge=(it-Ot)/yt,O=C-pe*Nt,b=it-ge*Nt;g.value.x=Math.round(O),g.value.y=Math.round(b),g.value.zoom=Nt,u("zoom-updated",y.unref(g))}function Rt(C){_.value=!0;const{pageX:it,pageY:ct}=C,{x:_t,y:ht,zoom:Ot}=y.unref(g);w.value={x:_t,y:ht,zoom:Ot,pageX:it,pageY:ct}}function Y(C,it){E.value=!0,_.value=!1,S.value=zt(C,it)}function st(C){const{pageX:it,pageY:ct}=C,{pageX:_t,pageY:ht,x:Ot,y:yt}=w.value;g.value.x=Math.round(Ot+(it-_t)),g.value.y=Math.round(yt+(ct-ht))}function ft(C,it){const ct=y.unref(p)?.getBoundingClientRect();if(!ct)return;const _t=zt(C,it);if(S.value>0){const ht=(C.clientX+it.clientX)/2-ct.left,Ot=(C.clientY+it.clientY)/2-ct.top,Nt=_t/S.value>1?1:-1;pt(ht,Ot,Nt,g_)}S.value=_t}function Dt(){_.value=!1,E.value=!1,S.value=0}function Ut(C){E.value=!1,_.value=!0;const{pageX:it,pageY:ct}=C,{x:_t,y:ht,zoom:Ot}=y.unref(g);w.value={x:_t,y:ht,zoom:Ot,pageX:it,pageY:ct}}function zt(C,it){const ct=C.clientX-it.clientX,_t=C.clientY-it.clientY;return Math.sqrt(ct*ct+_t*_t)}async function ce(){if(!T.value){console.warn("图片实例未找到");return}const C=d.value;if(!C){console.error("未找到 SVG 元素");return}try{const it=document.createElement("canvas"),ct=it.getContext("2d");if(!ct)throw new Error("无法获取 Canvas 2D 上下文");it.width=T.value.width,it.height=T.value.height,ct.drawImage(T.value,0,0),P.value=it.toDataURL("image/webp",1),await new Promise(yt=>setTimeout(yt,500));const _t=new XMLSerializer().serializeToString(C),ht=new Blob([_t],{type:"image/svg+xml;charset=utf-8"}),Ot=URL.createObjectURL(ht);return await at(Ot)}catch(it){console.error("导出 SVG 到 PNG 失败:",it)}finally{P.value=""}}function at(C){return new Promise((it,ct)=>{const _t=new Image;_t.src=C,_t.onload=()=>{try{URL.revokeObjectURL(C);const ht=document.createElement("canvas"),Ot=ht.getContext("2d");if(!Ot)throw new Error("无法获取 Canvas 2D 上下文");const yt=y.unref(p),{width:Nt,height:pe}=yt?.getBoundingClientRect()||{width:800,height:600},{zoom:ge=1,x:O=0,y:b=0}=y.unref(g);ht.width=Nt,ht.height=pe,Ot.setTransform(ge,0,0,ge,O,b),Ot.drawImage(_t,0,0),it(ht)}catch(ht){ct(ht)}},_t.onerror=()=>{URL.revokeObjectURL(C),ct(new Error("SVG 图像加载失败"))}})}return t({domElement:ce}),(C,it)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:J,onWheel:z,onMousedown:D,onMousemove:M,onMouseup:k,onMouseleave:Z,onTouchstart:V,onTouchmove:$,onTouchend:K},[y.createElementVNode("div",{ref_key:"transformWrapperRef",ref:m,style:y.normalizeStyle(N.value)},[(y.openBlock(),y.createElementBlock("svg",{id:"svgElement",ref_key:"svgRef",ref:d,width:R.value?.width,height:R.value?.height,overflow:"hidden",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[v.value?(y.openBlock(),y.createElementBlock("image",{key:0,x:0,y:0,width:R.value?.width,height:R.value?.height,href:P.value||C.url,crossOrigin:"anonymous"},null,8,p_)):y.createCommentVNode("",!0),y.renderSlot(C.$slots,"default",{},void 0,!0)],8,f_))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),v_={class:"vsleem-map-cad"},y_=Pn(y.defineComponent({name:"MapCad",__name:"MapCad",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(1),h=y.ref(1),u=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));function d(v,g){p(v),m(g),r("ready")}function p(v){h.value=v.scale??1}function m(v){l.value=v.zoom??1}async function _(v){r("select-point",v)}function E(v,g){r("select-point",v,g)}function w(){}async function S(){return await a.value?.domElement()}return t({needUpdate:w,domElement:S}),(v,g)=>(y.openBlock(),y.createElementBlock("div",v_,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(__,{key:0,url:v.store?.currentModel?.modelValue,ref_key:"wrapperElRef",ref:a,onReady:d,onResize:p,onZoomUpdated:m},{default:y.withCtx(()=>[v.map?.showPoint?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:0},y.renderList(v.store.dataSource,([R,P])=>(y.openBlock(),y.createElementBlock("g",{key:R},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(P.trackPoints,([T,U])=>(y.openBlock(),y.createBlock(h_,{key:T,point:U,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,stroke:v.store.currentPoint?.id==U.id?"#108ee9":"transparent",onClick:y.withModifiers(B=>_(U),["stop","prevent"])},null,8,["point","imgZoom","imgScale","wrapScale","stroke","onClick"]))),128))]))),128)):y.createCommentVNode("",!0),v.map?.showRadar?(y.openBlock(),y.createBlock(d_,{key:1,point:v.store.currentPoint,radarAngle:v.map.radarAngle,radarHFov:v.map.radarHFov,imgZoom:l.value,imgScale:h.value,wrapScale:u.value},null,8,["point","radarAngle","radarHFov","imgZoom","imgScale","wrapScale"])):y.createCommentVNode("",!0),v.map?.showMarker?(y.openBlock(!0),y.createElementBlock(y.Fragment,{key:2},y.renderList(v.store.groupedMarkers,([R,P])=>(y.openBlock(),y.createBlock(l_,{key:R.id,point:R,markers:P,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(T=>E(R,P),["stop","prevent"])},null,8,["point","markers","imgZoom","imgScale","wrapScale","onClick"]))),128)):y.createCommentVNode("",!0)]),_:1},8,["url"])):y.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-4f491d69"]]),E_="data:image/png;base64,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",x_="data:image/png;base64,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",w_="data:image/png;base64,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",S_={class:"vsleem-map-dragger"},M_=["src"],T_=["src"],b_=Pn(y.defineComponent({name:"MapDragger",__name:"MapDragger",props:{min:{},max:{},size:{}},emits:["collapse","dragger"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(!0),l=y.ref();function h(R){y.unref(a)!=R&&u()}function u(){const{min:R,max:P}=s,T=y.unref(a)?P:R;a.value=!y.unref(a),r("collapse",y.unref(a)),r("dragger",T)}function d(R){const{size:P}=s;l.value={x:R.pageX,y:R.pageY,size:P}}function p(R){if(y.unref(l)){const{min:P=0,max:T=0}=s,{x:U=0,size:B=0}=y.unref(l)||{};let N=Math.min(Math.max(B-(R.pageX-U),P),T);r("dragger",N)}}function m(){l.value=void 0}function _(R){d(R),document.addEventListener("mousemove",E),document.addEventListener("mouseup",w)}function E(R){p(R)}function w(){m(),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",w)}function S(R){d(R.touches[0]),document.addEventListener("touchmove",v),document.addEventListener("touchend",g)}function v(R){p(R.touches[0])}function g(){m(),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",g)}return t({collapse:h}),(R,P)=>(y.openBlock(),y.createElementBlock("div",S_,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:u},[y.createElementVNode("img",{src:a.value?y.unref(E_):y.unref(x_)},null,8,M_)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:_,onTouchstart:S},[y.createElementVNode("img",{src:y.unref(w_)},null,8,T_)],32)]))}}),[["__scopeId","data-v-f432df8d"]]);function A_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var mr={exports:{}};/* @preserve
2
2
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
3
3
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
4
- */var C_=mr.exports,Xh;function P_(){return Xh||(Xh=1,(function(n,t){(function(e,s){s(t)})(C_,(function(e){var s="1.9.4";function r(i){var o,c,f,x;for(c=1,f=arguments.length;c<f;c++){x=arguments[c];for(o in x)i[o]=x[o]}return i}var a=Object.create||(function(){function i(){}return function(o){return i.prototype=o,new i}})();function l(i,o){var c=Array.prototype.slice;if(i.bind)return i.bind.apply(i,c.call(arguments,1));var f=c.call(arguments,2);return function(){return i.apply(o,f.length?f.concat(c.call(arguments)):arguments)}}var h=0;function u(i){return"_leaflet_id"in i||(i._leaflet_id=++h),i._leaflet_id}function d(i,o,c){var f,x,b,F;return F=function(){f=!1,x&&(b.apply(c,x),x=!1)},b=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(F,o),f=!0)},b}function p(i,o,c){var f=o[1],x=o[0],b=f-x;return i===f&&c?i:((i-x)%b+b)%b+x}function m(){return!1}function _(i,o){if(o===!1)return i;var c=Math.pow(10,o===void 0?6:o);return Math.round(i*c)/c}function E(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function S(i){return E(i).split(/\s+/)}function w(i,o){Object.prototype.hasOwnProperty.call(i,"options")||(i.options=i.options?a(i.options):{});for(var c in o)i.options[c]=o[c];return i.options}function v(i,o,c){var f=[];for(var x in i)f.push(encodeURIComponent(c?x.toUpperCase():x)+"="+encodeURIComponent(i[x]));return(!o||o.indexOf("?")===-1?"?":"&")+f.join("&")}var g=/\{ *([\w_ -]+) *\}/g;function I(i,o){return i.replace(g,function(c,f){var x=o[f];if(x===void 0)throw new Error("No value provided for variable "+c);return typeof x=="function"&&(x=x(o)),x})}var C=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"};function T(i,o){for(var c=0;c<i.length;c++)if(i[c]===o)return c;return-1}var U="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function N(i){return window["webkit"+i]||window["moz"+i]||window["ms"+i]}var B=0;function z(i){var o=+new Date,c=Math.max(0,16-(o-B));return B=o+c,window.setTimeout(i,c)}var D=window.requestAnimationFrame||N("RequestAnimationFrame")||z,M=window.cancelAnimationFrame||N("CancelAnimationFrame")||N("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function k(i,o,c){if(c&&D===z)i.call(o);else return D.call(window,l(i,o))}function Z(i){i&&M.call(window,i)}var J={__proto__:null,extend:r,create:a,bind:l,get lastId(){return h},stamp:u,throttle:d,wrapNum:p,falseFn:m,formatNum:_,trim:E,splitWords:S,setOptions:w,getParamString:v,template:I,isArray:C,indexOf:T,emptyImageUrl:U,requestFn:D,cancelFn:M,requestAnimFrame:k,cancelAnimFrame:Z};function V(){}V.extend=function(i){var o=function(){w(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=o.__super__=this.prototype,f=a(c);f.constructor=o,o.prototype=f;for(var x in this)Object.prototype.hasOwnProperty.call(this,x)&&x!=="prototype"&&x!=="__super__"&&(o[x]=this[x]);return i.statics&&r(o,i.statics),i.includes&&($(i.includes),r.apply(null,[f].concat(i.includes))),r(f,i),delete f.statics,delete f.includes,f.options&&(f.options=c.options?a(c.options):{},r(f.options,i.options)),f._initHooks=[],f.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var b=0,F=f._initHooks.length;b<F;b++)f._initHooks[b].call(this)}},o},V.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},V.mergeOptions=function(i){return r(this.prototype.options,i),this},V.addInitHook=function(i){var o=Array.prototype.slice.call(arguments,1),c=typeof i=="function"?i:function(){this[i].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function $(i){if(!(typeof L>"u"||!L||!L.Mixin)){i=C(i)?i:[i];for(var o=0;o<i.length;o++)i[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var K={on:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o);else{i=S(i);for(var x=0,b=i.length;x<b;x++)this._on(i[x],o,c)}return this},off:function(i,o,c){if(!arguments.length)delete this._events;else if(typeof i=="object")for(var f in i)this._off(f,i[f],o);else{i=S(i);for(var x=arguments.length===1,b=0,F=i.length;b<F;b++)x?this._off(i[b]):this._off(i[b],o,c)}return this},_on:function(i,o,c,f){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(i,o,c)===!1){c===this&&(c=void 0);var x={fn:o,ctx:c};f&&(x.once=!0),this._events=this._events||{},this._events[i]=this._events[i]||[],this._events[i].push(x)}},_off:function(i,o,c){var f,x,b;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,b=f.length;x<b;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var F=this._listens(i,o,c);if(F!==!1){var Q=f[F];this._firingCount&&(Q.fn=m,this._events[i]=f=f.slice()),f.splice(F,1)}}},fire:function(i,o,c){if(!this.listens(i,c))return this;var f=r({},o,{type:i,target:this,sourceTarget:o&&o.sourceTarget||this});if(this._events){var x=this._events[i];if(x){this._firingCount=this._firingCount+1||1;for(var b=0,F=x.length;b<F;b++){var Q=x[b],nt=Q.fn;Q.once&&this.off(i,nt,Q.ctx),nt.call(Q.ctx||this,f)}this._firingCount--}}return c&&this._propagateEvent(f),this},listens:function(i,o,c,f){typeof i!="string"&&console.warn('"string" type argument expected');var x=o;typeof o!="function"&&(f=!!o,x=void 0,c=void 0);var b=this._events&&this._events[i];if(b&&b.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var F in this._eventParents)if(this._eventParents[F].listens(i,o,c,f))return!0}return!1},_listens:function(i,o,c){if(!this._events)return!1;var f=this._events[i]||[];if(!o)return!!f.length;c===this&&(c=void 0);for(var x=0,b=f.length;x<b;x++)if(f[x].fn===o&&f[x].ctx===c)return x;return!1},once:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o,!0);else{i=S(i);for(var x=0,b=i.length;x<b;x++)this._on(i[x],o,c,!0)}return this},addEventParent:function(i){return this._eventParents=this._eventParents||{},this._eventParents[u(i)]=i,this},removeEventParent:function(i){return this._eventParents&&delete this._eventParents[u(i)],this},_propagateEvent:function(i){for(var o in this._eventParents)this._eventParents[o].fire(i.type,r({layer:i.target,propagatedFrom:i.target},i),!0)}};K.addEventListener=K.on,K.removeEventListener=K.clearAllEventListeners=K.off,K.addOneTimeEventListener=K.once,K.fireEvent=K.fire,K.hasEventListeners=K.listens;var ut=V.extend(K);function G(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var Tt=Math.trunc||function(i){return i>0?Math.floor(i):Math.ceil(i)};G.prototype={clone:function(){return new G(this.x,this.y)},add:function(i){return this.clone()._add(ot(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(ot(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new G(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new G(this.x/i.x,this.y/i.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Tt(this.x),this.y=Tt(this.y),this},distanceTo:function(i){i=ot(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=ot(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=ot(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function ot(i,o,c){return i instanceof G?i:C(i)?new G(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new G(i.x,i.y):new G(i,o,c)}function St(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}St.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof G||typeof i[0]=="number"||"x"in i)o=c=ot(i);else if(i=Gt(i),o=i.min,c=i.max,!o||!c)return this;return!this.min&&!this.max?(this.min=o.clone(),this.max=c.clone()):(this.min.x=Math.min(o.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(o.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(i){return ot((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return ot(this.min.x,this.max.y)},getTopRight:function(){return ot(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(i){var o,c;return typeof i[0]=="number"||i instanceof G?i=ot(i):i=Gt(i),i instanceof St?(o=i.min,c=i.max):o=c=i,o.x>=this.min.x&&c.x<=this.max.x&&o.y>=this.min.y&&c.y<=this.max.y},intersects:function(i){i=Gt(i);var o=this.min,c=this.max,f=i.min,x=i.max,b=x.x>=o.x&&f.x<=c.x,F=x.y>=o.y&&f.y<=c.y;return b&&F},overlaps:function(i){i=Gt(i);var o=this.min,c=this.max,f=i.min,x=i.max,b=x.x>o.x&&f.x<c.x,F=x.y>o.y&&f.y<c.y;return b&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(i){var o=this.min,c=this.max,f=Math.abs(o.x-c.x)*i,x=Math.abs(o.y-c.y)*i;return Gt(ot(o.x-f,o.y-x),ot(c.x+f,c.y+x))},equals:function(i){return i?(i=Gt(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function Gt(i,o){return!i||i instanceof St?i:new St(i,o)}function pt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}pt.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof Y)f=i,x=i;else if(i instanceof pt){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(it(i)||Lt(i)):this;return!o&&!c?(this._southWest=new Y(f.lat,f.lng),this._northEast=new Y(x.lat,x.lng)):(o.lat=Math.min(f.lat,o.lat),o.lng=Math.min(f.lng,o.lng),c.lat=Math.max(x.lat,c.lat),c.lng=Math.max(x.lng,c.lng)),this},pad:function(i){var o=this._southWest,c=this._northEast,f=Math.abs(o.lat-c.lat)*i,x=Math.abs(o.lng-c.lng)*i;return new pt(new Y(o.lat-f,o.lng-x),new Y(c.lat+f,c.lng+x))},getCenter:function(){return new Y((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Y(this.getNorth(),this.getWest())},getSouthEast:function(){return new Y(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(i){typeof i[0]=="number"||i instanceof Y||"lat"in i?i=it(i):i=Lt(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof pt?(f=i.getSouthWest(),x=i.getNorthEast()):f=x=i,f.lat>=o.lat&&x.lat<=c.lat&&f.lng>=o.lng&&x.lng<=c.lng},intersects:function(i){i=Lt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),b=x.lat>=o.lat&&f.lat<=c.lat,F=x.lng>=o.lng&&f.lng<=c.lng;return b&&F},overlaps:function(i){i=Lt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),b=x.lat>o.lat&&f.lat<c.lat,F=x.lng>o.lng&&f.lng<c.lng;return b&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Lt(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Lt(i,o){return i instanceof pt?i:new pt(i,o)}function Y(i,o,c){if(isNaN(i)||isNaN(o))throw new Error("Invalid LatLng object: ("+i+", "+o+")");this.lat=+i,this.lng=+o,c!==void 0&&(this.alt=+c)}Y.prototype={equals:function(i,o){if(!i)return!1;i=it(i);var c=Math.max(Math.abs(this.lat-i.lat),Math.abs(this.lng-i.lng));return c<=(o===void 0?1e-9:o)},toString:function(i){return"LatLng("+_(this.lat,i)+", "+_(this.lng,i)+")"},distanceTo:function(i){return kt.distance(this,it(i))},wrap:function(){return kt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Lt([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new Y(this.lat,this.lng,this.alt)}};function it(i,o,c){return i instanceof Y?i:C(i)&&typeof i[0]!="object"?i.length===3?new Y(i[0],i[1],i[2]):i.length===2?new Y(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new Y(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new Y(i,o,c)}var ft={latLngToPoint:function(i,o){var c=this.projection.project(i),f=this.scale(o);return this.transformation._transform(c,f)},pointToLatLng:function(i,o){var c=this.scale(o),f=this.transformation.untransform(i,c);return this.projection.unproject(f)},project:function(i){return this.projection.project(i)},unproject:function(i){return this.projection.unproject(i)},scale:function(i){return 256*Math.pow(2,i)},zoom:function(i){return Math.log(i/256)/Math.LN2},getProjectedBounds:function(i){if(this.infinite)return null;var o=this.projection.bounds,c=this.scale(i),f=this.transformation.transform(o.min,c),x=this.transformation.transform(o.max,c);return new St(f,x)},infinite:!1,wrapLatLng:function(i){var o=this.wrapLng?p(i.lng,this.wrapLng,!0):i.lng,c=this.wrapLat?p(i.lat,this.wrapLat,!0):i.lat,f=i.alt;return new Y(c,o,f)},wrapLatLngBounds:function(i){var o=i.getCenter(),c=this.wrapLatLng(o),f=o.lat-c.lat,x=o.lng-c.lng;if(f===0&&x===0)return i;var b=i.getSouthWest(),F=i.getNorthEast(),Q=new Y(b.lat-f,b.lng-x),nt=new Y(F.lat-f,F.lng-x);return new pt(Q,nt)}},kt=r({},ft,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,b=Math.sin((o.lat-i.lat)*c/2),F=Math.sin((o.lng-i.lng)*c/2),Q=b*b+Math.cos(f)*Math.cos(x)*F*F,nt=2*Math.atan2(Math.sqrt(Q),Math.sqrt(1-Q));return this.R*nt}}),Ot=6378137,zt={R:Ot,MAX_LATITUDE:85.0511287798,project:function(i){var o=Math.PI/180,c=this.MAX_LATITUDE,f=Math.max(Math.min(c,i.lat),-c),x=Math.sin(f*o);return new G(this.R*i.lng*o,this.R*Math.log((1+x)/(1-x))/2)},unproject:function(i){var o=180/Math.PI;return new Y((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=Ot*Math.PI;return new St([-i,-i],[i,i])})()};function ct(i,o,c,f){if(C(i)){this._a=i[0],this._b=i[1],this._c=i[2],this._d=i[3];return}this._a=i,this._b=o,this._c=c,this._d=f}ct.prototype={transform:function(i,o){return this._transform(i.clone(),o)},_transform:function(i,o){return o=o||1,i.x=o*(this._a*i.x+this._b),i.y=o*(this._c*i.y+this._d),i},untransform:function(i,o){return o=o||1,new G((i.x/o-this._b)/this._a,(i.y/o-this._d)/this._c)}};function ht(i,o,c,f){return new ct(i,o,c,f)}var P=r({},kt,{code:"EPSG:3857",projection:zt,transformation:(function(){var i=.5/(Math.PI*zt.R);return ht(i,.5,-i,.5)})()}),lt=r({},P,{code:"EPSG:900913"});function at(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function vt(i,o){var c="",f,x,b,F,Q,nt;for(f=0,b=i.length;f<b;f++){for(Q=i[f],x=0,F=Q.length;x<F;x++)nt=Q[x],c+=(x?"L":"M")+nt.x+" "+nt.y;c+=o?Qt.svg?"z":"x":""}return c||"M0 0"}var gt=document.documentElement.style,Bt="ActiveXObject"in window,bt=Bt&&!document.addEventListener,Zt="msLaunchUri"in navigator&&!("documentMode"in document),ve=An("webkit"),Ae=An("android"),O=An("android 2")||An("android 3"),A=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),j=Ae&&An("Google")&&A<537&&!("AudioNode"in window),rt=!!window.opera,_t=!Zt&&An("chrome"),st=An("gecko")&&!ve&&!rt&&!Bt,Xt=!_t&&An("safari"),At=An("phantom"),Ht="OTransition"in gt,Yt=navigator.platform.indexOf("Win")===0,xt=Bt&&"transition"in gt,It="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!O,se="MozPerspective"in gt,qt=!window.L_DISABLE_3D&&(xt||It||se)&&!Ht&&!At,Pt=typeof orientation<"u"||An("mobile"),ce=Pt&&ve,H=Pt&&It,wt=!window.PointerEvent&&window.MSPointerEvent,Ct=!!(window.PointerEvent||wt),Ft="ontouchstart"in window||!!window.TouchEvent,yt=!window.L_NO_TOUCH&&(Ft||Ct),dt=Pt&&rt,Wt=Pt&&st,le=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,De=(function(){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",m,o),window.removeEventListener("testPassiveEventSupport",m,o)}catch{}return i})(),Me=(function(){return!!document.createElement("canvas").getContext})(),bn=!!(document.createElementNS&&at("svg").createSVGRect),On=!!bn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ba=!bn&&(function(){try{var i=document.createElement("div");i.innerHTML='<v:shape adj="1"/>';var o=i.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch{return!1}})(),wi=navigator.platform.indexOf("Mac")===0,io=navigator.platform.indexOf("Linux")===0;function An(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Qt={ie:Bt,ielt9:bt,edge:Zt,webkit:ve,android:Ae,android23:O,androidStock:j,opera:rt,chrome:_t,gecko:st,safari:Xt,phantom:At,opera12:Ht,win:Yt,ie3d:xt,webkit3d:It,gecko3d:se,any3d:qt,mobile:Pt,mobileWebkit:ce,mobileWebkit3d:H,msPointer:wt,pointer:Ct,touch:yt,touchNative:Ft,mobileOpera:dt,mobileGecko:Wt,retina:le,passiveEvents:De,canvas:Me,svg:bn,vml:Ba,inlineSvg:On,mac:wi,linux:io},_s=Qt.msPointer?"MSPointerDown":"pointerdown",so=Qt.msPointer?"MSPointerMove":"pointermove",vs=Qt.msPointer?"MSPointerUp":"pointerup",ro=Qt.msPointer?"MSPointerCancel":"pointercancel",lr={touchstart:_s,touchmove:so,touchend:vs,touchcancel:ro},Fa={touchstart:X,touchmove:tt,touchend:tt,touchcancel:tt},Ji={},za=!1;function ph(i,o,c){return o==="touchstart"&&et(),Fa[o]?(c=Fa[o].bind(this,c),i.addEventListener(lr[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function mh(i,o,c){if(!lr[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(lr[o],c,!1)}function gh(i){Ji[i.pointerId]=i}function R(i){Ji[i.pointerId]&&(Ji[i.pointerId]=i)}function W(i){delete Ji[i.pointerId]}function et(){za||(document.addEventListener(_s,gh,!0),document.addEventListener(so,R,!0),document.addEventListener(vs,W,!0),document.addEventListener(ro,W,!0),za=!0)}function tt(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Ji)o.touches.push(Ji[c]);o.changedTouches=[o],i(o)}}function X(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&nn(o),tt(i,o)}function Et(i){var o={},c,f;for(f in i)c=i[f],o[f]=c&&c.bind?c.bind(i):c;return i=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var Dt=200;function Vt(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(b){if(b.detail!==1){f=b.detail;return}if(!(b.pointerType==="mouse"||b.sourceCapabilities&&!b.sourceCapabilities.firesTouchEvents)){var F=Em(b);if(!(F.some(function(nt){return nt instanceof HTMLLabelElement&&nt.attributes.for})&&!F.some(function(nt){return nt instanceof HTMLInputElement||nt instanceof HTMLSelectElement}))){var Q=Date.now();Q-c<=Dt?(f++,f===2&&o(Et(b))):f=1,c=Q}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function Nt(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var ne=en(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ie=en(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Kt=ie==="webkitTransition"||ie==="OTransition"?ie+"End":"transitionend";function fe(i){return typeof i=="string"?document.getElementById(i):i}function Ee(i,o){var c=i.style[o]||i.currentStyle&&i.currentStyle[o];if((!c||c==="auto")&&document.defaultView){var f=document.defaultView.getComputedStyle(i,null);c=f?f[o]:null}return c==="auto"?null:c}function $t(i,o,c){var f=document.createElement(i);return f.className=o||"",c&&c.appendChild(f),f}function re(i){var o=i.parentNode;o&&o.removeChild(i)}function Te(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function jt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Le(i){var o=i.parentNode;o&&o.firstChild!==i&&o.insertBefore(i,o.firstChild)}function ge(i,o){if(i.classList!==void 0)return i.classList.contains(o);var c=si(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function ee(i,o){if(i.classList!==void 0)for(var c=S(o),f=0,x=c.length;f<x;f++)i.classList.add(c[f]);else if(!ge(i,o)){var b=si(i);tn(i,(b?b+" ":"")+o)}}function ke(i,o){i.classList!==void 0?i.classList.remove(o):tn(i,E((" "+si(i)+" ").replace(" "+o+" "," ")))}function tn(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function si(i){return i.correspondingElement&&(i=i.correspondingElement),i.className.baseVal===void 0?i.className:i.className.baseVal}function _e(i,o){"opacity"in i.style?i.style.opacity=o:"filter"in i.style&&_n(i,o)}function _n(i,o){var c=!1,f="DXImageTransform.Microsoft.Alpha";try{c=i.filters.item(f)}catch{if(o===1)return}o=Math.round(o*100),c?(c.Enabled=o!==100,c.Opacity=o):i.style.filter+=" progid:"+f+"(opacity="+o+")"}function en(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Fe(i,o,c){var f=o||new G(0,0);i.style[ne]=(Qt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function ye(i,o){i._leaflet_pos=o,Qt.any3d?Fe(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Yn(i){return i._leaflet_pos||new G(0,0)}var Cn,oo,_h;if("onselectstart"in document)Cn=function(){he(window,"selectstart",nn)},oo=function(){Ue(window,"selectstart",nn)};else{var ao=en(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Cn=function(){if(ao){var i=document.documentElement.style;_h=i[ao],i[ao]="none"}},oo=function(){ao&&(document.documentElement.style[ao]=_h,_h=void 0)}}function vh(){he(window,"dragstart",nn)}function yh(){Ue(window,"dragstart",nn)}var Ha,Eh;function xh(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Va(),Ha=i,Eh=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Va))}function Va(){Ha&&(Ha.style.outlineStyle=Eh,Ha=void 0,Eh=void 0,Ue(window,"keydown",Va))}function vm(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function wh(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var sT={__proto__:null,TRANSFORM:ne,TRANSITION:ie,TRANSITION_END:Kt,get:fe,getStyle:Ee,create:$t,remove:re,empty:Te,toFront:jt,toBack:Le,hasClass:ge,addClass:ee,removeClass:ke,setClass:tn,getClass:si,setOpacity:_e,testProp:en,setTransform:Fe,setPosition:ye,getPosition:Yn,get disableTextSelection(){return Cn},get enableTextSelection(){return oo},disableImageDrag:vh,enableImageDrag:yh,preventOutline:xh,restoreOutline:Va,getSizedParentNode:vm,getScale:wh};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)Mh(i,x,o[x],c);else{o=S(o);for(var b=0,F=o.length;b<F;b++)Mh(i,o[b],c,f)}return this}var ri="_leaflet_events";function Ue(i,o,c,f){if(arguments.length===1)ym(i),delete i[ri];else if(o&&typeof o=="object")for(var x in o)Th(i,x,o[x],c);else if(o=S(o),arguments.length===2)ym(i,function(Q){return T(o,Q)!==-1});else for(var b=0,F=o.length;b<F;b++)Th(i,o[b],c,f);return this}function ym(i,o){for(var c in i[ri]){var f=c.split(/\d/)[0];(!o||o(f))&&Th(i,f,null,null,c)}}var Sh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Mh(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ri]&&i[ri][x])return this;var b=function(Q){return c.call(f||i,Q||window.event)},F=b;!Qt.touchNative&&Qt.pointer&&o.indexOf("touch")===0?b=ph(i,o,b):Qt.touch&&o==="dblclick"?b=Vt(i,b):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(Sh[o]||o,b,Qt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(b=function(Q){Q=Q||window.event,Ah(i,Q)&&F(Q)},i.addEventListener(Sh[o],b,!1)):i.addEventListener(o,F,!1):i.attachEvent("on"+o,b),i[ri]=i[ri]||{},i[ri][x]=b}function Th(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var b=i[ri]&&i[ri][x];if(!b)return this;!Qt.touchNative&&Qt.pointer&&o.indexOf("touch")===0?mh(i,o,b):Qt.touch&&o==="dblclick"?Nt(i,b):"removeEventListener"in i?i.removeEventListener(Sh[o]||o,b,!1):i.detachEvent("on"+o,b),i[ri][x]=null}function ys(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function bh(i){return Mh(i,"wheel",ys),this}function lo(i){return he(i,"mousedown touchstart dblclick contextmenu",ys),i._leaflet_disable_click=!0,this}function nn(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function Es(i){return nn(i),ys(i),this}function Em(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function xm(i,o){if(!o)return new G(i.clientX,i.clientY);var c=wh(o),f=c.boundingClientRect;return new G((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var rT=Qt.linux&&Qt.chrome?window.devicePixelRatio:Qt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function wm(i){return Qt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/rT:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function Ah(i,o){var c=o.relatedTarget;if(!c)return!0;try{for(;c&&c!==i;)c=c.parentNode}catch{return!1}return c!==i}var oT={__proto__:null,on:he,off:Ue,stopPropagation:ys,disableScrollPropagation:bh,disableClickPropagation:lo,preventDefault:nn,stop:Es,getPropagationPath:Em,getMousePosition:xm,getWheelDelta:wm,isExternalTarget:Ah,addListener:he,removeListener:Ue},Sm=ut.extend({run:function(i,o,c,f){this.stop(),this._el=i,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(f||.5,.2),this._startPos=Yn(i),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(i){var o=+new Date-this._startTime,c=this._duration*1e3;o<c?this._runFrame(this._easeOut(o/c),i):(this._runFrame(1),this._complete())},_runFrame:function(i,o){var c=this._startPos.add(this._offset.multiplyBy(i));o&&c._round(),ye(this._el,c),this.fire("step")},_complete:function(){Z(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),xe=ut.extend({options:{crs:P,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(i,o){o=w(this,o),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(i),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),o.maxBounds&&this.setMaxBounds(o.maxBounds),o.zoom!==void 0&&(this._zoom=this._limitZoom(o.zoom)),o.center&&o.zoom!==void 0&&this.setView(it(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ie&&Qt.any3d&&!Qt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),he(this._proxy,Kt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(i,o,c){if(o=o===void 0?this._zoom:this._limitZoom(o),i=this._limitCenter(it(i),o,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=r({animate:c.animate},c.zoom),c.pan=r({animate:c.animate,duration:c.duration},c.pan));var f=this._zoom!==o?this._tryAnimatedZoom&&this._tryAnimatedZoom(i,o,c.zoom):this._tryAnimatedPan(i,c.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(i,o,c.pan&&c.pan.noMoveStart),this},setZoom:function(i,o){return this._loaded?this.setView(this.getCenter(),i,{zoom:o}):(this._zoom=i,this)},zoomIn:function(i,o){return i=i||(Qt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(Qt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-i,o)},setZoomAround:function(i,o,c){var f=this.getZoomScale(o),x=this.getSize().divideBy(2),b=i instanceof G?i:this.latLngToContainerPoint(i),F=b.subtract(x).multiplyBy(1-1/f),Q=this.containerPointToLatLng(x.add(F));return this.setView(Q,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Lt(i);var c=ot(o.paddingTopLeft||o.padding||[0,0]),f=ot(o.paddingBottomRight||o.padding||[0,0]),x=this.getBoundsZoom(i,!1,c.add(f));if(x=typeof o.maxZoom=="number"?Math.min(o.maxZoom,x):x,x===1/0)return{center:i.getCenter(),zoom:x};var b=f.subtract(c).divideBy(2),F=this.project(i.getSouthWest(),x),Q=this.project(i.getNorthEast(),x),nt=this.unproject(F.add(Q).divideBy(2).add(b),x);return{center:nt,zoom:x}},fitBounds:function(i,o){if(i=Lt(i),!i.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(i,o);return this.setView(c.center,c.zoom,o)},fitWorld:function(i){return this.fitBounds([[-90,-180],[90,180]],i)},panTo:function(i,o){return this.setView(i,this._zoom,{pan:o})},panBy:function(i,o){if(i=ot(i).round(),o=o||{},!i.x&&!i.y)return this.fire("moveend");if(o.animate!==!0&&!this.getSize().contains(i))return this._resetView(this.unproject(this.project(this.getCenter()).add(i)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Sm,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o.noMoveStart||this.fire("movestart"),o.animate!==!1){ee(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(i).round();this._panAnim.run(this._mapPane,c,o.duration||.25,o.easeLinearity)}else this._rawPanBy(i),this.fire("move").fire("moveend");return this},flyTo:function(i,o,c){if(c=c||{},c.animate===!1||!Qt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),b=this.getSize(),F=this._zoom;i=it(i),o=o===void 0?F:o;var Q=Math.max(b.x,b.y),nt=Q*this.getZoomScale(F,o),mt=x.distanceTo(f)||1,Ut=1.42,oe=Ut*Ut;function pe(We){var tl=We?-1:1,qT=We?nt:Q,QT=nt*nt-Q*Q+tl*oe*oe*mt*mt,jT=2*qT*oe*mt,Bh=QT/jT,ig=Math.sqrt(Bh*Bh+1)-Bh,JT=ig<1e-9?-18:Math.log(ig);return JT}function dn(We){return(Math.exp(We)-Math.exp(-We))/2}function je(We){return(Math.exp(We)+Math.exp(-We))/2}function Bn(We){return dn(We)/je(We)}var vn=pe(0);function pr(We){return Q*(je(vn)/je(vn+Ut*We))}function WT(We){return Q*(je(vn)*Bn(vn+Ut*We)-dn(vn))/oe}function ZT(We){return 1-Math.pow(1-We,1.5)}var XT=Date.now(),eg=(pe(1)-vn)/Ut,YT=c.duration?1e3*c.duration:1e3*eg*.8;function ng(){var We=(Date.now()-XT)/YT,tl=ZT(We)*eg;We<=1?(this._flyToFrame=k(ng,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(WT(tl)/mt)),F),this.getScaleZoom(Q/pr(tl),F),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),ng.call(this),this},flyToBounds:function(i,o){var c=this._getBoundsCenterZoom(i,o);return this.flyTo(c.center,c.zoom,o)},setMaxBounds:function(i){return i=Lt(i),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),i.isValid()?(this.options.maxBounds=i,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(i){var o=this.options.minZoom;return this.options.minZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(i):this},setMaxZoom:function(i){var o=this.options.maxZoom;return this.options.maxZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,o){this._enforcingBounds=!0;var c=this.getCenter(),f=this._limitCenter(c,this._zoom,Lt(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=ot(o.paddingTopLeft||o.padding||[0,0]),f=ot(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),b=this.project(i),F=this.getPixelBounds(),Q=Gt([F.min.add(c),F.max.subtract(f)]),nt=Q.getSize();if(!Q.contains(b)){this._enforcingBounds=!0;var mt=b.subtract(Q.getCenter()),Ut=Q.extend(b).getSize().subtract(nt);x.x+=mt.x<0?-Ut.x:Ut.x,x.y+=mt.y<0?-Ut.y:Ut.y,this.panTo(this.unproject(x),o),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=r({animate:!1,pan:!0},i===!0?{animate:!0}:i);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),f=o.divideBy(2).round(),x=c.divideBy(2).round(),b=f.subtract(x);return!b.x&&!b.y?this:(i.animate&&i.pan?this.panBy(b):(i.pan&&this._rawPanBy(b),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=r({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,c,i):navigator.geolocation.getCurrentPosition(o,c,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var o=i.code,c=i.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var o=i.coords.latitude,c=i.coords.longitude,f=new Y(o,c),x=f.toBounds(i.coords.accuracy*2),b=this._locateOptions;if(b.setView){var F=this.getBoundsZoom(x);this.setView(f,b.maxZoom?Math.min(F,b.maxZoom):F)}var Q={latlng:f,bounds:x,timestamp:i.timestamp};for(var nt in i.coords)typeof i.coords[nt]=="number"&&(Q[nt]=i.coords[nt]);this.fire("locationfound",Q)}},addHandler:function(i,o){if(!o)return this;var c=this[i]=new o(this);return this._handlers.push(c),this.options[i]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),re(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Z(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)re(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,o){var c="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),f=$t("div",c,o||this._mapPane);return i&&(this._panes[i]=f),f},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),o=this.unproject(i.getBottomLeft()),c=this.unproject(i.getTopRight());return new pt(o,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(i,o,c){i=Lt(i),c=ot(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),b=this.getMaxZoom(),F=i.getNorthWest(),Q=i.getSouthEast(),nt=this.getSize().subtract(c),mt=Gt(this.project(Q,f),this.project(F,f)).getSize(),Ut=Qt.any3d?this.options.zoomSnap:1,oe=nt.x/mt.x,pe=nt.y/mt.y,dn=o?Math.max(oe,pe):Math.min(oe,pe);return f=this.getScaleZoom(dn,f),Ut&&(f=Math.round(f/(Ut/100))*(Ut/100),f=o?Math.ceil(f/Ut)*Ut:Math.floor(f/Ut)*Ut),Math.max(x,Math.min(b,f))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new G(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,o){var c=this._getTopLeftPoint(i,o);return new St(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,o){var c=this.options.crs;return o=o===void 0?this._zoom:o,c.scale(i)/c.scale(o)},getScaleZoom:function(i,o){var c=this.options.crs;o=o===void 0?this._zoom:o;var f=c.zoom(i*c.scale(o));return isNaN(f)?1/0:f},project:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(it(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(ot(i),o)},layerPointToLatLng:function(i){var o=ot(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(it(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(it(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Lt(i))},distance:function(i,o){return this.options.crs.distance(it(i),it(o))},containerPointToLayerPoint:function(i){return ot(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return ot(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(ot(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(it(i)))},mouseEventToContainerPoint:function(i){return xm(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var o=this._container=fe(i);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");he(o,"scroll",this._onScroll,this),this._containerId=u(o)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&Qt.any3d,ee(i,"leaflet-container"+(Qt.touch?" leaflet-touch":"")+(Qt.retina?" leaflet-retina":"")+(Qt.ielt9?" leaflet-oldie":"")+(Qt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=Ee(i,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ye(this._mapPane,new G(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ee(i.markerPane,"leaflet-zoom-hide"),ee(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,o,c){ye(this._mapPane,new G(0,0));var f=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var x=this._zoom!==o;this._moveStart(x,c)._move(i,o)._moveEnd(x),this.fire("viewreset"),f&&this.fire("load")},_moveStart:function(i,o){return i&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(i,o,c,f){o===void 0&&(o=this._zoom);var x=this._zoom!==o;return this._zoom=o,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),f?c&&c.pinch&&this.fire("zoom",c):((x||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Z(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){ye(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[u(this._container)]=this;var o=i?Ue:he;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),Qt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Z(this._resizeRequest),this._resizeRequest=k(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,o){for(var c=[],f,x=o==="mouseout"||o==="mouseover",b=i.target||i.srcElement,F=!1;b;){if(f=this._targets[u(b)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){F=!0;break}if(f&&f.listens(o,!0)&&(x&&!Ah(b,i)||(c.push(f),x))||b===this._container)break;b=b.parentNode}return!c.length&&!F&&!x&&this.listens(o,!0)&&(c=[this]),c},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var o=i.target||i.srcElement;if(!(!this._loaded||o._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(o))){var c=i.type;c==="mousedown"&&xh(o),this._fireDOMEvent(i,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,o,c){if(i.type==="click"){var f=r({},i);f.type="preclick",this._fireDOMEvent(f,f.type,c)}var x=this._findEventTargets(i,o);if(c){for(var b=[],F=0;F<c.length;F++)c[F].listens(o,!0)&&b.push(c[F]);x=b.concat(x)}if(x.length){o==="contextmenu"&&nn(i);var Q=x[0],nt={originalEvent:i};if(i.type!=="keypress"&&i.type!=="keydown"&&i.type!=="keyup"){var mt=Q.getLatLng&&(!Q._radius||Q._radius<=10);nt.containerPoint=mt?this.latLngToContainerPoint(Q.getLatLng()):this.mouseEventToContainerPoint(i),nt.layerPoint=this.containerPointToLayerPoint(nt.containerPoint),nt.latlng=mt?Q.getLatLng():this.layerPointToLatLng(nt.layerPoint)}for(F=0;F<x.length;F++)if(x[F].fire(o,nt,!0),nt.originalEvent._stopped||x[F].options.bubblingMouseEvents===!1&&T(this._mouseEvents,o)!==-1)return}},_draggableMoved:function(i){return i=i.dragging&&i.dragging.enabled()?i:this,i.dragging&&i.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,o=this._handlers.length;i<o;i++)this._handlers[i].disable()},whenReady:function(i,o){return this._loaded?i.call(o||this,{target:this}):this.on("load",i,o),this},_getMapPanePos:function(){return Yn(this._mapPane)||new G(0,0)},_moved:function(){var i=this._getMapPanePos();return i&&!i.equals([0,0])},_getTopLeftPoint:function(i,o){var c=i&&o!==void 0?this._getNewPixelOrigin(i,o):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(i,o){var c=this.getSize()._divideBy(2);return this.project(i,o)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return this.project(i,o)._subtract(f)},_latLngBoundsToNewLayerBounds:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return Gt([this.project(i.getSouthWest(),o)._subtract(f),this.project(i.getNorthWest(),o)._subtract(f),this.project(i.getSouthEast(),o)._subtract(f),this.project(i.getNorthEast(),o)._subtract(f)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(i){return this.latLngToLayerPoint(i).subtract(this._getCenterLayerPoint())},_limitCenter:function(i,o,c){if(!c)return i;var f=this.project(i,o),x=this.getSize().divideBy(2),b=new St(f.subtract(x),f.add(x)),F=this._getBoundsOffset(b,c,o);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?i:this.unproject(f.add(F),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new St(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=Gt(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),b=f.max.subtract(i.max),F=this._rebound(x.x,-b.x),Q=this._rebound(x.y,-b.y);return new G(F,Q)},_rebound:function(i,o){return i+o>0?Math.round(i-o)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(o))},_limitZoom:function(i){var o=this.getMinZoom(),c=this.getMaxZoom(),f=Qt.any3d?this.options.zoomSnap:1;return f&&(i=Math.round(i/f)*f),Math.max(o,Math.min(c,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ke(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,o){var c=this._getCenterOffset(i)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,o),!0)},_createAnimProxy:function(){var i=this._proxy=$t("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(o){var c=ne,f=this._proxy.style[c];Fe(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),f===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){re(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),o=this.getZoom();Fe(this._proxy,this.project(i,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,o,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var f=this.getZoomScale(o),x=this._getCenterOffset(i)._divideBy(1-1/f);return c.animate!==!0&&!this.getSize().contains(x)?!1:(k(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(i,o,!0)},this),!0)},_animateZoom:function(i,o,c,f){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=o,ee(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:o,noUpdate:f}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ke(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function aT(i,o){return new xe(i,o)}var qn=V.extend({options:{position:"topright"},initialize:function(i){w(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var o=this._map;return o&&o.removeControl(this),this.options.position=i,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var o=this._container=this.onAdd(i),c=this.getPosition(),f=i._controlCorners[c];return ee(o,"leaflet-control"),c.indexOf("bottom")!==-1?f.insertBefore(o,f.firstChild):f.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(re(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),co=function(i){return new qn(i)};xe.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},o="leaflet-",c=this._controlContainer=$t("div",o+"control-container",this._container);function f(x,b){var F=o+x+" "+o+b;i[x+b]=$t("div",F,c)}f("top","left"),f("top","right"),f("bottom","left"),f("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)re(this._controlCorners[i]);re(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Mm=qn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,o,c,f){return c<f?-1:f<c?1:0}},initialize:function(i,o,c){w(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var f in i)this._addLayer(i[f],f);for(f in o)this._addLayer(o[f],f,!0)},onAdd:function(i){this._initLayout(),this._update(),this._map=i,i.on("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(i){return qn.prototype.addTo.call(this,i),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(i,o){return this._addLayer(i,o),this._map?this._update():this},addOverlay:function(i,o){return this._addLayer(i,o,!0),this._map?this._update():this},removeLayer:function(i){i.off("add remove",this._onLayerChange,this);var o=this._getLayer(u(i));return o&&this._layers.splice(this._layers.indexOf(o),1),this._map?this._update():this},expand:function(){ee(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var i=this._map.getSize().y-(this._container.offsetTop+50);return i<this._section.clientHeight?(ee(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=i+"px"):ke(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ke(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var i="leaflet-control-layers",o=this._container=$t("div",i),c=this.options.collapsed;o.setAttribute("aria-haspopup",!0),lo(o),bh(o);var f=this._section=$t("section",i+"-list");c&&(this._map.on("click",this.collapse,this),he(o,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var x=this._layersLink=$t("a",i+"-toggle",o);x.href="#",x.title="Layers",x.setAttribute("role","button"),he(x,{keydown:function(b){b.keyCode===13&&this._expandSafely()},click:function(b){nn(b),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=$t("div",i+"-base",f),this._separator=$t("div",i+"-separator",f),this._overlaysList=$t("div",i+"-overlays",f),o.appendChild(f)},_getLayer:function(i){for(var o=0;o<this._layers.length;o++)if(this._layers[o]&&u(this._layers[o].layer)===i)return this._layers[o]},_addLayer:function(i,o,c){this._map&&i.on("add remove",this._onLayerChange,this),this._layers.push({layer:i,name:o,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(f,x){return this.options.sortFunction(f.layer,x.layer,f.name,x.name)},this)),this.options.autoZIndex&&i.setZIndex&&(this._lastZIndex++,i.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Te(this._baseLayersList),Te(this._overlaysList),this._layerControlInputs=[];var i,o,c,f,x=0;for(c=0;c<this._layers.length;c++)f=this._layers[c],this._addItem(f),o=o||f.overlay,i=i||!f.overlay,x+=f.overlay?0:1;return this.options.hideSingleBase&&(i=i&&x>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=o&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var o=this._getLayer(u(i.target)),c=o.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;c&&this._map.fire(c,o)},_createRadioElement:function(i,o){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+i+'"'+(o?' checked="checked"':"")+"/>",f=document.createElement("div");return f.innerHTML=c,f.firstChild},_addItem:function(i){var o=document.createElement("label"),c=this._map.hasLayer(i.layer),f;i.overlay?(f=document.createElement("input"),f.type="checkbox",f.className="leaflet-control-layers-selector",f.defaultChecked=c):f=this._createRadioElement("leaflet-base-layers_"+u(this),c),this._layerControlInputs.push(f),f.layerId=u(i.layer),he(f,"click",this._onInputClick,this);var x=document.createElement("span");x.innerHTML=" "+i.name;var b=document.createElement("span");o.appendChild(b),b.appendChild(f),b.appendChild(x);var F=i.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var b=i.length-1;b>=0;b--)o=i[b],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(b=0;b<x.length;b++)this._map.hasLayer(x[b])&&this._map.removeLayer(x[b]);for(b=0;b<f.length;b++)this._map.hasLayer(f[b])||this._map.addLayer(f[b]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var i=this._layerControlInputs,o,c,f=this._map.getZoom(),x=i.length-1;x>=0;x--)o=i[x],c=this._getLayer(o.layerId).layer,o.disabled=c.options.minZoom!==void 0&&f<c.options.minZoom||c.options.maxZoom!==void 0&&f>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;this._preventClick=!0,he(i,"click",nn),this.expand();var o=this;setTimeout(function(){Ue(i,"click",nn),o._preventClick=!1})}}),lT=function(i,o,c){return new Mm(i,o,c)},Ch=qn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(i){var o="leaflet-control-zoom",c=$t("div",o+" leaflet-bar"),f=this.options;return this._zoomInButton=this._createButton(f.zoomInText,f.zoomInTitle,o+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(f.zoomOutText,f.zoomOutTitle,o+"-out",c,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(i){i.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(i){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(i.shiftKey?3:1))},_zoomOut:function(i){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,o,c,f,x){var b=$t("a",c,f);return b.innerHTML=i,b.href="#",b.title=o,b.setAttribute("role","button"),b.setAttribute("aria-label",o),lo(b),he(b,"click",Es),he(b,"click",x,this),he(b,"click",this._refocusOnMap,this),b},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";ke(this._zoomInButton,o),ke(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&(ee(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&(ee(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});xe.mergeOptions({zoomControl:!0}),xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ch,this.addControl(this.zoomControl))});var cT=function(i){return new Ch(i)},Tm=qn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var o="leaflet-control-scale",c=$t("div",o),f=this.options;return this._addScales(f,o+"-line",c),i.on(f.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),c},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,o,c){i.metric&&(this._mScale=$t("div",o,c)),i.imperial&&(this._iScale=$t("div",o,c))},_update:function(){var i=this._map,o=i.getSize().y/2,c=i.distance(i.containerPointToLatLng([0,o]),i.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(c)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var o=this._getRoundNum(i),c=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,c,o/i)},_updateImperial:function(i){var o=i*3.2808399,c,f,x;o>5280?(c=o/5280,f=this._getRoundNum(c),this._updateScale(this._iScale,f+" mi",f/c)):(x=this._getRoundNum(o),this._updateScale(this._iScale,x+" ft",x/o))},_updateScale:function(i,o,c){i.style.width=Math.round(this.options.maxWidth*c)+"px",i.innerHTML=o},_getRoundNum:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),c=i/o;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,o*c}}),hT=function(i){return new Tm(i)},uT='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ph=qn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Qt.inlineSvg?uT+" ":"")+"Leaflet</a>"},initialize:function(i){w(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=$t("div","leaflet-control-attribution"),lo(this._container);for(var o in i._layers)i._layers[o].getAttribution&&this.addAttribution(i._layers[o].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var o in this._attributions)this._attributions[o]&&i.push(o);var c=[];this.options.prefix&&c.push(this.options.prefix),i.length&&c.push(i.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});xe.mergeOptions({attributionControl:!0}),xe.addInitHook(function(){this.options.attributionControl&&new Ph().addTo(this)});var dT=function(i){return new Ph(i)};qn.Layers=Mm,qn.Zoom=Ch,qn.Scale=Tm,qn.Attribution=Ph,co.layers=lT,co.zoom=cT,co.scale=hT,co.attribution=dT;var oi=V.extend({initialize:function(i){this._map=i},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});oi.addTo=function(i,o){return i.addHandler(o,this),this};var fT={Events:K},bm=Qt.touch?"touchstart mousedown":"mousedown",Ki=ut.extend({options:{clickTolerance:3},initialize:function(i,o,c,f){w(this,f),this._element=i,this._dragStartTarget=o||i,this._preventOutline=c},enable:function(){this._enabled||(he(this._dragStartTarget,bm,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ki._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,bm,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!ge(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){Ki._dragging===this&&this.finishDrag();return}if(!(Ki._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Ki._dragging=this,this._preventOutline&&xh(this._element),vh(),Cn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=vm(this._element);this._startPoint=new G(o.clientX,o.clientY),this._startPos=Yn(this._element),this._parentScale=wh(c);var f=i.type==="mousedown";he(document,f?"mousemove":"touchmove",this._onMove,this),he(document,f?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var o=i.touches&&i.touches.length===1?i.touches[0]:i,c=new G(o.clientX,o.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,nn(i),this._moved||(this.fire("dragstart"),this._moved=!0,ee(document.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ee(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=i,this._updatePosition())}},_updatePosition:function(){var i={originalEvent:this._lastEvent};this.fire("predrag",i),ye(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){ke(document.body,"leaflet-dragging"),this._lastTarget&&(ke(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),yh(),oo();var o=this._moved&&this._moving;this._moving=!1,Ki._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function Am(i,o,c){var f,x=[1,4,2,8],b,F,Q,nt,mt,Ut,oe,pe;for(b=0,Ut=i.length;b<Ut;b++)i[b]._code=xs(i[b],o);for(Q=0;Q<4;Q++){for(oe=x[Q],f=[],b=0,Ut=i.length,F=Ut-1;b<Ut;F=b++)nt=i[b],mt=i[F],nt._code&oe?mt._code&oe||(pe=Ga(mt,nt,oe,o,c),pe._code=xs(pe,o),f.push(pe)):(mt._code&oe&&(pe=Ga(mt,nt,oe,o,c),pe._code=xs(pe,o),f.push(pe)),f.push(nt));i=f}return i}function Cm(i,o){var c,f,x,b,F,Q,nt,mt,Ut;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var oe=it([0,0]),pe=Lt(i),dn=pe.getNorthWest().distanceTo(pe.getSouthWest())*pe.getNorthEast().distanceTo(pe.getNorthWest());dn<1700&&(oe=Rh(i));var je=i.length,Bn=[];for(c=0;c<je;c++){var vn=it(i[c]);Bn.push(o.project(it([vn.lat-oe.lat,vn.lng-oe.lng])))}for(Q=nt=mt=0,c=0,f=je-1;c<je;f=c++)x=Bn[c],b=Bn[f],F=x.y*b.x-b.y*x.x,nt+=(x.x+b.x)*F,mt+=(x.y+b.y)*F,Q+=F*3;Q===0?Ut=Bn[0]:Ut=[nt/Q,mt/Q];var pr=o.unproject(ot(Ut));return it([pr.lat+oe.lat,pr.lng+oe.lng])}function Rh(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var b=it(i[x]);o+=b.lat,c+=b.lng,f++}return it([o/f,c/f])}var pT={__proto__:null,clipPolygon:Am,polygonCenter:Cm,centroid:Rh};function Pm(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=_T(i,c),i=gT(i,c),i}function Rm(i,o,c){return Math.sqrt(ho(i,o,c,!0))}function mT(i,o,c){return ho(i,o,c)}function gT(i,o){var c=i.length,f=typeof Uint8Array<"u"?Uint8Array:Array,x=new f(c);x[0]=x[c-1]=1,Lh(i,x,o,0,c-1);var b,F=[];for(b=0;b<c;b++)x[b]&&F.push(i[b]);return F}function Lh(i,o,c,f,x){var b=0,F,Q,nt;for(Q=f+1;Q<=x-1;Q++)nt=ho(i[Q],i[f],i[x],!0),nt>b&&(F=Q,b=nt);b>c&&(o[F]=1,Lh(i,o,c,f,F),Lh(i,o,c,F,x))}function _T(i,o){for(var c=[i[0]],f=1,x=0,b=i.length;f<b;f++)vT(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<b-1&&c.push(i[b-1]),c}var Lm;function Im(i,o,c,f,x){var b=f?Lm:xs(i,c),F=xs(o,c),Q,nt,mt;for(Lm=F;;){if(!(b|F))return[i,o];if(b&F)return!1;Q=b||F,nt=Ga(i,o,Q,c,x),mt=xs(nt,c),Q===b?(i=nt,b=mt):(o=nt,F=mt)}}function Ga(i,o,c,f,x){var b=o.x-i.x,F=o.y-i.y,Q=f.min,nt=f.max,mt,Ut;return c&8?(mt=i.x+b*(nt.y-i.y)/F,Ut=nt.y):c&4?(mt=i.x+b*(Q.y-i.y)/F,Ut=Q.y):c&2?(mt=nt.x,Ut=i.y+F*(nt.x-i.x)/b):c&1&&(mt=Q.x,Ut=i.y+F*(Q.x-i.x)/b),new G(mt,Ut,x)}function xs(i,o){var c=0;return i.x<o.min.x?c|=1:i.x>o.max.x&&(c|=2),i.y<o.min.y?c|=4:i.y>o.max.y&&(c|=8),c}function vT(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function ho(i,o,c,f){var x=o.x,b=o.y,F=c.x-x,Q=c.y-b,nt=F*F+Q*Q,mt;return nt>0&&(mt=((i.x-x)*F+(i.y-b)*Q)/nt,mt>1?(x=c.x,b=c.y):mt>0&&(x+=F*mt,b+=Q*mt)),F=i.x-x,Q=i.y-b,f?F*F+Q*Q:new G(x,b)}function Nn(i){return!C(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Dm(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Nn(i)}function km(i,o){var c,f,x,b,F,Q,nt,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var Ut=it([0,0]),oe=Lt(i),pe=oe.getNorthWest().distanceTo(oe.getSouthWest())*oe.getNorthEast().distanceTo(oe.getNorthWest());pe<1700&&(Ut=Rh(i));var dn=i.length,je=[];for(c=0;c<dn;c++){var Bn=it(i[c]);je.push(o.project(it([Bn.lat-Ut.lat,Bn.lng-Ut.lng])))}for(c=0,f=0;c<dn-1;c++)f+=je[c].distanceTo(je[c+1])/2;if(f===0)mt=je[0];else for(c=0,b=0;c<dn-1;c++)if(F=je[c],Q=je[c+1],x=F.distanceTo(Q),b+=x,b>f){nt=(b-f)/x,mt=[Q.x-nt*(Q.x-F.x),Q.y-nt*(Q.y-F.y)];break}var vn=o.unproject(ot(mt));return it([vn.lat+Ut.lat,vn.lng+Ut.lng])}var yT={__proto__:null,simplify:Pm,pointToSegmentDistance:Rm,closestPointOnSegment:mT,clipSegment:Im,_getEdgeIntersection:Ga,_getBitCode:xs,_sqClosestPointOnSegment:ho,isFlat:Nn,_flat:Dm,polylineCenter:km},Ih={project:function(i){return new G(i.lng,i.lat)},unproject:function(i){return new Y(i.y,i.x)},bounds:new St([-180,-90],[180,90])},Dh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new St([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(i){var o=Math.PI/180,c=this.R,f=i.lat*o,x=this.R_MINOR/c,b=Math.sqrt(1-x*x),F=b*Math.sin(f),Q=Math.tan(Math.PI/4-f/2)/Math.pow((1-F)/(1+F),b/2);return f=-c*Math.log(Math.max(Q,1e-10)),new G(i.lng*o*c,f)},unproject:function(i){for(var o=180/Math.PI,c=this.R,f=this.R_MINOR/c,x=Math.sqrt(1-f*f),b=Math.exp(-i.y/c),F=Math.PI/2-2*Math.atan(b),Q=0,nt=.1,mt;Q<15&&Math.abs(nt)>1e-7;Q++)mt=x*Math.sin(F),mt=Math.pow((1-mt)/(1+mt),x/2),nt=Math.PI/2-2*Math.atan(b*mt)-F,F+=nt;return new Y(F*o,i.x*o/c)}},ET={__proto__:null,LonLat:Ih,Mercator:Dh,SphericalMercator:zt},xT=r({},kt,{code:"EPSG:3395",projection:Dh,transformation:(function(){var i=.5/(Math.PI*Dh.R);return ht(i,.5,-i,.5)})()}),Um=r({},kt,{code:"EPSG:4326",projection:Ih,transformation:ht(1/180,1,-1/180,.5)}),wT=r({},ft,{projection:Ih,transformation:ht(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,o){var c=o.lng-i.lng,f=o.lat-i.lat;return Math.sqrt(c*c+f*f)},infinite:!0});ft.Earth=kt,ft.EPSG3395=xT,ft.EPSG3857=P,ft.EPSG900913=lt,ft.EPSG4326=Um,ft.Simple=wT;var Qn=ut.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[u(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[u(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var o=i.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var c=this.getEvents();o.on(c,this),this.once("remove",function(){o.off(c,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});xe.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var o=u(i);return this._layers[o]?this:(this._layers[o]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var o=u(i);return this._layers[o]?(this._loaded&&i.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return u(i)in this._layers},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},_addLayers:function(i){i=i?C(i)?i:[i]:[];for(var o=0,c=i.length;o<c;o++)this.addLayer(i[o])},_addZoomLimit:function(i){(!isNaN(i.options.maxZoom)||!isNaN(i.options.minZoom))&&(this._zoomBoundLayers[u(i)]=i,this._updateZoomLevels())},_removeZoomLimit:function(i){var o=u(i);this._zoomBoundLayers[o]&&(delete this._zoomBoundLayers[o],this._updateZoomLevels())},_updateZoomLevels:function(){var i=1/0,o=-1/0,c=this._getZoomSpan();for(var f in this._zoomBoundLayers){var x=this._zoomBoundLayers[f].options;i=x.minZoom===void 0?i:Math.min(i,x.minZoom),o=x.maxZoom===void 0?o:Math.max(o,x.maxZoom)}this._layersMaxZoom=o===-1/0?void 0:o,this._layersMinZoom=i===1/0?void 0:i,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var cr=Qn.extend({initialize:function(i,o){w(this,o),this._layers={};var c,f;if(i)for(c=0,f=i.length;c<f;c++)this.addLayer(i[c])},addLayer:function(i){var o=this.getLayerId(i);return this._layers[o]=i,this._map&&this._map.addLayer(i),this},removeLayer:function(i){var o=i in this._layers?i:this.getLayerId(i);return this._map&&this._layers[o]&&this._map.removeLayer(this._layers[o]),delete this._layers[o],this},hasLayer:function(i){var o=typeof i=="number"?i:this.getLayerId(i);return o in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(i){var o=Array.prototype.slice.call(arguments,1),c,f;for(c in this._layers)f=this._layers[c],f[i]&&f[i].apply(f,o);return this},onAdd:function(i){this.eachLayer(i.addLayer,i)},onRemove:function(i){this.eachLayer(i.removeLayer,i)},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},getLayer:function(i){return this._layers[i]},getLayers:function(){var i=[];return this.eachLayer(i.push,i),i},setZIndex:function(i){return this.invoke("setZIndex",i)},getLayerId:function(i){return u(i)}}),ST=function(i,o){return new cr(i,o)},Si=cr.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),cr.prototype.addLayer.call(this,i),this.fire("layeradd",{layer:i}))},removeLayer:function(i){return this.hasLayer(i)?(i in this._layers&&(i=this._layers[i]),i.removeEventParent(this),cr.prototype.removeLayer.call(this,i),this.fire("layerremove",{layer:i})):this},setStyle:function(i){return this.invoke("setStyle",i)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var i=new pt;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),MT=function(i,o){return new Si(i,o)},hr=V.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(i){w(this,i)},createIcon:function(i){return this._createIcon("icon",i)},createShadow:function(i){return this._createIcon("shadow",i)},_createIcon:function(i,o){var c=this._getIconUrl(i);if(!c){if(i==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var f=this._createImg(c,o&&o.tagName==="IMG"?o:null);return this._setIconStyles(f,i),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),f},_setIconStyles:function(i,o){var c=this.options,f=c[o+"Size"];typeof f=="number"&&(f=[f,f]);var x=ot(f),b=ot(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),b&&(i.style.marginLeft=-b.x+"px",i.style.marginTop=-b.y+"px"),x&&(i.style.width=x.x+"px",i.style.height=x.y+"px")},_createImg:function(i,o){return o=o||document.createElement("img"),o.src=i,o},_getIconUrl:function(i){return Qt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function TT(i){return new hr(i)}var uo=hr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(i){return typeof uo.imagePath!="string"&&(uo.imagePath=this._detectIconPath()),(this.options.imagePath||uo.imagePath)+hr.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var b=f.exec(c);return b&&b[x]};return i=o(i,/^url\((['"])?(.+)\1\)$/,2),i&&o(i,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var i=$t("div","leaflet-default-icon-path",document.body),o=Ee(i,"background-image")||Ee(i,"backgroundImage");if(document.body.removeChild(i),o=this._stripUrl(o),o)return o;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Om=oi.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Ki(i,i,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ee(i,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ke(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(i){var o=this._marker,c=o._map,f=this._marker.options.autoPanSpeed,x=this._marker.options.autoPanPadding,b=Yn(o._icon),F=c.getPixelBounds(),Q=c.getPixelOrigin(),nt=Gt(F.min._subtract(Q).add(x),F.max._subtract(Q).subtract(x));if(!nt.contains(b)){var mt=ot((Math.max(nt.max.x,b.x)-nt.max.x)/(F.max.x-nt.max.x)-(Math.min(nt.min.x,b.x)-nt.min.x)/(F.min.x-nt.min.x),(Math.max(nt.max.y,b.y)-nt.max.y)/(F.max.y-nt.max.y)-(Math.min(nt.min.y,b.y)-nt.min.y)/(F.min.y-nt.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),ye(o._icon,this._draggable._newPos),this._onDrag(i),this._panRequest=k(this._adjustPan.bind(this,i))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(i){this._marker.options.autoPan&&(Z(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Yn(o._icon),x=o._map.layerPointToLatLng(f);c&&ye(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){Z(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),Wa=Qn.extend({options:{icon:new uo,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(i,o){w(this,o),this._latlng=it(i)},onAdd:function(i){this._zoomAnimated=this._zoomAnimated&&i.options.markerZoomAnimation,this._zoomAnimated&&i.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(i){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&i.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(i){var o=this._latlng;return this._latlng=it(i),this.update(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},setZIndexOffset:function(i){return this.options.zIndexOffset=i,this.update()},getIcon:function(){return this.options.icon},setIcon:function(i){return this.options.icon=i,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var i=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(i)}return this},_initIcon:function(){var i=this.options,o="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=i.icon.createIcon(this._icon),f=!1;c!==this._icon&&(this._icon&&this._removeIcon(),f=!0,i.title&&(c.title=i.title),c.tagName==="IMG"&&(c.alt=i.alt||"")),ee(c,o),i.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,i.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&he(c,"focus",this._panOnFocus,this);var x=i.icon.createShadow(this._shadow),b=!1;x!==this._shadow&&(this._removeShadow(),b=!0),x&&(ee(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&b&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ue(this._icon,"focus",this._panOnFocus,this),re(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&re(this._shadow),this._shadow=null},_setPos:function(i){this._icon&&ye(this._icon,i),this._shadow&&ye(this._shadow,i),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(i){this._icon&&(this._icon.style.zIndex=this._zIndex+i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center).round();this._setPos(o)},_initInteraction:function(){if(this.options.interactive&&(ee(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Om)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Om(this),i&&this.dragging.enable()}},setOpacity:function(i){return this.options.opacity=i,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var i=this.options.opacity;this._icon&&_e(this._icon,i),this._shadow&&_e(this._shadow,i)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var i=this._map;if(i){var o=this.options.icon.options,c=o.iconSize?ot(o.iconSize):ot(0,0),f=o.iconAnchor?ot(o.iconAnchor):ot(0,0);i.panInside(this._latlng,{paddingTopLeft:f,paddingBottomRight:c.subtract(f)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function bT(i,o){return new Wa(i,o)}var $i=Qn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(i){this._renderer=i.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(i){return w(this,i),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&i&&Object.prototype.hasOwnProperty.call(i,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Za=$i.extend({options:{fill:!0,radius:10},initialize:function(i,o){w(this,o),this._latlng=it(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=it(i),this.redraw(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(i){return this.options.radius=this._radius=i,this.redraw()},getRadius:function(){return this._radius},setStyle:function(i){var o=i&&i.radius||this._radius;return $i.prototype.setStyle.call(this,i),this.setRadius(o),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var i=this._radius,o=this._radiusY||i,c=this._clickTolerance(),f=[i+c,o+c];this._pxBounds=new St(this._point.subtract(f),this._point.add(f))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(i){return i.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function AT(i,o){return new Za(i,o)}var kh=Za.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),w(this,o),this._latlng=it(i),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(i){return this._mRadius=i,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var i=[this._radius,this._radiusY||this._radius];return new pt(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:$i.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===kt.distance){var x=Math.PI/180,b=this._mRadius/kt.R/x,F=c.project([o+b,i]),Q=c.project([o-b,i]),nt=F.add(Q).divideBy(2),mt=c.unproject(nt).lat,Ut=Math.acos((Math.cos(b*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(Ut)||Ut===0)&&(Ut=b/Math.cos(Math.PI/180*o)),this._point=nt.subtract(c.getPixelOrigin()),this._radius=isNaN(Ut)?0:nt.x-c.project([mt,i-Ut]).x,this._radiusY=nt.y-F.y}else{var oe=f.unproject(f.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(oe).x}this._updateBounds()}});function CT(i,o,c){return new kh(i,o,c)}var Mi=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(i,o){w(this,o),this._setLatLngs(i)},getLatLngs:function(){return this._latlngs},setLatLngs:function(i){return this._setLatLngs(i),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(i){for(var o=1/0,c=null,f=ho,x,b,F=0,Q=this._parts.length;F<Q;F++)for(var nt=this._parts[F],mt=1,Ut=nt.length;mt<Ut;mt++){x=nt[mt-1],b=nt[mt];var oe=f(i,x,b,!0);oe<o&&(o=oe,c=f(i,x,b))}return c&&(c.distance=Math.sqrt(o)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return km(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=it(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new pt,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Nn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Nn(i),f=0,x=i.length;f<x;f++)c?(o[f]=it(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new St;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,i),this._bounds.isValid()&&i.isValid()&&(this._rawPxBounds=i,this._updateBounds())},_updateBounds:function(){var i=this._clickTolerance(),o=new G(i,i);this._rawPxBounds&&(this._pxBounds=new St([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof Y,x=i.length,b,F;if(f){for(F=[],b=0;b<x;b++)F[b]=this._map.latLngToLayerPoint(i[b]),c.extend(F[b]);o.push(F)}else for(b=0;b<x;b++)this._projectLatlngs(i[b],o,c)},_clipPoints:function(){var i=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}var o=this._parts,c,f,x,b,F,Q,nt;for(c=0,x=0,b=this._rings.length;c<b;c++)for(nt=this._rings[c],f=0,F=nt.length;f<F-1;f++)Q=Im(nt[f],nt[f+1],i,f,!0),Q&&(o[x]=o[x]||[],o[x].push(Q[0]),(Q[1]!==nt[f+1]||f===F-2)&&(o[x].push(Q[1]),x++))}},_simplifyPoints:function(){for(var i=this._parts,o=this.options.smoothFactor,c=0,f=i.length;c<f;c++)i[c]=Pm(i[c],o)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(i,o){var c,f,x,b,F,Q,nt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,b=this._parts.length;c<b;c++)for(Q=this._parts[c],f=0,F=Q.length,x=F-1;f<F;x=f++)if(!(!o&&f===0)&&Rm(i,Q[x],Q[f])<=nt)return!0;return!1}});function PT(i,o){return new Mi(i,o)}Mi._flat=Dm;var ur=Mi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Cm(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Mi.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof Y&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Mi.prototype._setLatLngs.call(this,i),Nn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Nn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,o=this.options.weight,c=new G(o,o);if(i=new St(i.min.subtract(c),i.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var f=0,x=this._rings.length,b;f<x;f++)b=Am(this._rings[f],i,!0),b.length&&this._parts.push(b)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,b,F,Q,nt,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(b=0,nt=this._parts.length;b<nt;b++)for(c=this._parts[b],F=0,mt=c.length,Q=mt-1;F<mt;Q=F++)f=c[F],x=c[Q],f.y>i.y!=x.y>i.y&&i.x<(x.x-f.x)*(i.y-f.y)/(x.y-f.y)+f.x&&(o=!o);return o||Mi.prototype._containsPoint.call(this,i,!0)}});function RT(i,o){return new ur(i,o)}var Ti=Si.extend({initialize:function(i,o){w(this,o),this._layers={},i&&this.addData(i)},addData:function(i){var o=C(i)?i:i.features,c,f,x;if(o){for(c=0,f=o.length;c<f;c++)x=o[c],(x.geometries||x.geometry||x.features||x.coordinates)&&this.addData(x);return this}var b=this.options;if(b.filter&&!b.filter(i))return this;var F=Xa(i,b);return F?(F.feature=Qa(i),F.defaultOptions=F.options,this.resetStyle(F),b.onEachFeature&&b.onEachFeature(i,F),this.addLayer(F)):this},resetStyle:function(i){return i===void 0?this.eachLayer(this.resetStyle,this):(i.options=r({},i.defaultOptions),this._setLayerStyle(i,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(o){this._setLayerStyle(o,i)},this)},_setLayerStyle:function(i,o){i.setStyle&&(typeof o=="function"&&(o=o(i.feature)),i.setStyle(o))}});function Xa(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],b=o&&o.pointToLayer,F=o&&o.coordsToLatLng||Uh,Q,nt,mt,Ut;if(!f&&!c)return null;switch(c.type){case"Point":return Q=F(f),Nm(b,i,Q,o);case"MultiPoint":for(mt=0,Ut=f.length;mt<Ut;mt++)Q=F(f[mt]),x.push(Nm(b,i,Q,o));return new Si(x);case"LineString":case"MultiLineString":return nt=Ya(f,c.type==="LineString"?0:1,F),new Mi(nt,o);case"Polygon":case"MultiPolygon":return nt=Ya(f,c.type==="Polygon"?1:2,F),new ur(nt,o);case"GeometryCollection":for(mt=0,Ut=c.geometries.length;mt<Ut;mt++){var oe=Xa({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);oe&&x.push(oe)}return new Si(x);case"FeatureCollection":for(mt=0,Ut=c.features.length;mt<Ut;mt++){var pe=Xa(c.features[mt],o);pe&&x.push(pe)}return new Si(x);default:throw new Error("Invalid GeoJSON object.")}}function Nm(i,o,c,f){return i?i(o,c):new Wa(c,f&&f.markersInheritOptions&&f)}function Uh(i){return new Y(i[1],i[0],i[2])}function Ya(i,o,c){for(var f=[],x=0,b=i.length,F;x<b;x++)F=o?Ya(i[x],o-1,c):(c||Uh)(i[x]),f.push(F);return f}function Oh(i,o){return i=it(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function qa(i,o,c,f){for(var x=[],b=0,F=i.length;b<F;b++)x.push(o?qa(i[b],Nn(i[b])?0:o-1,c,f):Oh(i[b],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function dr(i,o){return i.feature?r({},i.feature,{geometry:o}):Qa(o)}function Qa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var Nh={toGeoJSON:function(i){return dr(this,{type:"Point",coordinates:Oh(this.getLatLng(),i)})}};Wa.include(Nh),kh.include(Nh),Za.include(Nh),Mi.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=qa(this._latlngs,o?1:0,!1,i);return dr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),ur.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=o&&!Nn(this._latlngs[0]),f=qa(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),dr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),cr.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),dr(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(i){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(i);var c=o==="GeometryCollection",f=[];return this.eachLayer(function(x){if(x.toGeoJSON){var b=x.toGeoJSON(i);if(c)f.push(b.geometry);else{var F=Qa(b);F.type==="FeatureCollection"?f.push.apply(f,F.features):f.push(F)}}}),c?dr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function Bm(i,o){return new Ti(i,o)}var LT=Bm,ja=Qn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Lt(o),w(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ee(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){re(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(i){return this.options.opacity=i,this._image&&this._updateOpacity(),this},setStyle:function(i){return i.opacity&&this.setOpacity(i.opacity),this},bringToFront:function(){return this._map&&jt(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Lt(i),this._map&&this._reset(),this},getEvents:function(){var i={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var i=this._url.tagName==="IMG",o=this._image=i?this._url:$t("img");if(ee(o,"leaflet-image-layer"),this._zoomAnimated&&ee(o,"leaflet-zoom-animated"),this.options.className&&ee(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onload=l(this.fire,this,"load"),o.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),i){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(i){var o=this._map.getZoomScale(i.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;Fe(this._image,c,o)},_reset:function(){var i=this._image,o=new St(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();ye(i,o.min),i.style.width=c.x+"px",i.style.height=c.y+"px"},_updateOpacity:function(){_e(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var i=this.options.errorOverlayUrl;i&&this._url!==i&&(this._url=i,this._image.src=i)},getCenter:function(){return this._bounds.getCenter()}}),IT=function(i,o,c){return new ja(i,o,c)},Fm=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var i=this._url.tagName==="VIDEO",o=this._image=i?this._url:$t("video");if(ee(o,"leaflet-image-layer"),this._zoomAnimated&&ee(o,"leaflet-zoom-animated"),this.options.className&&ee(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onloadeddata=l(this.fire,this,"load"),i){for(var c=o.getElementsByTagName("source"),f=[],x=0;x<c.length;x++)f.push(c[x].src);this._url=c.length>0?f:[o.src];return}C(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var b=0;b<this._url.length;b++){var F=$t("source");F.src=this._url[b],o.appendChild(F)}}});function DT(i,o,c){return new Fm(i,o,c)}var zm=ja.extend({_initImage:function(){var i=this._image=this._url;ee(i,"leaflet-image-layer"),this._zoomAnimated&&ee(i,"leaflet-zoom-animated"),this.options.className&&ee(i,this.options.className),i.onselectstart=m,i.onmousemove=m}});function kT(i,o,c){return new zm(i,o,c)}var ai=Qn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof Y||C(i))?(this._latlng=it(i),w(this,o)):(w(this,i),this._source=o),this.options.content&&(this._content=this.options.content)},openOn:function(i){return i=arguments.length?i:this._source._map,i.hasLayer(this)||i.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(i){return this._map?this.close():(arguments.length?this._source=i:i=this._source,this._prepareOpen(),this.openOn(i._map)),this},onAdd:function(i){this._zoomAnimated=i._zoomAnimated,this._container||this._initLayout(),i._fadeAnimated&&_e(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),i._fadeAnimated&&_e(this._container,1),this.bringToFront(),this.options.interactive&&(ee(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(i){i._fadeAnimated?(_e(this._container,0),this._removeTimeout=setTimeout(l(re,void 0,this._container),200)):re(this._container),this.options.interactive&&(ke(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=it(i),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(i){return this._content=i,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var i={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&jt(this._container),this},bringToBack:function(){return this._map&&Le(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof Si){o=null;var c=this._source._layers;for(var f in c)if(c[f]._map){o=c[f];break}if(!o)return!1;this._source=o}if(!i)if(o.getCenter)i=o.getCenter();else if(o.getLatLng)i=o.getLatLng();else if(o.getBounds)i=o.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(i),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var i=this._contentNode,o=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof o=="string")i.innerHTML=o;else{for(;i.hasChildNodes();)i.removeChild(i.firstChild);i.appendChild(o)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),o=ot(this.options.offset),c=this._getAnchor();this._zoomAnimated?ye(this._container,i.add(c)):o=o.add(i).add(c);var f=this._containerBottom=-o.y,x=this._containerLeft=-Math.round(this._containerWidth/2)+o.x;this._container.style.bottom=f+"px",this._container.style.left=x+"px"}},_getAnchor:function(){return[0,0]}});xe.include({_initOverlay:function(i,o,c,f){var x=o;return x instanceof i||(x=new i(f).setContent(o)),c&&x.setLatLng(c),x}}),Qn.include({_initOverlay:function(i,o,c,f){var x=c;return x instanceof i?(w(x,f),x._source=this):(x=o&&!f?o:new i(f,this),x.setContent(c)),x}});var Ja=ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(i){return i=arguments.length?i:this._source._map,!i.hasLayer(this)&&i._popup&&i._popup.options.autoClose&&i.removeLayer(i._popup),i._popup=this,ai.prototype.openOn.call(this,i)},onAdd:function(i){ai.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",ys))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",ys))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(i.preclick=this.close),this.options.keepInView&&(i.moveend=this._adjustPan),i},_initLayout:function(){var i="leaflet-popup",o=this._container=$t("div",i+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=$t("div",i+"-content-wrapper",o);if(this._contentNode=$t("div",i+"-content",c),lo(o),bh(this._contentNode),he(o,"contextmenu",ys),this._tipContainer=$t("div",i+"-tip-container",o),this._tip=$t("div",i+"-tip",this._tipContainer),this.options.closeButton){var f=this._closeButton=$t("a",i+"-close-button",o);f.setAttribute("role","button"),f.setAttribute("aria-label","Close popup"),f.href="#close",f.innerHTML='<span aria-hidden="true">&#215;</span>',he(f,"click",function(x){nn(x),this.close()},this)}},_updateLayout:function(){var i=this._contentNode,o=i.style;o.width="",o.whiteSpace="nowrap";var c=i.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),o.width=c+1+"px",o.whiteSpace="",o.height="";var f=i.offsetHeight,x=this.options.maxHeight,b="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",ee(i,b)):ke(i,b),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();ye(this._container,o.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,o=parseInt(Ee(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new G(this._containerLeft,-c-this._containerBottom);x._add(Yn(this._container));var b=i.layerPointToContainerPoint(x),F=ot(this.options.autoPanPadding),Q=ot(this.options.autoPanPaddingTopLeft||F),nt=ot(this.options.autoPanPaddingBottomRight||F),mt=i.getSize(),Ut=0,oe=0;b.x+f+nt.x>mt.x&&(Ut=b.x+f-mt.x+nt.x),b.x-Ut-Q.x<0&&(Ut=b.x-Q.x),b.y+c+nt.y>mt.y&&(oe=b.y+c-mt.y+nt.y),b.y-oe-Q.y<0&&(oe=b.y-Q.y),(Ut||oe)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([Ut,oe]))}},_getAnchor:function(){return ot(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),UT=function(i,o){return new Ja(i,o)};xe.mergeOptions({closePopupOnClick:!0}),xe.include({openPopup:function(i,o,c){return this._initOverlay(Ja,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Qn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Ja,this._popup,i,o),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof Si||(this._popup._source=this),this._popup._prepareOpen(i||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){Es(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof $i)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=o,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var Ka=ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ai.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",o=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=$t("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var o,c,f=this._map,x=this._container,b=f.latLngToContainerPoint(f.getCenter()),F=f.layerPointToContainerPoint(i),Q=this.options.direction,nt=x.offsetWidth,mt=x.offsetHeight,Ut=ot(this.options.offset),oe=this._getAnchor();Q==="top"?(o=nt/2,c=mt):Q==="bottom"?(o=nt/2,c=0):Q==="center"?(o=nt/2,c=mt/2):Q==="right"?(o=0,c=mt/2):Q==="left"?(o=nt,c=mt/2):F.x<b.x?(Q="right",o=0,c=mt/2):(Q="left",o=nt+(Ut.x+oe.x)*2,c=mt/2),i=i.subtract(ot(o,c,!0)).add(Ut).add(oe),ke(x,"leaflet-tooltip-right"),ke(x,"leaflet-tooltip-left"),ke(x,"leaflet-tooltip-top"),ke(x,"leaflet-tooltip-bottom"),ee(x,"leaflet-tooltip-"+Q),ye(x,i)},_updatePosition:function(){var i=this._map.latLngToLayerPoint(this._latlng);this._setPosition(i)},setOpacity:function(i){this.options.opacity=i,this._container&&_e(this._container,i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center);this._setPosition(o)},_getAnchor:function(){return ot(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),OT=function(i,o){return new Ka(i,o)};xe.include({openTooltip:function(i,o,c){return this._initOverlay(Ka,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Qn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ka,this._tooltip,i,o),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(i){if(!(!i&&this._tooltipHandlersAdded)){var o=i?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[o](c),this._tooltipHandlersAdded=!i}},openTooltip:function(i){return this._tooltip&&(this instanceof Si||(this._tooltip._source=this),this._tooltip._prepareOpen(i)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(i){return this._tooltip&&this._tooltip.setContent(i),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&(he(o,"focus",function(){this._tooltip._source=i,this.openTooltip()},this),he(o,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&o.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(i){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var o=this;this._map.once("moveend",function(){o._openOnceFlag=!1,o._openTooltip(i)});return}this._tooltip._source=i.layer||i.target,this.openTooltip(this._tooltip.options.sticky?i.latlng:void 0)}},_moveTooltip:function(i){var o=i.latlng,c,f;this._tooltip.options.sticky&&i.originalEvent&&(c=this._map.mouseEventToContainerPoint(i.originalEvent),f=this._map.containerPointToLayerPoint(c),o=this._map.layerPointToLatLng(f)),this._tooltip.setLatLng(o)}});var Hm=hr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(i){var o=i&&i.tagName==="DIV"?i:document.createElement("div"),c=this.options;if(c.html instanceof Element?(Te(o),o.appendChild(c.html)):o.innerHTML=c.html!==!1?c.html:"",c.bgPos){var f=ot(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function NT(i){return new Hm(i)}hr.Default=uo;var fo=Qn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Qt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(i){w(this,i)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(i){i._addZoomLimit(this)},onRemove:function(i){this._removeAllTiles(),re(this._container),i._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(jt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Le(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(i){return this.options.opacity=i,this._updateOpacity(),this},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var i=this._clampZoom(this._map.getZoom());i!==this._tileZoom&&(this._tileZoom=i,this._updateLevels()),this._update()}return this},getEvents:function(){var i={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),i.move=this._onMove),this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},createTile:function(){return document.createElement("div")},getTileSize:function(){var i=this.options.tileSize;return i instanceof G?i:new G(i,i)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(i){for(var o=this.getPane().children,c=-i(-1/0,1/0),f=0,x=o.length,b;f<x;f++)b=o[f].style.zIndex,o[f]!==this._container&&b&&(c=i(c,+b));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Qt.ielt9){_e(this._container,this.options.opacity);var i=+new Date,o=!1,c=!1;for(var f in this._tiles){var x=this._tiles[f];if(!(!x.current||!x.loaded)){var b=Math.min(1,(i-x.loaded)/200);_e(x.el,b),b<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(Z(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=$t("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,o=this.options.maxZoom;if(i!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===i?(this._levels[c].el.style.zIndex=o-Math.abs(i-c),this._onUpdateLevel(c)):(re(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var f=this._levels[i],x=this._map;return f||(f=this._levels[i]={},f.el=$t("div","leaflet-tile-container leaflet-zoom-animated",this._container),f.el.style.zIndex=o,f.origin=x.project(x.unproject(x.getPixelOrigin()),i).round(),f.zoom=i,this._setZoomTransform(f,x.getCenter(),x.getZoom()),m(f.el.offsetWidth),this._onCreateLevel(f)),this._level=f,f}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var i,o,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(i in this._tiles)o=this._tiles[i],o.retain=o.current;for(i in this._tiles)if(o=this._tiles[i],o.current&&!o.active){var f=o.coords;this._retainParent(f.x,f.y,f.z,f.z-5)||this._retainChildren(f.x,f.y,f.z,f.z+2)}for(i in this._tiles)this._tiles[i].retain||this._removeTile(i)}},_removeTilesAtZoom:function(i){for(var o in this._tiles)this._tiles[o].coords.z===i&&this._removeTile(o)},_removeAllTiles:function(){for(var i in this._tiles)this._removeTile(i)},_invalidateAll:function(){for(var i in this._levels)re(this._levels[i].el),this._onRemoveLevel(Number(i)),delete this._levels[i];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(i,o,c,f){var x=Math.floor(i/2),b=Math.floor(o/2),F=c-1,Q=new G(+x,+b);Q.z=+F;var nt=this._tileCoordsToKey(Q),mt=this._tiles[nt];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),F>f?this._retainParent(x,b,F,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var b=2*o;b<2*o+2;b++){var F=new G(x,b);F.z=c+1;var Q=this._tileCoordsToKey(F),nt=this._tiles[Q];if(nt&&nt.active){nt.retain=!0;continue}else nt&&nt.loaded&&(nt.retain=!0);c+1<f&&this._retainChildren(x,b,c+1,f)}},_resetView:function(i){var o=i&&(i.pinch||i.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),o,o)},_animateZoom:function(i){this._setView(i.center,i.zoom,!0,i.noUpdate)},_clampZoom:function(i){var o=this.options;return o.minNativeZoom!==void 0&&i<o.minNativeZoom?o.minNativeZoom:o.maxNativeZoom!==void 0&&o.maxNativeZoom<i?o.maxNativeZoom:i},_setView:function(i,o,c,f){var x=Math.round(o);this.options.maxZoom!==void 0&&x>this.options.maxZoom||this.options.minZoom!==void 0&&x<this.options.minZoom?x=void 0:x=this._clampZoom(x);var b=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||b)&&(this._tileZoom=x,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),x!==void 0&&this._update(i),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(i,o)},_setZoomTransforms:function(i,o){for(var c in this._levels)this._setZoomTransform(this._levels[c],i,o)},_setZoomTransform:function(i,o,c){var f=this._map.getZoomScale(c,i.zoom),x=i.origin.multiplyBy(f).subtract(this._map._getNewPixelOrigin(o,c)).round();Qt.any3d?Fe(i.el,x,f):ye(i.el,x)},_resetGrid:function(){var i=this._map,o=i.options.crs,c=this._tileSize=this.getTileSize(),f=this._tileZoom,x=this._map.getPixelWorldBounds(this._tileZoom);x&&(this._globalTileRange=this._pxBoundsToTileRange(x)),this._wrapX=o.wrapLng&&!this.options.noWrap&&[Math.floor(i.project([0,o.wrapLng[0]],f).x/c.x),Math.ceil(i.project([0,o.wrapLng[1]],f).x/c.y)],this._wrapY=o.wrapLat&&!this.options.noWrap&&[Math.floor(i.project([o.wrapLat[0],0],f).y/c.x),Math.ceil(i.project([o.wrapLat[1],0],f).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(i){var o=this._map,c=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),f=o.getZoomScale(c,this._tileZoom),x=o.project(i,this._tileZoom).floor(),b=o.getSize().divideBy(f*2);return new St(x.subtract(b),x.add(b))},_update:function(i){var o=this._map;if(o){var c=this._clampZoom(o.getZoom());if(i===void 0&&(i=o.getCenter()),this._tileZoom!==void 0){var f=this._getTiledPixelBounds(i),x=this._pxBoundsToTileRange(f),b=x.getCenter(),F=[],Q=this.options.keepBuffer,nt=new St(x.getBottomLeft().subtract([Q,-Q]),x.getTopRight().add([Q,-Q]));if(!(isFinite(x.min.x)&&isFinite(x.min.y)&&isFinite(x.max.x)&&isFinite(x.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var mt in this._tiles){var Ut=this._tiles[mt].coords;(Ut.z!==this._tileZoom||!nt.contains(new G(Ut.x,Ut.y)))&&(this._tiles[mt].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(i,c);return}for(var oe=x.min.y;oe<=x.max.y;oe++)for(var pe=x.min.x;pe<=x.max.x;pe++){var dn=new G(pe,oe);if(dn.z=this._tileZoom,!!this._isValidTile(dn)){var je=this._tiles[this._tileCoordsToKey(dn)];je?je.current=!0:F.push(dn)}}if(F.sort(function(vn,pr){return vn.distanceTo(b)-pr.distanceTo(b)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Bn=document.createDocumentFragment();for(pe=0;pe<F.length;pe++)this._addTile(F[pe],Bn);this._level.el.appendChild(Bn)}}}},_isValidTile:function(i){var o=this._map.options.crs;if(!o.infinite){var c=this._globalTileRange;if(!o.wrapLng&&(i.x<c.min.x||i.x>c.max.x)||!o.wrapLat&&(i.y<c.min.y||i.y>c.max.y))return!1}if(!this.options.bounds)return!0;var f=this._tileCoordsToBounds(i);return Lt(this.options.bounds).overlaps(f)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var o=this._map,c=this.getTileSize(),f=i.scaleBy(c),x=f.add(c),b=o.unproject(f,i.z),F=o.unproject(x,i.z);return[b,F]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new pt(o[0],o[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var o=i.split(":"),c=new G(+o[0],+o[1]);return c.z=+o[2],c},_removeTile:function(i){var o=this._tiles[i];o&&(re(o.el),delete this._tiles[i],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){ee(i,"leaflet-tile");var o=this.getTileSize();i.style.width=o.x+"px",i.style.height=o.y+"px",i.onselectstart=m,i.onmousemove=m,Qt.ielt9&&this.options.opacity<1&&_e(i,this.options.opacity)},_addTile:function(i,o){var c=this._getTilePos(i),f=this._tileCoordsToKey(i),x=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(x),this.createTile.length<2&&k(l(this._tileReady,this,i,null,x)),ye(x,c),this._tiles[f]={el:x,coords:i,current:!0},o.appendChild(x),this.fire("tileloadstart",{tile:x,coords:i})},_tileReady:function(i,o,c){o&&this.fire("tileerror",{error:o,tile:c,coords:i});var f=this._tileCoordsToKey(i);c=this._tiles[f],c&&(c.loaded=+new Date,this._map._fadeAnimated?(_e(c.el,0),Z(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),o||(ee(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Qt.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var o=new G(this._wrapX?p(i.x,this._wrapX):i.x,this._wrapY?p(i.y,this._wrapY):i.y);return o.z=i.z,o},_pxBoundsToTileRange:function(i){var o=this.getTileSize();return new St(i.min.unscaleBy(o).floor(),i.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function BT(i){return new fo(i)}var fr=fo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,o){this._url=i,o=w(this,o),o.detectRetina&&Qt.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,o){return this._url===i&&o===void 0&&(o=!0),this._url=i,o||this.redraw(),this},createTile:function(i,o){var c=document.createElement("img");return he(c,"load",l(this._tileOnLoad,this,o,c)),he(c,"error",l(this._tileOnError,this,o,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(i),c},getTileUrl:function(i){var o={r:Qt.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-i.y;this.options.tms&&(o.y=c),o["-y"]=c}return I(this._url,r(o,this.options))},_tileOnLoad:function(i,o){Qt.ielt9?setTimeout(l(i,this,null,o),0):i(null,o)},_tileOnError:function(i,o,c){var f=this.options.errorTileUrl;f&&o.getAttribute("src")!==f&&(o.src=f),i(c,o)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,o=this.options.maxZoom,c=this.options.zoomReverse,f=this.options.zoomOffset;return c&&(i=o-i),i+f},_getSubdomain:function(i){var o=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var i,o;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(o=this._tiles[i].el,o.onload=m,o.onerror=m,!o.complete)){o.src=U;var c=this._tiles[i].coords;re(o),delete this._tiles[i],this.fire("tileabort",{tile:o,coords:c})}},_removeTile:function(i){var o=this._tiles[i];if(o)return o.el.setAttribute("src",U),fo.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===U))return fo.prototype._tileReady.call(this,i,o,c)}});function Vm(i,o){return new fr(i,o)}var Gm=fr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,o){this._url=i;var c=r({},this.defaultWmsParams);for(var f in o)f in this.options||(c[f]=o[f]);o=w(this,o);var x=o.detectRetina&&Qt.retina?2:1,b=this.getTileSize();c.width=b.x*x,c.height=b.y*x,this.wmsParams=c},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,fr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=Gt(c.project(o[0]),c.project(o[1])),x=f.min,b=f.max,F=(this._wmsVersion>=1.3&&this._crs===Um?[x.y,x.x,b.y,b.x]:[x.x,x.y,b.x,b.y]).join(","),Q=fr.prototype.getTileUrl.call(this,i);return Q+v(this.wmsParams,Q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function FT(i,o){return new Gm(i,o)}fr.WMS=Gm,Vm.wms=FT;var bi=Qn.extend({options:{padding:.1},initialize:function(i){w(this,i),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),ee(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,o){var c=this._map.getZoomScale(o,this._zoom),f=this._map.getSize().multiplyBy(.5+this.options.padding),x=this._map.project(this._center,o),b=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));Qt.any3d?Fe(this._container,b,c):ye(this._container,b)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,o=this._map.getSize(),c=this._map.containerPointToLayerPoint(o.multiplyBy(-i)).round();this._bounds=new St(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wm=bi.extend({options:{tolerance:0},getEvents:function(){var i=bi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");he(i,"mousemove",this._onMouseMove,this),he(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),he(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){Z(this._redrawRequest),delete this._ctx,re(this._container),Ue(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var o in this._layers)i=this._layers[o],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=Qt.retina?2:1;ye(o,i.min),o.width=f*c.x,o.height=f*c.y,o.style.width=c.x+"px",o.style.height=c.y+"px",Qt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){bi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[u(i)]=i;var o=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var o=i._order,c=o.next,f=o.prev;c?c.prev=f:this._drawLast=f,f?f.next=c:this._drawFirst=c,delete i._order,delete this._layers[u(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var o=i.options.dashArray.split(/[, ]+/),c=[],f,x;for(x=0;x<o.length;x++){if(f=Number(o[x]),isNaN(f))return;c.push(f)}i.options._dashArray=c}else i.options._dashArray=i.options.dashArray},_requestRedraw:function(i){this._map&&(this._extendRedrawBounds(i),this._redrawRequest=this._redrawRequest||k(this._redraw,this))},_extendRedrawBounds:function(i){if(i._pxBounds){var o=(i.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new St,this._redrawBounds.extend(i._pxBounds.min.subtract([o,o])),this._redrawBounds.extend(i._pxBounds.max.add([o,o]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var i=this._redrawBounds;if(i){var o=i.getSize();this._ctx.clearRect(i.min.x,i.min.y,o.x,o.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var i,o=this._redrawBounds;if(this._ctx.save(),o){var c=o.getSize();this._ctx.beginPath(),this._ctx.rect(o.min.x,o.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var f=this._drawFirst;f;f=f.next)i=f.layer,(!o||i._pxBounds&&i._pxBounds.intersects(o))&&i._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(i,o){if(this._drawing){var c,f,x,b,F=i._parts,Q=F.length,nt=this._ctx;if(Q){for(nt.beginPath(),c=0;c<Q;c++){for(f=0,x=F[c].length;f<x;f++)b=F[c][f],nt[f?"lineTo":"moveTo"](b.x,b.y);o&&nt.closePath()}this._fillStroke(nt,i)}}},_updateCircle:function(i){if(!(!this._drawing||i._empty())){var o=i._point,c=this._ctx,f=Math.max(Math.round(i._radius),1),x=(Math.max(Math.round(i._radiusY),1)||f)/f;x!==1&&(c.save(),c.scale(1,x)),c.beginPath(),c.arc(o.x,o.y/x,f,0,Math.PI*2,!1),x!==1&&c.restore(),this._fillStroke(c,i)}},_fillStroke:function(i,o){var c=o.options;c.fill&&(i.globalAlpha=c.fillOpacity,i.fillStyle=c.fillColor||c.color,i.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(i.setLineDash&&i.setLineDash(o.options&&o.options._dashArray||[]),i.globalAlpha=c.opacity,i.lineWidth=c.weight,i.strokeStyle=c.color,i.lineCap=c.lineCap,i.lineJoin=c.lineJoin,i.stroke())},_onClick:function(i){for(var o=this._map.mouseEventToLayerPoint(i),c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(!(i.type==="click"||i.type==="preclick")||!this._map._draggableMoved(c))&&(f=c);this._fireEvent(f?[f]:!1,i)},_onMouseMove:function(i){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var o=this._map.mouseEventToLayerPoint(i);this._handleMouseHover(i,o)}},_handleMouseOut:function(i){var o=this._hoveredLayer;o&&(ke(this._container,"leaflet-interactive"),this._fireEvent([o],i,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(i,o){if(!this._mouseHoverThrottled){for(var c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(f=c);f!==this._hoveredLayer&&(this._handleMouseOut(i),f&&(ee(this._container,"leaflet-interactive"),this._fireEvent([f],i,"mouseover"),this._hoveredLayer=f)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,i),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(i,o,c){this._map._fireDOMEvent(o,c||o.type,i)},_bringToFront:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(c)c.prev=f;else return;f?f.next=c:c&&(this._drawFirst=c),o.prev=this._drawLast,this._drawLast.next=o,o.next=null,this._drawLast=o,this._requestRedraw(i)}},_bringToBack:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(f)f.next=c;else return;c?c.prev=f:f&&(this._drawLast=f),o.prev=null,o.next=this._drawFirst,this._drawFirst.prev=o,this._drawFirst=o,this._requestRedraw(i)}}});function Zm(i){return Qt.canvas?new Wm(i):null}var po=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(i){return document.createElement("<lvml:"+i+' class="lvml">')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),zT={_initContainer:function(){this._container=$t("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=po("shape");ee(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=po("path"),o.appendChild(i._path),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){var o=i._container;this._container.appendChild(o),i.options.interactive&&i.addInteractiveTarget(o)},_removePath:function(i){var o=i._container;re(o),i.removeInteractiveTarget(o),delete this._layers[u(i)]},_updateStyle:function(i){var o=i._stroke,c=i._fill,f=i.options,x=i._container;x.stroked=!!f.stroke,x.filled=!!f.fill,f.stroke?(o||(o=i._stroke=po("stroke")),x.appendChild(o),o.weight=f.weight+"px",o.color=f.color,o.opacity=f.opacity,f.dashArray?o.dashStyle=C(f.dashArray)?f.dashArray.join(" "):f.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=f.lineCap.replace("butt","flat"),o.joinstyle=f.lineJoin):o&&(x.removeChild(o),i._stroke=null),f.fill?(c||(c=i._fill=po("fill")),x.appendChild(c),c.color=f.fillColor||f.color,c.opacity=f.fillOpacity):c&&(x.removeChild(c),i._fill=null)},_updateCircle:function(i){var o=i._point.round(),c=Math.round(i._radius),f=Math.round(i._radiusY||c);this._setPath(i,i._empty()?"M0 0":"AL "+o.x+","+o.y+" "+c+","+f+" 0,"+65535*360)},_setPath:function(i,o){i._path.v=o},_bringToFront:function(i){jt(i._container)},_bringToBack:function(i){Le(i._container)}},$a=Qt.vml?po:at,mo=bi.extend({_initContainer:function(){this._container=$a("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$a("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){re(this._container),Ue(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=i.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,c.setAttribute("width",o.x),c.setAttribute("height",o.y)),ye(c,i.min),c.setAttribute("viewBox",[i.min.x,i.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(i){var o=i._path=$a("path");i.options.className&&ee(o,i.options.className),i.options.interactive&&ee(o,"leaflet-interactive"),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){re(i._path),i.removeInteractiveTarget(i._path),delete this._layers[u(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var o=i._path,c=i.options;o&&(c.stroke?(o.setAttribute("stroke",c.color),o.setAttribute("stroke-opacity",c.opacity),o.setAttribute("stroke-width",c.weight),o.setAttribute("stroke-linecap",c.lineCap),o.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?o.setAttribute("stroke-dasharray",c.dashArray):o.removeAttribute("stroke-dasharray"),c.dashOffset?o.setAttribute("stroke-dashoffset",c.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),c.fill?(o.setAttribute("fill",c.fillColor||c.color),o.setAttribute("fill-opacity",c.fillOpacity),o.setAttribute("fill-rule",c.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(i,o){this._setPath(i,vt(i._parts,o))},_updateCircle:function(i){var o=i._point,c=Math.max(Math.round(i._radius),1),f=Math.max(Math.round(i._radiusY),1)||c,x="a"+c+","+f+" 0 1,0 ",b=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,b)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){jt(i._path)},_bringToBack:function(i){Le(i._path)}});Qt.vml&&mo.include(zT);function Xm(i){return Qt.svg||Qt.vml?new mo(i):null}xe.include({getRenderer:function(i){var o=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var o=this._paneRenderers[i];return o===void 0&&(o=this._createRenderer({pane:i}),this._paneRenderers[i]=o),o},_createRenderer:function(i){return this.options.preferCanvas&&Zm(i)||Xm(i)}});var Ym=ur.extend({initialize:function(i,o){ur.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Lt(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function HT(i,o){return new Ym(i,o)}mo.create=$a,mo.pointsToPath=vt,Ti.geometryToLayer=Xa,Ti.coordsToLatLng=Uh,Ti.coordsToLatLngs=Ya,Ti.latLngToCoords=Oh,Ti.latLngsToCoords=qa,Ti.getFeature=dr,Ti.asFeature=Qa,xe.mergeOptions({boxZoom:!0});var qm=oi.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){he(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ue(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){re(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cn(),vh(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=$t("div","leaflet-zoom-box",this._container),ee(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var o=new St(this._point,this._startPoint),c=o.getSize();ye(this._box,o.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(re(this._box),ke(this._container,"leaflet-crosshair")),oo(),yh(),Ue(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var o=new pt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});xe.addInitHook("addHandler","boxZoom",qm),xe.mergeOptions({doubleClickZoom:!0});var Qm=oi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var o=this._map,c=o.getZoom(),f=o.options.zoomDelta,x=i.originalEvent.shiftKey?c-f:c+f;o.options.doubleClickZoom==="center"?o.setZoom(x):o.setZoomAround(i.containerPoint,x)}});xe.addInitHook("addHandler","doubleClickZoom",Qm),xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var jm=oi.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Ki(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}ee(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ke(this._map._container,"leaflet-grab"),ke(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=Lt(this._map.options.maxBounds);this._offsetLimit=Gt(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var o=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(o),this._prunePositions(o)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,o){return i-(i-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;i.x<o.min.x&&(i.x=this._viscousLimit(i.x,o.min.x)),i.y<o.min.y&&(i.y=this._viscousLimit(i.y,o.min.y)),i.x>o.max.x&&(i.x=this._viscousLimit(i.x,o.max.x)),i.y>o.max.y&&(i.y=this._viscousLimit(i.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,o=Math.round(i/2),c=this._initialWorldOffset,f=this._draggable._newPos.x,x=(f-o+c)%i+o-c,b=(f+o+c)%i-o-c,F=Math.abs(x+c)<Math.abs(b+c)?x:b;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(i){var o=this._map,c=o.options,f=!c.inertia||i.noInertia||this._times.length<2;if(o.fire("dragend",i),f)o.fire("moveend");else{this._prunePositions(+new Date);var x=this._lastPos.subtract(this._positions[0]),b=(this._lastTime-this._times[0])/1e3,F=c.easeLinearity,Q=x.multiplyBy(F/b),nt=Q.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,nt),Ut=Q.multiplyBy(mt/nt),oe=mt/(c.inertiaDeceleration*F),pe=Ut.multiplyBy(-oe/2).round();!pe.x&&!pe.y?o.fire("moveend"):(pe=o._limitOffset(pe,o.options.maxBounds),k(function(){o.panBy(pe,{duration:oe,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});xe.addInitHook("addHandler","dragging",jm),xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Jm=oi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(i){this._map=i,this._setPanDelta(i.options.keyboardPanDelta),this._setZoomDelta(i.options.zoomDelta)},addHooks:function(){var i=this._map._container;i.tabIndex<=0&&(i.tabIndex="0"),he(i,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ue(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=document.body,o=document.documentElement,c=i.scrollTop||o.scrollTop,f=i.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(f,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(i){var o=this._panKeys={},c=this.keyCodes,f,x;for(f=0,x=c.left.length;f<x;f++)o[c.left[f]]=[-1*i,0];for(f=0,x=c.right.length;f<x;f++)o[c.right[f]]=[i,0];for(f=0,x=c.down.length;f<x;f++)o[c.down[f]]=[0,i];for(f=0,x=c.up.length;f<x;f++)o[c.up[f]]=[0,-1*i]},_setZoomDelta:function(i){var o=this._zoomKeys={},c=this.keyCodes,f,x;for(f=0,x=c.zoomIn.length;f<x;f++)o[c.zoomIn[f]]=i;for(f=0,x=c.zoomOut.length;f<x;f++)o[c.zoomOut[f]]=-i},_addHooks:function(){he(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ue(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(i){if(!(i.altKey||i.ctrlKey||i.metaKey)){var o=i.keyCode,c=this._map,f;if(o in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(f=this._panKeys[o],i.shiftKey&&(f=ot(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(ot(f),c.options.maxBounds)),c.options.worldCopyJump){var x=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(f)));c.panTo(x)}else c.panBy(f)}else if(o in this._zoomKeys)c.setZoom(c.getZoom()+(i.shiftKey?3:1)*this._zoomKeys[o]);else if(o===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;Es(i)}}});xe.addInitHook("addHandler","keyboard",Jm),xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Km=oi.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ue(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=wm(i),c=this._map.options.wheelDebounceTime;this._delta+=o,this._lastMousePos=this._map.mouseEventToContainerPoint(i),this._startTime||(this._startTime=+new Date);var f=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),f),Es(i)},_performZoom:function(){var i=this._map,o=i.getZoom(),c=this._map.options.zoomSnap||0;i._stop();var f=this._delta/(this._map.options.wheelPxPerZoomLevel*4),x=4*Math.log(2/(1+Math.exp(-Math.abs(f))))/Math.LN2,b=c?Math.ceil(x/c)*c:x,F=i._limitZoom(o+(this._delta>0?b:-b))-o;this._delta=0,this._startTime=null,F&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+F):i.setZoomAround(this._lastMousePos,o+F))}});xe.addInitHook("addHandler","scrollWheelZoom",Km);var VT=600;xe.mergeOptions({tapHold:Qt.touchNative&&Qt.safari&&Qt.mobile,tapTolerance:15});var $m=oi.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var o=i.touches[0];this._startPos=this._newPos=new G(o.clientX,o.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(he(document,"touchend",nn),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),VT),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Ue(document,"touchend",nn),Ue(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)},_onMove:function(i){var o=i.touches[0];this._newPos=new G(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,o){var c=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});c._simulated=!0,o.target.dispatchEvent(c)}});xe.addInitHook("addHandler","tapHold",$m),xe.mergeOptions({touchZoom:Qt.touch,bounceAtZoomLimits:!0});var tg=oi.extend({addHooks:function(){ee(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ke(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var o=this._map;if(!(!i.touches||i.touches.length!==2||o._animatingZoom||this._zooming)){var c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(c.add(f)._divideBy(2))),this._startDist=c.distanceTo(f),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),he(document,"touchmove",this._onTouchMove,this),he(document,"touchend touchcancel",this._onTouchEnd,this),nn(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var o=this._map,c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]),x=c.distanceTo(f)/this._startDist;if(this._zoom=o.getScaleZoom(x,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoom<o.getMinZoom()&&x<1||this._zoom>o.getMaxZoom()&&x>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,x===1)return}else{var b=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&b.x===0&&b.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(b),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),Z(this._animRequest);var F=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(F,this,!0),nn(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Z(this._animRequest),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});xe.addInitHook("addHandler","touchZoom",tg),xe.BoxZoom=qm,xe.DoubleClickZoom=Qm,xe.Drag=jm,xe.Keyboard=Jm,xe.ScrollWheelZoom=Km,xe.TapHold=$m,xe.TouchZoom=tg,e.Bounds=St,e.Browser=Qt,e.CRS=ft,e.Canvas=Wm,e.Circle=kh,e.CircleMarker=Za,e.Class=V,e.Control=qn,e.DivIcon=Hm,e.DivOverlay=ai,e.DomEvent=oT,e.DomUtil=sT,e.Draggable=Ki,e.Evented=ut,e.FeatureGroup=Si,e.GeoJSON=Ti,e.GridLayer=fo,e.Handler=oi,e.Icon=hr,e.ImageOverlay=ja,e.LatLng=Y,e.LatLngBounds=pt,e.Layer=Qn,e.LayerGroup=cr,e.LineUtil=yT,e.Map=xe,e.Marker=Wa,e.Mixin=fT,e.Path=$i,e.Point=G,e.PolyUtil=pT,e.Polygon=ur,e.Polyline=Mi,e.Popup=Ja,e.PosAnimation=Sm,e.Projection=ET,e.Rectangle=Ym,e.Renderer=bi,e.SVG=mo,e.SVGOverlay=zm,e.TileLayer=fr,e.Tooltip=Ka,e.Transformation=ct,e.Util=J,e.VideoOverlay=Fm,e.bind=l,e.bounds=Gt,e.canvas=Zm,e.circle=CT,e.circleMarker=AT,e.control=co,e.divIcon=NT,e.extend=r,e.featureGroup=MT,e.geoJSON=Bm,e.geoJson=LT,e.gridLayer=BT,e.icon=TT,e.imageOverlay=IT,e.latLng=it,e.latLngBounds=Lt,e.layerGroup=ST,e.map=aT,e.marker=bT,e.point=ot,e.polygon=RT,e.polyline=PT,e.popup=UT,e.rectangle=HT,e.setOptions=w,e.stamp=u,e.svg=Xm,e.svgOverlay=kT,e.tileLayer=Vm,e.tooltip=OT,e.transformation=ht,e.version=s,e.videoOverlay=DT;var GT=window.L;e.noConflict=function(){return window.L=GT,this},window.L=e}))})(mr,mr.exports)),mr.exports}var R_=P_();const yn=A_(R_);function L_(n,t,e){if(n){const{obsType:s,obsPrefix:r,obsTiles:a}=e||{},{cols:l=8,rows:h=1}=a||{},{width:u=5760,height:d=2880}=t||{};if(s===Mt.AppObsType.Hw){const m=ws(n,"x-image-process=image/resize,m_fixed,w_720,h_360,limit_0/marker,u_plus/imageslim");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-image-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/imageslim`;return ws(n,v)}}}else if(s===Mt.AppObsType.Ali){const m=ws(n,"x-oss-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-oss-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else if(s===Mt.AppObsType.Hs){const m=ws(n,"x-tos-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const S=u/l,w=d/h,v=`x-tos-process=image/crop,x_${_*S},y_${E*w},w_${S},h_${w}/quality,Q_75`;return ws(n,v)}}}else return s===Mt.AppObsType.Aws?n:s===Mt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function I_(n,t){if(n){const{obsType:e}=t||{};if(e===Mt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await Mt.api.getImageInfo(s);return{width:r,height:a}}else if(e===Mt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Mt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===Mt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Mt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===Mt.AppObsType.Aws?{width:5760,height:2880}:e===Mt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function ws(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class D_{marker;options;radarElement;map=null;constructor(t){this.options={radius:t.radius??30,color:t.color??"#108ee9",hFov:t.hFov??90,angle:t.angle??0,className:t.className??"leaflet-radar-marker"},this.radarElement=this.createRadarElement(),this.marker=yn.marker(t.latLng,{icon:yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[this.options.radius*2,this.options.radius*2],iconAnchor:[this.options.radius,this.options.radius]}),interactive:!1})}createRadarElement(){const t=document.createElement("div");t.style.pointerEvents="none",t.style.position="relative";const e=document.createElement("div");return e.style.transition="all 0.3s ease",e.style.display="block",t.appendChild(e),this.updateRadarStyle(),t}updateRadarStyle(){const t=this?.radarElement?.querySelector("div");if(!t)return;const{radius:e,color:s,hFov:r,angle:a}=this.options,h=`conic-gradient(
4
+ */var C_=mr.exports,Xh;function P_(){return Xh||(Xh=1,(function(n,t){(function(e,s){s(t)})(C_,(function(e){var s="1.9.4";function r(i){var o,c,f,x;for(c=1,f=arguments.length;c<f;c++){x=arguments[c];for(o in x)i[o]=x[o]}return i}var a=Object.create||(function(){function i(){}return function(o){return i.prototype=o,new i}})();function l(i,o){var c=Array.prototype.slice;if(i.bind)return i.bind.apply(i,c.call(arguments,1));var f=c.call(arguments,2);return function(){return i.apply(o,f.length?f.concat(c.call(arguments)):arguments)}}var h=0;function u(i){return"_leaflet_id"in i||(i._leaflet_id=++h),i._leaflet_id}function d(i,o,c){var f,x,A,F;return F=function(){f=!1,x&&(A.apply(c,x),x=!1)},A=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(F,o),f=!0)},A}function p(i,o,c){var f=o[1],x=o[0],A=f-x;return i===f&&c?i:((i-x)%A+A)%A+x}function m(){return!1}function _(i,o){if(o===!1)return i;var c=Math.pow(10,o===void 0?6:o);return Math.round(i*c)/c}function E(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function w(i){return E(i).split(/\s+/)}function S(i,o){Object.prototype.hasOwnProperty.call(i,"options")||(i.options=i.options?a(i.options):{});for(var c in o)i.options[c]=o[c];return i.options}function v(i,o,c){var f=[];for(var x in i)f.push(encodeURIComponent(c?x.toUpperCase():x)+"="+encodeURIComponent(i[x]));return(!o||o.indexOf("?")===-1?"?":"&")+f.join("&")}var g=/\{ *([\w_ -]+) *\}/g;function R(i,o){return i.replace(g,function(c,f){var x=o[f];if(x===void 0)throw new Error("No value provided for variable "+c);return typeof x=="function"&&(x=x(o)),x})}var P=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"};function T(i,o){for(var c=0;c<i.length;c++)if(i[c]===o)return c;return-1}var U="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function B(i){return window["webkit"+i]||window["moz"+i]||window["ms"+i]}var N=0;function z(i){var o=+new Date,c=Math.max(0,16-(o-N));return N=o+c,window.setTimeout(i,c)}var D=window.requestAnimationFrame||B("RequestAnimationFrame")||z,M=window.cancelAnimationFrame||B("CancelAnimationFrame")||B("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function k(i,o,c){if(c&&D===z)i.call(o);else return D.call(window,l(i,o))}function Z(i){i&&M.call(window,i)}var J={__proto__:null,extend:r,create:a,bind:l,get lastId(){return h},stamp:u,throttle:d,wrapNum:p,falseFn:m,formatNum:_,trim:E,splitWords:w,setOptions:S,getParamString:v,template:R,isArray:P,indexOf:T,emptyImageUrl:U,requestFn:D,cancelFn:M,requestAnimFrame:k,cancelAnimFrame:Z};function V(){}V.extend=function(i){var o=function(){S(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=o.__super__=this.prototype,f=a(c);f.constructor=o,o.prototype=f;for(var x in this)Object.prototype.hasOwnProperty.call(this,x)&&x!=="prototype"&&x!=="__super__"&&(o[x]=this[x]);return i.statics&&r(o,i.statics),i.includes&&($(i.includes),r.apply(null,[f].concat(i.includes))),r(f,i),delete f.statics,delete f.includes,f.options&&(f.options=c.options?a(c.options):{},r(f.options,i.options)),f._initHooks=[],f.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var A=0,F=f._initHooks.length;A<F;A++)f._initHooks[A].call(this)}},o},V.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},V.mergeOptions=function(i){return r(this.prototype.options,i),this},V.addInitHook=function(i){var o=Array.prototype.slice.call(arguments,1),c=typeof i=="function"?i:function(){this[i].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function $(i){if(!(typeof L>"u"||!L||!L.Mixin)){i=P(i)?i:[i];for(var o=0;o<i.length;o++)i[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var K={on:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o);else{i=w(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c)}return this},off:function(i,o,c){if(!arguments.length)delete this._events;else if(typeof i=="object")for(var f in i)this._off(f,i[f],o);else{i=w(i);for(var x=arguments.length===1,A=0,F=i.length;A<F;A++)x?this._off(i[A]):this._off(i[A],o,c)}return this},_on:function(i,o,c,f){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(i,o,c)===!1){c===this&&(c=void 0);var x={fn:o,ctx:c};f&&(x.once=!0),this._events=this._events||{},this._events[i]=this._events[i]||[],this._events[i].push(x)}},_off:function(i,o,c){var f,x,A;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,A=f.length;x<A;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var F=this._listens(i,o,c);if(F!==!1){var j=f[F];this._firingCount&&(j.fn=m,this._events[i]=f=f.slice()),f.splice(F,1)}}},fire:function(i,o,c){if(!this.listens(i,c))return this;var f=r({},o,{type:i,target:this,sourceTarget:o&&o.sourceTarget||this});if(this._events){var x=this._events[i];if(x){this._firingCount=this._firingCount+1||1;for(var A=0,F=x.length;A<F;A++){var j=x[A],nt=j.fn;j.once&&this.off(i,nt,j.ctx),nt.call(j.ctx||this,f)}this._firingCount--}}return c&&this._propagateEvent(f),this},listens:function(i,o,c,f){typeof i!="string"&&console.warn('"string" type argument expected');var x=o;typeof o!="function"&&(f=!!o,x=void 0,c=void 0);var A=this._events&&this._events[i];if(A&&A.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var F in this._eventParents)if(this._eventParents[F].listens(i,o,c,f))return!0}return!1},_listens:function(i,o,c){if(!this._events)return!1;var f=this._events[i]||[];if(!o)return!!f.length;c===this&&(c=void 0);for(var x=0,A=f.length;x<A;x++)if(f[x].fn===o&&f[x].ctx===c)return x;return!1},once:function(i,o,c){if(typeof i=="object")for(var f in i)this._on(f,i[f],o,!0);else{i=w(i);for(var x=0,A=i.length;x<A;x++)this._on(i[x],o,c,!0)}return this},addEventParent:function(i){return this._eventParents=this._eventParents||{},this._eventParents[u(i)]=i,this},removeEventParent:function(i){return this._eventParents&&delete this._eventParents[u(i)],this},_propagateEvent:function(i){for(var o in this._eventParents)this._eventParents[o].fire(i.type,r({layer:i.target,propagatedFrom:i.target},i),!0)}};K.addEventListener=K.on,K.removeEventListener=K.clearAllEventListeners=K.off,K.addOneTimeEventListener=K.once,K.fireEvent=K.fire,K.hasEventListeners=K.listens;var ut=V.extend(K);function G(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var Tt=Math.trunc||function(i){return i>0?Math.floor(i):Math.ceil(i)};G.prototype={clone:function(){return new G(this.x,this.y)},add:function(i){return this.clone()._add(lt(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(lt(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new G(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new G(this.x/i.x,this.y/i.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Tt(this.x),this.y=Tt(this.y),this},distanceTo:function(i){i=lt(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=lt(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=lt(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+_(this.x)+", "+_(this.y)+")"}};function lt(i,o,c){return i instanceof G?i:P(i)?new G(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new G(i.x,i.y):new G(i,o,c)}function Mt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}Mt.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof G||typeof i[0]=="number"||"x"in i)o=c=lt(i);else if(i=Gt(i),o=i.min,c=i.max,!o||!c)return this;return!this.min&&!this.max?(this.min=o.clone(),this.max=c.clone()):(this.min.x=Math.min(o.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(o.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(i){return lt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return lt(this.min.x,this.max.y)},getTopRight:function(){return lt(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(i){var o,c;return typeof i[0]=="number"||i instanceof G?i=lt(i):i=Gt(i),i instanceof Mt?(o=i.min,c=i.max):o=c=i,o.x>=this.min.x&&c.x<=this.max.x&&o.y>=this.min.y&&c.y<=this.max.y},intersects:function(i){i=Gt(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>=o.x&&f.x<=c.x,F=x.y>=o.y&&f.y<=c.y;return A&&F},overlaps:function(i){i=Gt(i);var o=this.min,c=this.max,f=i.min,x=i.max,A=x.x>o.x&&f.x<c.x,F=x.y>o.y&&f.y<c.y;return A&&F},isValid:function(){return!!(this.min&&this.max)},pad:function(i){var o=this.min,c=this.max,f=Math.abs(o.x-c.x)*i,x=Math.abs(o.y-c.y)*i;return Gt(lt(o.x-f,o.y-x),lt(c.x+f,c.y+x))},equals:function(i){return i?(i=Gt(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function Gt(i,o){return!i||i instanceof Mt?i:new Mt(i,o)}function pt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}pt.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof Y)f=i,x=i;else if(i instanceof pt){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(st(i)||Rt(i)):this;return!o&&!c?(this._southWest=new Y(f.lat,f.lng),this._northEast=new Y(x.lat,x.lng)):(o.lat=Math.min(f.lat,o.lat),o.lng=Math.min(f.lng,o.lng),c.lat=Math.max(x.lat,c.lat),c.lng=Math.max(x.lng,c.lng)),this},pad:function(i){var o=this._southWest,c=this._northEast,f=Math.abs(o.lat-c.lat)*i,x=Math.abs(o.lng-c.lng)*i;return new pt(new Y(o.lat-f,o.lng-x),new Y(c.lat+f,c.lng+x))},getCenter:function(){return new Y((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Y(this.getNorth(),this.getWest())},getSouthEast:function(){return new Y(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(i){typeof i[0]=="number"||i instanceof Y||"lat"in i?i=st(i):i=Rt(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof pt?(f=i.getSouthWest(),x=i.getNorthEast()):f=x=i,f.lat>=o.lat&&x.lat<=c.lat&&f.lng>=o.lng&&x.lng<=c.lng},intersects:function(i){i=Rt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>=o.lat&&f.lat<=c.lat,F=x.lng>=o.lng&&f.lng<=c.lng;return A&&F},overlaps:function(i){i=Rt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),A=x.lat>o.lat&&f.lat<c.lat,F=x.lng>o.lng&&f.lng<c.lng;return A&&F},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Rt(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Rt(i,o){return i instanceof pt?i:new pt(i,o)}function Y(i,o,c){if(isNaN(i)||isNaN(o))throw new Error("Invalid LatLng object: ("+i+", "+o+")");this.lat=+i,this.lng=+o,c!==void 0&&(this.alt=+c)}Y.prototype={equals:function(i,o){if(!i)return!1;i=st(i);var c=Math.max(Math.abs(this.lat-i.lat),Math.abs(this.lng-i.lng));return c<=(o===void 0?1e-9:o)},toString:function(i){return"LatLng("+_(this.lat,i)+", "+_(this.lng,i)+")"},distanceTo:function(i){return Dt.distance(this,st(i))},wrap:function(){return Dt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Rt([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new Y(this.lat,this.lng,this.alt)}};function st(i,o,c){return i instanceof Y?i:P(i)&&typeof i[0]!="object"?i.length===3?new Y(i[0],i[1],i[2]):i.length===2?new Y(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new Y(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new Y(i,o,c)}var ft={latLngToPoint:function(i,o){var c=this.projection.project(i),f=this.scale(o);return this.transformation._transform(c,f)},pointToLatLng:function(i,o){var c=this.scale(o),f=this.transformation.untransform(i,c);return this.projection.unproject(f)},project:function(i){return this.projection.project(i)},unproject:function(i){return this.projection.unproject(i)},scale:function(i){return 256*Math.pow(2,i)},zoom:function(i){return Math.log(i/256)/Math.LN2},getProjectedBounds:function(i){if(this.infinite)return null;var o=this.projection.bounds,c=this.scale(i),f=this.transformation.transform(o.min,c),x=this.transformation.transform(o.max,c);return new Mt(f,x)},infinite:!1,wrapLatLng:function(i){var o=this.wrapLng?p(i.lng,this.wrapLng,!0):i.lng,c=this.wrapLat?p(i.lat,this.wrapLat,!0):i.lat,f=i.alt;return new Y(c,o,f)},wrapLatLngBounds:function(i){var o=i.getCenter(),c=this.wrapLatLng(o),f=o.lat-c.lat,x=o.lng-c.lng;if(f===0&&x===0)return i;var A=i.getSouthWest(),F=i.getNorthEast(),j=new Y(A.lat-f,A.lng-x),nt=new Y(F.lat-f,F.lng-x);return new pt(j,nt)}},Dt=r({},ft,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,A=Math.sin((o.lat-i.lat)*c/2),F=Math.sin((o.lng-i.lng)*c/2),j=A*A+Math.cos(f)*Math.cos(x)*F*F,nt=2*Math.atan2(Math.sqrt(j),Math.sqrt(1-j));return this.R*nt}}),Ut=6378137,zt={R:Ut,MAX_LATITUDE:85.0511287798,project:function(i){var o=Math.PI/180,c=this.MAX_LATITUDE,f=Math.max(Math.min(c,i.lat),-c),x=Math.sin(f*o);return new G(this.R*i.lng*o,this.R*Math.log((1+x)/(1-x))/2)},unproject:function(i){var o=180/Math.PI;return new Y((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=Ut*Math.PI;return new Mt([-i,-i],[i,i])})()};function ce(i,o,c,f){if(P(i)){this._a=i[0],this._b=i[1],this._c=i[2],this._d=i[3];return}this._a=i,this._b=o,this._c=c,this._d=f}ce.prototype={transform:function(i,o){return this._transform(i.clone(),o)},_transform:function(i,o){return o=o||1,i.x=o*(this._a*i.x+this._b),i.y=o*(this._c*i.y+this._d),i},untransform:function(i,o){return o=o||1,new G((i.x/o-this._b)/this._a,(i.y/o-this._d)/this._c)}};function at(i,o,c,f){return new ce(i,o,c,f)}var C=r({},Dt,{code:"EPSG:3857",projection:zt,transformation:(function(){var i=.5/(Math.PI*zt.R);return at(i,.5,-i,.5)})()}),it=r({},C,{code:"EPSG:900913"});function ct(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function _t(i,o){var c="",f,x,A,F,j,nt;for(f=0,A=i.length;f<A;f++){for(j=i[f],x=0,F=j.length;x<F;x++)nt=j[x],c+=(x?"L":"M")+nt.x+" "+nt.y;c+=o?qt.svg?"z":"x":""}return c||"M0 0"}var ht=document.documentElement.style,Ot="ActiveXObject"in window,yt=Ot&&!document.addEventListener,Nt="msLaunchUri"in navigator&&!("documentMode"in document),pe=An("webkit"),ge=An("android"),O=An("android 2")||An("android 3"),b=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Q=ge&&An("Google")&&b<537&&!("AudioNode"in window),ot=!!window.opera,gt=!Nt&&An("chrome"),rt=An("gecko")&&!pe&&!ot&&!Ot,Zt=!gt&&An("safari"),bt=An("phantom"),Ht="OTransition"in ht,Xt=navigator.platform.indexOf("Win")===0,wt=Ot&&"transition"in ht,Lt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!O,ie="MozPerspective"in ht,Yt=!window.L_DISABLE_3D&&(wt||Lt||ie)&&!Ht&&!bt,Ct=typeof orientation<"u"||An("mobile"),le=Ct&&pe,H=Ct&&Lt,St=!window.PointerEvent&&window.MSPointerEvent,At=!!(window.PointerEvent||St),Ft="ontouchstart"in window||!!window.TouchEvent,vt=!window.L_NO_TOUCH&&(Ft||At),dt=Ct&&ot,Wt=Ct&&rt,ae=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,De=(function(){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",m,o),window.removeEventListener("testPassiveEventSupport",m,o)}catch{}return i})(),Te=(function(){return!!document.createElement("canvas").getContext})(),bn=!!(document.createElementNS&&ct("svg").createSVGRect),On=!!bn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ba=!bn&&(function(){try{var i=document.createElement("div");i.innerHTML='<v:shape adj="1"/>';var o=i.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch{return!1}})(),wi=navigator.platform.indexOf("Mac")===0,io=navigator.platform.indexOf("Linux")===0;function An(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var qt={ie:Ot,ielt9:yt,edge:Nt,webkit:pe,android:ge,android23:O,androidStock:Q,opera:ot,chrome:gt,gecko:rt,safari:Zt,phantom:bt,opera12:Ht,win:Xt,ie3d:wt,webkit3d:Lt,gecko3d:ie,any3d:Yt,mobile:Ct,mobileWebkit:le,mobileWebkit3d:H,msPointer:St,pointer:At,touch:vt,touchNative:Ft,mobileOpera:dt,mobileGecko:Wt,retina:ae,passiveEvents:De,canvas:Te,svg:bn,vml:Ba,inlineSvg:On,mac:wi,linux:io},_s=qt.msPointer?"MSPointerDown":"pointerdown",so=qt.msPointer?"MSPointerMove":"pointermove",vs=qt.msPointer?"MSPointerUp":"pointerup",ro=qt.msPointer?"MSPointerCancel":"pointercancel",lr={touchstart:_s,touchmove:so,touchend:vs,touchcancel:ro},Fa={touchstart:X,touchmove:tt,touchend:tt,touchcancel:tt},Ji={},za=!1;function ph(i,o,c){return o==="touchstart"&&et(),Fa[o]?(c=Fa[o].bind(this,c),i.addEventListener(lr[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function mh(i,o,c){if(!lr[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(lr[o],c,!1)}function gh(i){Ji[i.pointerId]=i}function I(i){Ji[i.pointerId]&&(Ji[i.pointerId]=i)}function W(i){delete Ji[i.pointerId]}function et(){za||(document.addEventListener(_s,gh,!0),document.addEventListener(so,I,!0),document.addEventListener(vs,W,!0),document.addEventListener(ro,W,!0),za=!0)}function tt(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Ji)o.touches.push(Ji[c]);o.changedTouches=[o],i(o)}}function X(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&nn(o),tt(i,o)}function Et(i){var o={},c,f;for(f in i)c=i[f],o[f]=c&&c.bind?c.bind(i):c;return i=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var It=200;function Vt(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(A){if(A.detail!==1){f=A.detail;return}if(!(A.pointerType==="mouse"||A.sourceCapabilities&&!A.sourceCapabilities.firesTouchEvents)){var F=Em(A);if(!(F.some(function(nt){return nt instanceof HTMLLabelElement&&nt.attributes.for})&&!F.some(function(nt){return nt instanceof HTMLInputElement||nt instanceof HTMLSelectElement}))){var j=Date.now();j-c<=It?(f++,f===2&&o(Et(A))):f=1,c=j}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function Bt(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var ee=en(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ne=en(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Jt=ne==="webkitTransition"||ne==="OTransition"?ne+"End":"transitionend";function fe(i){return typeof i=="string"?document.getElementById(i):i}function xe(i,o){var c=i.style[o]||i.currentStyle&&i.currentStyle[o];if((!c||c==="auto")&&document.defaultView){var f=document.defaultView.getComputedStyle(i,null);c=f?f[o]:null}return c==="auto"?null:c}function Kt(i,o,c){var f=document.createElement(i);return f.className=o||"",c&&c.appendChild(f),f}function se(i){var o=i.parentNode;o&&o.removeChild(i)}function be(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Qt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Le(i){var o=i.parentNode;o&&o.firstChild!==i&&o.insertBefore(i,o.firstChild)}function ve(i,o){if(i.classList!==void 0)return i.classList.contains(o);var c=si(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function te(i,o){if(i.classList!==void 0)for(var c=w(o),f=0,x=c.length;f<x;f++)i.classList.add(c[f]);else if(!ve(i,o)){var A=si(i);tn(i,(A?A+" ":"")+o)}}function ke(i,o){i.classList!==void 0?i.classList.remove(o):tn(i,E((" "+si(i)+" ").replace(" "+o+" "," ")))}function tn(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function si(i){return i.correspondingElement&&(i=i.correspondingElement),i.className.baseVal===void 0?i.className:i.className.baseVal}function ye(i,o){"opacity"in i.style?i.style.opacity=o:"filter"in i.style&&_n(i,o)}function _n(i,o){var c=!1,f="DXImageTransform.Microsoft.Alpha";try{c=i.filters.item(f)}catch{if(o===1)return}o=Math.round(o*100),c?(c.Enabled=o!==100,c.Opacity=o):i.style.filter+=" progid:"+f+"(opacity="+o+")"}function en(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Fe(i,o,c){var f=o||new G(0,0);i.style[ee]=(qt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function Ee(i,o){i._leaflet_pos=o,qt.any3d?Fe(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Yn(i){return i._leaflet_pos||new G(0,0)}var Cn,oo,_h;if("onselectstart"in document)Cn=function(){he(window,"selectstart",nn)},oo=function(){Ue(window,"selectstart",nn)};else{var ao=en(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Cn=function(){if(ao){var i=document.documentElement.style;_h=i[ao],i[ao]="none"}},oo=function(){ao&&(document.documentElement.style[ao]=_h,_h=void 0)}}function vh(){he(window,"dragstart",nn)}function yh(){Ue(window,"dragstart",nn)}var Ha,Eh;function xh(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Va(),Ha=i,Eh=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Va))}function Va(){Ha&&(Ha.style.outlineStyle=Eh,Ha=void 0,Eh=void 0,Ue(window,"keydown",Va))}function vm(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function wh(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var sT={__proto__:null,TRANSFORM:ee,TRANSITION:ne,TRANSITION_END:Jt,get:fe,getStyle:xe,create:Kt,remove:se,empty:be,toFront:Qt,toBack:Le,hasClass:ve,addClass:te,removeClass:ke,setClass:tn,getClass:si,setOpacity:ye,testProp:en,setTransform:Fe,setPosition:Ee,getPosition:Yn,get disableTextSelection(){return Cn},get enableTextSelection(){return oo},disableImageDrag:vh,enableImageDrag:yh,preventOutline:xh,restoreOutline:Va,getSizedParentNode:vm,getScale:wh};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)Mh(i,x,o[x],c);else{o=w(o);for(var A=0,F=o.length;A<F;A++)Mh(i,o[A],c,f)}return this}var ri="_leaflet_events";function Ue(i,o,c,f){if(arguments.length===1)ym(i),delete i[ri];else if(o&&typeof o=="object")for(var x in o)Th(i,x,o[x],c);else if(o=w(o),arguments.length===2)ym(i,function(j){return T(o,j)!==-1});else for(var A=0,F=o.length;A<F;A++)Th(i,o[A],c,f);return this}function ym(i,o){for(var c in i[ri]){var f=c.split(/\d/)[0];(!o||o(f))&&Th(i,f,null,null,c)}}var Sh={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Mh(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ri]&&i[ri][x])return this;var A=function(j){return c.call(f||i,j||window.event)},F=A;!qt.touchNative&&qt.pointer&&o.indexOf("touch")===0?A=ph(i,o,A):qt.touch&&o==="dblclick"?A=Vt(i,A):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(Sh[o]||o,A,qt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(A=function(j){j=j||window.event,Ah(i,j)&&F(j)},i.addEventListener(Sh[o],A,!1)):i.addEventListener(o,F,!1):i.attachEvent("on"+o,A),i[ri]=i[ri]||{},i[ri][x]=A}function Th(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var A=i[ri]&&i[ri][x];if(!A)return this;!qt.touchNative&&qt.pointer&&o.indexOf("touch")===0?mh(i,o,A):qt.touch&&o==="dblclick"?Bt(i,A):"removeEventListener"in i?i.removeEventListener(Sh[o]||o,A,!1):i.detachEvent("on"+o,A),i[ri][x]=null}function ys(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function bh(i){return Mh(i,"wheel",ys),this}function lo(i){return he(i,"mousedown touchstart dblclick contextmenu",ys),i._leaflet_disable_click=!0,this}function nn(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function Es(i){return nn(i),ys(i),this}function Em(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function xm(i,o){if(!o)return new G(i.clientX,i.clientY);var c=wh(o),f=c.boundingClientRect;return new G((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var rT=qt.linux&&qt.chrome?window.devicePixelRatio:qt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function wm(i){return qt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/rT:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function Ah(i,o){var c=o.relatedTarget;if(!c)return!0;try{for(;c&&c!==i;)c=c.parentNode}catch{return!1}return c!==i}var oT={__proto__:null,on:he,off:Ue,stopPropagation:ys,disableScrollPropagation:bh,disableClickPropagation:lo,preventDefault:nn,stop:Es,getPropagationPath:Em,getMousePosition:xm,getWheelDelta:wm,isExternalTarget:Ah,addListener:he,removeListener:Ue},Sm=ut.extend({run:function(i,o,c,f){this.stop(),this._el=i,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(f||.5,.2),this._startPos=Yn(i),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=k(this._animate,this),this._step()},_step:function(i){var o=+new Date-this._startTime,c=this._duration*1e3;o<c?this._runFrame(this._easeOut(o/c),i):(this._runFrame(1),this._complete())},_runFrame:function(i,o){var c=this._startPos.add(this._offset.multiplyBy(i));o&&c._round(),Ee(this._el,c),this.fire("step")},_complete:function(){Z(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),we=ut.extend({options:{crs:C,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(i,o){o=S(this,o),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(i),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),o.maxBounds&&this.setMaxBounds(o.maxBounds),o.zoom!==void 0&&(this._zoom=this._limitZoom(o.zoom)),o.center&&o.zoom!==void 0&&this.setView(st(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ne&&qt.any3d&&!qt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),he(this._proxy,Jt,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(i,o,c){if(o=o===void 0?this._zoom:this._limitZoom(o),i=this._limitCenter(st(i),o,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=r({animate:c.animate},c.zoom),c.pan=r({animate:c.animate,duration:c.duration},c.pan));var f=this._zoom!==o?this._tryAnimatedZoom&&this._tryAnimatedZoom(i,o,c.zoom):this._tryAnimatedPan(i,c.pan);if(f)return clearTimeout(this._sizeTimer),this}return this._resetView(i,o,c.pan&&c.pan.noMoveStart),this},setZoom:function(i,o){return this._loaded?this.setView(this.getCenter(),i,{zoom:o}):(this._zoom=i,this)},zoomIn:function(i,o){return i=i||(qt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(qt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-i,o)},setZoomAround:function(i,o,c){var f=this.getZoomScale(o),x=this.getSize().divideBy(2),A=i instanceof G?i:this.latLngToContainerPoint(i),F=A.subtract(x).multiplyBy(1-1/f),j=this.containerPointToLatLng(x.add(F));return this.setView(j,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Rt(i);var c=lt(o.paddingTopLeft||o.padding||[0,0]),f=lt(o.paddingBottomRight||o.padding||[0,0]),x=this.getBoundsZoom(i,!1,c.add(f));if(x=typeof o.maxZoom=="number"?Math.min(o.maxZoom,x):x,x===1/0)return{center:i.getCenter(),zoom:x};var A=f.subtract(c).divideBy(2),F=this.project(i.getSouthWest(),x),j=this.project(i.getNorthEast(),x),nt=this.unproject(F.add(j).divideBy(2).add(A),x);return{center:nt,zoom:x}},fitBounds:function(i,o){if(i=Rt(i),!i.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(i,o);return this.setView(c.center,c.zoom,o)},fitWorld:function(i){return this.fitBounds([[-90,-180],[90,180]],i)},panTo:function(i,o){return this.setView(i,this._zoom,{pan:o})},panBy:function(i,o){if(i=lt(i).round(),o=o||{},!i.x&&!i.y)return this.fire("moveend");if(o.animate!==!0&&!this.getSize().contains(i))return this._resetView(this.unproject(this.project(this.getCenter()).add(i)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Sm,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o.noMoveStart||this.fire("movestart"),o.animate!==!1){te(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(i).round();this._panAnim.run(this._mapPane,c,o.duration||.25,o.easeLinearity)}else this._rawPanBy(i),this.fire("move").fire("moveend");return this},flyTo:function(i,o,c){if(c=c||{},c.animate===!1||!qt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),A=this.getSize(),F=this._zoom;i=st(i),o=o===void 0?F:o;var j=Math.max(A.x,A.y),nt=j*this.getZoomScale(F,o),mt=x.distanceTo(f)||1,kt=1.42,re=kt*kt;function me(We){var tl=We?-1:1,qT=We?nt:j,QT=nt*nt-j*j+tl*re*re*mt*mt,jT=2*qT*re*mt,Bh=QT/jT,ig=Math.sqrt(Bh*Bh+1)-Bh,JT=ig<1e-9?-18:Math.log(ig);return JT}function dn(We){return(Math.exp(We)-Math.exp(-We))/2}function je(We){return(Math.exp(We)+Math.exp(-We))/2}function Bn(We){return dn(We)/je(We)}var vn=me(0);function pr(We){return j*(je(vn)/je(vn+kt*We))}function WT(We){return j*(je(vn)*Bn(vn+kt*We)-dn(vn))/re}function ZT(We){return 1-Math.pow(1-We,1.5)}var XT=Date.now(),eg=(me(1)-vn)/kt,YT=c.duration?1e3*c.duration:1e3*eg*.8;function ng(){var We=(Date.now()-XT)/YT,tl=ZT(We)*eg;We<=1?(this._flyToFrame=k(ng,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(WT(tl)/mt)),F),this.getScaleZoom(j/pr(tl),F),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),ng.call(this),this},flyToBounds:function(i,o){var c=this._getBoundsCenterZoom(i,o);return this.flyTo(c.center,c.zoom,o)},setMaxBounds:function(i){return i=Rt(i),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),i.isValid()?(this.options.maxBounds=i,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(i){var o=this.options.minZoom;return this.options.minZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(i):this},setMaxZoom:function(i){var o=this.options.maxZoom;return this.options.maxZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,o){this._enforcingBounds=!0;var c=this.getCenter(),f=this._limitCenter(c,this._zoom,Rt(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=lt(o.paddingTopLeft||o.padding||[0,0]),f=lt(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),A=this.project(i),F=this.getPixelBounds(),j=Gt([F.min.add(c),F.max.subtract(f)]),nt=j.getSize();if(!j.contains(A)){this._enforcingBounds=!0;var mt=A.subtract(j.getCenter()),kt=j.extend(A).getSize().subtract(nt);x.x+=mt.x<0?-kt.x:kt.x,x.y+=mt.y<0?-kt.y:kt.y,this.panTo(this.unproject(x),o),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=r({animate:!1,pan:!0},i===!0?{animate:!0}:i);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),f=o.divideBy(2).round(),x=c.divideBy(2).round(),A=f.subtract(x);return!A.x&&!A.y?this:(i.animate&&i.pan?this.panBy(A):(i.pan&&this._rawPanBy(A),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=r({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,c,i):navigator.geolocation.getCurrentPosition(o,c,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var o=i.code,c=i.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var o=i.coords.latitude,c=i.coords.longitude,f=new Y(o,c),x=f.toBounds(i.coords.accuracy*2),A=this._locateOptions;if(A.setView){var F=this.getBoundsZoom(x);this.setView(f,A.maxZoom?Math.min(F,A.maxZoom):F)}var j={latlng:f,bounds:x,timestamp:i.timestamp};for(var nt in i.coords)typeof i.coords[nt]=="number"&&(j[nt]=i.coords[nt]);this.fire("locationfound",j)}},addHandler:function(i,o){if(!o)return this;var c=this[i]=new o(this);return this._handlers.push(c),this.options[i]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),se(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(Z(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)se(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,o){var c="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),f=Kt("div",c,o||this._mapPane);return i&&(this._panes[i]=f),f},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),o=this.unproject(i.getBottomLeft()),c=this.unproject(i.getTopRight());return new pt(o,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(i,o,c){i=Rt(i),c=lt(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),A=this.getMaxZoom(),F=i.getNorthWest(),j=i.getSouthEast(),nt=this.getSize().subtract(c),mt=Gt(this.project(j,f),this.project(F,f)).getSize(),kt=qt.any3d?this.options.zoomSnap:1,re=nt.x/mt.x,me=nt.y/mt.y,dn=o?Math.max(re,me):Math.min(re,me);return f=this.getScaleZoom(dn,f),kt&&(f=Math.round(f/(kt/100))*(kt/100),f=o?Math.ceil(f/kt)*kt:Math.floor(f/kt)*kt),Math.max(x,Math.min(A,f))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new G(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,o){var c=this._getTopLeftPoint(i,o);return new Mt(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,o){var c=this.options.crs;return o=o===void 0?this._zoom:o,c.scale(i)/c.scale(o)},getScaleZoom:function(i,o){var c=this.options.crs;o=o===void 0?this._zoom:o;var f=c.zoom(i*c.scale(o));return isNaN(f)?1/0:f},project:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(st(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(lt(i),o)},layerPointToLatLng:function(i){var o=lt(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(st(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(st(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Rt(i))},distance:function(i,o){return this.options.crs.distance(st(i),st(o))},containerPointToLayerPoint:function(i){return lt(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return lt(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(lt(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(st(i)))},mouseEventToContainerPoint:function(i){return xm(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var o=this._container=fe(i);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");he(o,"scroll",this._onScroll,this),this._containerId=u(o)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&qt.any3d,te(i,"leaflet-container"+(qt.touch?" leaflet-touch":"")+(qt.retina?" leaflet-retina":"")+(qt.ielt9?" leaflet-oldie":"")+(qt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=xe(i,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ee(this._mapPane,new G(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(te(i.markerPane,"leaflet-zoom-hide"),te(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,o,c){Ee(this._mapPane,new G(0,0));var f=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var x=this._zoom!==o;this._moveStart(x,c)._move(i,o)._moveEnd(x),this.fire("viewreset"),f&&this.fire("load")},_moveStart:function(i,o){return i&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(i,o,c,f){o===void 0&&(o=this._zoom);var x=this._zoom!==o;return this._zoom=o,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),f?c&&c.pinch&&this.fire("zoom",c):((x||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return Z(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){Ee(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[u(this._container)]=this;var o=i?Ue:he;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),qt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){Z(this._resizeRequest),this._resizeRequest=k(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,o){for(var c=[],f,x=o==="mouseout"||o==="mouseover",A=i.target||i.srcElement,F=!1;A;){if(f=this._targets[u(A)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){F=!0;break}if(f&&f.listens(o,!0)&&(x&&!Ah(A,i)||(c.push(f),x))||A===this._container)break;A=A.parentNode}return!c.length&&!F&&!x&&this.listens(o,!0)&&(c=[this]),c},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;i=i.parentNode}},_handleDOMEvent:function(i){var o=i.target||i.srcElement;if(!(!this._loaded||o._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(o))){var c=i.type;c==="mousedown"&&xh(o),this._fireDOMEvent(i,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,o,c){if(i.type==="click"){var f=r({},i);f.type="preclick",this._fireDOMEvent(f,f.type,c)}var x=this._findEventTargets(i,o);if(c){for(var A=[],F=0;F<c.length;F++)c[F].listens(o,!0)&&A.push(c[F]);x=A.concat(x)}if(x.length){o==="contextmenu"&&nn(i);var j=x[0],nt={originalEvent:i};if(i.type!=="keypress"&&i.type!=="keydown"&&i.type!=="keyup"){var mt=j.getLatLng&&(!j._radius||j._radius<=10);nt.containerPoint=mt?this.latLngToContainerPoint(j.getLatLng()):this.mouseEventToContainerPoint(i),nt.layerPoint=this.containerPointToLayerPoint(nt.containerPoint),nt.latlng=mt?j.getLatLng():this.layerPointToLatLng(nt.layerPoint)}for(F=0;F<x.length;F++)if(x[F].fire(o,nt,!0),nt.originalEvent._stopped||x[F].options.bubblingMouseEvents===!1&&T(this._mouseEvents,o)!==-1)return}},_draggableMoved:function(i){return i=i.dragging&&i.dragging.enabled()?i:this,i.dragging&&i.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,o=this._handlers.length;i<o;i++)this._handlers[i].disable()},whenReady:function(i,o){return this._loaded?i.call(o||this,{target:this}):this.on("load",i,o),this},_getMapPanePos:function(){return Yn(this._mapPane)||new G(0,0)},_moved:function(){var i=this._getMapPanePos();return i&&!i.equals([0,0])},_getTopLeftPoint:function(i,o){var c=i&&o!==void 0?this._getNewPixelOrigin(i,o):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(i,o){var c=this.getSize()._divideBy(2);return this.project(i,o)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return this.project(i,o)._subtract(f)},_latLngBoundsToNewLayerBounds:function(i,o,c){var f=this._getNewPixelOrigin(c,o);return Gt([this.project(i.getSouthWest(),o)._subtract(f),this.project(i.getNorthWest(),o)._subtract(f),this.project(i.getSouthEast(),o)._subtract(f),this.project(i.getNorthEast(),o)._subtract(f)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(i){return this.latLngToLayerPoint(i).subtract(this._getCenterLayerPoint())},_limitCenter:function(i,o,c){if(!c)return i;var f=this.project(i,o),x=this.getSize().divideBy(2),A=new Mt(f.subtract(x),f.add(x)),F=this._getBoundsOffset(A,c,o);return Math.abs(F.x)<=1&&Math.abs(F.y)<=1?i:this.unproject(f.add(F),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new Mt(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=Gt(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),A=f.max.subtract(i.max),F=this._rebound(x.x,-A.x),j=this._rebound(x.y,-A.y);return new G(F,j)},_rebound:function(i,o){return i+o>0?Math.round(i-o)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(o))},_limitZoom:function(i){var o=this.getMinZoom(),c=this.getMaxZoom(),f=qt.any3d?this.options.zoomSnap:1;return f&&(i=Math.round(i/f)*f),Math.max(o,Math.min(c,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ke(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,o){var c=this._getCenterOffset(i)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,o),!0)},_createAnimProxy:function(){var i=this._proxy=Kt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(o){var c=ee,f=this._proxy.style[c];Fe(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),f===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){se(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),o=this.getZoom();Fe(this._proxy,this.project(i,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,o,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var f=this.getZoomScale(o),x=this._getCenterOffset(i)._divideBy(1-1/f);return c.animate!==!0&&!this.getSize().contains(x)?!1:(k(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(i,o,!0)},this),!0)},_animateZoom:function(i,o,c,f){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=o,te(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:o,noUpdate:f}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ke(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function aT(i,o){return new we(i,o)}var qn=V.extend({options:{position:"topright"},initialize:function(i){S(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var o=this._map;return o&&o.removeControl(this),this.options.position=i,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var o=this._container=this.onAdd(i),c=this.getPosition(),f=i._controlCorners[c];return te(o,"leaflet-control"),c.indexOf("bottom")!==-1?f.insertBefore(o,f.firstChild):f.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(se(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),co=function(i){return new qn(i)};we.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this},_initControlPos:function(){var i=this._controlCorners={},o="leaflet-",c=this._controlContainer=Kt("div",o+"control-container",this._container);function f(x,A){var F=o+x+" "+o+A;i[x+A]=Kt("div",F,c)}f("top","left"),f("top","right"),f("bottom","left"),f("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)se(this._controlCorners[i]);se(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Mm=qn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,o,c,f){return c<f?-1:f<c?1:0}},initialize:function(i,o,c){S(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var f in i)this._addLayer(i[f],f);for(f in o)this._addLayer(o[f],f,!0)},onAdd:function(i){this._initLayout(),this._update(),this._map=i,i.on("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(i){return qn.prototype.addTo.call(this,i),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(i,o){return this._addLayer(i,o),this._map?this._update():this},addOverlay:function(i,o){return this._addLayer(i,o,!0),this._map?this._update():this},removeLayer:function(i){i.off("add remove",this._onLayerChange,this);var o=this._getLayer(u(i));return o&&this._layers.splice(this._layers.indexOf(o),1),this._map?this._update():this},expand:function(){te(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var i=this._map.getSize().y-(this._container.offsetTop+50);return i<this._section.clientHeight?(te(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=i+"px"):ke(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ke(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var i="leaflet-control-layers",o=this._container=Kt("div",i),c=this.options.collapsed;o.setAttribute("aria-haspopup",!0),lo(o),bh(o);var f=this._section=Kt("section",i+"-list");c&&(this._map.on("click",this.collapse,this),he(o,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var x=this._layersLink=Kt("a",i+"-toggle",o);x.href="#",x.title="Layers",x.setAttribute("role","button"),he(x,{keydown:function(A){A.keyCode===13&&this._expandSafely()},click:function(A){nn(A),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Kt("div",i+"-base",f),this._separator=Kt("div",i+"-separator",f),this._overlaysList=Kt("div",i+"-overlays",f),o.appendChild(f)},_getLayer:function(i){for(var o=0;o<this._layers.length;o++)if(this._layers[o]&&u(this._layers[o].layer)===i)return this._layers[o]},_addLayer:function(i,o,c){this._map&&i.on("add remove",this._onLayerChange,this),this._layers.push({layer:i,name:o,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(f,x){return this.options.sortFunction(f.layer,x.layer,f.name,x.name)},this)),this.options.autoZIndex&&i.setZIndex&&(this._lastZIndex++,i.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;be(this._baseLayersList),be(this._overlaysList),this._layerControlInputs=[];var i,o,c,f,x=0;for(c=0;c<this._layers.length;c++)f=this._layers[c],this._addItem(f),o=o||f.overlay,i=i||!f.overlay,x+=f.overlay?0:1;return this.options.hideSingleBase&&(i=i&&x>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=o&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var o=this._getLayer(u(i.target)),c=o.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;c&&this._map.fire(c,o)},_createRadioElement:function(i,o){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+i+'"'+(o?' checked="checked"':"")+"/>",f=document.createElement("div");return f.innerHTML=c,f.firstChild},_addItem:function(i){var o=document.createElement("label"),c=this._map.hasLayer(i.layer),f;i.overlay?(f=document.createElement("input"),f.type="checkbox",f.className="leaflet-control-layers-selector",f.defaultChecked=c):f=this._createRadioElement("leaflet-base-layers_"+u(this),c),this._layerControlInputs.push(f),f.layerId=u(i.layer),he(f,"click",this._onInputClick,this);var x=document.createElement("span");x.innerHTML=" "+i.name;var A=document.createElement("span");o.appendChild(A),A.appendChild(f),A.appendChild(x);var F=i.overlay?this._overlaysList:this._baseLayersList;return F.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var A=i.length-1;A>=0;A--)o=i[A],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(A=0;A<x.length;A++)this._map.hasLayer(x[A])&&this._map.removeLayer(x[A]);for(A=0;A<f.length;A++)this._map.hasLayer(f[A])||this._map.addLayer(f[A]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var i=this._layerControlInputs,o,c,f=this._map.getZoom(),x=i.length-1;x>=0;x--)o=i[x],c=this._getLayer(o.layerId).layer,o.disabled=c.options.minZoom!==void 0&&f<c.options.minZoom||c.options.maxZoom!==void 0&&f>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;this._preventClick=!0,he(i,"click",nn),this.expand();var o=this;setTimeout(function(){Ue(i,"click",nn),o._preventClick=!1})}}),lT=function(i,o,c){return new Mm(i,o,c)},Ch=qn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(i){var o="leaflet-control-zoom",c=Kt("div",o+" leaflet-bar"),f=this.options;return this._zoomInButton=this._createButton(f.zoomInText,f.zoomInTitle,o+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(f.zoomOutText,f.zoomOutTitle,o+"-out",c,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(i){i.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(i){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(i.shiftKey?3:1))},_zoomOut:function(i){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,o,c,f,x){var A=Kt("a",c,f);return A.innerHTML=i,A.href="#",A.title=o,A.setAttribute("role","button"),A.setAttribute("aria-label",o),lo(A),he(A,"click",Es),he(A,"click",x,this),he(A,"click",this._refocusOnMap,this),A},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";ke(this._zoomInButton,o),ke(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&(te(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&(te(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});we.mergeOptions({zoomControl:!0}),we.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Ch,this.addControl(this.zoomControl))});var cT=function(i){return new Ch(i)},Tm=qn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var o="leaflet-control-scale",c=Kt("div",o),f=this.options;return this._addScales(f,o+"-line",c),i.on(f.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),c},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,o,c){i.metric&&(this._mScale=Kt("div",o,c)),i.imperial&&(this._iScale=Kt("div",o,c))},_update:function(){var i=this._map,o=i.getSize().y/2,c=i.distance(i.containerPointToLatLng([0,o]),i.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(c)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var o=this._getRoundNum(i),c=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,c,o/i)},_updateImperial:function(i){var o=i*3.2808399,c,f,x;o>5280?(c=o/5280,f=this._getRoundNum(c),this._updateScale(this._iScale,f+" mi",f/c)):(x=this._getRoundNum(o),this._updateScale(this._iScale,x+" ft",x/o))},_updateScale:function(i,o,c){i.style.width=Math.round(this.options.maxWidth*c)+"px",i.innerHTML=o},_getRoundNum:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),c=i/o;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,o*c}}),hT=function(i){return new Tm(i)},uT='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ph=qn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(qt.inlineSvg?uT+" ":"")+"Leaflet</a>"},initialize:function(i){S(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Kt("div","leaflet-control-attribution"),lo(this._container);for(var o in i._layers)i._layers[o].getAttribution&&this.addAttribution(i._layers[o].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var o in this._attributions)this._attributions[o]&&i.push(o);var c=[];this.options.prefix&&c.push(this.options.prefix),i.length&&c.push(i.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});we.mergeOptions({attributionControl:!0}),we.addInitHook(function(){this.options.attributionControl&&new Ph().addTo(this)});var dT=function(i){return new Ph(i)};qn.Layers=Mm,qn.Zoom=Ch,qn.Scale=Tm,qn.Attribution=Ph,co.layers=lT,co.zoom=cT,co.scale=hT,co.attribution=dT;var oi=V.extend({initialize:function(i){this._map=i},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});oi.addTo=function(i,o){return i.addHandler(o,this),this};var fT={Events:K},bm=qt.touch?"touchstart mousedown":"mousedown",Ki=ut.extend({options:{clickTolerance:3},initialize:function(i,o,c,f){S(this,f),this._element=i,this._dragStartTarget=o||i,this._preventOutline=c},enable:function(){this._enabled||(he(this._dragStartTarget,bm,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ki._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,bm,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!ve(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){Ki._dragging===this&&this.finishDrag();return}if(!(Ki._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Ki._dragging=this,this._preventOutline&&xh(this._element),vh(),Cn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=vm(this._element);this._startPoint=new G(o.clientX,o.clientY),this._startPos=Yn(this._element),this._parentScale=wh(c);var f=i.type==="mousedown";he(document,f?"mousemove":"touchmove",this._onMove,this),he(document,f?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var o=i.touches&&i.touches.length===1?i.touches[0]:i,c=new G(o.clientX,o.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,nn(i),this._moved||(this.fire("dragstart"),this._moved=!0,te(document.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),te(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=i,this._updatePosition())}},_updatePosition:function(){var i={originalEvent:this._lastEvent};this.fire("predrag",i),Ee(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){ke(document.body,"leaflet-dragging"),this._lastTarget&&(ke(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),yh(),oo();var o=this._moved&&this._moving;this._moving=!1,Ki._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function Am(i,o,c){var f,x=[1,4,2,8],A,F,j,nt,mt,kt,re,me;for(A=0,kt=i.length;A<kt;A++)i[A]._code=xs(i[A],o);for(j=0;j<4;j++){for(re=x[j],f=[],A=0,kt=i.length,F=kt-1;A<kt;F=A++)nt=i[A],mt=i[F],nt._code&re?mt._code&re||(me=Ga(mt,nt,re,o,c),me._code=xs(me,o),f.push(me)):(mt._code&re&&(me=Ga(mt,nt,re,o,c),me._code=xs(me,o),f.push(me)),f.push(nt));i=f}return i}function Cm(i,o){var c,f,x,A,F,j,nt,mt,kt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var re=st([0,0]),me=Rt(i),dn=me.getNorthWest().distanceTo(me.getSouthWest())*me.getNorthEast().distanceTo(me.getNorthWest());dn<1700&&(re=Rh(i));var je=i.length,Bn=[];for(c=0;c<je;c++){var vn=st(i[c]);Bn.push(o.project(st([vn.lat-re.lat,vn.lng-re.lng])))}for(j=nt=mt=0,c=0,f=je-1;c<je;f=c++)x=Bn[c],A=Bn[f],F=x.y*A.x-A.y*x.x,nt+=(x.x+A.x)*F,mt+=(x.y+A.y)*F,j+=F*3;j===0?kt=Bn[0]:kt=[nt/j,mt/j];var pr=o.unproject(lt(kt));return st([pr.lat+re.lat,pr.lng+re.lng])}function Rh(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var A=st(i[x]);o+=A.lat,c+=A.lng,f++}return st([o/f,c/f])}var pT={__proto__:null,clipPolygon:Am,polygonCenter:Cm,centroid:Rh};function Pm(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=_T(i,c),i=gT(i,c),i}function Rm(i,o,c){return Math.sqrt(ho(i,o,c,!0))}function mT(i,o,c){return ho(i,o,c)}function gT(i,o){var c=i.length,f=typeof Uint8Array<"u"?Uint8Array:Array,x=new f(c);x[0]=x[c-1]=1,Lh(i,x,o,0,c-1);var A,F=[];for(A=0;A<c;A++)x[A]&&F.push(i[A]);return F}function Lh(i,o,c,f,x){var A=0,F,j,nt;for(j=f+1;j<=x-1;j++)nt=ho(i[j],i[f],i[x],!0),nt>A&&(F=j,A=nt);A>c&&(o[F]=1,Lh(i,o,c,f,F),Lh(i,o,c,F,x))}function _T(i,o){for(var c=[i[0]],f=1,x=0,A=i.length;f<A;f++)vT(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<A-1&&c.push(i[A-1]),c}var Lm;function Im(i,o,c,f,x){var A=f?Lm:xs(i,c),F=xs(o,c),j,nt,mt;for(Lm=F;;){if(!(A|F))return[i,o];if(A&F)return!1;j=A||F,nt=Ga(i,o,j,c,x),mt=xs(nt,c),j===A?(i=nt,A=mt):(o=nt,F=mt)}}function Ga(i,o,c,f,x){var A=o.x-i.x,F=o.y-i.y,j=f.min,nt=f.max,mt,kt;return c&8?(mt=i.x+A*(nt.y-i.y)/F,kt=nt.y):c&4?(mt=i.x+A*(j.y-i.y)/F,kt=j.y):c&2?(mt=nt.x,kt=i.y+F*(nt.x-i.x)/A):c&1&&(mt=j.x,kt=i.y+F*(j.x-i.x)/A),new G(mt,kt,x)}function xs(i,o){var c=0;return i.x<o.min.x?c|=1:i.x>o.max.x&&(c|=2),i.y<o.min.y?c|=4:i.y>o.max.y&&(c|=8),c}function vT(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function ho(i,o,c,f){var x=o.x,A=o.y,F=c.x-x,j=c.y-A,nt=F*F+j*j,mt;return nt>0&&(mt=((i.x-x)*F+(i.y-A)*j)/nt,mt>1?(x=c.x,A=c.y):mt>0&&(x+=F*mt,A+=j*mt)),F=i.x-x,j=i.y-A,f?F*F+j*j:new G(x,A)}function Nn(i){return!P(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Dm(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Nn(i)}function km(i,o){var c,f,x,A,F,j,nt,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Nn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var kt=st([0,0]),re=Rt(i),me=re.getNorthWest().distanceTo(re.getSouthWest())*re.getNorthEast().distanceTo(re.getNorthWest());me<1700&&(kt=Rh(i));var dn=i.length,je=[];for(c=0;c<dn;c++){var Bn=st(i[c]);je.push(o.project(st([Bn.lat-kt.lat,Bn.lng-kt.lng])))}for(c=0,f=0;c<dn-1;c++)f+=je[c].distanceTo(je[c+1])/2;if(f===0)mt=je[0];else for(c=0,A=0;c<dn-1;c++)if(F=je[c],j=je[c+1],x=F.distanceTo(j),A+=x,A>f){nt=(A-f)/x,mt=[j.x-nt*(j.x-F.x),j.y-nt*(j.y-F.y)];break}var vn=o.unproject(lt(mt));return st([vn.lat+kt.lat,vn.lng+kt.lng])}var yT={__proto__:null,simplify:Pm,pointToSegmentDistance:Rm,closestPointOnSegment:mT,clipSegment:Im,_getEdgeIntersection:Ga,_getBitCode:xs,_sqClosestPointOnSegment:ho,isFlat:Nn,_flat:Dm,polylineCenter:km},Ih={project:function(i){return new G(i.lng,i.lat)},unproject:function(i){return new Y(i.y,i.x)},bounds:new Mt([-180,-90],[180,90])},Dh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Mt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(i){var o=Math.PI/180,c=this.R,f=i.lat*o,x=this.R_MINOR/c,A=Math.sqrt(1-x*x),F=A*Math.sin(f),j=Math.tan(Math.PI/4-f/2)/Math.pow((1-F)/(1+F),A/2);return f=-c*Math.log(Math.max(j,1e-10)),new G(i.lng*o*c,f)},unproject:function(i){for(var o=180/Math.PI,c=this.R,f=this.R_MINOR/c,x=Math.sqrt(1-f*f),A=Math.exp(-i.y/c),F=Math.PI/2-2*Math.atan(A),j=0,nt=.1,mt;j<15&&Math.abs(nt)>1e-7;j++)mt=x*Math.sin(F),mt=Math.pow((1-mt)/(1+mt),x/2),nt=Math.PI/2-2*Math.atan(A*mt)-F,F+=nt;return new Y(F*o,i.x*o/c)}},ET={__proto__:null,LonLat:Ih,Mercator:Dh,SphericalMercator:zt},xT=r({},Dt,{code:"EPSG:3395",projection:Dh,transformation:(function(){var i=.5/(Math.PI*Dh.R);return at(i,.5,-i,.5)})()}),Um=r({},Dt,{code:"EPSG:4326",projection:Ih,transformation:at(1/180,1,-1/180,.5)}),wT=r({},ft,{projection:Ih,transformation:at(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,o){var c=o.lng-i.lng,f=o.lat-i.lat;return Math.sqrt(c*c+f*f)},infinite:!0});ft.Earth=Dt,ft.EPSG3395=xT,ft.EPSG3857=C,ft.EPSG900913=it,ft.EPSG4326=Um,ft.Simple=wT;var Qn=ut.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[u(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[u(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var o=i.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var c=this.getEvents();o.on(c,this),this.once("remove",function(){o.off(c,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});we.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var o=u(i);return this._layers[o]?this:(this._layers[o]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var o=u(i);return this._layers[o]?(this._loaded&&i.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return u(i)in this._layers},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},_addLayers:function(i){i=i?P(i)?i:[i]:[];for(var o=0,c=i.length;o<c;o++)this.addLayer(i[o])},_addZoomLimit:function(i){(!isNaN(i.options.maxZoom)||!isNaN(i.options.minZoom))&&(this._zoomBoundLayers[u(i)]=i,this._updateZoomLevels())},_removeZoomLimit:function(i){var o=u(i);this._zoomBoundLayers[o]&&(delete this._zoomBoundLayers[o],this._updateZoomLevels())},_updateZoomLevels:function(){var i=1/0,o=-1/0,c=this._getZoomSpan();for(var f in this._zoomBoundLayers){var x=this._zoomBoundLayers[f].options;i=x.minZoom===void 0?i:Math.min(i,x.minZoom),o=x.maxZoom===void 0?o:Math.max(o,x.maxZoom)}this._layersMaxZoom=o===-1/0?void 0:o,this._layersMinZoom=i===1/0?void 0:i,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var cr=Qn.extend({initialize:function(i,o){S(this,o),this._layers={};var c,f;if(i)for(c=0,f=i.length;c<f;c++)this.addLayer(i[c])},addLayer:function(i){var o=this.getLayerId(i);return this._layers[o]=i,this._map&&this._map.addLayer(i),this},removeLayer:function(i){var o=i in this._layers?i:this.getLayerId(i);return this._map&&this._layers[o]&&this._map.removeLayer(this._layers[o]),delete this._layers[o],this},hasLayer:function(i){var o=typeof i=="number"?i:this.getLayerId(i);return o in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(i){var o=Array.prototype.slice.call(arguments,1),c,f;for(c in this._layers)f=this._layers[c],f[i]&&f[i].apply(f,o);return this},onAdd:function(i){this.eachLayer(i.addLayer,i)},onRemove:function(i){this.eachLayer(i.removeLayer,i)},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},getLayer:function(i){return this._layers[i]},getLayers:function(){var i=[];return this.eachLayer(i.push,i),i},setZIndex:function(i){return this.invoke("setZIndex",i)},getLayerId:function(i){return u(i)}}),ST=function(i,o){return new cr(i,o)},Si=cr.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),cr.prototype.addLayer.call(this,i),this.fire("layeradd",{layer:i}))},removeLayer:function(i){return this.hasLayer(i)?(i in this._layers&&(i=this._layers[i]),i.removeEventParent(this),cr.prototype.removeLayer.call(this,i),this.fire("layerremove",{layer:i})):this},setStyle:function(i){return this.invoke("setStyle",i)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var i=new pt;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),MT=function(i,o){return new Si(i,o)},hr=V.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(i){S(this,i)},createIcon:function(i){return this._createIcon("icon",i)},createShadow:function(i){return this._createIcon("shadow",i)},_createIcon:function(i,o){var c=this._getIconUrl(i);if(!c){if(i==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var f=this._createImg(c,o&&o.tagName==="IMG"?o:null);return this._setIconStyles(f,i),(this.options.crossOrigin||this.options.crossOrigin==="")&&(f.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),f},_setIconStyles:function(i,o){var c=this.options,f=c[o+"Size"];typeof f=="number"&&(f=[f,f]);var x=lt(f),A=lt(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),A&&(i.style.marginLeft=-A.x+"px",i.style.marginTop=-A.y+"px"),x&&(i.style.width=x.x+"px",i.style.height=x.y+"px")},_createImg:function(i,o){return o=o||document.createElement("img"),o.src=i,o},_getIconUrl:function(i){return qt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function TT(i){return new hr(i)}var uo=hr.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(i){return typeof uo.imagePath!="string"&&(uo.imagePath=this._detectIconPath()),(this.options.imagePath||uo.imagePath)+hr.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var A=f.exec(c);return A&&A[x]};return i=o(i,/^url\((['"])?(.+)\1\)$/,2),i&&o(i,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var i=Kt("div","leaflet-default-icon-path",document.body),o=xe(i,"background-image")||xe(i,"backgroundImage");if(document.body.removeChild(i),o=this._stripUrl(o),o)return o;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Om=oi.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Ki(i,i,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),te(i,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ke(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(i){var o=this._marker,c=o._map,f=this._marker.options.autoPanSpeed,x=this._marker.options.autoPanPadding,A=Yn(o._icon),F=c.getPixelBounds(),j=c.getPixelOrigin(),nt=Gt(F.min._subtract(j).add(x),F.max._subtract(j).subtract(x));if(!nt.contains(A)){var mt=lt((Math.max(nt.max.x,A.x)-nt.max.x)/(F.max.x-nt.max.x)-(Math.min(nt.min.x,A.x)-nt.min.x)/(F.min.x-nt.min.x),(Math.max(nt.max.y,A.y)-nt.max.y)/(F.max.y-nt.max.y)-(Math.min(nt.min.y,A.y)-nt.min.y)/(F.min.y-nt.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),Ee(o._icon,this._draggable._newPos),this._onDrag(i),this._panRequest=k(this._adjustPan.bind(this,i))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(i){this._marker.options.autoPan&&(Z(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Yn(o._icon),x=o._map.layerPointToLatLng(f);c&&Ee(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){Z(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),Wa=Qn.extend({options:{icon:new uo,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(i,o){S(this,o),this._latlng=st(i)},onAdd:function(i){this._zoomAnimated=this._zoomAnimated&&i.options.markerZoomAnimation,this._zoomAnimated&&i.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(i){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&i.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(i){var o=this._latlng;return this._latlng=st(i),this.update(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},setZIndexOffset:function(i){return this.options.zIndexOffset=i,this.update()},getIcon:function(){return this.options.icon},setIcon:function(i){return this.options.icon=i,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var i=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(i)}return this},_initIcon:function(){var i=this.options,o="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=i.icon.createIcon(this._icon),f=!1;c!==this._icon&&(this._icon&&this._removeIcon(),f=!0,i.title&&(c.title=i.title),c.tagName==="IMG"&&(c.alt=i.alt||"")),te(c,o),i.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,i.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&he(c,"focus",this._panOnFocus,this);var x=i.icon.createShadow(this._shadow),A=!1;x!==this._shadow&&(this._removeShadow(),A=!0),x&&(te(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&A&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ue(this._icon,"focus",this._panOnFocus,this),se(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&se(this._shadow),this._shadow=null},_setPos:function(i){this._icon&&Ee(this._icon,i),this._shadow&&Ee(this._shadow,i),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(i){this._icon&&(this._icon.style.zIndex=this._zIndex+i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center).round();this._setPos(o)},_initInteraction:function(){if(this.options.interactive&&(te(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Om)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Om(this),i&&this.dragging.enable()}},setOpacity:function(i){return this.options.opacity=i,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var i=this.options.opacity;this._icon&&ye(this._icon,i),this._shadow&&ye(this._shadow,i)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var i=this._map;if(i){var o=this.options.icon.options,c=o.iconSize?lt(o.iconSize):lt(0,0),f=o.iconAnchor?lt(o.iconAnchor):lt(0,0);i.panInside(this._latlng,{paddingTopLeft:f,paddingBottomRight:c.subtract(f)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function bT(i,o){return new Wa(i,o)}var $i=Qn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(i){this._renderer=i.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(i){return S(this,i),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&i&&Object.prototype.hasOwnProperty.call(i,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Za=$i.extend({options:{fill:!0,radius:10},initialize:function(i,o){S(this,o),this._latlng=st(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=st(i),this.redraw(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(i){return this.options.radius=this._radius=i,this.redraw()},getRadius:function(){return this._radius},setStyle:function(i){var o=i&&i.radius||this._radius;return $i.prototype.setStyle.call(this,i),this.setRadius(o),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var i=this._radius,o=this._radiusY||i,c=this._clickTolerance(),f=[i+c,o+c];this._pxBounds=new Mt(this._point.subtract(f),this._point.add(f))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(i){return i.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function AT(i,o){return new Za(i,o)}var kh=Za.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),S(this,o),this._latlng=st(i),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(i){return this._mRadius=i,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var i=[this._radius,this._radiusY||this._radius];return new pt(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:$i.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===Dt.distance){var x=Math.PI/180,A=this._mRadius/Dt.R/x,F=c.project([o+A,i]),j=c.project([o-A,i]),nt=F.add(j).divideBy(2),mt=c.unproject(nt).lat,kt=Math.acos((Math.cos(A*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(kt)||kt===0)&&(kt=A/Math.cos(Math.PI/180*o)),this._point=nt.subtract(c.getPixelOrigin()),this._radius=isNaN(kt)?0:nt.x-c.project([mt,i-kt]).x,this._radiusY=nt.y-F.y}else{var re=f.unproject(f.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(re).x}this._updateBounds()}});function CT(i,o,c){return new kh(i,o,c)}var Mi=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(i,o){S(this,o),this._setLatLngs(i)},getLatLngs:function(){return this._latlngs},setLatLngs:function(i){return this._setLatLngs(i),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(i){for(var o=1/0,c=null,f=ho,x,A,F=0,j=this._parts.length;F<j;F++)for(var nt=this._parts[F],mt=1,kt=nt.length;mt<kt;mt++){x=nt[mt-1],A=nt[mt];var re=f(i,x,A,!0);re<o&&(o=re,c=f(i,x,A))}return c&&(c.distance=Math.sqrt(o)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return km(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=st(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new pt,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Nn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Nn(i),f=0,x=i.length;f<x;f++)c?(o[f]=st(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new Mt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,i),this._bounds.isValid()&&i.isValid()&&(this._rawPxBounds=i,this._updateBounds())},_updateBounds:function(){var i=this._clickTolerance(),o=new G(i,i);this._rawPxBounds&&(this._pxBounds=new Mt([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof Y,x=i.length,A,F;if(f){for(F=[],A=0;A<x;A++)F[A]=this._map.latLngToLayerPoint(i[A]),c.extend(F[A]);o.push(F)}else for(A=0;A<x;A++)this._projectLatlngs(i[A],o,c)},_clipPoints:function(){var i=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}var o=this._parts,c,f,x,A,F,j,nt;for(c=0,x=0,A=this._rings.length;c<A;c++)for(nt=this._rings[c],f=0,F=nt.length;f<F-1;f++)j=Im(nt[f],nt[f+1],i,f,!0),j&&(o[x]=o[x]||[],o[x].push(j[0]),(j[1]!==nt[f+1]||f===F-2)&&(o[x].push(j[1]),x++))}},_simplifyPoints:function(){for(var i=this._parts,o=this.options.smoothFactor,c=0,f=i.length;c<f;c++)i[c]=Pm(i[c],o)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(i,o){var c,f,x,A,F,j,nt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,A=this._parts.length;c<A;c++)for(j=this._parts[c],f=0,F=j.length,x=F-1;f<F;x=f++)if(!(!o&&f===0)&&Rm(i,j[x],j[f])<=nt)return!0;return!1}});function PT(i,o){return new Mi(i,o)}Mi._flat=Dm;var ur=Mi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Cm(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Mi.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof Y&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Mi.prototype._setLatLngs.call(this,i),Nn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Nn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,o=this.options.weight,c=new G(o,o);if(i=new Mt(i.min.subtract(c),i.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var f=0,x=this._rings.length,A;f<x;f++)A=Am(this._rings[f],i,!0),A.length&&this._parts.push(A)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,A,F,j,nt,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(A=0,nt=this._parts.length;A<nt;A++)for(c=this._parts[A],F=0,mt=c.length,j=mt-1;F<mt;j=F++)f=c[F],x=c[j],f.y>i.y!=x.y>i.y&&i.x<(x.x-f.x)*(i.y-f.y)/(x.y-f.y)+f.x&&(o=!o);return o||Mi.prototype._containsPoint.call(this,i,!0)}});function RT(i,o){return new ur(i,o)}var Ti=Si.extend({initialize:function(i,o){S(this,o),this._layers={},i&&this.addData(i)},addData:function(i){var o=P(i)?i:i.features,c,f,x;if(o){for(c=0,f=o.length;c<f;c++)x=o[c],(x.geometries||x.geometry||x.features||x.coordinates)&&this.addData(x);return this}var A=this.options;if(A.filter&&!A.filter(i))return this;var F=Xa(i,A);return F?(F.feature=Qa(i),F.defaultOptions=F.options,this.resetStyle(F),A.onEachFeature&&A.onEachFeature(i,F),this.addLayer(F)):this},resetStyle:function(i){return i===void 0?this.eachLayer(this.resetStyle,this):(i.options=r({},i.defaultOptions),this._setLayerStyle(i,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(o){this._setLayerStyle(o,i)},this)},_setLayerStyle:function(i,o){i.setStyle&&(typeof o=="function"&&(o=o(i.feature)),i.setStyle(o))}});function Xa(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],A=o&&o.pointToLayer,F=o&&o.coordsToLatLng||Uh,j,nt,mt,kt;if(!f&&!c)return null;switch(c.type){case"Point":return j=F(f),Nm(A,i,j,o);case"MultiPoint":for(mt=0,kt=f.length;mt<kt;mt++)j=F(f[mt]),x.push(Nm(A,i,j,o));return new Si(x);case"LineString":case"MultiLineString":return nt=Ya(f,c.type==="LineString"?0:1,F),new Mi(nt,o);case"Polygon":case"MultiPolygon":return nt=Ya(f,c.type==="Polygon"?1:2,F),new ur(nt,o);case"GeometryCollection":for(mt=0,kt=c.geometries.length;mt<kt;mt++){var re=Xa({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);re&&x.push(re)}return new Si(x);case"FeatureCollection":for(mt=0,kt=c.features.length;mt<kt;mt++){var me=Xa(c.features[mt],o);me&&x.push(me)}return new Si(x);default:throw new Error("Invalid GeoJSON object.")}}function Nm(i,o,c,f){return i?i(o,c):new Wa(c,f&&f.markersInheritOptions&&f)}function Uh(i){return new Y(i[1],i[0],i[2])}function Ya(i,o,c){for(var f=[],x=0,A=i.length,F;x<A;x++)F=o?Ya(i[x],o-1,c):(c||Uh)(i[x]),f.push(F);return f}function Oh(i,o){return i=st(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function qa(i,o,c,f){for(var x=[],A=0,F=i.length;A<F;A++)x.push(o?qa(i[A],Nn(i[A])?0:o-1,c,f):Oh(i[A],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function dr(i,o){return i.feature?r({},i.feature,{geometry:o}):Qa(o)}function Qa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var Nh={toGeoJSON:function(i){return dr(this,{type:"Point",coordinates:Oh(this.getLatLng(),i)})}};Wa.include(Nh),kh.include(Nh),Za.include(Nh),Mi.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=qa(this._latlngs,o?1:0,!1,i);return dr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),ur.include({toGeoJSON:function(i){var o=!Nn(this._latlngs),c=o&&!Nn(this._latlngs[0]),f=qa(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),dr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),cr.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),dr(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(i){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(i);var c=o==="GeometryCollection",f=[];return this.eachLayer(function(x){if(x.toGeoJSON){var A=x.toGeoJSON(i);if(c)f.push(A.geometry);else{var F=Qa(A);F.type==="FeatureCollection"?f.push.apply(f,F.features):f.push(F)}}}),c?dr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function Bm(i,o){return new Ti(i,o)}var LT=Bm,ja=Qn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Rt(o),S(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(te(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){se(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(i){return this.options.opacity=i,this._image&&this._updateOpacity(),this},setStyle:function(i){return i.opacity&&this.setOpacity(i.opacity),this},bringToFront:function(){return this._map&&Qt(this._image),this},bringToBack:function(){return this._map&&Le(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Rt(i),this._map&&this._reset(),this},getEvents:function(){var i={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var i=this._url.tagName==="IMG",o=this._image=i?this._url:Kt("img");if(te(o,"leaflet-image-layer"),this._zoomAnimated&&te(o,"leaflet-zoom-animated"),this.options.className&&te(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onload=l(this.fire,this,"load"),o.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),i){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(i){var o=this._map.getZoomScale(i.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;Fe(this._image,c,o)},_reset:function(){var i=this._image,o=new Mt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();Ee(i,o.min),i.style.width=c.x+"px",i.style.height=c.y+"px"},_updateOpacity:function(){ye(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var i=this.options.errorOverlayUrl;i&&this._url!==i&&(this._url=i,this._image.src=i)},getCenter:function(){return this._bounds.getCenter()}}),IT=function(i,o,c){return new ja(i,o,c)},Fm=ja.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var i=this._url.tagName==="VIDEO",o=this._image=i?this._url:Kt("video");if(te(o,"leaflet-image-layer"),this._zoomAnimated&&te(o,"leaflet-zoom-animated"),this.options.className&&te(o,this.options.className),o.onselectstart=m,o.onmousemove=m,o.onloadeddata=l(this.fire,this,"load"),i){for(var c=o.getElementsByTagName("source"),f=[],x=0;x<c.length;x++)f.push(c[x].src);this._url=c.length>0?f:[o.src];return}P(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var A=0;A<this._url.length;A++){var F=Kt("source");F.src=this._url[A],o.appendChild(F)}}});function DT(i,o,c){return new Fm(i,o,c)}var zm=ja.extend({_initImage:function(){var i=this._image=this._url;te(i,"leaflet-image-layer"),this._zoomAnimated&&te(i,"leaflet-zoom-animated"),this.options.className&&te(i,this.options.className),i.onselectstart=m,i.onmousemove=m}});function kT(i,o,c){return new zm(i,o,c)}var ai=Qn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof Y||P(i))?(this._latlng=st(i),S(this,o)):(S(this,i),this._source=o),this.options.content&&(this._content=this.options.content)},openOn:function(i){return i=arguments.length?i:this._source._map,i.hasLayer(this)||i.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(i){return this._map?this.close():(arguments.length?this._source=i:i=this._source,this._prepareOpen(),this.openOn(i._map)),this},onAdd:function(i){this._zoomAnimated=i._zoomAnimated,this._container||this._initLayout(),i._fadeAnimated&&ye(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),i._fadeAnimated&&ye(this._container,1),this.bringToFront(),this.options.interactive&&(te(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(i){i._fadeAnimated?(ye(this._container,0),this._removeTimeout=setTimeout(l(se,void 0,this._container),200)):se(this._container),this.options.interactive&&(ke(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=st(i),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(i){return this._content=i,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var i={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&Qt(this._container),this},bringToBack:function(){return this._map&&Le(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof Si){o=null;var c=this._source._layers;for(var f in c)if(c[f]._map){o=c[f];break}if(!o)return!1;this._source=o}if(!i)if(o.getCenter)i=o.getCenter();else if(o.getLatLng)i=o.getLatLng();else if(o.getBounds)i=o.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(i),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var i=this._contentNode,o=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof o=="string")i.innerHTML=o;else{for(;i.hasChildNodes();)i.removeChild(i.firstChild);i.appendChild(o)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),o=lt(this.options.offset),c=this._getAnchor();this._zoomAnimated?Ee(this._container,i.add(c)):o=o.add(i).add(c);var f=this._containerBottom=-o.y,x=this._containerLeft=-Math.round(this._containerWidth/2)+o.x;this._container.style.bottom=f+"px",this._container.style.left=x+"px"}},_getAnchor:function(){return[0,0]}});we.include({_initOverlay:function(i,o,c,f){var x=o;return x instanceof i||(x=new i(f).setContent(o)),c&&x.setLatLng(c),x}}),Qn.include({_initOverlay:function(i,o,c,f){var x=c;return x instanceof i?(S(x,f),x._source=this):(x=o&&!f?o:new i(f,this),x.setContent(c)),x}});var Ja=ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(i){return i=arguments.length?i:this._source._map,!i.hasLayer(this)&&i._popup&&i._popup.options.autoClose&&i.removeLayer(i._popup),i._popup=this,ai.prototype.openOn.call(this,i)},onAdd:function(i){ai.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",ys))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",ys))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(i.preclick=this.close),this.options.keepInView&&(i.moveend=this._adjustPan),i},_initLayout:function(){var i="leaflet-popup",o=this._container=Kt("div",i+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Kt("div",i+"-content-wrapper",o);if(this._contentNode=Kt("div",i+"-content",c),lo(o),bh(this._contentNode),he(o,"contextmenu",ys),this._tipContainer=Kt("div",i+"-tip-container",o),this._tip=Kt("div",i+"-tip",this._tipContainer),this.options.closeButton){var f=this._closeButton=Kt("a",i+"-close-button",o);f.setAttribute("role","button"),f.setAttribute("aria-label","Close popup"),f.href="#close",f.innerHTML='<span aria-hidden="true">&#215;</span>',he(f,"click",function(x){nn(x),this.close()},this)}},_updateLayout:function(){var i=this._contentNode,o=i.style;o.width="",o.whiteSpace="nowrap";var c=i.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),o.width=c+1+"px",o.whiteSpace="",o.height="";var f=i.offsetHeight,x=this.options.maxHeight,A="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",te(i,A)):ke(i,A),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();Ee(this._container,o.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,o=parseInt(xe(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new G(this._containerLeft,-c-this._containerBottom);x._add(Yn(this._container));var A=i.layerPointToContainerPoint(x),F=lt(this.options.autoPanPadding),j=lt(this.options.autoPanPaddingTopLeft||F),nt=lt(this.options.autoPanPaddingBottomRight||F),mt=i.getSize(),kt=0,re=0;A.x+f+nt.x>mt.x&&(kt=A.x+f-mt.x+nt.x),A.x-kt-j.x<0&&(kt=A.x-j.x),A.y+c+nt.y>mt.y&&(re=A.y+c-mt.y+nt.y),A.y-re-j.y<0&&(re=A.y-j.y),(kt||re)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([kt,re]))}},_getAnchor:function(){return lt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),UT=function(i,o){return new Ja(i,o)};we.mergeOptions({closePopupOnClick:!0}),we.include({openPopup:function(i,o,c){return this._initOverlay(Ja,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Qn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Ja,this._popup,i,o),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof Si||(this._popup._source=this),this._popup._prepareOpen(i||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){Es(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof $i)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=o,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var Ka=ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ai.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){ai.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=ai.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",o=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Kt("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+u(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var o,c,f=this._map,x=this._container,A=f.latLngToContainerPoint(f.getCenter()),F=f.layerPointToContainerPoint(i),j=this.options.direction,nt=x.offsetWidth,mt=x.offsetHeight,kt=lt(this.options.offset),re=this._getAnchor();j==="top"?(o=nt/2,c=mt):j==="bottom"?(o=nt/2,c=0):j==="center"?(o=nt/2,c=mt/2):j==="right"?(o=0,c=mt/2):j==="left"?(o=nt,c=mt/2):F.x<A.x?(j="right",o=0,c=mt/2):(j="left",o=nt+(kt.x+re.x)*2,c=mt/2),i=i.subtract(lt(o,c,!0)).add(kt).add(re),ke(x,"leaflet-tooltip-right"),ke(x,"leaflet-tooltip-left"),ke(x,"leaflet-tooltip-top"),ke(x,"leaflet-tooltip-bottom"),te(x,"leaflet-tooltip-"+j),Ee(x,i)},_updatePosition:function(){var i=this._map.latLngToLayerPoint(this._latlng);this._setPosition(i)},setOpacity:function(i){this.options.opacity=i,this._container&&ye(this._container,i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center);this._setPosition(o)},_getAnchor:function(){return lt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),OT=function(i,o){return new Ka(i,o)};we.include({openTooltip:function(i,o,c){return this._initOverlay(Ka,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Qn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ka,this._tooltip,i,o),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(i){if(!(!i&&this._tooltipHandlersAdded)){var o=i?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[o](c),this._tooltipHandlersAdded=!i}},openTooltip:function(i){return this._tooltip&&(this instanceof Si||(this._tooltip._source=this),this._tooltip._prepareOpen(i)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(i){return this._tooltip&&this._tooltip.setContent(i),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&(he(o,"focus",function(){this._tooltip._source=i,this.openTooltip()},this),he(o,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&o.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(i){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var o=this;this._map.once("moveend",function(){o._openOnceFlag=!1,o._openTooltip(i)});return}this._tooltip._source=i.layer||i.target,this.openTooltip(this._tooltip.options.sticky?i.latlng:void 0)}},_moveTooltip:function(i){var o=i.latlng,c,f;this._tooltip.options.sticky&&i.originalEvent&&(c=this._map.mouseEventToContainerPoint(i.originalEvent),f=this._map.containerPointToLayerPoint(c),o=this._map.layerPointToLatLng(f)),this._tooltip.setLatLng(o)}});var Hm=hr.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(i){var o=i&&i.tagName==="DIV"?i:document.createElement("div"),c=this.options;if(c.html instanceof Element?(be(o),o.appendChild(c.html)):o.innerHTML=c.html!==!1?c.html:"",c.bgPos){var f=lt(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function NT(i){return new Hm(i)}hr.Default=uo;var fo=Qn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:qt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(i){S(this,i)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(i){i._addZoomLimit(this)},onRemove:function(i){this._removeAllTiles(),se(this._container),i._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(Qt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Le(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(i){return this.options.opacity=i,this._updateOpacity(),this},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var i=this._clampZoom(this._map.getZoom());i!==this._tileZoom&&(this._tileZoom=i,this._updateLevels()),this._update()}return this},getEvents:function(){var i={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),i.move=this._onMove),this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},createTile:function(){return document.createElement("div")},getTileSize:function(){var i=this.options.tileSize;return i instanceof G?i:new G(i,i)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(i){for(var o=this.getPane().children,c=-i(-1/0,1/0),f=0,x=o.length,A;f<x;f++)A=o[f].style.zIndex,o[f]!==this._container&&A&&(c=i(c,+A));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!qt.ielt9){ye(this._container,this.options.opacity);var i=+new Date,o=!1,c=!1;for(var f in this._tiles){var x=this._tiles[f];if(!(!x.current||!x.loaded)){var A=Math.min(1,(i-x.loaded)/200);ye(x.el,A),A<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(Z(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this))}},_onOpaqueTile:m,_initContainer:function(){this._container||(this._container=Kt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,o=this.options.maxZoom;if(i!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===i?(this._levels[c].el.style.zIndex=o-Math.abs(i-c),this._onUpdateLevel(c)):(se(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var f=this._levels[i],x=this._map;return f||(f=this._levels[i]={},f.el=Kt("div","leaflet-tile-container leaflet-zoom-animated",this._container),f.el.style.zIndex=o,f.origin=x.project(x.unproject(x.getPixelOrigin()),i).round(),f.zoom=i,this._setZoomTransform(f,x.getCenter(),x.getZoom()),m(f.el.offsetWidth),this._onCreateLevel(f)),this._level=f,f}},_onUpdateLevel:m,_onRemoveLevel:m,_onCreateLevel:m,_pruneTiles:function(){if(this._map){var i,o,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(i in this._tiles)o=this._tiles[i],o.retain=o.current;for(i in this._tiles)if(o=this._tiles[i],o.current&&!o.active){var f=o.coords;this._retainParent(f.x,f.y,f.z,f.z-5)||this._retainChildren(f.x,f.y,f.z,f.z+2)}for(i in this._tiles)this._tiles[i].retain||this._removeTile(i)}},_removeTilesAtZoom:function(i){for(var o in this._tiles)this._tiles[o].coords.z===i&&this._removeTile(o)},_removeAllTiles:function(){for(var i in this._tiles)this._removeTile(i)},_invalidateAll:function(){for(var i in this._levels)se(this._levels[i].el),this._onRemoveLevel(Number(i)),delete this._levels[i];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(i,o,c,f){var x=Math.floor(i/2),A=Math.floor(o/2),F=c-1,j=new G(+x,+A);j.z=+F;var nt=this._tileCoordsToKey(j),mt=this._tiles[nt];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),F>f?this._retainParent(x,A,F,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var A=2*o;A<2*o+2;A++){var F=new G(x,A);F.z=c+1;var j=this._tileCoordsToKey(F),nt=this._tiles[j];if(nt&&nt.active){nt.retain=!0;continue}else nt&&nt.loaded&&(nt.retain=!0);c+1<f&&this._retainChildren(x,A,c+1,f)}},_resetView:function(i){var o=i&&(i.pinch||i.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),o,o)},_animateZoom:function(i){this._setView(i.center,i.zoom,!0,i.noUpdate)},_clampZoom:function(i){var o=this.options;return o.minNativeZoom!==void 0&&i<o.minNativeZoom?o.minNativeZoom:o.maxNativeZoom!==void 0&&o.maxNativeZoom<i?o.maxNativeZoom:i},_setView:function(i,o,c,f){var x=Math.round(o);this.options.maxZoom!==void 0&&x>this.options.maxZoom||this.options.minZoom!==void 0&&x<this.options.minZoom?x=void 0:x=this._clampZoom(x);var A=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||A)&&(this._tileZoom=x,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),x!==void 0&&this._update(i),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(i,o)},_setZoomTransforms:function(i,o){for(var c in this._levels)this._setZoomTransform(this._levels[c],i,o)},_setZoomTransform:function(i,o,c){var f=this._map.getZoomScale(c,i.zoom),x=i.origin.multiplyBy(f).subtract(this._map._getNewPixelOrigin(o,c)).round();qt.any3d?Fe(i.el,x,f):Ee(i.el,x)},_resetGrid:function(){var i=this._map,o=i.options.crs,c=this._tileSize=this.getTileSize(),f=this._tileZoom,x=this._map.getPixelWorldBounds(this._tileZoom);x&&(this._globalTileRange=this._pxBoundsToTileRange(x)),this._wrapX=o.wrapLng&&!this.options.noWrap&&[Math.floor(i.project([0,o.wrapLng[0]],f).x/c.x),Math.ceil(i.project([0,o.wrapLng[1]],f).x/c.y)],this._wrapY=o.wrapLat&&!this.options.noWrap&&[Math.floor(i.project([o.wrapLat[0],0],f).y/c.x),Math.ceil(i.project([o.wrapLat[1],0],f).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(i){var o=this._map,c=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),f=o.getZoomScale(c,this._tileZoom),x=o.project(i,this._tileZoom).floor(),A=o.getSize().divideBy(f*2);return new Mt(x.subtract(A),x.add(A))},_update:function(i){var o=this._map;if(o){var c=this._clampZoom(o.getZoom());if(i===void 0&&(i=o.getCenter()),this._tileZoom!==void 0){var f=this._getTiledPixelBounds(i),x=this._pxBoundsToTileRange(f),A=x.getCenter(),F=[],j=this.options.keepBuffer,nt=new Mt(x.getBottomLeft().subtract([j,-j]),x.getTopRight().add([j,-j]));if(!(isFinite(x.min.x)&&isFinite(x.min.y)&&isFinite(x.max.x)&&isFinite(x.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var mt in this._tiles){var kt=this._tiles[mt].coords;(kt.z!==this._tileZoom||!nt.contains(new G(kt.x,kt.y)))&&(this._tiles[mt].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(i,c);return}for(var re=x.min.y;re<=x.max.y;re++)for(var me=x.min.x;me<=x.max.x;me++){var dn=new G(me,re);if(dn.z=this._tileZoom,!!this._isValidTile(dn)){var je=this._tiles[this._tileCoordsToKey(dn)];je?je.current=!0:F.push(dn)}}if(F.sort(function(vn,pr){return vn.distanceTo(A)-pr.distanceTo(A)}),F.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Bn=document.createDocumentFragment();for(me=0;me<F.length;me++)this._addTile(F[me],Bn);this._level.el.appendChild(Bn)}}}},_isValidTile:function(i){var o=this._map.options.crs;if(!o.infinite){var c=this._globalTileRange;if(!o.wrapLng&&(i.x<c.min.x||i.x>c.max.x)||!o.wrapLat&&(i.y<c.min.y||i.y>c.max.y))return!1}if(!this.options.bounds)return!0;var f=this._tileCoordsToBounds(i);return Rt(this.options.bounds).overlaps(f)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var o=this._map,c=this.getTileSize(),f=i.scaleBy(c),x=f.add(c),A=o.unproject(f,i.z),F=o.unproject(x,i.z);return[A,F]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new pt(o[0],o[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var o=i.split(":"),c=new G(+o[0],+o[1]);return c.z=+o[2],c},_removeTile:function(i){var o=this._tiles[i];o&&(se(o.el),delete this._tiles[i],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){te(i,"leaflet-tile");var o=this.getTileSize();i.style.width=o.x+"px",i.style.height=o.y+"px",i.onselectstart=m,i.onmousemove=m,qt.ielt9&&this.options.opacity<1&&ye(i,this.options.opacity)},_addTile:function(i,o){var c=this._getTilePos(i),f=this._tileCoordsToKey(i),x=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(x),this.createTile.length<2&&k(l(this._tileReady,this,i,null,x)),Ee(x,c),this._tiles[f]={el:x,coords:i,current:!0},o.appendChild(x),this.fire("tileloadstart",{tile:x,coords:i})},_tileReady:function(i,o,c){o&&this.fire("tileerror",{error:o,tile:c,coords:i});var f=this._tileCoordsToKey(i);c=this._tiles[f],c&&(c.loaded=+new Date,this._map._fadeAnimated?(ye(c.el,0),Z(this._fadeFrame),this._fadeFrame=k(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),o||(te(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),qt.ielt9||!this._map._fadeAnimated?k(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var o=new G(this._wrapX?p(i.x,this._wrapX):i.x,this._wrapY?p(i.y,this._wrapY):i.y);return o.z=i.z,o},_pxBoundsToTileRange:function(i){var o=this.getTileSize();return new Mt(i.min.unscaleBy(o).floor(),i.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function BT(i){return new fo(i)}var fr=fo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,o){this._url=i,o=S(this,o),o.detectRetina&&qt.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,o){return this._url===i&&o===void 0&&(o=!0),this._url=i,o||this.redraw(),this},createTile:function(i,o){var c=document.createElement("img");return he(c,"load",l(this._tileOnLoad,this,o,c)),he(c,"error",l(this._tileOnError,this,o,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(i),c},getTileUrl:function(i){var o={r:qt.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-i.y;this.options.tms&&(o.y=c),o["-y"]=c}return R(this._url,r(o,this.options))},_tileOnLoad:function(i,o){qt.ielt9?setTimeout(l(i,this,null,o),0):i(null,o)},_tileOnError:function(i,o,c){var f=this.options.errorTileUrl;f&&o.getAttribute("src")!==f&&(o.src=f),i(c,o)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,o=this.options.maxZoom,c=this.options.zoomReverse,f=this.options.zoomOffset;return c&&(i=o-i),i+f},_getSubdomain:function(i){var o=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var i,o;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(o=this._tiles[i].el,o.onload=m,o.onerror=m,!o.complete)){o.src=U;var c=this._tiles[i].coords;se(o),delete this._tiles[i],this.fire("tileabort",{tile:o,coords:c})}},_removeTile:function(i){var o=this._tiles[i];if(o)return o.el.setAttribute("src",U),fo.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===U))return fo.prototype._tileReady.call(this,i,o,c)}});function Vm(i,o){return new fr(i,o)}var Gm=fr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,o){this._url=i;var c=r({},this.defaultWmsParams);for(var f in o)f in this.options||(c[f]=o[f]);o=S(this,o);var x=o.detectRetina&&qt.retina?2:1,A=this.getTileSize();c.width=A.x*x,c.height=A.y*x,this.wmsParams=c},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,fr.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=Gt(c.project(o[0]),c.project(o[1])),x=f.min,A=f.max,F=(this._wmsVersion>=1.3&&this._crs===Um?[x.y,x.x,A.y,A.x]:[x.x,x.y,A.x,A.y]).join(","),j=fr.prototype.getTileUrl.call(this,i);return j+v(this.wmsParams,j,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+F},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function FT(i,o){return new Gm(i,o)}fr.WMS=Gm,Vm.wms=FT;var bi=Qn.extend({options:{padding:.1},initialize:function(i){S(this,i),u(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),te(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,o){var c=this._map.getZoomScale(o,this._zoom),f=this._map.getSize().multiplyBy(.5+this.options.padding),x=this._map.project(this._center,o),A=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));qt.any3d?Fe(this._container,A,c):Ee(this._container,A)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,o=this._map.getSize(),c=this._map.containerPointToLayerPoint(o.multiplyBy(-i)).round();this._bounds=new Mt(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Wm=bi.extend({options:{tolerance:0},getEvents:function(){var i=bi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){bi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");he(i,"mousemove",this._onMouseMove,this),he(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),he(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){Z(this._redrawRequest),delete this._ctx,se(this._container),Ue(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var o in this._layers)i=this._layers[o],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=qt.retina?2:1;Ee(o,i.min),o.width=f*c.x,o.height=f*c.y,o.style.width=c.x+"px",o.style.height=c.y+"px",qt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){bi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[u(i)]=i;var o=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var o=i._order,c=o.next,f=o.prev;c?c.prev=f:this._drawLast=f,f?f.next=c:this._drawFirst=c,delete i._order,delete this._layers[u(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var o=i.options.dashArray.split(/[, ]+/),c=[],f,x;for(x=0;x<o.length;x++){if(f=Number(o[x]),isNaN(f))return;c.push(f)}i.options._dashArray=c}else i.options._dashArray=i.options.dashArray},_requestRedraw:function(i){this._map&&(this._extendRedrawBounds(i),this._redrawRequest=this._redrawRequest||k(this._redraw,this))},_extendRedrawBounds:function(i){if(i._pxBounds){var o=(i.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Mt,this._redrawBounds.extend(i._pxBounds.min.subtract([o,o])),this._redrawBounds.extend(i._pxBounds.max.add([o,o]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var i=this._redrawBounds;if(i){var o=i.getSize();this._ctx.clearRect(i.min.x,i.min.y,o.x,o.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var i,o=this._redrawBounds;if(this._ctx.save(),o){var c=o.getSize();this._ctx.beginPath(),this._ctx.rect(o.min.x,o.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var f=this._drawFirst;f;f=f.next)i=f.layer,(!o||i._pxBounds&&i._pxBounds.intersects(o))&&i._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(i,o){if(this._drawing){var c,f,x,A,F=i._parts,j=F.length,nt=this._ctx;if(j){for(nt.beginPath(),c=0;c<j;c++){for(f=0,x=F[c].length;f<x;f++)A=F[c][f],nt[f?"lineTo":"moveTo"](A.x,A.y);o&&nt.closePath()}this._fillStroke(nt,i)}}},_updateCircle:function(i){if(!(!this._drawing||i._empty())){var o=i._point,c=this._ctx,f=Math.max(Math.round(i._radius),1),x=(Math.max(Math.round(i._radiusY),1)||f)/f;x!==1&&(c.save(),c.scale(1,x)),c.beginPath(),c.arc(o.x,o.y/x,f,0,Math.PI*2,!1),x!==1&&c.restore(),this._fillStroke(c,i)}},_fillStroke:function(i,o){var c=o.options;c.fill&&(i.globalAlpha=c.fillOpacity,i.fillStyle=c.fillColor||c.color,i.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(i.setLineDash&&i.setLineDash(o.options&&o.options._dashArray||[]),i.globalAlpha=c.opacity,i.lineWidth=c.weight,i.strokeStyle=c.color,i.lineCap=c.lineCap,i.lineJoin=c.lineJoin,i.stroke())},_onClick:function(i){for(var o=this._map.mouseEventToLayerPoint(i),c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(!(i.type==="click"||i.type==="preclick")||!this._map._draggableMoved(c))&&(f=c);this._fireEvent(f?[f]:!1,i)},_onMouseMove:function(i){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var o=this._map.mouseEventToLayerPoint(i);this._handleMouseHover(i,o)}},_handleMouseOut:function(i){var o=this._hoveredLayer;o&&(ke(this._container,"leaflet-interactive"),this._fireEvent([o],i,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(i,o){if(!this._mouseHoverThrottled){for(var c,f,x=this._drawFirst;x;x=x.next)c=x.layer,c.options.interactive&&c._containsPoint(o)&&(f=c);f!==this._hoveredLayer&&(this._handleMouseOut(i),f&&(te(this._container,"leaflet-interactive"),this._fireEvent([f],i,"mouseover"),this._hoveredLayer=f)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,i),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(i,o,c){this._map._fireDOMEvent(o,c||o.type,i)},_bringToFront:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(c)c.prev=f;else return;f?f.next=c:c&&(this._drawFirst=c),o.prev=this._drawLast,this._drawLast.next=o,o.next=null,this._drawLast=o,this._requestRedraw(i)}},_bringToBack:function(i){var o=i._order;if(o){var c=o.next,f=o.prev;if(f)f.next=c;else return;c?c.prev=f:f&&(this._drawLast=f),o.prev=null,o.next=this._drawFirst,this._drawFirst.prev=o,this._drawFirst=o,this._requestRedraw(i)}}});function Zm(i){return qt.canvas?new Wm(i):null}var po=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(i){return document.createElement("<lvml:"+i+' class="lvml">')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),zT={_initContainer:function(){this._container=Kt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(bi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=po("shape");te(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=po("path"),o.appendChild(i._path),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){var o=i._container;this._container.appendChild(o),i.options.interactive&&i.addInteractiveTarget(o)},_removePath:function(i){var o=i._container;se(o),i.removeInteractiveTarget(o),delete this._layers[u(i)]},_updateStyle:function(i){var o=i._stroke,c=i._fill,f=i.options,x=i._container;x.stroked=!!f.stroke,x.filled=!!f.fill,f.stroke?(o||(o=i._stroke=po("stroke")),x.appendChild(o),o.weight=f.weight+"px",o.color=f.color,o.opacity=f.opacity,f.dashArray?o.dashStyle=P(f.dashArray)?f.dashArray.join(" "):f.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=f.lineCap.replace("butt","flat"),o.joinstyle=f.lineJoin):o&&(x.removeChild(o),i._stroke=null),f.fill?(c||(c=i._fill=po("fill")),x.appendChild(c),c.color=f.fillColor||f.color,c.opacity=f.fillOpacity):c&&(x.removeChild(c),i._fill=null)},_updateCircle:function(i){var o=i._point.round(),c=Math.round(i._radius),f=Math.round(i._radiusY||c);this._setPath(i,i._empty()?"M0 0":"AL "+o.x+","+o.y+" "+c+","+f+" 0,"+65535*360)},_setPath:function(i,o){i._path.v=o},_bringToFront:function(i){Qt(i._container)},_bringToBack:function(i){Le(i._container)}},$a=qt.vml?po:ct,mo=bi.extend({_initContainer:function(){this._container=$a("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=$a("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){se(this._container),Ue(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){bi.prototype._update.call(this);var i=this._bounds,o=i.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,c.setAttribute("width",o.x),c.setAttribute("height",o.y)),Ee(c,i.min),c.setAttribute("viewBox",[i.min.x,i.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(i){var o=i._path=$a("path");i.options.className&&te(o,i.options.className),i.options.interactive&&te(o,"leaflet-interactive"),this._updateStyle(i),this._layers[u(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){se(i._path),i.removeInteractiveTarget(i._path),delete this._layers[u(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var o=i._path,c=i.options;o&&(c.stroke?(o.setAttribute("stroke",c.color),o.setAttribute("stroke-opacity",c.opacity),o.setAttribute("stroke-width",c.weight),o.setAttribute("stroke-linecap",c.lineCap),o.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?o.setAttribute("stroke-dasharray",c.dashArray):o.removeAttribute("stroke-dasharray"),c.dashOffset?o.setAttribute("stroke-dashoffset",c.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),c.fill?(o.setAttribute("fill",c.fillColor||c.color),o.setAttribute("fill-opacity",c.fillOpacity),o.setAttribute("fill-rule",c.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(i,o){this._setPath(i,_t(i._parts,o))},_updateCircle:function(i){var o=i._point,c=Math.max(Math.round(i._radius),1),f=Math.max(Math.round(i._radiusY),1)||c,x="a"+c+","+f+" 0 1,0 ",A=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,A)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){Qt(i._path)},_bringToBack:function(i){Le(i._path)}});qt.vml&&mo.include(zT);function Xm(i){return qt.svg||qt.vml?new mo(i):null}we.include({getRenderer:function(i){var o=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var o=this._paneRenderers[i];return o===void 0&&(o=this._createRenderer({pane:i}),this._paneRenderers[i]=o),o},_createRenderer:function(i){return this.options.preferCanvas&&Zm(i)||Xm(i)}});var Ym=ur.extend({initialize:function(i,o){ur.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Rt(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function HT(i,o){return new Ym(i,o)}mo.create=$a,mo.pointsToPath=_t,Ti.geometryToLayer=Xa,Ti.coordsToLatLng=Uh,Ti.coordsToLatLngs=Ya,Ti.latLngToCoords=Oh,Ti.latLngsToCoords=qa,Ti.getFeature=dr,Ti.asFeature=Qa,we.mergeOptions({boxZoom:!0});var qm=oi.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){he(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ue(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){se(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Cn(),vh(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Kt("div","leaflet-zoom-box",this._container),te(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var o=new Mt(this._point,this._startPoint),c=o.getSize();Ee(this._box,o.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(se(this._box),ke(this._container,"leaflet-crosshair")),oo(),yh(),Ue(document,{contextmenu:Es,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var o=new pt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});we.addInitHook("addHandler","boxZoom",qm),we.mergeOptions({doubleClickZoom:!0});var Qm=oi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var o=this._map,c=o.getZoom(),f=o.options.zoomDelta,x=i.originalEvent.shiftKey?c-f:c+f;o.options.doubleClickZoom==="center"?o.setZoom(x):o.setZoomAround(i.containerPoint,x)}});we.addInitHook("addHandler","doubleClickZoom",Qm),we.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var jm=oi.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Ki(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}te(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ke(this._map._container,"leaflet-grab"),ke(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=Rt(this._map.options.maxBounds);this._offsetLimit=Gt(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var o=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(o),this._prunePositions(o)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,o){return i-(i-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;i.x<o.min.x&&(i.x=this._viscousLimit(i.x,o.min.x)),i.y<o.min.y&&(i.y=this._viscousLimit(i.y,o.min.y)),i.x>o.max.x&&(i.x=this._viscousLimit(i.x,o.max.x)),i.y>o.max.y&&(i.y=this._viscousLimit(i.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,o=Math.round(i/2),c=this._initialWorldOffset,f=this._draggable._newPos.x,x=(f-o+c)%i+o-c,A=(f+o+c)%i-o-c,F=Math.abs(x+c)<Math.abs(A+c)?x:A;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=F},_onDragEnd:function(i){var o=this._map,c=o.options,f=!c.inertia||i.noInertia||this._times.length<2;if(o.fire("dragend",i),f)o.fire("moveend");else{this._prunePositions(+new Date);var x=this._lastPos.subtract(this._positions[0]),A=(this._lastTime-this._times[0])/1e3,F=c.easeLinearity,j=x.multiplyBy(F/A),nt=j.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,nt),kt=j.multiplyBy(mt/nt),re=mt/(c.inertiaDeceleration*F),me=kt.multiplyBy(-re/2).round();!me.x&&!me.y?o.fire("moveend"):(me=o._limitOffset(me,o.options.maxBounds),k(function(){o.panBy(me,{duration:re,easeLinearity:F,noMoveStart:!0,animate:!0})}))}}});we.addInitHook("addHandler","dragging",jm),we.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Jm=oi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(i){this._map=i,this._setPanDelta(i.options.keyboardPanDelta),this._setZoomDelta(i.options.zoomDelta)},addHooks:function(){var i=this._map._container;i.tabIndex<=0&&(i.tabIndex="0"),he(i,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ue(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=document.body,o=document.documentElement,c=i.scrollTop||o.scrollTop,f=i.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(f,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(i){var o=this._panKeys={},c=this.keyCodes,f,x;for(f=0,x=c.left.length;f<x;f++)o[c.left[f]]=[-1*i,0];for(f=0,x=c.right.length;f<x;f++)o[c.right[f]]=[i,0];for(f=0,x=c.down.length;f<x;f++)o[c.down[f]]=[0,i];for(f=0,x=c.up.length;f<x;f++)o[c.up[f]]=[0,-1*i]},_setZoomDelta:function(i){var o=this._zoomKeys={},c=this.keyCodes,f,x;for(f=0,x=c.zoomIn.length;f<x;f++)o[c.zoomIn[f]]=i;for(f=0,x=c.zoomOut.length;f<x;f++)o[c.zoomOut[f]]=-i},_addHooks:function(){he(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ue(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(i){if(!(i.altKey||i.ctrlKey||i.metaKey)){var o=i.keyCode,c=this._map,f;if(o in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(f=this._panKeys[o],i.shiftKey&&(f=lt(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(lt(f),c.options.maxBounds)),c.options.worldCopyJump){var x=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(f)));c.panTo(x)}else c.panBy(f)}else if(o in this._zoomKeys)c.setZoom(c.getZoom()+(i.shiftKey?3:1)*this._zoomKeys[o]);else if(o===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;Es(i)}}});we.addInitHook("addHandler","keyboard",Jm),we.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Km=oi.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ue(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=wm(i),c=this._map.options.wheelDebounceTime;this._delta+=o,this._lastMousePos=this._map.mouseEventToContainerPoint(i),this._startTime||(this._startTime=+new Date);var f=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),f),Es(i)},_performZoom:function(){var i=this._map,o=i.getZoom(),c=this._map.options.zoomSnap||0;i._stop();var f=this._delta/(this._map.options.wheelPxPerZoomLevel*4),x=4*Math.log(2/(1+Math.exp(-Math.abs(f))))/Math.LN2,A=c?Math.ceil(x/c)*c:x,F=i._limitZoom(o+(this._delta>0?A:-A))-o;this._delta=0,this._startTime=null,F&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+F):i.setZoomAround(this._lastMousePos,o+F))}});we.addInitHook("addHandler","scrollWheelZoom",Km);var VT=600;we.mergeOptions({tapHold:qt.touchNative&&qt.safari&&qt.mobile,tapTolerance:15});var $m=oi.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var o=i.touches[0];this._startPos=this._newPos=new G(o.clientX,o.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(he(document,"touchend",nn),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),VT),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Ue(document,"touchend",nn),Ue(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)},_onMove:function(i){var o=i.touches[0];this._newPos=new G(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,o){var c=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});c._simulated=!0,o.target.dispatchEvent(c)}});we.addInitHook("addHandler","tapHold",$m),we.mergeOptions({touchZoom:qt.touch,bounceAtZoomLimits:!0});var tg=oi.extend({addHooks:function(){te(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ke(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var o=this._map;if(!(!i.touches||i.touches.length!==2||o._animatingZoom||this._zooming)){var c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(c.add(f)._divideBy(2))),this._startDist=c.distanceTo(f),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),he(document,"touchmove",this._onTouchMove,this),he(document,"touchend touchcancel",this._onTouchEnd,this),nn(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var o=this._map,c=o.mouseEventToContainerPoint(i.touches[0]),f=o.mouseEventToContainerPoint(i.touches[1]),x=c.distanceTo(f)/this._startDist;if(this._zoom=o.getScaleZoom(x,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoom<o.getMinZoom()&&x<1||this._zoom>o.getMaxZoom()&&x>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,x===1)return}else{var A=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&A.x===0&&A.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(A),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),Z(this._animRequest);var F=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(F,this,!0),nn(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,Z(this._animRequest),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});we.addInitHook("addHandler","touchZoom",tg),we.BoxZoom=qm,we.DoubleClickZoom=Qm,we.Drag=jm,we.Keyboard=Jm,we.ScrollWheelZoom=Km,we.TapHold=$m,we.TouchZoom=tg,e.Bounds=Mt,e.Browser=qt,e.CRS=ft,e.Canvas=Wm,e.Circle=kh,e.CircleMarker=Za,e.Class=V,e.Control=qn,e.DivIcon=Hm,e.DivOverlay=ai,e.DomEvent=oT,e.DomUtil=sT,e.Draggable=Ki,e.Evented=ut,e.FeatureGroup=Si,e.GeoJSON=Ti,e.GridLayer=fo,e.Handler=oi,e.Icon=hr,e.ImageOverlay=ja,e.LatLng=Y,e.LatLngBounds=pt,e.Layer=Qn,e.LayerGroup=cr,e.LineUtil=yT,e.Map=we,e.Marker=Wa,e.Mixin=fT,e.Path=$i,e.Point=G,e.PolyUtil=pT,e.Polygon=ur,e.Polyline=Mi,e.Popup=Ja,e.PosAnimation=Sm,e.Projection=ET,e.Rectangle=Ym,e.Renderer=bi,e.SVG=mo,e.SVGOverlay=zm,e.TileLayer=fr,e.Tooltip=Ka,e.Transformation=ce,e.Util=J,e.VideoOverlay=Fm,e.bind=l,e.bounds=Gt,e.canvas=Zm,e.circle=CT,e.circleMarker=AT,e.control=co,e.divIcon=NT,e.extend=r,e.featureGroup=MT,e.geoJSON=Bm,e.geoJson=LT,e.gridLayer=BT,e.icon=TT,e.imageOverlay=IT,e.latLng=st,e.latLngBounds=Rt,e.layerGroup=ST,e.map=aT,e.marker=bT,e.point=lt,e.polygon=RT,e.polyline=PT,e.popup=UT,e.rectangle=HT,e.setOptions=S,e.stamp=u,e.svg=Xm,e.svgOverlay=kT,e.tileLayer=Vm,e.tooltip=OT,e.transformation=at,e.version=s,e.videoOverlay=DT;var GT=window.L;e.noConflict=function(){return window.L=GT,this},window.L=e}))})(mr,mr.exports)),mr.exports}var R_=P_();const yn=A_(R_);function L_(n,t,e){if(n){const{obsType:s,obsPrefix:r,obsTiles:a}=e||{},{cols:l=8,rows:h=1}=a||{},{width:u=5760,height:d=2880}=t||{};if(s===xt.AppObsType.Hw){const m=ws(n,"x-image-process=image/resize,m_fixed,w_720,h_360,limit_0/marker,u_plus/imageslim");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const w=u/l,S=d/h,v=`x-image-process=image/crop,x_${_*w},y_${E*S},w_${w},h_${S}/imageslim`;return ws(n,v)}}}else if(s===xt.AppObsType.Ali){const m=ws(n,"x-oss-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const w=u/l,S=d/h,v=`x-oss-process=image/crop,x_${_*w},y_${E*S},w_${w},h_${S}/quality,Q_75`;return ws(n,v)}}}else if(s===xt.AppObsType.Hs){const m=ws(n,"x-tos-process=image/resize,m_fixed,w_720,h_360,limit_0/quality,Q_75");return{width:u,cols:l,rows:h,baseUrl:m,tileUrl:(_,E)=>{const w=u/l,S=d/h,v=`x-tos-process=image/crop,x_${_*w},y_${E*S},w_${w},h_${S}/quality,Q_75`;return ws(n,v)}}}else return s===xt.AppObsType.Aws?n:s===xt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function I_(n,t){if(n){const{obsType:e}=t||{};if(e===xt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await xt.api.getImageInfo(s);return{width:r,height:a}}else if(e===xt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await xt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===xt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await xt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===xt.AppObsType.Aws?{width:5760,height:2880}:e===xt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function ws(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class D_{marker;options;radarElement;map=null;constructor(t){this.options={radius:t.radius??30,color:t.color??"#108ee9",hFov:t.hFov??90,angle:t.angle??0,className:t.className??"leaflet-radar-marker"},this.radarElement=this.createRadarElement(),this.marker=yn.marker(t.latLng,{icon:yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[this.options.radius*2,this.options.radius*2],iconAnchor:[this.options.radius,this.options.radius]}),interactive:!1})}createRadarElement(){const t=document.createElement("div");t.style.pointerEvents="none",t.style.position="relative";const e=document.createElement("div");return e.style.transition="all 0.3s ease",e.style.display="block",t.appendChild(e),this.updateRadarStyle(),t}updateRadarStyle(){const t=this?.radarElement?.querySelector("div");if(!t)return;const{radius:e,color:s,hFov:r,angle:a}=this.options,h=`conic-gradient(
5
5
  from ${this.normalizeAngle(a+90)-r/2}deg,
6
6
  white 0deg,
7
7
  white ${r}deg,
8
8
  transparent ${r}deg,
9
9
  transparent 360deg
10
- )`,u=e*2;Object.assign(t.style,{width:"100%",height:"100%",borderRadius:"50%",backgroundImage:`radial-gradient(circle at 50% 50%, ${s} 0%, transparent 100%)`,maskImage:h,WebkitMaskImage:h}),Object.assign(this.radarElement.style,{width:`${u}px`,height:`${u}px`,background:"transparent",border:"none",pointerEvents:"none"})}normalizeAngle(t){return(t%360+360)%360}updateIconSize=()=>{if(!this.map)return;const t=this.options.radius/this.getMeterPerPixel(),e=t*2,s=yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[e,e],iconAnchor:[t,t]});this.marker.setIcon(s)};getMeterPerPixel(){if(!this.map)return 1;const t=this.map.getCenter(),e=this.map.latLngToContainerPoint(t),s=this.map.latLngToContainerPoint(yn.latLng(t.lat,t.lng+.001)),r=Math.abs(s.x-e.x);return r>0?111.32/r:1}addTo(t){return this.marker.addTo(t),this}remove(){return this.marker.remove(),this}removeFrom(t){return this.marker.removeFrom(t),this}setOptions(t){let e=!1;return t.radius!==void 0&&(this.options.radius=t.radius,e=!0),t.color!==void 0&&(this.options.color=t.color),t.hFov!==void 0&&(this.options.hFov=t.hFov),t.angle!==void 0&&(this.options.angle=t.angle),t.latLng!==void 0&&this.setLatLng(t.latLng),t.className!==void 0&&(this.options.className=t.className,e=!0),this.updateRadarStyle(),e&&this.updateIconSize(),this}setLatLng(t){return this.marker.setLatLng(t),this}setRadius(t){return this.setOptions({radius:t})}setColor(t){return this.setOptions({color:t})}setHFov(t){return this.setOptions({hFov:t})}setAngle(t){return this.setOptions({angle:t})}getLatLng(){return this.marker.getLatLng()}getMarker(){return this.marker}on(t,e,s){return this.marker.on(t,e,s),this}off(t,e,s){return this.marker.off(t,e,s),this}}const k_={class:"vsleem-map-geo"},U_=Pn(y.defineComponent({name:"MapGeo",__name:"MapGeo",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref([]),d=Mt.utils.debounce(z,10),p=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));y.watch(()=>s.map.radarAngle,S),y.watch(()=>s.map.radarHFov,S),y.watch(()=>s.store?.currentPoint?.id,S),y.watch(()=>s.store?.dataSource.size,D),y.watch(()=>p.value,d),y.onMounted(()=>{m(),_(),v(),w(),E()}),y.onUnmounted(()=>{B()});function m(){const{currentPoint:M}=s.store||{},k={...Vh};if(M){const{point:Z}=M;k.center=[Z.lat,Z.lon]}l.value=yn.map(a.value,k),r("ready",l.value)}function _(){const{tileLayers:M=nl}=s.map||{};M.length&&l.value&&M?.forEach(k=>yn.tileLayer(k.url,k.options).addTo(l.value))}function E(){const{point:M}=s.store?.currentPoint||{};if(!s.map.showRadar||!l.value||!M)return;const{radarAngle:k,radarHFov:Z}=s.map,J=yn.latLng(M.lat,M.lon);h.value?h.value.setOptions({latLng:J,hFov:Z,angle:k}):(h.value=new D_({latLng:J,hFov:Z,angle:k}),h.value?.addTo(l.value))}function S(){E()}async function w(){const{dataSource:M}=s.store||{},{showPoint:k,showMarker:Z}=s.map;for(const J of M?.values()||[])for(const V of J.trackPoints.values()){const{lon:$,lat:K}=V.point,ut=yn.latLng(K,$);k&&g(V,ut),Z&&I(V,ut)}}function v(){u.value.length&&u.value.forEach(M=>{l.value&&M.removeFrom(l.value)}),u.value=[]}function g(M,k){if(l.value){const Z=yn.circleMarker(k,{fillColor:M.color,fillOpacity:1,radius:3,opacity:0}).addTo(l.value);u.value.push(Z),C(Z,M)}}function I(M,k){const Z=s.store?.groupedMarkers.get(M);if(Z?.length&&l.value){const J=yn.icon({iconUrl:Z[0].markerIcon,iconSize:yn.point([30,35]),iconAnchor:yn.point([15,35])}),V=yn.marker(k,{icon:J}).addTo(l.value);u.value.push(V),T(V,M,Z)}}function C(M,k){M?.addEventListener("click",Z=>{Z.originalEvent.preventDefault(),Z.originalEvent.stopPropagation(),U(k)})}function T(M,k,Z){M?.addEventListener("click",J=>{J.originalEvent.preventDefault(),J.originalEvent.stopPropagation(),N(k,Z)})}async function U(M){r("select-point",M)}function N(M,k){r("select-point",M,k)}function B(){l.value&&l.value.remove()}function z(){const{currentPoint:M}=s.store||{};if(M){const{point:k}=M,Z=l.value?.getZoom()??17;l.value?.setView([k.lat,k.lon],Z)}l.value?.invalidateSize(!0)}function D(){v(),w(),E()}return t({needUpdate:D}),(M,k)=>(y.openBlock(),y.createElementBlock("div",k_,[y.createElementVNode("div",{ref_key:"mapElRef",ref:a,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-4868df43"]]),Yh=Pn(y.defineComponent({name:"Map",__name:"Map",emits:["register","ready","collapse","dragger","angle-updated","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref(),p=y.computed(()=>y.unref(y.unref(d))),m=y.computed(()=>y.unref(y.unref(u))),{getProps:_,getSize:E,getBindValue:S,mapAction:w,handleReady:v,handleCollapse:g,handleDragger:I,handleSelectPoint:C}=i_(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,T,{immediate:!0}),y.onMounted(N);function T(B){B&&(r.value=w)}function U(B,z){d.value=B,u.value=z}function N(){s("register",r,U)}return t(w),(B,z)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-map",style:y.normalizeStyle(y.unref(_).style)},[y.renderSlot(B.$slots,"left",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.createElementVNode("div",{class:"vsleem-map-content",style:y.normalizeStyle(y.unref(E))},[y.renderSlot(B.$slots,"extra",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(b_,{key:0,ref_key:"draggerElRef",ref:a,min:y.unref(_).minSize,max:y.unref(_).maxSize,size:y.unref(_).size,onCollapse:y.unref(g),onDragger:y.unref(I)},null,8,["min","max","size","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(Mt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(U_,{key:1,ref_key:"mapGeoElRef",ref:l,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"])):(y.openBlock(),y.createBlock(y_,{key:2,ref_key:"mapCadElRef",ref:h,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(C)},null,8,["store","map","onReady","onSelectPoint"]))],4),y.renderSlot(B.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.renderSlot(B.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)],4))}}),[["__scopeId","data-v-49a6a917"]]),{cloneDeep:qh,deepMergeProps:O_,getDiffProps:N_}=Mt.utils;function B_(n,t,e,s,r){const a=y.ref(qh(_o)),l=y.computed(()=>{const{currentRecord:V,currentPoint:$}=y.unref(t)||{},K=V?.trackPoints?.size??0,ut=$?.index??0;return{...a.value,count:K,index:ut}}),h=y.computed(()=>{const{currentRecord:V}=y.unref(t)||{};return Array.from(V?.trackPoints?.values()||[])}),u=y.computed(()=>{const{dataSource:V,coordinateTree:$,mappedCoordinateTree:K,currentSpace:ut,currentModel:G,currentRecord:Tt,currentPoint:ot,currentMarker:St,currentPointMarkers:Gt}=t.value||{};return{dataSource:V,coordinateTree:$,mappedCoordinateTree:K,currentSpace:ut,currentModel:G,currentRecord:Tt,currentPoint:ot,currentPointMarkers:Gt,currentMarker:St,state:l.value}});y.watch(()=>qh(n.value?.playbar),d,{immediate:!0,deep:!0});function d(V,$){const K=N_(V,$);m(K)}function p(){return l.value}function m(V){V&&O_(a.value,V)}function _(V){return h.value[V]}function E(){r("ready")}function S(V){const $=_(V);$&&(T($),r("backward",$))}function w(V){const $=_(V);$&&r("pause",$)}function v(V){const $=_(V);$&&(T($),r("play",$))}function g(V){const $=_(V);$&&(T($),r("forward",$))}function I(V){r("speed",V)}function C(V){const $=_(V);$&&(T($),r("slider",$))}function T(V){y.unref(t)?.selectPoint(V),r("select-point",V)}function U(){y.unref(e)?.handleBackward?.()}function N(){y.unref(e)?.handlePlay?.()}function B(){y.unref(e)?.handlePause?.()}function z(){y.unref(e)?.handleForward?.()}function D(){y.unref(e)?.handleSpeed?.()}function M(){y.unref(e)?.handlePlayNext?.()}function k(){y.unref(s)?.handleSlider?.()}function Z(V=0){return _(V)?.uxTime?.split(" ")?.[1]||null}return{getProps:l,getBindValue:u,playbarAction:{getState:p,setState:m,backward:U,play:N,pause:B,forward:z,slider:k,speed:D,playNext:M},formatter:Z,handleReady:E,handleBackward:S,handlePause:w,handlePlay:v,handleForward:g,handleSlider:C,handleSpeed:I}}const F_="data:image/png;base64,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",z_="data:image/png;base64,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",H_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAABr5JREFUeF7t181tVUEQROG5mZAJZAJkApFAKBAJZHL5XbAA9Ko1ltw9n9c9V+7TVTr2tfwggMA/CVzYIIDAvwkoiHQg8B8CCiIeCCiIDCBQI8AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQUJBDDm3NGgEFqXHz6hACCnLIoa1ZI6AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQOKog932/WWu9rN72uq631bfP6d1936/WWq8Lv9Pntdan67q+Ft62fHJaQT6stX6UpPRzXdcIXvd9f1lrvShBWOvddw7vi2/bPRtx8Eep3/etIGut+77vR5n9Ze7jFJM+wkBBHqH0e2aQQRTkwbsryIOgfowpyE9YDBJkptWoP7F+ncufWI/HlkEeZ8Ugv1gxSJCZVqMMwiBpYBkkIOZ/EAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEBhnky1rrRbD6n6PvvnN4X3zb7tlpBXmz1npZvdJ1XW+rb5/Tu/u+X/3mkJbk83VdH5/TLk/9uxxVkKeG6fvzCCjIvJvaaCMBBdkI06fmEVCQeTe10UYCCrIRpk/NI6Ag825qo40EFGQjTJ+aR0BB5t3URhsJKMhGmD41j4CCzLupjTYSUJCNMH1qHgEFmXdTG20koCAbYfrUPAIKMu+mNtpIQEE2wvSpeQQUZN5NbbSRgIJshOlT8wgoyLyb2mgjAQXZCNOn5hFQkHk3tdFGAgqyEaZPzSOgIPNuaqONBBRkI0yfmkdAQebd1EYbCSjIRpg+NY+Agsy7qY02ElCQjTB9ah4BBZl3UxttJKAgG2H61DwCCjLvpjbaSEBBNsL0qXkEFGTeTW20kYCCbITpU/MIKMi8m9poI4FvKQ+mBQo6RGMAAAAASUVORK5CYII=",V_="data:image/png;base64,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",G_={class:"vsleem-playbar-box"},W_={class:"playbar-box-caption"},Z_={style:{flex:"1"}},X_={class:"playbar-box-btns"},Y_=["src"],q_=["src"],Q_=["src"],j_=["src"],J_=["title"],K_=Pn(y.defineComponent({name:"PlaybarBox",__name:"PlaybarBox",props:{state:{},currentPoint:{}},emits:["backward","pause","play","forward","speed"],setup(n,{expose:t,emit:e}){const s=n,r=e;let a;const l=y.ref(!1),h=y.computed(()=>l.value||s.state.index<1),u=y.computed(()=>s.state.index>=s.state.count-1),d=y.computed(()=>l.value||u.value),p=y.computed(()=>Math.round(s.state.baseSpeed/s.state.speed*100)/100),m=y.computed(()=>`${s.state.speed}ms`);y.onBeforeUnmount(S);function _(){h.value||r("backward",I(-1))}function E(){u.value||(l.value=!0,r("play",I(1)))}function S(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function w(){d.value||r("forward",I(1))}async function v(){const T=C();r("speed",T)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",I(1))},s.state.speed)))}function I(T){let U=s.state.index+T;return U<0||U>=s.state.count&&(U=s.state.count-1),U}function C(){const{speed:T,step:U,baseSpeed:N,threshold:B}=s.state;let D=N/T+U;const M=B/N;return D>M&&(D=U),Math.round(N/D)}return t({handleBackward:_,handlePlay:E,handlePause:S,handleForward:w,handlePlayNext:g,handleSpeed:v}),(T,U)=>(y.openBlock(),y.createElementBlock("div",G_,[y.createElementVNode("div",W_,[y.renderSlot(T.$slots,"caption",{state:T.state,currentPoint:T.currentPoint},()=>[y.createElementVNode("span",Z_,y.toDisplayString(T.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(T.state.index+1)+" / "+y.toDisplayString(T.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",X_,[y.renderSlot(T.$slots,"button",{state:T.state,currentPoint:T.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(F_),alt:""},null,8,Y_)],2),T.state.showPlay?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[l.value?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:S},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(H_),alt:""},null,8,Q_)])):(y.openBlock(),y.createElementBlock("div",{key:0,class:y.normalizeClass(["playbar-box-button",{disabled:u.value}]),onClick:E},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(V_),alt:""},null,8,q_)],2))],64)):y.createCommentVNode("",!0),y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:d.value}]),onClick:w},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(z_),alt:""},null,8,j_)],2),T.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,J_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),$_={key:0,class:"vsleem-handle-tooltip"},tv=["innerHTML"],ev=Pn(y.defineComponent({name:"PlaybarSlider",__name:"PlaybarSlider",props:{min:{default:0},max:{default:100},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},step:{default:1},tipFormatter:{type:Function,default:n=>n},hideTip:{type:Boolean,default:!1},value:{default:0}},emits:["update:value","change","after-change"],setup(n,{emit:t}){const e=t,s=n,r=y.ref(!1),a=y.ref(0),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>_(h.value/(s.max-s.min)*s.step)),p=y.computed(()=>Math.round(a.value/d.value*s.step+s.min)),m=y.computed(()=>s.tipFormatter(p.value));y.watch(()=>s.value,S),y.watch(p,C=>{e("update:value",C),e("change",C)}),y.onMounted(()=>{E(),S()});function _(C){return parseFloat(C.toFixed(2))}function E(){h.value=l.value.offsetWidth}function S(){a.value=_((s.value-s.min)/s.step*d.value)}async function w(C){if(s.disabled)return;const T=Math.round(C.offsetX/d.value)*d.value;a.value=T,u.value.focus(),await y.nextTick(),e("after-change",y.unref(p))}function v(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;document.onmousemove=T=>{I(T,C)},document.onmouseup=async()=>{document.onmousemove=null,document.onmouseup=null,await y.nextTick(),e("after-change",y.unref(p))}}function g(){if(s.disabled)return;const C=l.value.getBoundingClientRect().left;u.value?.classList.remove("mouse-handle"),u.value?.classList.add("touch-handle"),document.ontouchmove=T=>{I(T.touches[0],C)},document.ontouchend=async()=>{document.ontouchmove=null,document.ontouchend=null,u.value?.classList.remove("touch-handle"),await y.nextTick(),e("after-change",y.unref(p))}}function I(C,T){const U=_(Math.round((C.clientX-T)/d.value)*d.value);U>h.value?a.value=h.value:0<=U&&U<=h.value?a.value=U:a.value=0}return(C,T)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:C.disabled}]),ref_key:"slider",ref:l},[T[1]||(T[1]=y.createElementVNode("div",{class:"playbar-silder-rail"},null,-1)),y.createElementVNode("div",{class:y.normalizeClass(["playbar-silder-track",{trackTransition:r.value}]),style:y.normalizeStyle(`left: 0px; right: auto; width: ${a.value}px;`)},null,6),y.createElementVNode("div",{class:"playbar-silder-step",onClick:y.withModifiers(w,["stop"])}),y.createElementVNode("div",{tabindex:"0",ref_key:"rightHandle",ref:u,class:y.normalizeClass(["playbar-silder-handle mouse-handle",{handleTransition:r.value}]),style:y.normalizeStyle(`left: ${a.value}px; right: auto; transform: translate(-50%, -50%);`),onMousedown:v,onTouchstart:g},[C.hideTip?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",$_,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,tv),T[0]||(T[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-72db022b"]]),Qh=Pn(y.defineComponent({name:"Playbar",__name:"Playbar",emits:["register","ready","backward","pause","play","forward","speed","slider","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(u))),p=y.computed(()=>y.unref(y.unref(h))),{getProps:m,getBindValue:_,playbarAction:E,formatter:S,handleReady:w,handleBackward:v,handlePause:g,handlePlay:I,handleForward:C,handleSlider:T,handleSpeed:U}=B_(d,p,a,l,s);y.watch(()=>y.unref(p)?.ready,N,{immediate:!0}),y.onMounted(z);function N(D){D&&(w(),r.value=E)}function B(D,M){u.value=D,h.value=M}function z(){s("register",r,B)}return t(E),(D,M)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(m)?.style)},[y.renderSlot(D.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(ev,{ref_key:"playSliderElRef",ref:l,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-silder","tip-formatter":y.unref(S),onAfterChange:y.unref(T)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(D.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(K_,{ref_key:"playBoxElRef",ref:a,state:y.unref(_).state,currentPoint:y.unref(_).currentPoint,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-player",onBackward:y.unref(v),onPlay:y.unref(I),onPause:y.unref(g),onForward:y.unref(C),onSpeed:y.unref(U)},{caption:y.withCtx(k=>[y.renderSlot(D.$slots,"caption",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),button:y.withCtx(k=>[y.renderSlot(D.$slots,"button",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},8,["state","currentPoint","max","value","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(D.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(_))),void 0,!0)],4))}}),[["__scopeId","data-v-01c48639"]]);/**
10
+ )`,u=e*2;Object.assign(t.style,{width:"100%",height:"100%",borderRadius:"50%",backgroundImage:`radial-gradient(circle at 50% 50%, ${s} 0%, transparent 100%)`,maskImage:h,WebkitMaskImage:h}),Object.assign(this.radarElement.style,{width:`${u}px`,height:`${u}px`,background:"transparent",border:"none",pointerEvents:"none"})}normalizeAngle(t){return(t%360+360)%360}updateIconSize=()=>{if(!this.map)return;const t=this.options.radius/this.getMeterPerPixel(),e=t*2,s=yn.divIcon({className:this.options.className,html:this.radarElement,iconSize:[e,e],iconAnchor:[t,t]});this.marker.setIcon(s)};getMeterPerPixel(){if(!this.map)return 1;const t=this.map.getCenter(),e=this.map.latLngToContainerPoint(t),s=this.map.latLngToContainerPoint(yn.latLng(t.lat,t.lng+.001)),r=Math.abs(s.x-e.x);return r>0?111.32/r:1}addTo(t){return this.marker.addTo(t),this}remove(){return this.marker.remove(),this}removeFrom(t){return this.marker.removeFrom(t),this}setOptions(t){let e=!1;return t.radius!==void 0&&(this.options.radius=t.radius,e=!0),t.color!==void 0&&(this.options.color=t.color),t.hFov!==void 0&&(this.options.hFov=t.hFov),t.angle!==void 0&&(this.options.angle=t.angle),t.latLng!==void 0&&this.setLatLng(t.latLng),t.className!==void 0&&(this.options.className=t.className,e=!0),this.updateRadarStyle(),e&&this.updateIconSize(),this}setLatLng(t){return this.marker.setLatLng(t),this}setRadius(t){return this.setOptions({radius:t})}setColor(t){return this.setOptions({color:t})}setHFov(t){return this.setOptions({hFov:t})}setAngle(t){return this.setOptions({angle:t})}getLatLng(){return this.marker.getLatLng()}getMarker(){return this.marker}on(t,e,s){return this.marker.on(t,e,s),this}off(t,e,s){return this.marker.off(t,e,s),this}}const k_={class:"vsleem-map-geo"},U_=Pn(y.defineComponent({name:"MapGeo",__name:"MapGeo",props:{store:{},map:{}},emits:["ready","select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref([]),d=xt.utils.debounce(z,10),p=y.computed(()=>(s.map.size??0)/(s.map.minSize??1));y.watch(()=>s.map.radarAngle,w),y.watch(()=>s.map.radarHFov,w),y.watch(()=>s.store?.currentPoint?.id,w),y.watch(()=>s.store?.dataSource.size,D),y.watch(()=>p.value,d),y.onMounted(()=>{m(),_(),v(),S(),E()}),y.onUnmounted(()=>{N()});function m(){const{currentPoint:M}=s.store||{},k={...Vh};if(M){const{point:Z}=M;k.center=[Z.lat,Z.lon]}l.value=yn.map(a.value,k),r("ready",l.value)}function _(){const{tileLayers:M=nl}=s.map||{};M.length&&l.value&&M?.forEach(k=>yn.tileLayer(k.url,k.options).addTo(l.value))}function E(){const{point:M}=s.store?.currentPoint||{};if(!s.map.showRadar||!l.value||!M)return;const{radarAngle:k,radarHFov:Z}=s.map,J=yn.latLng(M.lat,M.lon);h.value?h.value.setOptions({latLng:J,hFov:Z,angle:k}):(h.value=new D_({latLng:J,hFov:Z,angle:k}),h.value?.addTo(l.value))}function w(){E()}async function S(){const{dataSource:M}=s.store||{},{showPoint:k,showMarker:Z}=s.map;for(const J of M?.values()||[])for(const V of J.trackPoints.values()){const{lon:$,lat:K}=V.point,ut=yn.latLng(K,$);k&&g(V,ut),Z&&R(V,ut)}}function v(){u.value.length&&u.value.forEach(M=>{l.value&&M.removeFrom(l.value)}),u.value=[]}function g(M,k){if(l.value){const Z=yn.circleMarker(k,{fillColor:M.color,fillOpacity:1,radius:3,opacity:0}).addTo(l.value);u.value.push(Z),P(Z,M)}}function R(M,k){const Z=s.store?.groupedMarkers.get(M);if(Z?.length&&l.value){const J=yn.icon({iconUrl:Z[0].markerIcon,iconSize:yn.point([30,35]),iconAnchor:yn.point([15,35])}),V=yn.marker(k,{icon:J}).addTo(l.value);u.value.push(V),T(V,M,Z)}}function P(M,k){M?.addEventListener("click",Z=>{Z.originalEvent.preventDefault(),Z.originalEvent.stopPropagation(),U(k)})}function T(M,k,Z){M?.addEventListener("click",J=>{J.originalEvent.preventDefault(),J.originalEvent.stopPropagation(),B(k,Z)})}async function U(M){r("select-point",M)}function B(M,k){r("select-point",M,k)}function N(){l.value&&l.value.remove()}function z(){const{currentPoint:M}=s.store||{};if(M){const{point:k}=M,Z=l.value?.getZoom()??17;l.value?.setView([k.lat,k.lon],Z)}l.value?.invalidateSize(!0)}function D(){v(),S(),E()}return t({needUpdate:D}),(M,k)=>(y.openBlock(),y.createElementBlock("div",k_,[y.createElementVNode("div",{ref_key:"mapElRef",ref:a,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-4868df43"]]),Yh=Pn(y.defineComponent({name:"Map",__name:"Map",emits:["register","ready","collapse","dragger","angle-updated","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.ref(),p=y.computed(()=>y.unref(y.unref(d))),m=y.computed(()=>y.unref(y.unref(u))),{getProps:_,getSize:E,getBindValue:w,mapAction:S,handleReady:v,handleCollapse:g,handleDragger:R,handleSelectPoint:P}=i_(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,T,{immediate:!0}),y.onMounted(B);function T(N){N&&(r.value=S)}function U(N,z){d.value=N,u.value=z}function B(){s("register",r,U)}return t(S),(N,z)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-map",style:y.normalizeStyle(y.unref(_).style)},[y.renderSlot(N.$slots,"left",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0),y.createElementVNode("div",{class:"vsleem-map-content",style:y.normalizeStyle(y.unref(E))},[y.renderSlot(N.$slots,"extra",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(b_,{key:0,ref_key:"draggerElRef",ref:a,min:y.unref(_).minSize,max:y.unref(_).maxSize,size:y.unref(_).size,onCollapse:y.unref(g),onDragger:y.unref(R)},null,8,["min","max","size","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(xt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(U_,{key:1,ref_key:"mapGeoElRef",ref:l,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(P)},null,8,["store","map","onReady","onSelectPoint"])):(y.openBlock(),y.createBlock(y_,{key:2,ref_key:"mapCadElRef",ref:h,store:m.value,map:y.unref(_),onReady:y.unref(v),onSelectPoint:y.unref(P)},null,8,["store","map","onReady","onSelectPoint"]))],4),y.renderSlot(N.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0),y.renderSlot(N.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0)],4))}}),[["__scopeId","data-v-49a6a917"]]),{cloneDeep:qh,deepMergeProps:O_,getDiffProps:N_}=xt.utils;function B_(n,t,e,s,r){const a=y.ref(qh(_o)),l=y.computed(()=>{const{currentRecord:V,currentPoint:$}=y.unref(t)||{},K=V?.trackPoints?.size??0,ut=$?.index??0;return{...a.value,count:K,index:ut}}),h=y.computed(()=>{const{currentRecord:V}=y.unref(t)||{};return Array.from(V?.trackPoints?.values()||[])}),u=y.computed(()=>{const{dataSource:V,coordinateTree:$,mappedCoordinateTree:K,currentSpace:ut,currentModel:G,currentRecord:Tt,currentPoint:lt,currentMarker:Mt,currentPointMarkers:Gt}=t.value||{};return{dataSource:V,coordinateTree:$,mappedCoordinateTree:K,currentSpace:ut,currentModel:G,currentRecord:Tt,currentPoint:lt,currentPointMarkers:Gt,currentMarker:Mt,state:l.value}});y.watch(()=>qh(n.value?.playbar),d,{immediate:!0,deep:!0});function d(V,$){const K=N_(V,$);m(K)}function p(){return l.value}function m(V){V&&O_(a.value,V)}function _(V){return h.value[V]}function E(){r("ready")}function w(V){const $=_(V);$&&(T($),r("backward",$))}function S(V){const $=_(V);$&&r("pause",$)}function v(V){const $=_(V);$&&(T($),r("play",$))}function g(V){const $=_(V);$&&(T($),r("forward",$))}function R(V){r("speed",V)}function P(V){const $=_(V);$&&(T($),r("slider",$))}function T(V){y.unref(t)?.selectPoint(V),r("select-point",V)}function U(){y.unref(e)?.handleBackward?.()}function B(){y.unref(e)?.handlePlay?.()}function N(){y.unref(e)?.handlePause?.()}function z(){y.unref(e)?.handleForward?.()}function D(){y.unref(e)?.handleSpeed?.()}function M(){y.unref(e)?.handlePlayNext?.()}function k(){y.unref(s)?.handleSlider?.()}function Z(V=0){return _(V)?.uxTime?.split(" ")?.[1]||null}return{getProps:l,getBindValue:u,playbarAction:{getState:p,setState:m,backward:U,play:B,pause:N,forward:z,slider:k,speed:D,playNext:M},formatter:Z,handleReady:E,handleBackward:w,handlePause:S,handlePlay:v,handleForward:g,handleSlider:P,handleSpeed:R}}const F_="data:image/png;base64,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",z_="data:image/png;base64,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",H_="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAABr5JREFUeF7t181tVUEQROG5mZAJZAJkApFAKBAJZHL5XbAA9Ko1ltw9n9c9V+7TVTr2tfwggMA/CVzYIIDAvwkoiHQg8B8CCiIeCCiIDCBQI8AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQUJBDDm3NGgEFqXHz6hACCnLIoa1ZI6AgNW5eHUJAQQ45tDVrBBSkxs2rQwgoyCGHtmaNgILUuHl1CAEFOeTQ1qwRUJAaN68OIaAghxzamjUCClLj5tUhBBTkkENbs0ZAQWrcvDqEgIIccmhr1ggoSI2bV4cQOKog932/WWu9rN72uq631bfP6d1936/WWq8Lv9Pntdan67q+Ft62fHJaQT6stX6UpPRzXdcIXvd9f1lrvShBWOvddw7vi2/bPRtx8Eep3/etIGut+77vR5n9Ze7jFJM+wkBBHqH0e2aQQRTkwbsryIOgfowpyE9YDBJkptWoP7F+ncufWI/HlkEeZ8Ugv1gxSJCZVqMMwiBpYBkkIOZ/EAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEGIRBgrj0G2UQBklTyyABMQZhkCAu/UYZhEHS1DJIQIxBGCSIS79RBmGQNLUMEhBjEAYJ4tJvlEEYJE0tgwTEBhnky1rrRbD6n6PvvnN4X3zb7tlpBXmz1npZvdJ1XW+rb5/Tu/u+X/3mkJbk83VdH5/TLk/9uxxVkKeG6fvzCCjIvJvaaCMBBdkI06fmEVCQeTe10UYCCrIRpk/NI6Ag825qo40EFGQjTJ+aR0BB5t3URhsJKMhGmD41j4CCzLupjTYSUJCNMH1qHgEFmXdTG20koCAbYfrUPAIKMu+mNtpIQEE2wvSpeQQUZN5NbbSRgIJshOlT8wgoyLyb2mgjAQXZCNOn5hFQkHk3tdFGAgqyEaZPzSOgIPNuaqONBBRkI0yfmkdAQebd1EYbCSjIRpg+NY+Agsy7qY02ElCQjTB9ah4BBZl3UxttJKAgG2H61DwCCjLvpjbaSEBBNsL0qXkEFGTeTW20kYCCbITpU/MIKMi8m9poI4FvKQ+mBQo6RGMAAAAASUVORK5CYII=",V_="data:image/png;base64,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",G_={class:"vsleem-playbar-box"},W_={class:"playbar-box-caption"},Z_={style:{flex:"1"}},X_={class:"playbar-box-btns"},Y_=["src"],q_=["src"],Q_=["src"],j_=["src"],J_=["title"],K_=Pn(y.defineComponent({name:"PlaybarBox",__name:"PlaybarBox",props:{state:{},currentPoint:{}},emits:["backward","pause","play","forward","speed"],setup(n,{expose:t,emit:e}){const s=n,r=e;let a;const l=y.ref(!1),h=y.computed(()=>l.value||s.state.index<1),u=y.computed(()=>s.state.index>=s.state.count-1),d=y.computed(()=>l.value||u.value),p=y.computed(()=>Math.round(s.state.baseSpeed/s.state.speed*100)/100),m=y.computed(()=>`${s.state.speed}ms`);y.onBeforeUnmount(w);function _(){h.value||r("backward",R(-1))}function E(){u.value||(l.value=!0,r("play",R(1)))}function w(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function S(){d.value||r("forward",R(1))}async function v(){const T=P();r("speed",T)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",R(1))},s.state.speed)))}function R(T){let U=s.state.index+T;return U<0||U>=s.state.count&&(U=s.state.count-1),U}function P(){const{speed:T,step:U,baseSpeed:B,threshold:N}=s.state;let D=B/T+U;const M=N/B;return D>M&&(D=U),Math.round(B/D)}return t({handleBackward:_,handlePlay:E,handlePause:w,handleForward:S,handlePlayNext:g,handleSpeed:v}),(T,U)=>(y.openBlock(),y.createElementBlock("div",G_,[y.createElementVNode("div",W_,[y.renderSlot(T.$slots,"caption",{state:T.state,currentPoint:T.currentPoint},()=>[y.createElementVNode("span",Z_,y.toDisplayString(T.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(T.state.index+1)+" / "+y.toDisplayString(T.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",X_,[y.renderSlot(T.$slots,"button",{state:T.state,currentPoint:T.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(F_),alt:""},null,8,Y_)],2),T.state.showPlay?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[l.value?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:w},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(H_),alt:""},null,8,Q_)])):(y.openBlock(),y.createElementBlock("div",{key:0,class:y.normalizeClass(["playbar-box-button",{disabled:u.value}]),onClick:E},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(V_),alt:""},null,8,q_)],2))],64)):y.createCommentVNode("",!0),y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:d.value}]),onClick:S},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(z_),alt:""},null,8,j_)],2),T.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,J_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),$_={key:0,class:"vsleem-handle-tooltip"},tv=["innerHTML"],ev=Pn(y.defineComponent({name:"PlaybarSlider",__name:"PlaybarSlider",props:{min:{default:0},max:{default:100},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},step:{default:1},tipFormatter:{type:Function,default:n=>n},hideTip:{type:Boolean,default:!1},value:{default:0}},emits:["update:value","change","after-change"],setup(n,{emit:t}){const e=t,s=n,r=y.ref(!1),a=y.ref(0),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>_(h.value/(s.max-s.min)*s.step)),p=y.computed(()=>Math.round(a.value/d.value*s.step+s.min)),m=y.computed(()=>s.tipFormatter(p.value));y.watch(()=>s.value,w),y.watch(p,P=>{e("update:value",P),e("change",P)}),y.onMounted(()=>{E(),w()});function _(P){return parseFloat(P.toFixed(2))}function E(){h.value=l.value.offsetWidth}function w(){a.value=_((s.value-s.min)/s.step*d.value)}async function S(P){if(s.disabled)return;const T=Math.round(P.offsetX/d.value)*d.value;a.value=T,u.value.focus(),await y.nextTick(),e("after-change",y.unref(p))}function v(){if(s.disabled)return;const P=l.value.getBoundingClientRect().left;document.onmousemove=T=>{R(T,P)},document.onmouseup=async()=>{document.onmousemove=null,document.onmouseup=null,await y.nextTick(),e("after-change",y.unref(p))}}function g(){if(s.disabled)return;const P=l.value.getBoundingClientRect().left;u.value?.classList.remove("mouse-handle"),u.value?.classList.add("touch-handle"),document.ontouchmove=T=>{R(T.touches[0],P)},document.ontouchend=async()=>{document.ontouchmove=null,document.ontouchend=null,u.value?.classList.remove("touch-handle"),await y.nextTick(),e("after-change",y.unref(p))}}function R(P,T){const U=_(Math.round((P.clientX-T)/d.value)*d.value);U>h.value?a.value=h.value:0<=U&&U<=h.value?a.value=U:a.value=0}return(P,T)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:P.disabled}]),ref_key:"slider",ref:l},[T[1]||(T[1]=y.createElementVNode("div",{class:"playbar-silder-rail"},null,-1)),y.createElementVNode("div",{class:y.normalizeClass(["playbar-silder-track",{trackTransition:r.value}]),style:y.normalizeStyle(`left: 0px; right: auto; width: ${a.value}px;`)},null,6),y.createElementVNode("div",{class:"playbar-silder-step",onClick:y.withModifiers(S,["stop"])}),y.createElementVNode("div",{tabindex:"0",ref_key:"rightHandle",ref:u,class:y.normalizeClass(["playbar-silder-handle mouse-handle",{handleTransition:r.value}]),style:y.normalizeStyle(`left: ${a.value}px; right: auto; transform: translate(-50%, -50%);`),onMousedown:v,onTouchstart:g},[P.hideTip?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",$_,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,tv),T[0]||(T[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-72db022b"]]),Qh=Pn(y.defineComponent({name:"Playbar",__name:"Playbar",emits:["register","ready","backward","pause","play","forward","speed","slider","select-point"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(u))),p=y.computed(()=>y.unref(y.unref(h))),{getProps:m,getBindValue:_,playbarAction:E,formatter:w,handleReady:S,handleBackward:v,handlePause:g,handlePlay:R,handleForward:P,handleSlider:T,handleSpeed:U}=B_(d,p,a,l,s);y.watch(()=>y.unref(p)?.ready,B,{immediate:!0}),y.onMounted(z);function B(D){D&&(S(),r.value=E)}function N(D,M){u.value=D,h.value=M}function z(){s("register",r,N)}return t(E),(D,M)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(m)?.style)},[y.renderSlot(D.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(ev,{ref_key:"playSliderElRef",ref:l,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-silder","tip-formatter":y.unref(w),onAfterChange:y.unref(T)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(D.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(_))),()=>[y.createVNode(K_,{ref_key:"playBoxElRef",ref:a,state:y.unref(_).state,currentPoint:y.unref(_).currentPoint,min:0,max:y.unref(m).count-1,value:y.unref(m).index,class:"vsleem-player",onBackward:y.unref(v),onPlay:y.unref(R),onPause:y.unref(g),onForward:y.unref(P),onSpeed:y.unref(U)},{caption:y.withCtx(k=>[y.renderSlot(D.$slots,"caption",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),button:y.withCtx(k=>[y.renderSlot(D.$slots,"button",y.normalizeProps(y.guardReactiveProps(k)),void 0,!0)]),_:3},8,["state","currentPoint","max","value","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(D.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(_))),void 0,!0)],4))}}),[["__scopeId","data-v-01c48639"]]);/**
11
11
  * @license
12
12
  * Copyright 2010-2025 Three.js Authors
13
13
  * SPDX-License-Identifier: MIT
14
- */const il="179",nv=0,jh=1,iv=2,Jh=1,sv=2,li=3,Ai=0,fn=1,ci=2,Ci=0,Ss=1,Kh=2,$h=3,tu=4,rv=5,ts=100,ov=101,av=102,lv=103,cv=104,hv=200,uv=201,dv=202,fv=203,sl=204,rl=205,pv=206,mv=207,gv=208,_v=209,vv=210,yv=211,Ev=212,xv=213,wv=214,ol=0,al=1,ll=2,Ms=3,cl=4,hl=5,ul=6,dl=7,eu=0,Sv=1,Mv=2,Pi=0,nu=1,Tv=2,bv=3,Av=4,Cv=5,Pv=6,Rv=7,iu=300,Ts=301,bs=302,fl=303,pl=304,vo=306,ml=1e3,es=1001,gl=1002,Fn=1003,Lv=1004,yo=1005,En=1006,_l=1007,Ri=1008,hi=1009,su=1010,ru=1011,gr=1012,vl=1013,ns=1014,ui=1015,_r=1016,yl=1017,El=1018,vr=1020,ou=35902,au=1021,lu=1022,zn=1023,yr=1026,Er=1027,cu=1028,xl=1029,hu=1030,wl=1031,Sl=1033,Eo=33776,xo=33777,wo=33778,So=33779,Ml=35840,Tl=35841,bl=35842,Al=35843,Cl=36196,Pl=37492,Rl=37496,Ll=37808,Il=37809,Dl=37810,kl=37811,Ul=37812,Ol=37813,Nl=37814,Bl=37815,Fl=37816,zl=37817,Hl=37818,Vl=37819,Gl=37820,Wl=37821,Mo=36492,Zl=36494,Xl=36495,uu=36283,Yl=36284,ql=36285,Ql=36286,Iv=3200,Dv=3201,kv=0,Uv=1,Li="",Rn="srgb",is="srgb-linear",To="linear",Ie="srgb",As=7680,du=519,Ov=512,Nv=513,Bv=514,fu=515,Fv=516,zv=517,Hv=518,Vv=519,pu=35044,mu="300 es",jn=2e3,bo=2001;class Cs{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners;if(s===void 0)return;const r=s[t];if(r!==void 0){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const s=e[t.type];if(s!==void 0){t.target=this;const r=s.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,t);t.target=null}}}const sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let gu=1234567;const xr=Math.PI/180,wr=180/Math.PI;function Ps(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(sn[n&255]+sn[n>>8&255]+sn[n>>16&255]+sn[n>>24&255]+"-"+sn[t&255]+sn[t>>8&255]+"-"+sn[t>>16&15|64]+sn[t>>24&255]+"-"+sn[e&63|128]+sn[e>>8&255]+"-"+sn[e>>16&255]+sn[e>>24&255]+sn[s&255]+sn[s>>8&255]+sn[s>>16&255]+sn[s>>24&255]).toLowerCase()}function me(n,t,e){return Math.max(t,Math.min(e,n))}function jl(n,t){return(n%t+t)%t}function Gv(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function Wv(n,t,e){return n!==t?(e-n)/(t-n):0}function Sr(n,t,e){return(1-e)*n+e*t}function Zv(n,t,e,s){return Sr(n,t,1-Math.exp(-e*s))}function Xv(n,t=1){return t-Math.abs(jl(n,t*2)-t)}function Yv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function qv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function Qv(n,t){return n+Math.floor(Math.random()*(t-n+1))}function jv(n,t){return n+Math.random()*(t-n)}function Jv(n){return n*(.5-Math.random())}function Kv(n){n!==void 0&&(gu=n);let t=gu+=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 $v(n){return n*xr}function t0(n){return n*wr}function e0(n){return(n&n-1)===0&&n!==0}function n0(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function i0(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function s0(n,t,e,s,r){const a=Math.cos,l=Math.sin,h=a(e/2),u=l(e/2),d=a((t+s)/2),p=l((t+s)/2),m=a((t-s)/2),_=l((t-s)/2),E=a((s-t)/2),S=l((s-t)/2);switch(r){case"XYX":n.set(h*p,u*m,u*_,h*d);break;case"YZY":n.set(u*_,h*p,u*m,h*d);break;case"ZXZ":n.set(u*m,u*_,h*p,h*d);break;case"XZX":n.set(h*p,u*S,u*E,h*d);break;case"YXY":n.set(u*E,h*p,u*S,h*d);break;case"ZYZ":n.set(u*S,u*E,h*p,h*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Rs(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function on(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const we={DEG2RAD:xr,RAD2DEG:wr,generateUUID:Ps,clamp:me,euclideanModulo:jl,mapLinear:Gv,inverseLerp:Wv,lerp:Sr,damp:Zv,pingpong:Xv,smoothstep:Yv,smootherstep:qv,randInt:Qv,randFloat:jv,randFloatSpread:Jv,seededRandom:Kv,degToRad:$v,radToDeg:t0,isPowerOfTwo:e0,ceilPowerOfTwo:n0,floorPowerOfTwo:i0,setQuaternionFromProperEuler:s0,normalize:on,denormalize:Rs};class be{constructor(t=0,e=0){be.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){const e=this.x,s=this.y,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6],this.y=r[1]*e+r[4]*s+r[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=me(this.x,t.x,e.x),this.y=me(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=me(this.x,t,e),this.y=me(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(me(s,t,e))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(me(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,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){const s=Math.cos(e),r=Math.sin(e),a=this.x-t.x,l=this.y-t.y;return this.x=a*s-l*r+t.x,this.y=a*r+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ss{constructor(t=0,e=0,s=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=r}static slerpFlat(t,e,s,r,a,l,h){let u=s[r+0],d=s[r+1],p=s[r+2],m=s[r+3];const _=a[l+0],E=a[l+1],S=a[l+2],w=a[l+3];if(h===0){t[e+0]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m;return}if(h===1){t[e+0]=_,t[e+1]=E,t[e+2]=S,t[e+3]=w;return}if(m!==w||u!==_||d!==E||p!==S){let v=1-h;const g=u*_+d*E+p*S+m*w,I=g>=0?1:-1,C=1-g*g;if(C>Number.EPSILON){const U=Math.sqrt(C),N=Math.atan2(U,g*I);v=Math.sin(v*N)/U,h=Math.sin(h*N)/U}const T=h*I;if(u=u*v+_*T,d=d*v+E*T,p=p*v+S*T,m=m*v+w*T,v===1-h){const U=1/Math.sqrt(u*u+d*d+p*p+m*m);u*=U,d*=U,p*=U,m*=U}}t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m}static multiplyQuaternionsFlat(t,e,s,r,a,l){const h=s[r],u=s[r+1],d=s[r+2],p=s[r+3],m=a[l],_=a[l+1],E=a[l+2],S=a[l+3];return t[e]=h*S+p*m+u*E-d*_,t[e+1]=u*S+p*_+d*m-h*E,t[e+2]=d*S+p*E+h*_-u*m,t[e+3]=p*S-h*m-u*_-d*E,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,s,r){return this._x=t,this._y=e,this._z=s,this._w=r,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){const s=t._x,r=t._y,a=t._z,l=t._order,h=Math.cos,u=Math.sin,d=h(s/2),p=h(r/2),m=h(a/2),_=u(s/2),E=u(r/2),S=u(a/2);switch(l){case"XYZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"YXZ":this._x=_*p*m+d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"ZXY":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m-_*E*S;break;case"ZYX":this._x=_*p*m-d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m+_*E*S;break;case"YZX":this._x=_*p*m+d*E*S,this._y=d*E*m+_*p*S,this._z=d*p*S-_*E*m,this._w=d*p*m-_*E*S;break;case"XZY":this._x=_*p*m-d*E*S,this._y=d*E*m-_*p*S,this._z=d*p*S+_*E*m,this._w=d*p*m+_*E*S;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,r=Math.sin(s);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],r=e[4],a=e[8],l=e[1],h=e[5],u=e[9],d=e[2],p=e[6],m=e[10],_=s+h+m;if(_>0){const E=.5/Math.sqrt(_+1);this._w=.25/E,this._x=(p-u)*E,this._y=(a-d)*E,this._z=(l-r)*E}else if(s>h&&s>m){const E=2*Math.sqrt(1+s-h-m);this._w=(p-u)/E,this._x=.25*E,this._y=(r+l)/E,this._z=(a+d)/E}else if(h>m){const E=2*Math.sqrt(1+h-s-m);this._w=(a-d)/E,this._x=(r+l)/E,this._y=.25*E,this._z=(u+p)/E}else{const E=2*Math.sqrt(1+m-s-h);this._w=(l-r)/E,this._x=(a+d)/E,this._y=(u+p)/E,this._z=.25*E}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(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=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(me(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const r=Math.min(1,e/s);return this.slerp(t,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(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){const s=t._x,r=t._y,a=t._z,l=t._w,h=e._x,u=e._y,d=e._z,p=e._w;return this._x=s*p+l*h+r*d-a*u,this._y=r*p+l*u+a*h-s*d,this._z=a*p+l*d+s*u-r*h,this._w=l*p-s*h-r*u-a*d,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,r=this._y,a=this._z,l=this._w;let h=l*t._w+s*t._x+r*t._y+a*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=l,this._x=s,this._y=r,this._z=a,this;const u=1-h*h;if(u<=Number.EPSILON){const E=1-e;return this._w=E*l+e*this._w,this._x=E*s+e*this._x,this._y=E*r+e*this._y,this._z=E*a+e*this._z,this.normalize(),this}const d=Math.sqrt(u),p=Math.atan2(d,h),m=Math.sin((1-e)*p)/d,_=Math.sin(e*p)/d;return this._w=l*m+this._w*_,this._x=s*m+this._x*_,this._y=r*m+this._y*_,this._z=a*m+this._z*_,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),r=Math.sqrt(1-s),a=Math.sqrt(s);return this.set(r*Math.sin(t),r*Math.cos(t),a*Math.sin(e),a*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}}class q{constructor(t=0,e=0,s=0){q.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,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(_u.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_u.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[3]*s+a[6]*r,this.y=a[1]*e+a[4]*s+a[7]*r,this.z=a[2]*e+a[5]*s+a[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=t.elements,l=1/(a[3]*e+a[7]*s+a[11]*r+a[15]);return this.x=(a[0]*e+a[4]*s+a[8]*r+a[12])*l,this.y=(a[1]*e+a[5]*s+a[9]*r+a[13])*l,this.z=(a[2]*e+a[6]*s+a[10]*r+a[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,r=this.z,a=t.x,l=t.y,h=t.z,u=t.w,d=2*(l*r-h*s),p=2*(h*e-a*r),m=2*(a*s-l*e);return this.x=e+u*d+l*m-h*p,this.y=s+u*p+h*d-a*m,this.z=r+u*m+a*p-l*d,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[4]*s+a[8]*r,this.y=a[1]*e+a[5]*s+a[9]*r,this.z=a[2]*e+a[6]*s+a[10]*r,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=me(this.x,t.x,e.x),this.y=me(this.y,t.y,e.y),this.z=me(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=me(this.x,t,e),this.y=me(this.y,t,e),this.z=me(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(me(s,t,e))}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,r=t.y,a=t.z,l=e.x,h=e.y,u=e.z;return this.x=r*u-a*h,this.y=a*l-s*u,this.z=s*h-r*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return Jl.copy(this).projectOnVector(t),this.sub(Jl)}reflect(t){return this.sub(Jl.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(me(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return e*e+s*s+r*r}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,s){const r=Math.sin(e)*t;return this.x=r*Math.sin(s),this.y=Math.cos(e)*t,this.z=r*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=r,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(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jl=new q,_u=new ss;class ue{constructor(t,e,s,r,a,l,h,u,d){ue.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d)}set(t,e,s,r,a,l,h,u,d){const p=this.elements;return p[0]=t,p[1]=r,p[2]=h,p[3]=e,p[4]=a,p[5]=u,p[6]=s,p[7]=l,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],this}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const 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){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[3],u=s[6],d=s[1],p=s[4],m=s[7],_=s[2],E=s[5],S=s[8],w=r[0],v=r[3],g=r[6],I=r[1],C=r[4],T=r[7],U=r[2],N=r[5],B=r[8];return a[0]=l*w+h*I+u*U,a[3]=l*v+h*C+u*N,a[6]=l*g+h*T+u*B,a[1]=d*w+p*I+m*U,a[4]=d*v+p*C+m*N,a[7]=d*g+p*T+m*B,a[2]=_*w+E*I+S*U,a[5]=_*v+E*C+S*N,a[8]=_*g+E*T+S*B,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8];return e*l*p-e*h*d-s*a*p+s*h*u+r*a*d-r*l*u}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=p*l-h*d,_=h*u-p*a,E=d*a-l*u,S=e*m+s*_+r*E;if(S===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/S;return t[0]=m*w,t[1]=(r*d-p*s)*w,t[2]=(h*s-r*l)*w,t[3]=_*w,t[4]=(p*e-r*u)*w,t[5]=(r*a-h*e)*w,t[6]=E*w,t[7]=(s*u-d*e)*w,t[8]=(l*e-s*a)*w,this}transpose(){let t;const 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){const 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,s,r,a,l,h){const u=Math.cos(a),d=Math.sin(a);return this.set(s*u,s*d,-s*(u*l+d*h)+l+t,-r*d,r*u,-r*(-d*l+u*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(Kl.makeScale(t,e)),this}rotate(t){return this.premultiply(Kl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kl.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){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<9;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<9;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Kl=new ue;function vu(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Mr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function r0(){const n=Mr("canvas");return n.style.display="block",n}const yu={};function Ls(n){n in yu||(yu[n]=!0,console.warn(n))}function o0(n,t,e){return new Promise(function(s,r){function a(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,e);break;default:s()}}setTimeout(a,e)})}const Eu=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xu=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function a0(){const n={enabled:!0,workingColorSpace:is,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ie&&(r.r=di(r.r),r.g=di(r.g),r.b=di(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ie&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Li?To:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],s=[.3127,.329];return n.define({[is]:{primaries:t,whitePoint:s,transfer:To,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Rn},outputColorSpaceConfig:{drawingBufferColorSpace:Rn}},[Rn]:{primaries:t,whitePoint:s,transfer:Ie,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Rn}}}),n}const Se=a0();function di(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Is(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ds;class l0{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Ds===void 0&&(Ds=Mr("canvas")),Ds.width=t.width,Ds.height=t.height;const r=Ds.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ds}return s.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Mr("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const r=s.getImageData(0,0,t.width,t.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=di(a[l]/255)*255;return s.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let s=0;s<e.length;s++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[s]=Math.floor(di(e[s]/255)*255):e[s]=di(e[s]);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}}let c0=0;class $l{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:c0++}),this.uuid=Ps(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let l=0,h=r.length;l<h;l++)r[l].isDataTexture?a.push(tc(r[l].image)):a.push(tc(r[l]))}else a=tc(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function tc(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?l0.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let h0=0;const ec=new q;class Je extends Cs{constructor(t=Je.DEFAULT_IMAGE,e=Je.DEFAULT_MAPPING,s=es,r=es,a=En,l=Ri,h=zn,u=hi,d=Je.DEFAULT_ANISOTROPY,p=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:h0++}),this.uuid=Ps(),this.name="",this.source=new $l(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=s,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=d,this.format=h,this.internalFormat=null,this.type=u,this.offset=new be(0,0),this.repeat=new be(1,1),this.center=new be(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ue,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ec).x}get height(){return this.source.getSize(ec).y}get depth(){return this.source.getSize(ec).z}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)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&s&&r.isVector2&&s.isVector2||r&&s&&r.isVector3&&s.isVector3||r&&s&&r.isMatrix3&&s.isMatrix3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,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&&(s.userData=this.userData),e||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==iu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ml:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case gl: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 ml:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case gl: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++}}Je.DEFAULT_IMAGE=null,Je.DEFAULT_MAPPING=iu,Je.DEFAULT_ANISOTROPY=1;class ze{constructor(t=0,e=0,s=0,r=1){ze.prototype.isVector4=!0,this.x=t,this.y=e,this.z=s,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,s,r){return this.x=t,this.y=e,this.z=s,this.w=r,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=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;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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.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){const e=this.x,s=this.y,r=this.z,a=this.w,l=t.elements;return this.x=l[0]*e+l[4]*s+l[8]*r+l[12]*a,this.y=l[1]*e+l[5]*s+l[9]*r+l[13]*a,this.z=l[2]*e+l[6]*s+l[10]*r+l[14]*a,this.w=l[3]*e+l[7]*s+l[11]*r+l[15]*a,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,s,r,a;const u=t.elements,d=u[0],p=u[4],m=u[8],_=u[1],E=u[5],S=u[9],w=u[2],v=u[6],g=u[10];if(Math.abs(p-_)<.01&&Math.abs(m-w)<.01&&Math.abs(S-v)<.01){if(Math.abs(p+_)<.1&&Math.abs(m+w)<.1&&Math.abs(S+v)<.1&&Math.abs(d+E+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const C=(d+1)/2,T=(E+1)/2,U=(g+1)/2,N=(p+_)/4,B=(m+w)/4,z=(S+v)/4;return C>T&&C>U?C<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(C),r=N/s,a=B/s):T>U?T<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(T),s=N/r,a=z/r):U<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(U),s=B/a,r=z/a),this.set(s,r,a,e),this}let I=Math.sqrt((v-S)*(v-S)+(m-w)*(m-w)+(_-p)*(_-p));return Math.abs(I)<.001&&(I=1),this.x=(v-S)/I,this.y=(m-w)/I,this.z=(_-p)/I,this.w=Math.acos((d+E+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],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,e){return this.x=me(this.x,t.x,e.x),this.y=me(this.y,t.y,e.y),this.z=me(this.z,t.z,e.z),this.w=me(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=me(this.x,t,e),this.y=me(this.y,t,e),this.z=me(this.z,t,e),this.w=me(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(me(s,t,e))}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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}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}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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class u0 extends Cs{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:En,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=s.depth,this.scissor=new ze(0,0,t,e),this.scissorTest=!1,this.viewport=new ze(0,0,t,e);const r={width:t,height:e,depth:s.depth},a=new Je(r);this.textures=[];const l=s.count;for(let h=0;h<l;h++)this.textures[h]=a.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const e={minFilter:En,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,s=1){if(this.width!==t||this.height!==e||this.depth!==s){this.width=t,this.height=e,this.depth=s;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=s,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,s=t.textures.length;e<s;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const r=Object.assign({},t.textures[e].image);this.textures[e].source=new $l(r)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ii extends u0{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class wu extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class d0 extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ks{constructor(t=new q(1/0,1/0,1/0),e=new q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e+=3)this.expandByPoint(Hn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Hn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const s=Hn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const a=s.getAttribute("position");if(e===!0&&a!==void 0&&t.isInstancedMesh!==!0)for(let l=0,h=a.count;l<h;l++)t.isMesh===!0?t.getVertexPosition(l,Hn):Hn.fromBufferAttribute(a,l),Hn.applyMatrix4(t.matrixWorld),this.expandByPoint(Hn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ao.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ao.copy(s.boundingBox)),Ao.applyMatrix4(t.matrixWorld),this.union(Ao)}const r=t.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,s;return t.normal.x>0?(e=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),e<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tr),Co.subVectors(this.max,Tr),Us.subVectors(t.a,Tr),Os.subVectors(t.b,Tr),Ns.subVectors(t.c,Tr),Di.subVectors(Os,Us),ki.subVectors(Ns,Os),rs.subVectors(Us,Ns);let e=[0,-Di.z,Di.y,0,-ki.z,ki.y,0,-rs.z,rs.y,Di.z,0,-Di.x,ki.z,0,-ki.x,rs.z,0,-rs.x,-Di.y,Di.x,0,-ki.y,ki.x,0,-rs.y,rs.x,0];return!nc(e,Us,Os,Ns,Co)||(e=[1,0,0,0,1,0,0,0,1],!nc(e,Us,Os,Ns,Co))?!1:(Po.crossVectors(Di,ki),e=[Po.x,Po.y,Po.z],nc(e,Us,Os,Ns,Co))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const fi=[new q,new q,new q,new q,new q,new q,new q,new q],Hn=new q,Ao=new ks,Us=new q,Os=new q,Ns=new q,Di=new q,ki=new q,rs=new q,Tr=new q,Co=new q,Po=new q,os=new q;function nc(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){os.fromArray(n,a);const h=r.x*Math.abs(os.x)+r.y*Math.abs(os.y)+r.z*Math.abs(os.z),u=t.dot(os),d=e.dot(os),p=s.dot(os);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const f0=new ks,br=new q,ic=new q;class Ro{constructor(t=new q,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const s=this.center;e!==void 0?s.copy(e):f0.setFromPoints(t).getCenter(s);let r=0;for(let a=0,l=t.length;a<l;a++)r=Math.max(r,s.distanceToSquared(t[a]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const s=this.center.distanceToSquared(t);return e.copy(t),s>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;br.subVectors(t,this.center);const e=br.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(br,r/s),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ic.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(br.copy(t.center).add(ic)),this.expandByPoint(br.copy(t.center).sub(ic))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const pi=new q,sc=new q,Lo=new q,Ui=new q,rc=new q,Io=new q,oc=new q;class ac{constructor(t=new q,e=new q(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,pi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const s=e.dot(this.direction);return s<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=pi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(pi.copy(this.origin).addScaledVector(this.direction,e),pi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){sc.copy(t).add(e).multiplyScalar(.5),Lo.copy(e).sub(t).normalize(),Ui.copy(this.origin).sub(sc);const a=t.distanceTo(e)*.5,l=-this.direction.dot(Lo),h=Ui.dot(this.direction),u=-Ui.dot(Lo),d=Ui.lengthSq(),p=Math.abs(1-l*l);let m,_,E,S;if(p>0)if(m=l*u-h,_=l*h-u,S=a*p,m>=0)if(_>=-S)if(_<=S){const w=1/p;m*=w,_*=w,E=m*(m+l*_+2*h)+_*(l*m+_+2*u)+d}else _=a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _=-a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _<=-S?(m=Math.max(0,-(-l*a+h)),_=m>0?-a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d):_<=S?(m=0,_=Math.min(Math.max(-a,-u),a),E=_*(_+2*u)+d):(m=Math.max(0,-(l*a+h)),_=m>0?a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d);else _=l>0?-a:a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(sc).addScaledVector(Lo,_),E}intersectSphere(t,e){pi.subVectors(t.center,this.origin);const s=pi.dot(this.direction),r=pi.dot(pi)-s*s,a=t.radius*t.radius;if(r>a)return null;const l=Math.sqrt(a-r),h=s-l,u=s+l;return u<0?null:h<0?this.at(u,e):this.at(h,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/e;return s>=0?s:null}intersectPlane(t,e){const s=this.distanceToPlane(t);return s===null?null:this.at(s,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let s,r,a,l,h,u;const d=1/this.direction.x,p=1/this.direction.y,m=1/this.direction.z,_=this.origin;return d>=0?(s=(t.min.x-_.x)*d,r=(t.max.x-_.x)*d):(s=(t.max.x-_.x)*d,r=(t.min.x-_.x)*d),p>=0?(a=(t.min.y-_.y)*p,l=(t.max.y-_.y)*p):(a=(t.max.y-_.y)*p,l=(t.min.y-_.y)*p),s>l||a>r||((a>s||isNaN(s))&&(s=a),(l<r||isNaN(r))&&(r=l),m>=0?(h=(t.min.z-_.z)*m,u=(t.max.z-_.z)*m):(h=(t.max.z-_.z)*m,u=(t.min.z-_.z)*m),s>u||h>r)||((h>s||s!==s)&&(s=h),(u<r||r!==r)&&(r=u),r<0)?null:this.at(s>=0?s:r,e)}intersectsBox(t){return this.intersectBox(t,pi)!==null}intersectTriangle(t,e,s,r,a){rc.subVectors(e,t),Io.subVectors(s,t),oc.crossVectors(rc,Io);let l=this.direction.dot(oc),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Ui.subVectors(this.origin,t);const u=h*this.direction.dot(Io.crossVectors(Ui,Io));if(u<0)return null;const d=h*this.direction.dot(rc.cross(Ui));if(d<0||u+d>l)return null;const p=-h*Ui.dot(oc);return p<0?null:this.at(p/l,a)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Oe{constructor(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){Oe.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,s,r,a,l,h,u,d,p,m,_,E,S,w,v)}set(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){const g=this.elements;return g[0]=t,g[4]=e,g[8]=s,g[12]=r,g[1]=a,g[5]=l,g[9]=h,g[13]=u,g[2]=d,g[6]=p,g[10]=m,g[14]=_,g[3]=E,g[7]=S,g[11]=w,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Oe().fromArray(this.elements)}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],e[9]=s[9],e[10]=s[10],e[11]=s[11],e[12]=s[12],e[13]=s[13],e[14]=s[14],e[15]=s[15],this}copyPosition(t){const e=this.elements,s=t.elements;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const 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,s){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,s=t.elements,r=1/Bs.setFromMatrixColumn(t,0).length(),a=1/Bs.setFromMatrixColumn(t,1).length(),l=1/Bs.setFromMatrixColumn(t,2).length();return e[0]=s[0]*r,e[1]=s[1]*r,e[2]=s[2]*r,e[3]=0,e[4]=s[4]*a,e[5]=s[5]*a,e[6]=s[6]*a,e[7]=0,e[8]=s[8]*l,e[9]=s[9]*l,e[10]=s[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,s=t.x,r=t.y,a=t.z,l=Math.cos(s),h=Math.sin(s),u=Math.cos(r),d=Math.sin(r),p=Math.cos(a),m=Math.sin(a);if(t.order==="XYZ"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=-u*m,e[8]=d,e[1]=E+S*d,e[5]=_-w*d,e[9]=-h*u,e[2]=w-_*d,e[6]=S+E*d,e[10]=l*u}else if(t.order==="YXZ"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_+w*h,e[4]=S*h-E,e[8]=l*d,e[1]=l*m,e[5]=l*p,e[9]=-h,e[2]=E*h-S,e[6]=w+_*h,e[10]=l*u}else if(t.order==="ZXY"){const _=u*p,E=u*m,S=d*p,w=d*m;e[0]=_-w*h,e[4]=-l*m,e[8]=S+E*h,e[1]=E+S*h,e[5]=l*p,e[9]=w-_*h,e[2]=-l*d,e[6]=h,e[10]=l*u}else if(t.order==="ZYX"){const _=l*p,E=l*m,S=h*p,w=h*m;e[0]=u*p,e[4]=S*d-E,e[8]=_*d+w,e[1]=u*m,e[5]=w*d+_,e[9]=E*d-S,e[2]=-d,e[6]=h*u,e[10]=l*u}else if(t.order==="YZX"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=w-_*m,e[8]=S*m+E,e[1]=m,e[5]=l*p,e[9]=-h*p,e[2]=-d*p,e[6]=E*m+S,e[10]=_-w*m}else if(t.order==="XZY"){const _=l*u,E=l*d,S=h*u,w=h*d;e[0]=u*p,e[4]=-m,e[8]=d*p,e[1]=_*m+w,e[5]=l*p,e[9]=E*m-S,e[2]=S*m-E,e[6]=h*p,e[10]=w*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(p0,t,m0)}lookAt(t,e,s){const r=this.elements;return xn.subVectors(t,e),xn.lengthSq()===0&&(xn.z=1),xn.normalize(),Oi.crossVectors(s,xn),Oi.lengthSq()===0&&(Math.abs(s.z)===1?xn.x+=1e-4:xn.z+=1e-4,xn.normalize(),Oi.crossVectors(s,xn)),Oi.normalize(),Do.crossVectors(xn,Oi),r[0]=Oi.x,r[4]=Do.x,r[8]=xn.x,r[1]=Oi.y,r[5]=Do.y,r[9]=xn.y,r[2]=Oi.z,r[6]=Do.z,r[10]=xn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[4],u=s[8],d=s[12],p=s[1],m=s[5],_=s[9],E=s[13],S=s[2],w=s[6],v=s[10],g=s[14],I=s[3],C=s[7],T=s[11],U=s[15],N=r[0],B=r[4],z=r[8],D=r[12],M=r[1],k=r[5],Z=r[9],J=r[13],V=r[2],$=r[6],K=r[10],ut=r[14],G=r[3],Tt=r[7],ot=r[11],St=r[15];return a[0]=l*N+h*M+u*V+d*G,a[4]=l*B+h*k+u*$+d*Tt,a[8]=l*z+h*Z+u*K+d*ot,a[12]=l*D+h*J+u*ut+d*St,a[1]=p*N+m*M+_*V+E*G,a[5]=p*B+m*k+_*$+E*Tt,a[9]=p*z+m*Z+_*K+E*ot,a[13]=p*D+m*J+_*ut+E*St,a[2]=S*N+w*M+v*V+g*G,a[6]=S*B+w*k+v*$+g*Tt,a[10]=S*z+w*Z+v*K+g*ot,a[14]=S*D+w*J+v*ut+g*St,a[3]=I*N+C*M+T*V+U*G,a[7]=I*B+C*k+T*$+U*Tt,a[11]=I*z+C*Z+T*K+U*ot,a[15]=I*D+C*J+T*ut+U*St,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],s=t[4],r=t[8],a=t[12],l=t[1],h=t[5],u=t[9],d=t[13],p=t[2],m=t[6],_=t[10],E=t[14],S=t[3],w=t[7],v=t[11],g=t[15];return S*(+a*u*m-r*d*m-a*h*_+s*d*_+r*h*E-s*u*E)+w*(+e*u*E-e*d*_+a*l*_-r*l*E+r*d*p-a*u*p)+v*(+e*d*m-e*h*E-a*l*m+s*l*E+a*h*p-s*d*p)+g*(-r*h*p-e*u*m+e*h*_+r*l*m-s*l*_+s*u*p)}transpose(){const t=this.elements;let 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,s){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=s),this}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=t[9],_=t[10],E=t[11],S=t[12],w=t[13],v=t[14],g=t[15],I=m*v*d-w*_*d+w*u*E-h*v*E-m*u*g+h*_*g,C=S*_*d-p*v*d-S*u*E+l*v*E+p*u*g-l*_*g,T=p*w*d-S*m*d+S*h*E-l*w*E-p*h*g+l*m*g,U=S*m*u-p*w*u-S*h*_+l*w*_+p*h*v-l*m*v,N=e*I+s*C+r*T+a*U;if(N===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/N;return t[0]=I*B,t[1]=(w*_*a-m*v*a-w*r*E+s*v*E+m*r*g-s*_*g)*B,t[2]=(h*v*a-w*u*a+w*r*d-s*v*d-h*r*g+s*u*g)*B,t[3]=(m*u*a-h*_*a-m*r*d+s*_*d+h*r*E-s*u*E)*B,t[4]=C*B,t[5]=(p*v*a-S*_*a+S*r*E-e*v*E-p*r*g+e*_*g)*B,t[6]=(S*u*a-l*v*a-S*r*d+e*v*d+l*r*g-e*u*g)*B,t[7]=(l*_*a-p*u*a+p*r*d-e*_*d-l*r*E+e*u*E)*B,t[8]=T*B,t[9]=(S*m*a-p*w*a-S*s*E+e*w*E+p*s*g-e*m*g)*B,t[10]=(l*w*a-S*h*a+S*s*d-e*w*d-l*s*g+e*h*g)*B,t[11]=(p*h*a-l*m*a-p*s*d+e*m*d+l*s*E-e*h*E)*B,t[12]=U*B,t[13]=(p*w*r-S*m*r+S*s*_-e*w*_-p*s*v+e*m*v)*B,t[14]=(S*h*r-l*w*r-S*s*u+e*w*u+l*s*v-e*h*v)*B,t[15]=(l*m*r-p*h*r+p*s*u-e*m*u-l*s*_+e*h*_)*B,this}scale(t){const e=this.elements,s=t.x,r=t.y,a=t.z;return e[0]*=s,e[4]*=r,e[8]*=a,e[1]*=s,e[5]*=r,e[9]*=a,e[2]*=s,e[6]*=r,e[10]*=a,e[3]*=s,e[7]*=r,e[11]*=a,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,r))}makeTranslation(t,e,s){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,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),r=Math.sin(e),a=1-s,l=t.x,h=t.y,u=t.z,d=a*l,p=a*h;return this.set(d*l+s,d*h-r*u,d*u+r*h,0,d*h+r*u,p*h+s,p*u-r*l,0,d*u-r*h,p*u+r*l,a*u*u+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,r,a,l){return this.set(1,s,a,0,t,1,l,0,e,r,1,0,0,0,0,1),this}compose(t,e,s){const r=this.elements,a=e._x,l=e._y,h=e._z,u=e._w,d=a+a,p=l+l,m=h+h,_=a*d,E=a*p,S=a*m,w=l*p,v=l*m,g=h*m,I=u*d,C=u*p,T=u*m,U=s.x,N=s.y,B=s.z;return r[0]=(1-(w+g))*U,r[1]=(E+T)*U,r[2]=(S-C)*U,r[3]=0,r[4]=(E-T)*N,r[5]=(1-(_+g))*N,r[6]=(v+I)*N,r[7]=0,r[8]=(S+C)*B,r[9]=(v-I)*B,r[10]=(1-(_+w))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,s){const r=this.elements;let a=Bs.set(r[0],r[1],r[2]).length();const l=Bs.set(r[4],r[5],r[6]).length(),h=Bs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),t.x=r[12],t.y=r[13],t.z=r[14],Vn.copy(this);const d=1/a,p=1/l,m=1/h;return Vn.elements[0]*=d,Vn.elements[1]*=d,Vn.elements[2]*=d,Vn.elements[4]*=p,Vn.elements[5]*=p,Vn.elements[6]*=p,Vn.elements[8]*=m,Vn.elements[9]*=m,Vn.elements[10]*=m,e.setFromRotationMatrix(Vn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2*a/(e-t),m=2*a/(s-r),_=(e+t)/(e-t),E=(s+r)/(s-r);let S,w;if(u)S=a/(l-a),w=l*a/(l-a);else if(h===jn)S=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(h===bo)S=-l/(l-a),w=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=_,d[12]=0,d[1]=0,d[5]=m,d[9]=E,d[13]=0,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2/(e-t),m=2/(s-r),_=-(e+t)/(e-t),E=-(s+r)/(s-r);let S,w;if(u)S=1/(l-a),w=l/(l-a);else if(h===jn)S=-2/(l-a),w=-(l+a)/(l-a);else if(h===bo)S=-1/(l-a),w=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=0,d[12]=_,d[1]=0,d[5]=m,d[9]=0,d[13]=E,d[2]=0,d[6]=0,d[10]=S,d[14]=w,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<16;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<16;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}}const Bs=new q,Vn=new Oe,p0=new q(0,0,0),m0=new q(1,1,1),Oi=new q,Do=new q,xn=new q,Su=new Oe,Mu=new ss;class Jn{constructor(t=0,e=0,s=0,r=Jn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=s,this._order=r}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,s,r=this._order){return this._x=t,this._y=e,this._z=s,this._order=r,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,s=!0){const r=t.elements,a=r[0],l=r[4],h=r[8],u=r[1],d=r[5],p=r[9],m=r[2],_=r[6],E=r[10];switch(e){case"XYZ":this._y=Math.asin(me(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,E),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(_,d),this._z=0);break;case"YXZ":this._x=Math.asin(-me(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(h,E),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(me(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-m,E),this._z=Math.atan2(-l,d)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-me(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(_,E),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,d));break;case"YZX":this._z=Math.asin(me(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(h,E));break;case"XZY":this._z=Math.asin(-me(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(_,d),this._y=Math.atan2(h,a)):(this._x=Math.atan2(-p,E),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,s){return Su.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Su,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mu.setFromEuler(this),this.setFromQuaternion(Mu,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}}Jn.DEFAULT_ORDER="XYZ";class lc{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}}let g0=0;const Tu=new q,Fs=new ss,mi=new Oe,ko=new q,Ar=new q,_0=new q,v0=new ss,bu=new q(1,0,0),Au=new q(0,1,0),Cu=new q(0,0,1),Pu={type:"added"},y0={type:"removed"},zs={type:"childadded",child:null},cc={type:"childremoved",child:null};class an extends Cs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:g0++}),this.uuid=Ps(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=an.DEFAULT_UP.clone();const t=new q,e=new Jn,s=new ss,r=new q(1,1,1);function a(){s.setFromEuler(e,!1)}function l(){e.setFromQuaternion(s,void 0,!1)}e._onChange(a),s._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Oe},normalMatrix:{value:new ue}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=an.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new lc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,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 Fs.setFromAxisAngle(t,e),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.premultiply(Fs),this}rotateX(t){return this.rotateOnAxis(bu,t)}rotateY(t){return this.rotateOnAxis(Au,t)}rotateZ(t){return this.rotateOnAxis(Cu,t)}translateOnAxis(t,e){return Tu.copy(t).applyQuaternion(this.quaternion),this.position.add(Tu.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bu,t)}translateY(t){return this.translateOnAxis(Au,t)}translateZ(t){return this.translateOnAxis(Cu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(mi.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?ko.copy(t):ko.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),Ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?mi.lookAt(Ar,ko,this.up):mi.lookAt(ko,Ar,this.up),this.quaternion.setFromRotationMatrix(mi),r&&(mi.extractRotation(r.matrixWorld),Fs.setFromRotationMatrix(mi),this.quaternion.premultiply(Fs.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(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(y0),cc.child=t,this.dispatchEvent(cc),cc.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),mi.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),mi.multiply(t.parent.matrixWorld)),t.applyMatrix4(mi),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.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 s=0,r=this.children.length;s<r;s++){const l=this.children[s].getObjectByProperty(t,e);if(l!==void 0)return l}}getObjectsByProperty(t,e,s=[]){this[t]===e&&s.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(t,e,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,t,_0),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,v0,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverseVisible(t)}traverseAncestors(t){const 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.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].updateMatrixWorld(t)}updateWorldMatrix(t,e){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",s={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(h=>({...h})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(h,u){return h[u.uuid]===void 0&&(h[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(t.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const u=h.shapes;if(Array.isArray(u))for(let d=0,p=u.length;d<p;d++){const m=u[d];a(t.shapes,m)}else a(t.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let u=0,d=this.material.length;u<d;u++)h.push(a(t.materials,this.material[u]));r.material=h}else r.material=a(t.materials,this.material);if(this.children.length>0){r.children=[];for(let h=0;h<this.children.length;h++)r.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let h=0;h<this.animations.length;h++){const u=this.animations[h];r.animations.push(a(t.animations,u))}}if(e){const h=l(t.geometries),u=l(t.materials),d=l(t.textures),p=l(t.images),m=l(t.shapes),_=l(t.skeletons),E=l(t.animations),S=l(t.nodes);h.length>0&&(s.geometries=h),u.length>0&&(s.materials=u),d.length>0&&(s.textures=d),p.length>0&&(s.images=p),m.length>0&&(s.shapes=m),_.length>0&&(s.skeletons=_),E.length>0&&(s.animations=E),S.length>0&&(s.nodes=S)}return s.object=r,s;function l(h){const u=[];for(const d in h){const p=h[d];delete p.metadata,u.push(p)}return u}}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 s=0;s<t.children.length;s++){const r=t.children[s];this.add(r.clone())}return this}}an.DEFAULT_UP=new q(0,1,0),an.DEFAULT_MATRIX_AUTO_UPDATE=!0,an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Gn=new q,gi=new q,hc=new q,_i=new q,Hs=new q,Vs=new q,Ru=new q,uc=new q,dc=new q,fc=new q,pc=new ze,mc=new ze,gc=new ze;class Wn{constructor(t=new q,e=new q,s=new q){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Gn.subVectors(t,e),r.cross(Gn);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(t,e,s,r,a){Gn.subVectors(r,e),gi.subVectors(s,e),hc.subVectors(t,e);const l=Gn.dot(Gn),h=Gn.dot(gi),u=Gn.dot(hc),d=gi.dot(gi),p=gi.dot(hc),m=l*d-h*h;if(m===0)return a.set(0,0,0),null;const _=1/m,E=(d*u-h*p)*_,S=(l*p-h*u)*_;return a.set(1-E-S,S,E)}static containsPoint(t,e,s,r){return this.getBarycoord(t,e,s,r,_i)===null?!1:_i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,_i)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,_i.x),u.addScaledVector(l,_i.y),u.addScaledVector(h,_i.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return pc.setScalar(0),mc.setScalar(0),gc.setScalar(0),pc.fromBufferAttribute(t,e),mc.fromBufferAttribute(t,s),gc.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(pc,a.x),l.addScaledVector(mc,a.y),l.addScaledVector(gc,a.z),l}static isFrontFacing(t,e,s,r){return Gn.subVectors(s,e),gi.subVectors(t,e),Gn.cross(gi).dot(r)<0}set(t,e,s){return this.a.copy(t),this.b.copy(e),this.c.copy(s),this}setFromPointsAndIndices(t,e,s,r){return this.a.copy(t[e]),this.b.copy(t[s]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,s,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,r),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 Gn.subVectors(this.c,this.b),gi.subVectors(this.a,this.b),Gn.cross(gi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Wn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Wn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return Wn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return Wn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Wn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const s=this.a,r=this.b,a=this.c;let l,h;Hs.subVectors(r,s),Vs.subVectors(a,s),uc.subVectors(t,s);const u=Hs.dot(uc),d=Vs.dot(uc);if(u<=0&&d<=0)return e.copy(s);dc.subVectors(t,r);const p=Hs.dot(dc),m=Vs.dot(dc);if(p>=0&&m<=p)return e.copy(r);const _=u*m-p*d;if(_<=0&&u>=0&&p<=0)return l=u/(u-p),e.copy(s).addScaledVector(Hs,l);fc.subVectors(t,a);const E=Hs.dot(fc),S=Vs.dot(fc);if(S>=0&&E<=S)return e.copy(a);const w=E*d-u*S;if(w<=0&&d>=0&&S<=0)return h=d/(d-S),e.copy(s).addScaledVector(Vs,h);const v=p*S-E*m;if(v<=0&&m-p>=0&&E-S>=0)return Ru.subVectors(a,r),h=(m-p)/(m-p+(E-S)),e.copy(r).addScaledVector(Ru,h);const g=1/(v+w+_);return l=w*g,h=_*g,e.copy(s).addScaledVector(Hs,l).addScaledVector(Vs,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Lu={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},Ni={h:0,s:0,l:0},Uo={h:0,s:0,l:0};function _c(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Pe{constructor(t,e,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,s)}set(t,e,s){if(e===void 0&&s===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=Se.workingColorSpace){return this.r=t,this.g=e,this.b=s,Se.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=Se.workingColorSpace){if(t=jl(t,1),e=me(e,0,1),s=me(s,0,1),e===0)this.r=this.g=this.b=s;else{const a=s<=.5?s*(1+e):s+e-s*e,l=2*s-a;this.r=_c(l,a,t+1/3),this.g=_c(l,a,t),this.b=_c(l,a,t-1/3)}return Se.colorSpaceToWorking(this,r),this}setStyle(t,e=Rn){function s(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let a;const l=r[1],h=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,e);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,e);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,e);if(l===6)return this.setHex(parseInt(a,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=Rn){const s=Lu[t.toLowerCase()];return s!==void 0?this.setHex(s,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=di(t.r),this.g=di(t.g),this.b=di(t.b),this}copyLinearToSRGB(t){return this.r=Is(t.r),this.g=Is(t.g),this.b=Is(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rn){return Se.workingToColorSpace(rn.copy(this),t),Math.round(me(rn.r*255,0,255))*65536+Math.round(me(rn.g*255,0,255))*256+Math.round(me(rn.b*255,0,255))}getHexString(t=Rn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.workingToColorSpace(rn.copy(this),e);const s=rn.r,r=rn.g,a=rn.b,l=Math.max(s,r,a),h=Math.min(s,r,a);let u,d;const p=(h+l)/2;if(h===l)u=0,d=0;else{const m=l-h;switch(d=p<=.5?m/(l+h):m/(2-l-h),l){case s:u=(r-a)/m+(r<a?6:0);break;case r:u=(a-s)/m+2;break;case a:u=(s-r)/m+4;break}u/=6}return t.h=u,t.s=d,t.l=p,t}getRGB(t,e=Se.workingColorSpace){return Se.workingToColorSpace(rn.copy(this),e),t.r=rn.r,t.g=rn.g,t.b=rn.b,t}getStyle(t=Rn){Se.workingToColorSpace(rn.copy(this),t);const e=rn.r,s=rn.g,r=rn.b;return t!==Rn?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(s*255)},${Math.round(r*255)})`}offsetHSL(t,e,s){return this.getHSL(Ni),this.setHSL(Ni.h+t,Ni.s+e,Ni.l+s)}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,s){return this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}lerpHSL(t,e){this.getHSL(Ni),t.getHSL(Uo);const s=Sr(Ni.h,Uo.h,e),r=Sr(Ni.s,Uo.s,e),a=Sr(Ni.l,Uo.l,e);return this.setHSL(s,r,a),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,r=this.b,a=t.elements;return this.r=a[0]*e+a[3]*s+a[6]*r,this.g=a[1]*e+a[4]*s+a[7]*r,this.b=a[2]*e+a[5]*s+a[8]*r,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}}const rn=new Pe;Pe.NAMES=Lu;let E0=0;class Cr extends Cs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:E0++}),this.uuid=Ps(),this.name="",this.type="Material",this.blending=Ss,this.side=Ai,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=sl,this.blendDst=rl,this.blendEquation=ts,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Pe(0,0,0),this.blendAlpha=0,this.depthFunc=Ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=du,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=As,this.stencilZFail=As,this.stencilZPass=As,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.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Ss&&(s.blending=this.blending),this.side!==Ai&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==sl&&(s.blendSrc=this.blendSrc),this.blendDst!==rl&&(s.blendDst=this.blendDst),this.blendEquation!==ts&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Ms&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==du&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==As&&(s.stencilFail=this.stencilFail),this.stencilZFail!==As&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==As&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(a){const l=[];for(const h in a){const u=a[h];delete u.metadata,l.push(u)}return l}if(e){const a=r(t.textures),l=r(t.images);a.length>0&&(s.textures=a),l.length>0&&(s.images=l)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let s=null;if(e!==null){const r=e.length;s=new Array(r);for(let a=0;a!==r;++a)s[a]=e[a].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Bi extends Cr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pe(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 Jn,this.combine=eu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Ve=new q,Oo=new be;let x0=0;class Kn{constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:x0++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=pu,this.updateRanges=[],this.gpuType=ui,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[t+r]=e.array[s+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Oo.fromBufferAttribute(this,e),Oo.applyMatrix3(t),this.setXY(e,Oo.x,Oo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Rs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=on(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Rs(e,this.array)),e}setX(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Rs(e,this.array)),e}setY(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Rs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Rs(e,this.array)),e}setW(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,r){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this}setXYZW(t,e,s,r,a){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array),a=on(a,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this.array[t+3]=a,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==pu&&(t.usage=this.usage),t}}class Iu extends Kn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class Du extends Kn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class wn extends Kn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let w0=0;const Ln=new Oe,vc=new an,Gs=new q,Sn=new ks,Pr=new ks,Ye=new q;class $n extends Cs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:w0++}),this.uuid=Ps(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(vu(t)?Du:Iu)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,s=0){this.groups.push({start:t,count:e,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const a=new ue().getNormalMatrix(t);s.applyNormalMatrix(a),s.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ln.makeRotationFromQuaternion(t),this.applyMatrix4(Ln),this}rotateX(t){return Ln.makeRotationX(t),this.applyMatrix4(Ln),this}rotateY(t){return Ln.makeRotationY(t),this.applyMatrix4(Ln),this}rotateZ(t){return Ln.makeRotationZ(t),this.applyMatrix4(Ln),this}translate(t,e,s){return Ln.makeTranslation(t,e,s),this.applyMatrix4(Ln),this}scale(t,e,s){return Ln.makeScale(t,e,s),this.applyMatrix4(Ln),this}lookAt(t){return vc.lookAt(t),vc.updateMatrix(),this.applyMatrix4(vc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gs).negate(),this.translate(Gs.x,Gs.y,Gs.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const s=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];s.push(l.x,l.y,l.z||0)}this.setAttribute("position",new wn(s,3))}else{const s=Math.min(t.length,e.count);for(let r=0;r<s;r++){const a=t[r];e.setXYZ(r,a.x,a.y,a.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ks);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new q(-1/0,-1/0,-1/0),new q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let s=0,r=e.length;s<r;s++){const a=e[s];Sn.setFromBufferAttribute(a),this.morphTargetsRelative?(Ye.addVectors(this.boundingBox.min,Sn.min),this.boundingBox.expandByPoint(Ye),Ye.addVectors(this.boundingBox.max,Sn.max),this.boundingBox.expandByPoint(Ye)):(this.boundingBox.expandByPoint(Sn.min),this.boundingBox.expandByPoint(Sn.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 Ro);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new q,1/0);return}if(t){const s=this.boundingSphere.center;if(Sn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];Pr.setFromBufferAttribute(h),this.morphTargetsRelative?(Ye.addVectors(Sn.min,Pr.min),Sn.expandByPoint(Ye),Ye.addVectors(Sn.max,Pr.max),Sn.expandByPoint(Ye)):(Sn.expandByPoint(Pr.min),Sn.expandByPoint(Pr.max))}Sn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Ye.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Ye));if(e)for(let a=0,l=e.length;a<l;a++){const h=e[a],u=this.morphTargetsRelative;for(let d=0,p=h.count;d<p;d++)Ye.fromBufferAttribute(h,d),u&&(Gs.fromBufferAttribute(t,d),Ye.add(Gs)),r=Math.max(r,s.distanceToSquared(Ye))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=e.position,r=e.normal,a=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Kn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let z=0;z<s.count;z++)h[z]=new q,u[z]=new q;const d=new q,p=new q,m=new q,_=new be,E=new be,S=new be,w=new q,v=new q;function g(z,D,M){d.fromBufferAttribute(s,z),p.fromBufferAttribute(s,D),m.fromBufferAttribute(s,M),_.fromBufferAttribute(a,z),E.fromBufferAttribute(a,D),S.fromBufferAttribute(a,M),p.sub(d),m.sub(d),E.sub(_),S.sub(_);const k=1/(E.x*S.y-S.x*E.y);isFinite(k)&&(w.copy(p).multiplyScalar(S.y).addScaledVector(m,-E.y).multiplyScalar(k),v.copy(m).multiplyScalar(E.x).addScaledVector(p,-S.x).multiplyScalar(k),h[z].add(w),h[D].add(w),h[M].add(w),u[z].add(v),u[D].add(v),u[M].add(v))}let I=this.groups;I.length===0&&(I=[{start:0,count:t.count}]);for(let z=0,D=I.length;z<D;++z){const M=I[z],k=M.start,Z=M.count;for(let J=k,V=k+Z;J<V;J+=3)g(t.getX(J+0),t.getX(J+1),t.getX(J+2))}const C=new q,T=new q,U=new q,N=new q;function B(z){U.fromBufferAttribute(r,z),N.copy(U);const D=h[z];C.copy(D),C.sub(U.multiplyScalar(U.dot(D))).normalize(),T.crossVectors(N,D);const k=T.dot(u[z])<0?-1:1;l.setXYZW(z,C.x,C.y,C.z,k)}for(let z=0,D=I.length;z<D;++z){const M=I[z],k=M.start,Z=M.count;for(let J=k,V=k+Z;J<V;J+=3)B(t.getX(J+0)),B(t.getX(J+1)),B(t.getX(J+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new Kn(new Float32Array(e.count*3),3),this.setAttribute("normal",s);else for(let _=0,E=s.count;_<E;_++)s.setXYZ(_,0,0,0);const r=new q,a=new q,l=new q,h=new q,u=new q,d=new q,p=new q,m=new q;if(t)for(let _=0,E=t.count;_<E;_+=3){const S=t.getX(_+0),w=t.getX(_+1),v=t.getX(_+2);r.fromBufferAttribute(e,S),a.fromBufferAttribute(e,w),l.fromBufferAttribute(e,v),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),h.fromBufferAttribute(s,S),u.fromBufferAttribute(s,w),d.fromBufferAttribute(s,v),h.add(p),u.add(p),d.add(p),s.setXYZ(S,h.x,h.y,h.z),s.setXYZ(w,u.x,u.y,u.z),s.setXYZ(v,d.x,d.y,d.z)}else for(let _=0,E=e.count;_<E;_+=3)r.fromBufferAttribute(e,_+0),a.fromBufferAttribute(e,_+1),l.fromBufferAttribute(e,_+2),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),s.setXYZ(_+0,p.x,p.y,p.z),s.setXYZ(_+1,p.x,p.y,p.z),s.setXYZ(_+2,p.x,p.y,p.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,s=t.count;e<s;e++)Ye.fromBufferAttribute(t,e),Ye.normalize(),t.setXYZ(e,Ye.x,Ye.y,Ye.z)}toNonIndexed(){function t(h,u){const d=h.array,p=h.itemSize,m=h.normalized,_=new d.constructor(u.length*p);let E=0,S=0;for(let w=0,v=u.length;w<v;w++){h.isInterleavedBufferAttribute?E=u[w]*h.data.stride+h.offset:E=u[w]*p;for(let g=0;g<p;g++)_[S++]=d[E++]}return new Kn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new $n,s=this.index.array,r=this.attributes;for(const h in r){const u=r[h],d=t(u,s);e.setAttribute(h,d)}const a=this.morphAttributes;for(const h in a){const u=[],d=a[h];for(let p=0,m=d.length;p<m;p++){const _=d[p],E=t(_,s);u.push(E)}e.morphAttributes[h]=u}e.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,u=l.length;h<u;h++){const d=l[h];e.addGroup(d.start,d.count,d.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,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){const u=this.parameters;for(const d in u)u[d]!==void 0&&(t[d]=u[d]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const s=this.attributes;for(const u in s){const d=s[u];t.data.attributes[u]=d.toJSON(t.data)}const r={};let a=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],p=[];for(let m=0,_=d.length;m<_;m++){const E=d[m];p.push(E.toJSON(t.data))}p.length>0&&(r[u]=p,a=!0)}a&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(t.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(t.data.boundingSphere=h.toJSON()),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;const e={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const r=t.attributes;for(const d in r){const p=r[d];this.setAttribute(d,p.clone(e))}const a=t.morphAttributes;for(const d in a){const p=[],m=a[d];for(let _=0,E=m.length;_<E;_++)p.push(m[_].clone(e));this.morphAttributes[d]=p}this.morphTargetsRelative=t.morphTargetsRelative;const l=t.groups;for(let d=0,p=l.length;d<p;d++){const m=l[d];this.addGroup(m.start,m.count,m.materialIndex)}const h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());const u=t.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ku=new Oe,as=new ac,No=new Ro,Uu=new q,Bo=new q,Fo=new q,zo=new q,yc=new q,Ho=new q,Ou=new q,Vo=new q;class pn extends an{constructor(t=new $n,e=new Bi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}getVertexPosition(t,e){const s=this.geometry,r=s.attributes.position,a=s.morphAttributes.position,l=s.morphTargetsRelative;e.fromBufferAttribute(r,t);const h=this.morphTargetInfluences;if(a&&h){Ho.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(yc.fromBufferAttribute(m,t),l?Ho.addScaledVector(yc,p):Ho.addScaledVector(yc.sub(e),p))}e.add(Ho)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),No.copy(s.boundingSphere),No.applyMatrix4(a),as.copy(t.ray).recast(t.near),!(No.containsPoint(as.origin)===!1&&(as.intersectSphere(No,Uu)===null||as.origin.distanceToSquared(Uu)>(t.far-t.near)**2))&&(ku.copy(a).invert(),as.copy(t.ray).applyMatrix4(ku),!(s.boundingBox!==null&&as.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,as)))}_computeIntersections(t,e,s){let r;const a=this.geometry,l=this.material,h=a.index,u=a.attributes.position,d=a.attributes.uv,p=a.attributes.uv1,m=a.attributes.normal,_=a.groups,E=a.drawRange;if(h!==null)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let T=I,U=C;T<U;T+=3){const N=h.getX(T),B=h.getX(T+1),z=h.getX(T+2);r=Go(this,g,t,s,d,p,m,N,B,z),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(h.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=h.getX(v),C=h.getX(v+1),T=h.getX(v+2);r=Go(this,l,t,s,d,p,m,I,C,T),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let S=0,w=_.length;S<w;S++){const v=_[S],g=l[v.materialIndex],I=Math.max(v.start,E.start),C=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let T=I,U=C;T<U;T+=3){const N=T,B=T+1,z=T+2;r=Go(this,g,t,s,d,p,m,N,B,z),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const S=Math.max(0,E.start),w=Math.min(u.count,E.start+E.count);for(let v=S,g=w;v<g;v+=3){const I=v,C=v+1,T=v+2;r=Go(this,l,t,s,d,p,m,I,C,T),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function S0(n,t,e,s,r,a,l,h){let u;if(t.side===fn?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Ai,h),u===null)return null;Vo.copy(h),Vo.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Vo);return d<e.near||d>e.far?null:{distance:d,point:Vo.clone(),object:n}}function Go(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,Bo),n.getVertexPosition(u,Fo),n.getVertexPosition(d,zo);const p=S0(n,t,e,s,Bo,Fo,zo,Ou);if(p){const m=new q;Wn.getBarycoord(Ou,Bo,Fo,zo,m),r&&(p.uv=Wn.getInterpolatedAttribute(r,h,u,d,m,new be)),a&&(p.uv1=Wn.getInterpolatedAttribute(a,h,u,d,m,new be)),l&&(p.normal=Wn.getInterpolatedAttribute(l,h,u,d,m,new q),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new q,materialIndex:0};Wn.getNormal(Bo,Fo,zo,_.normal),p.face=_,p.barycoord=m}return p}class Rr extends $n{constructor(t=1,e=1,s=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:s,widthSegments:r,heightSegments:a,depthSegments:l};const h=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],d=[],p=[],m=[];let _=0,E=0;S("z","y","x",-1,-1,s,e,t,l,a,0),S("z","y","x",1,-1,s,e,-t,l,a,1),S("x","z","y",1,1,t,s,e,r,l,2),S("x","z","y",1,-1,t,s,-e,r,l,3),S("x","y","z",1,-1,t,e,s,r,a,4),S("x","y","z",-1,-1,t,e,-s,r,a,5),this.setIndex(u),this.setAttribute("position",new wn(d,3)),this.setAttribute("normal",new wn(p,3)),this.setAttribute("uv",new wn(m,2));function S(w,v,g,I,C,T,U,N,B,z,D){const M=T/B,k=U/z,Z=T/2,J=U/2,V=N/2,$=B+1,K=z+1;let ut=0,G=0;const Tt=new q;for(let ot=0;ot<K;ot++){const St=ot*k-J;for(let Gt=0;Gt<$;Gt++){const pt=Gt*M-Z;Tt[w]=pt*I,Tt[v]=St*C,Tt[g]=V,d.push(Tt.x,Tt.y,Tt.z),Tt[w]=0,Tt[v]=0,Tt[g]=N>0?1:-1,p.push(Tt.x,Tt.y,Tt.z),m.push(Gt/B),m.push(1-ot/z),ut+=1}}for(let ot=0;ot<z;ot++)for(let St=0;St<B;St++){const Gt=_+St+$*ot,pt=_+St+$*(ot+1),Lt=_+(St+1)+$*(ot+1),Y=_+(St+1)+$*ot;u.push(Gt,pt,Y),u.push(pt,Lt,Y),G+=6}h.addGroup(E,G,D),E+=G,_+=ut}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ws(n){const t={};for(const e in n){t[e]={};for(const s in n[e]){const r=n[e][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][s]=null):t[e][s]=r.clone():Array.isArray(r)?t[e][s]=r.slice():t[e][s]=r}}return t}function ln(n){const t={};for(let e=0;e<n.length;e++){const s=Ws(n[e]);for(const r in s)t[r]=s[r]}return t}function M0(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function Nu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}const T0={clone:Ws,merge:ln};var b0=`void main() {
14
+ */const il="179",nv=0,jh=1,iv=2,Jh=1,sv=2,li=3,Ai=0,fn=1,ci=2,Ci=0,Ss=1,Kh=2,$h=3,tu=4,rv=5,ts=100,ov=101,av=102,lv=103,cv=104,hv=200,uv=201,dv=202,fv=203,sl=204,rl=205,pv=206,mv=207,gv=208,_v=209,vv=210,yv=211,Ev=212,xv=213,wv=214,ol=0,al=1,ll=2,Ms=3,cl=4,hl=5,ul=6,dl=7,eu=0,Sv=1,Mv=2,Pi=0,nu=1,Tv=2,bv=3,Av=4,Cv=5,Pv=6,Rv=7,iu=300,Ts=301,bs=302,fl=303,pl=304,vo=306,ml=1e3,es=1001,gl=1002,Fn=1003,Lv=1004,yo=1005,En=1006,_l=1007,Ri=1008,hi=1009,su=1010,ru=1011,gr=1012,vl=1013,ns=1014,ui=1015,_r=1016,yl=1017,El=1018,vr=1020,ou=35902,au=1021,lu=1022,zn=1023,yr=1026,Er=1027,cu=1028,xl=1029,hu=1030,wl=1031,Sl=1033,Eo=33776,xo=33777,wo=33778,So=33779,Ml=35840,Tl=35841,bl=35842,Al=35843,Cl=36196,Pl=37492,Rl=37496,Ll=37808,Il=37809,Dl=37810,kl=37811,Ul=37812,Ol=37813,Nl=37814,Bl=37815,Fl=37816,zl=37817,Hl=37818,Vl=37819,Gl=37820,Wl=37821,Mo=36492,Zl=36494,Xl=36495,uu=36283,Yl=36284,ql=36285,Ql=36286,Iv=3200,Dv=3201,kv=0,Uv=1,Li="",Rn="srgb",is="srgb-linear",To="linear",Ie="srgb",As=7680,du=519,Ov=512,Nv=513,Bv=514,fu=515,Fv=516,zv=517,Hv=518,Vv=519,pu=35044,mu="300 es",jn=2e3,bo=2001;class Cs{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s===void 0?!1:s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners;if(s===void 0)return;const r=s[t];if(r!==void 0){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}}dispatchEvent(t){const e=this._listeners;if(e===void 0)return;const s=e[t.type];if(s!==void 0){t.target=this;const r=s.slice(0);for(let a=0,l=r.length;a<l;a++)r[a].call(this,t);t.target=null}}}const sn=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let gu=1234567;const xr=Math.PI/180,wr=180/Math.PI;function Ps(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(sn[n&255]+sn[n>>8&255]+sn[n>>16&255]+sn[n>>24&255]+"-"+sn[t&255]+sn[t>>8&255]+"-"+sn[t>>16&15|64]+sn[t>>24&255]+"-"+sn[e&63|128]+sn[e>>8&255]+"-"+sn[e>>16&255]+sn[e>>24&255]+sn[s&255]+sn[s>>8&255]+sn[s>>16&255]+sn[s>>24&255]).toLowerCase()}function _e(n,t,e){return Math.max(t,Math.min(e,n))}function jl(n,t){return(n%t+t)%t}function Gv(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function Wv(n,t,e){return n!==t?(e-n)/(t-n):0}function Sr(n,t,e){return(1-e)*n+e*t}function Zv(n,t,e,s){return Sr(n,t,1-Math.exp(-e*s))}function Xv(n,t=1){return t-Math.abs(jl(n,t*2)-t)}function Yv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function qv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function Qv(n,t){return n+Math.floor(Math.random()*(t-n+1))}function jv(n,t){return n+Math.random()*(t-n)}function Jv(n){return n*(.5-Math.random())}function Kv(n){n!==void 0&&(gu=n);let t=gu+=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 $v(n){return n*xr}function t0(n){return n*wr}function e0(n){return(n&n-1)===0&&n!==0}function n0(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function i0(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function s0(n,t,e,s,r){const a=Math.cos,l=Math.sin,h=a(e/2),u=l(e/2),d=a((t+s)/2),p=l((t+s)/2),m=a((t-s)/2),_=l((t-s)/2),E=a((s-t)/2),w=l((s-t)/2);switch(r){case"XYX":n.set(h*p,u*m,u*_,h*d);break;case"YZY":n.set(u*_,h*p,u*m,h*d);break;case"ZXZ":n.set(u*m,u*_,h*p,h*d);break;case"XZX":n.set(h*p,u*w,u*E,h*d);break;case"YXY":n.set(u*E,h*p,u*w,h*d);break;case"ZYZ":n.set(u*w,u*E,h*p,h*d);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Rs(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function on(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const Se={DEG2RAD:xr,RAD2DEG:wr,generateUUID:Ps,clamp:_e,euclideanModulo:jl,mapLinear:Gv,inverseLerp:Wv,lerp:Sr,damp:Zv,pingpong:Xv,smoothstep:Yv,smootherstep:qv,randInt:Qv,randFloat:jv,randFloatSpread:Jv,seededRandom:Kv,degToRad:$v,radToDeg:t0,isPowerOfTwo:e0,ceilPowerOfTwo:n0,floorPowerOfTwo:i0,setQuaternionFromProperEuler:s0,normalize:on,denormalize:Rs};class Ae{constructor(t=0,e=0){Ae.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){const e=this.x,s=this.y,r=t.elements;return this.x=r[0]*e+r[3]*s+r[6],this.y=r[1]*e+r[4]*s+r[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=_e(this.x,t.x,e.x),this.y=_e(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=_e(this.x,t,e),this.y=_e(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(_e(s,t,e))}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){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(_e(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,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){const s=Math.cos(e),r=Math.sin(e),a=this.x-t.x,l=this.y-t.y;return this.x=a*s-l*r+t.x,this.y=a*r+l*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ss{constructor(t=0,e=0,s=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=s,this._w=r}static slerpFlat(t,e,s,r,a,l,h){let u=s[r+0],d=s[r+1],p=s[r+2],m=s[r+3];const _=a[l+0],E=a[l+1],w=a[l+2],S=a[l+3];if(h===0){t[e+0]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m;return}if(h===1){t[e+0]=_,t[e+1]=E,t[e+2]=w,t[e+3]=S;return}if(m!==S||u!==_||d!==E||p!==w){let v=1-h;const g=u*_+d*E+p*w+m*S,R=g>=0?1:-1,P=1-g*g;if(P>Number.EPSILON){const U=Math.sqrt(P),B=Math.atan2(U,g*R);v=Math.sin(v*B)/U,h=Math.sin(h*B)/U}const T=h*R;if(u=u*v+_*T,d=d*v+E*T,p=p*v+w*T,m=m*v+S*T,v===1-h){const U=1/Math.sqrt(u*u+d*d+p*p+m*m);u*=U,d*=U,p*=U,m*=U}}t[e]=u,t[e+1]=d,t[e+2]=p,t[e+3]=m}static multiplyQuaternionsFlat(t,e,s,r,a,l){const h=s[r],u=s[r+1],d=s[r+2],p=s[r+3],m=a[l],_=a[l+1],E=a[l+2],w=a[l+3];return t[e]=h*w+p*m+u*E-d*_,t[e+1]=u*w+p*_+d*m-h*E,t[e+2]=d*w+p*E+h*_-u*m,t[e+3]=p*w-h*m-u*_-d*E,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,s,r){return this._x=t,this._y=e,this._z=s,this._w=r,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){const s=t._x,r=t._y,a=t._z,l=t._order,h=Math.cos,u=Math.sin,d=h(s/2),p=h(r/2),m=h(a/2),_=u(s/2),E=u(r/2),w=u(a/2);switch(l){case"XYZ":this._x=_*p*m+d*E*w,this._y=d*E*m-_*p*w,this._z=d*p*w+_*E*m,this._w=d*p*m-_*E*w;break;case"YXZ":this._x=_*p*m+d*E*w,this._y=d*E*m-_*p*w,this._z=d*p*w-_*E*m,this._w=d*p*m+_*E*w;break;case"ZXY":this._x=_*p*m-d*E*w,this._y=d*E*m+_*p*w,this._z=d*p*w+_*E*m,this._w=d*p*m-_*E*w;break;case"ZYX":this._x=_*p*m-d*E*w,this._y=d*E*m+_*p*w,this._z=d*p*w-_*E*m,this._w=d*p*m+_*E*w;break;case"YZX":this._x=_*p*m+d*E*w,this._y=d*E*m+_*p*w,this._z=d*p*w-_*E*m,this._w=d*p*m-_*E*w;break;case"XZY":this._x=_*p*m-d*E*w,this._y=d*E*m-_*p*w,this._z=d*p*w+_*E*m,this._w=d*p*m+_*E*w;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,r=Math.sin(s);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,s=e[0],r=e[4],a=e[8],l=e[1],h=e[5],u=e[9],d=e[2],p=e[6],m=e[10],_=s+h+m;if(_>0){const E=.5/Math.sqrt(_+1);this._w=.25/E,this._x=(p-u)*E,this._y=(a-d)*E,this._z=(l-r)*E}else if(s>h&&s>m){const E=2*Math.sqrt(1+s-h-m);this._w=(p-u)/E,this._x=.25*E,this._y=(r+l)/E,this._z=(a+d)/E}else if(h>m){const E=2*Math.sqrt(1+h-s-m);this._w=(a-d)/E,this._x=(r+l)/E,this._y=.25*E,this._z=(u+p)/E}else{const E=2*Math.sqrt(1+m-s-h);this._w=(l-r)/E,this._x=(a+d)/E,this._y=(u+p)/E,this._z=.25*E}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<1e-8?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(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=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(_e(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const r=Math.min(1,e/s);return this.slerp(t,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(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){const s=t._x,r=t._y,a=t._z,l=t._w,h=e._x,u=e._y,d=e._z,p=e._w;return this._x=s*p+l*h+r*d-a*u,this._y=r*p+l*u+a*h-s*d,this._z=a*p+l*d+s*u-r*h,this._w=l*p-s*h-r*u-a*d,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,r=this._y,a=this._z,l=this._w;let h=l*t._w+s*t._x+r*t._y+a*t._z;if(h<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,h=-h):this.copy(t),h>=1)return this._w=l,this._x=s,this._y=r,this._z=a,this;const u=1-h*h;if(u<=Number.EPSILON){const E=1-e;return this._w=E*l+e*this._w,this._x=E*s+e*this._x,this._y=E*r+e*this._y,this._z=E*a+e*this._z,this.normalize(),this}const d=Math.sqrt(u),p=Math.atan2(d,h),m=Math.sin((1-e)*p)/d,_=Math.sin(e*p)/d;return this._w=l*m+this._w*_,this._x=s*m+this._x*_,this._y=r*m+this._y*_,this._z=a*m+this._z*_,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),r=Math.sqrt(1-s),a=Math.sqrt(s);return this.set(r*Math.sin(t),r*Math.cos(t),a*Math.sin(e),a*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}}class q{constructor(t=0,e=0,s=0){q.prototype.isVector3=!0,this.x=t,this.y=e,this.z=s}set(t,e,s){return s===void 0&&(s=this.z),this.x=t,this.y=e,this.z=s,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(_u.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_u.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[3]*s+a[6]*r,this.y=a[1]*e+a[4]*s+a[7]*r,this.z=a[2]*e+a[5]*s+a[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,r=this.z,a=t.elements,l=1/(a[3]*e+a[7]*s+a[11]*r+a[15]);return this.x=(a[0]*e+a[4]*s+a[8]*r+a[12])*l,this.y=(a[1]*e+a[5]*s+a[9]*r+a[13])*l,this.z=(a[2]*e+a[6]*s+a[10]*r+a[14])*l,this}applyQuaternion(t){const e=this.x,s=this.y,r=this.z,a=t.x,l=t.y,h=t.z,u=t.w,d=2*(l*r-h*s),p=2*(h*e-a*r),m=2*(a*s-l*e);return this.x=e+u*d+l*m-h*p,this.y=s+u*p+h*d-a*m,this.z=r+u*m+a*p-l*d,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,s=this.y,r=this.z,a=t.elements;return this.x=a[0]*e+a[4]*s+a[8]*r,this.y=a[1]*e+a[5]*s+a[9]*r,this.z=a[2]*e+a[6]*s+a[10]*r,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=_e(this.x,t.x,e.x),this.y=_e(this.y,t.y,e.y),this.z=_e(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=_e(this.x,t,e),this.y=_e(this.y,t,e),this.z=_e(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(_e(s,t,e))}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,r=t.y,a=t.z,l=e.x,h=e.y,u=e.z;return this.x=r*u-a*h,this.y=a*l-s*u,this.z=s*h-r*l,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}projectOnPlane(t){return Jl.copy(this).projectOnVector(t),this.sub(Jl)}reflect(t){return this.sub(Jl.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(_e(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,r=this.z-t.z;return e*e+s*s+r*r}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,s){const r=Math.sin(e)*t;return this.x=r*Math.sin(s),this.y=Math.cos(e)*t,this.z=r*Math.cos(s),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,s){return this.x=t*Math.sin(e),this.y=s,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),s=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=s,this.z=r,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(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Jl=new q,_u=new ss;class ue{constructor(t,e,s,r,a,l,h,u,d){ue.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,s,r,a,l,h,u,d)}set(t,e,s,r,a,l,h,u,d){const p=this.elements;return p[0]=t,p[1]=r,p[2]=h,p[3]=e,p[4]=a,p[5]=u,p[6]=s,p[7]=l,p[8]=d,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],this}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const 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){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[3],u=s[6],d=s[1],p=s[4],m=s[7],_=s[2],E=s[5],w=s[8],S=r[0],v=r[3],g=r[6],R=r[1],P=r[4],T=r[7],U=r[2],B=r[5],N=r[8];return a[0]=l*S+h*R+u*U,a[3]=l*v+h*P+u*B,a[6]=l*g+h*T+u*N,a[1]=d*S+p*R+m*U,a[4]=d*v+p*P+m*B,a[7]=d*g+p*T+m*N,a[2]=_*S+E*R+w*U,a[5]=_*v+E*P+w*B,a[8]=_*g+E*T+w*N,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8];return e*l*p-e*h*d-s*a*p+s*h*u+r*a*d-r*l*u}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=p*l-h*d,_=h*u-p*a,E=d*a-l*u,w=e*m+s*_+r*E;if(w===0)return this.set(0,0,0,0,0,0,0,0,0);const S=1/w;return t[0]=m*S,t[1]=(r*d-p*s)*S,t[2]=(h*s-r*l)*S,t[3]=_*S,t[4]=(p*e-r*u)*S,t[5]=(r*a-h*e)*S,t[6]=E*S,t[7]=(s*u-d*e)*S,t[8]=(l*e-s*a)*S,this}transpose(){let t;const 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){const 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,s,r,a,l,h){const u=Math.cos(a),d=Math.sin(a);return this.set(s*u,s*d,-s*(u*l+d*h)+l+t,-r*d,r*u,-r*(-d*l+u*h)+h+e,0,0,1),this}scale(t,e){return this.premultiply(Kl.makeScale(t,e)),this}rotate(t){return this.premultiply(Kl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Kl.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){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<9;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<9;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const Kl=new ue;function vu(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Mr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function r0(){const n=Mr("canvas");return n.style.display="block",n}const yu={};function Ls(n){n in yu||(yu[n]=!0,console.warn(n))}function o0(n,t,e){return new Promise(function(s,r){function a(){switch(n.clientWaitSync(t,n.SYNC_FLUSH_COMMANDS_BIT,0)){case n.WAIT_FAILED:r();break;case n.TIMEOUT_EXPIRED:setTimeout(a,e);break;default:s()}}setTimeout(a,e)})}const Eu=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),xu=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function a0(){const n={enabled:!0,workingColorSpace:is,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ie&&(r.r=di(r.r),r.g=di(r.g),r.b=di(r.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(r.applyMatrix3(this.spaces[a].toXYZ),r.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ie&&(r.r=Is(r.r),r.g=Is(r.g),r.b=Is(r.b))),r},workingToColorSpace:function(r,a){return this.convert(r,this.workingColorSpace,a)},colorSpaceToWorking:function(r,a){return this.convert(r,a,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Li?To:this.spaces[r].transfer},getLuminanceCoefficients:function(r,a=this.workingColorSpace){return r.fromArray(this.spaces[a].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,a,l){return r.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return Ls("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),n.colorSpaceToWorking(r,a)}},t=[.64,.33,.3,.6,.15,.06],e=[.2126,.7152,.0722],s=[.3127,.329];return n.define({[is]:{primaries:t,whitePoint:s,transfer:To,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:Rn},outputColorSpaceConfig:{drawingBufferColorSpace:Rn}},[Rn]:{primaries:t,whitePoint:s,transfer:Ie,toXYZ:Eu,fromXYZ:xu,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:Rn}}}),n}const Me=a0();function di(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Is(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ds;class l0{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let s;if(t instanceof HTMLCanvasElement)s=t;else{Ds===void 0&&(Ds=Mr("canvas")),Ds.width=t.width,Ds.height=t.height;const r=Ds.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ds}return s.toDataURL(e)}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Mr("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");s.drawImage(t,0,0,t.width,t.height);const r=s.getImageData(0,0,t.width,t.height),a=r.data;for(let l=0;l<a.length;l++)a[l]=di(a[l]/255)*255;return s.putImageData(r,0,0),e}else if(t.data){const e=t.data.slice(0);for(let s=0;s<e.length;s++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[s]=Math.floor(di(e[s]/255)*255):e[s]=di(e[s]);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}}let c0=0;class $l{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:c0++}),this.uuid=Ps(),this.data=t,this.dataReady=!0,this.version=0}getSize(t){const e=this.data;return e instanceof HTMLVideoElement?t.set(e.videoWidth,e.videoHeight,0):e instanceof VideoFrame?t.set(e.displayHeight,e.displayWidth,0):e!==null?t.set(e.width,e.height,e.depth||0):t.set(0,0,0),t}set needsUpdate(t){t===!0&&this.version++}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];const s={uuid:this.uuid,url:""},r=this.data;if(r!==null){let a;if(Array.isArray(r)){a=[];for(let l=0,h=r.length;l<h;l++)r[l].isDataTexture?a.push(tc(r[l].image)):a.push(tc(r[l]))}else a=tc(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function tc(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?l0.getDataURL(n):n.data?{data:Array.from(n.data),width:n.width,height:n.height,type:n.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let h0=0;const ec=new q;class Je extends Cs{constructor(t=Je.DEFAULT_IMAGE,e=Je.DEFAULT_MAPPING,s=es,r=es,a=En,l=Ri,h=zn,u=hi,d=Je.DEFAULT_ANISOTROPY,p=Li){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:h0++}),this.uuid=Ps(),this.name="",this.source=new $l(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=s,this.wrapT=r,this.magFilter=a,this.minFilter=l,this.anisotropy=d,this.format=h,this.internalFormat=null,this.type=u,this.offset=new Ae(0,0),this.repeat=new Ae(1,1),this.center=new Ae(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ue,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=p,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(t&&t.depth&&t.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(ec).x}get height(){return this.source.getSize(ec).y}get depth(){return this.source.getSize(ec).z}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)}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}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.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isArrayTexture=t.isArrayTexture,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}setValues(t){for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Texture.setValues(): parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Texture.setValues(): property '${e}' does not exist.`);continue}r&&s&&r.isVector2&&s.isVector2||r&&s&&r.isVector3&&s.isVector3||r&&s&&r.isMatrix3&&s.isMatrix3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];const s={metadata:{version:4.7,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&&(s.userData=this.userData),e||(t.textures[this.uuid]=s),s}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==iu)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ml:t.x=t.x-Math.floor(t.x);break;case es:t.x=t.x<0?0:1;break;case gl: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 ml:t.y=t.y-Math.floor(t.y);break;case es:t.y=t.y<0?0:1;break;case gl: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++}}Je.DEFAULT_IMAGE=null,Je.DEFAULT_MAPPING=iu,Je.DEFAULT_ANISOTROPY=1;class He{constructor(t=0,e=0,s=0,r=1){He.prototype.isVector4=!0,this.x=t,this.y=e,this.z=s,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,s,r){return this.x=t,this.y=e,this.z=s,this.w=r,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,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=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;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,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,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,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.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){const e=this.x,s=this.y,r=this.z,a=this.w,l=t.elements;return this.x=l[0]*e+l[4]*s+l[8]*r+l[12]*a,this.y=l[1]*e+l[5]*s+l[9]*r+l[13]*a,this.z=l[2]*e+l[6]*s+l[10]*r+l[14]*a,this.w=l[3]*e+l[7]*s+l[11]*r+l[15]*a,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,s,r,a;const u=t.elements,d=u[0],p=u[4],m=u[8],_=u[1],E=u[5],w=u[9],S=u[2],v=u[6],g=u[10];if(Math.abs(p-_)<.01&&Math.abs(m-S)<.01&&Math.abs(w-v)<.01){if(Math.abs(p+_)<.1&&Math.abs(m+S)<.1&&Math.abs(w+v)<.1&&Math.abs(d+E+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const P=(d+1)/2,T=(E+1)/2,U=(g+1)/2,B=(p+_)/4,N=(m+S)/4,z=(w+v)/4;return P>T&&P>U?P<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(P),r=B/s,a=N/s):T>U?T<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(T),s=B/r,a=z/r):U<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(U),s=N/a,r=z/a),this.set(s,r,a,e),this}let R=Math.sqrt((v-w)*(v-w)+(m-S)*(m-S)+(_-p)*(_-p));return Math.abs(R)<.001&&(R=1),this.x=(v-w)/R,this.y=(m-S)/R,this.z=(_-p)/R,this.w=Math.acos((d+E+g-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],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,e){return this.x=_e(this.x,t.x,e.x),this.y=_e(this.y,t.y,e.y),this.z=_e(this.z,t.z,e.z),this.w=_e(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=_e(this.x,t,e),this.y=_e(this.y,t,e),this.z=_e(this.z,t,e),this.w=_e(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(_e(s,t,e))}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,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}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}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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class u0 extends Cs{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:En,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},s),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=s.depth,this.scissor=new He(0,0,t,e),this.scissorTest=!1,this.viewport=new He(0,0,t,e);const r={width:t,height:e,depth:s.depth},a=new Je(r);this.textures=[];const l=s.count;for(let h=0;h<l;h++)this.textures[h]=a.clone(),this.textures[h].isRenderTargetTexture=!0,this.textures[h].renderTarget=this;this._setTextureOptions(s),this.depthBuffer=s.depthBuffer,this.stencilBuffer=s.stencilBuffer,this.resolveDepthBuffer=s.resolveDepthBuffer,this.resolveStencilBuffer=s.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=s.depthTexture,this.samples=s.samples,this.multiview=s.multiview}_setTextureOptions(t={}){const e={minFilter:En,generateMipmaps:!1,flipY:!1,internalFormat:null};t.mapping!==void 0&&(e.mapping=t.mapping),t.wrapS!==void 0&&(e.wrapS=t.wrapS),t.wrapT!==void 0&&(e.wrapT=t.wrapT),t.wrapR!==void 0&&(e.wrapR=t.wrapR),t.magFilter!==void 0&&(e.magFilter=t.magFilter),t.minFilter!==void 0&&(e.minFilter=t.minFilter),t.format!==void 0&&(e.format=t.format),t.type!==void 0&&(e.type=t.type),t.anisotropy!==void 0&&(e.anisotropy=t.anisotropy),t.colorSpace!==void 0&&(e.colorSpace=t.colorSpace),t.flipY!==void 0&&(e.flipY=t.flipY),t.generateMipmaps!==void 0&&(e.generateMipmaps=t.generateMipmaps),t.internalFormat!==void 0&&(e.internalFormat=t.internalFormat);for(let s=0;s<this.textures.length;s++)this.textures[s].setValues(e)}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}set depthTexture(t){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),t!==null&&(t.renderTarget=this),this._depthTexture=t}get depthTexture(){return this._depthTexture}setSize(t,e,s=1){if(this.width!==t||this.height!==e||this.depth!==s){this.width=t,this.height=e,this.depth=s;for(let r=0,a=this.textures.length;r<a;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=s,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let e=0,s=t.textures.length;e<s;e++){this.textures[e]=t.textures[e].clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;const r=Object.assign({},t.textures[e].image);this.textures[e].source=new $l(r)}return this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ii extends u0{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class wu extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class d0 extends Je{constructor(t=null,e=1,s=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:s,depth:r},this.magFilter=Fn,this.minFilter=Fn,this.wrapR=es,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ks{constructor(t=new q(1/0,1/0,1/0),e=new q(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e+=3)this.expandByPoint(Hn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Hn.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,s=t.length;e<s;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const s=Hn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(s),this.max.copy(t).add(s),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const s=t.geometry;if(s!==void 0){const a=s.getAttribute("position");if(e===!0&&a!==void 0&&t.isInstancedMesh!==!0)for(let l=0,h=a.count;l<h;l++)t.isMesh===!0?t.getVertexPosition(l,Hn):Hn.fromBufferAttribute(a,l),Hn.applyMatrix4(t.matrixWorld),this.expandByPoint(Hn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),Ao.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),Ao.copy(s.boundingBox)),Ao.applyMatrix4(t.matrixWorld),this.union(Ao)}const r=t.children;for(let a=0,l=r.length;a<l;a++)this.expandByObject(r[a],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,s;return t.normal.x>0?(e=t.normal.x*this.min.x,s=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,s=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,s+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,s+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,s+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,s+=t.normal.z*this.min.z),e<=-t.constant&&s>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tr),Co.subVectors(this.max,Tr),Us.subVectors(t.a,Tr),Os.subVectors(t.b,Tr),Ns.subVectors(t.c,Tr),Di.subVectors(Os,Us),ki.subVectors(Ns,Os),rs.subVectors(Us,Ns);let e=[0,-Di.z,Di.y,0,-ki.z,ki.y,0,-rs.z,rs.y,Di.z,0,-Di.x,ki.z,0,-ki.x,rs.z,0,-rs.x,-Di.y,Di.x,0,-ki.y,ki.x,0,-rs.y,rs.x,0];return!nc(e,Us,Os,Ns,Co)||(e=[1,0,0,0,1,0,0,0,1],!nc(e,Us,Os,Ns,Co))?!1:(Po.crossVectors(Di,ki),e=[Po.x,Po.y,Po.z],nc(e,Us,Os,Ns,Co))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hn).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(fi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),fi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),fi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),fi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),fi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),fi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),fi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),fi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(fi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(t){return this.min.fromArray(t.min),this.max.fromArray(t.max),this}}const fi=[new q,new q,new q,new q,new q,new q,new q,new q],Hn=new q,Ao=new ks,Us=new q,Os=new q,Ns=new q,Di=new q,ki=new q,rs=new q,Tr=new q,Co=new q,Po=new q,os=new q;function nc(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){os.fromArray(n,a);const h=r.x*Math.abs(os.x)+r.y*Math.abs(os.y)+r.z*Math.abs(os.z),u=t.dot(os),d=e.dot(os),p=s.dot(os);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const f0=new ks,br=new q,ic=new q;class Ro{constructor(t=new q,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const s=this.center;e!==void 0?s.copy(e):f0.setFromPoints(t).getCenter(s);let r=0;for(let a=0,l=t.length;a<l;a++)r=Math.max(r,s.distanceToSquared(t[a]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const s=this.center.distanceToSquared(t);return e.copy(t),s>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;br.subVectors(t,this.center);const e=br.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(br,r/s),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(ic.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(br.copy(t.center).add(ic)),this.expandByPoint(br.copy(t.center).sub(ic))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(t){return this.radius=t.radius,this.center.fromArray(t.center),this}}const pi=new q,sc=new q,Lo=new q,Ui=new q,rc=new q,Io=new q,oc=new q;class ac{constructor(t=new q,e=new q(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,pi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const s=e.dot(this.direction);return s<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,s)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=pi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(pi.copy(this.origin).addScaledVector(this.direction,e),pi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){sc.copy(t).add(e).multiplyScalar(.5),Lo.copy(e).sub(t).normalize(),Ui.copy(this.origin).sub(sc);const a=t.distanceTo(e)*.5,l=-this.direction.dot(Lo),h=Ui.dot(this.direction),u=-Ui.dot(Lo),d=Ui.lengthSq(),p=Math.abs(1-l*l);let m,_,E,w;if(p>0)if(m=l*u-h,_=l*h-u,w=a*p,m>=0)if(_>=-w)if(_<=w){const S=1/p;m*=S,_*=S,E=m*(m+l*_+2*h)+_*(l*m+_+2*u)+d}else _=a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _=-a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;else _<=-w?(m=Math.max(0,-(-l*a+h)),_=m>0?-a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d):_<=w?(m=0,_=Math.min(Math.max(-a,-u),a),E=_*(_+2*u)+d):(m=Math.max(0,-(l*a+h)),_=m>0?a:Math.min(Math.max(-a,-u),a),E=-m*m+_*(_+2*u)+d);else _=l>0?-a:a,m=Math.max(0,-(l*_+h)),E=-m*m+_*(_+2*u)+d;return s&&s.copy(this.origin).addScaledVector(this.direction,m),r&&r.copy(sc).addScaledVector(Lo,_),E}intersectSphere(t,e){pi.subVectors(t.center,this.origin);const s=pi.dot(this.direction),r=pi.dot(pi)-s*s,a=t.radius*t.radius;if(r>a)return null;const l=Math.sqrt(a-r),h=s-l,u=s+l;return u<0?null:h<0?this.at(u,e):this.at(h,e)}intersectsSphere(t){return t.radius<0?!1:this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const s=-(this.origin.dot(t.normal)+t.constant)/e;return s>=0?s:null}intersectPlane(t,e){const s=this.distanceToPlane(t);return s===null?null:this.at(s,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let s,r,a,l,h,u;const d=1/this.direction.x,p=1/this.direction.y,m=1/this.direction.z,_=this.origin;return d>=0?(s=(t.min.x-_.x)*d,r=(t.max.x-_.x)*d):(s=(t.max.x-_.x)*d,r=(t.min.x-_.x)*d),p>=0?(a=(t.min.y-_.y)*p,l=(t.max.y-_.y)*p):(a=(t.max.y-_.y)*p,l=(t.min.y-_.y)*p),s>l||a>r||((a>s||isNaN(s))&&(s=a),(l<r||isNaN(r))&&(r=l),m>=0?(h=(t.min.z-_.z)*m,u=(t.max.z-_.z)*m):(h=(t.max.z-_.z)*m,u=(t.min.z-_.z)*m),s>u||h>r)||((h>s||s!==s)&&(s=h),(u<r||r!==r)&&(r=u),r<0)?null:this.at(s>=0?s:r,e)}intersectsBox(t){return this.intersectBox(t,pi)!==null}intersectTriangle(t,e,s,r,a){rc.subVectors(e,t),Io.subVectors(s,t),oc.crossVectors(rc,Io);let l=this.direction.dot(oc),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Ui.subVectors(this.origin,t);const u=h*this.direction.dot(Io.crossVectors(Ui,Io));if(u<0)return null;const d=h*this.direction.dot(rc.cross(Ui));if(d<0||u+d>l)return null;const p=-h*Ui.dot(oc);return p<0?null:this.at(p/l,a)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Oe{constructor(t,e,s,r,a,l,h,u,d,p,m,_,E,w,S,v){Oe.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,s,r,a,l,h,u,d,p,m,_,E,w,S,v)}set(t,e,s,r,a,l,h,u,d,p,m,_,E,w,S,v){const g=this.elements;return g[0]=t,g[4]=e,g[8]=s,g[12]=r,g[1]=a,g[5]=l,g[9]=h,g[13]=u,g[2]=d,g[6]=p,g[10]=m,g[14]=_,g[3]=E,g[7]=w,g[11]=S,g[15]=v,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Oe().fromArray(this.elements)}copy(t){const e=this.elements,s=t.elements;return e[0]=s[0],e[1]=s[1],e[2]=s[2],e[3]=s[3],e[4]=s[4],e[5]=s[5],e[6]=s[6],e[7]=s[7],e[8]=s[8],e[9]=s[9],e[10]=s[10],e[11]=s[11],e[12]=s[12],e[13]=s[13],e[14]=s[14],e[15]=s[15],this}copyPosition(t){const e=this.elements,s=t.elements;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const 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,s){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),s.setFromMatrixColumn(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,s=t.elements,r=1/Bs.setFromMatrixColumn(t,0).length(),a=1/Bs.setFromMatrixColumn(t,1).length(),l=1/Bs.setFromMatrixColumn(t,2).length();return e[0]=s[0]*r,e[1]=s[1]*r,e[2]=s[2]*r,e[3]=0,e[4]=s[4]*a,e[5]=s[5]*a,e[6]=s[6]*a,e[7]=0,e[8]=s[8]*l,e[9]=s[9]*l,e[10]=s[10]*l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,s=t.x,r=t.y,a=t.z,l=Math.cos(s),h=Math.sin(s),u=Math.cos(r),d=Math.sin(r),p=Math.cos(a),m=Math.sin(a);if(t.order==="XYZ"){const _=l*p,E=l*m,w=h*p,S=h*m;e[0]=u*p,e[4]=-u*m,e[8]=d,e[1]=E+w*d,e[5]=_-S*d,e[9]=-h*u,e[2]=S-_*d,e[6]=w+E*d,e[10]=l*u}else if(t.order==="YXZ"){const _=u*p,E=u*m,w=d*p,S=d*m;e[0]=_+S*h,e[4]=w*h-E,e[8]=l*d,e[1]=l*m,e[5]=l*p,e[9]=-h,e[2]=E*h-w,e[6]=S+_*h,e[10]=l*u}else if(t.order==="ZXY"){const _=u*p,E=u*m,w=d*p,S=d*m;e[0]=_-S*h,e[4]=-l*m,e[8]=w+E*h,e[1]=E+w*h,e[5]=l*p,e[9]=S-_*h,e[2]=-l*d,e[6]=h,e[10]=l*u}else if(t.order==="ZYX"){const _=l*p,E=l*m,w=h*p,S=h*m;e[0]=u*p,e[4]=w*d-E,e[8]=_*d+S,e[1]=u*m,e[5]=S*d+_,e[9]=E*d-w,e[2]=-d,e[6]=h*u,e[10]=l*u}else if(t.order==="YZX"){const _=l*u,E=l*d,w=h*u,S=h*d;e[0]=u*p,e[4]=S-_*m,e[8]=w*m+E,e[1]=m,e[5]=l*p,e[9]=-h*p,e[2]=-d*p,e[6]=E*m+w,e[10]=_-S*m}else if(t.order==="XZY"){const _=l*u,E=l*d,w=h*u,S=h*d;e[0]=u*p,e[4]=-m,e[8]=d*p,e[1]=_*m+S,e[5]=l*p,e[9]=E*m-w,e[2]=w*m-E,e[6]=h*p,e[10]=S*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(p0,t,m0)}lookAt(t,e,s){const r=this.elements;return xn.subVectors(t,e),xn.lengthSq()===0&&(xn.z=1),xn.normalize(),Oi.crossVectors(s,xn),Oi.lengthSq()===0&&(Math.abs(s.z)===1?xn.x+=1e-4:xn.z+=1e-4,xn.normalize(),Oi.crossVectors(s,xn)),Oi.normalize(),Do.crossVectors(xn,Oi),r[0]=Oi.x,r[4]=Do.x,r[8]=xn.x,r[1]=Oi.y,r[5]=Do.y,r[9]=xn.y,r[2]=Oi.z,r[6]=Do.z,r[10]=xn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const s=t.elements,r=e.elements,a=this.elements,l=s[0],h=s[4],u=s[8],d=s[12],p=s[1],m=s[5],_=s[9],E=s[13],w=s[2],S=s[6],v=s[10],g=s[14],R=s[3],P=s[7],T=s[11],U=s[15],B=r[0],N=r[4],z=r[8],D=r[12],M=r[1],k=r[5],Z=r[9],J=r[13],V=r[2],$=r[6],K=r[10],ut=r[14],G=r[3],Tt=r[7],lt=r[11],Mt=r[15];return a[0]=l*B+h*M+u*V+d*G,a[4]=l*N+h*k+u*$+d*Tt,a[8]=l*z+h*Z+u*K+d*lt,a[12]=l*D+h*J+u*ut+d*Mt,a[1]=p*B+m*M+_*V+E*G,a[5]=p*N+m*k+_*$+E*Tt,a[9]=p*z+m*Z+_*K+E*lt,a[13]=p*D+m*J+_*ut+E*Mt,a[2]=w*B+S*M+v*V+g*G,a[6]=w*N+S*k+v*$+g*Tt,a[10]=w*z+S*Z+v*K+g*lt,a[14]=w*D+S*J+v*ut+g*Mt,a[3]=R*B+P*M+T*V+U*G,a[7]=R*N+P*k+T*$+U*Tt,a[11]=R*z+P*Z+T*K+U*lt,a[15]=R*D+P*J+T*ut+U*Mt,this}multiplyScalar(t){const 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(){const t=this.elements,e=t[0],s=t[4],r=t[8],a=t[12],l=t[1],h=t[5],u=t[9],d=t[13],p=t[2],m=t[6],_=t[10],E=t[14],w=t[3],S=t[7],v=t[11],g=t[15];return w*(+a*u*m-r*d*m-a*h*_+s*d*_+r*h*E-s*u*E)+S*(+e*u*E-e*d*_+a*l*_-r*l*E+r*d*p-a*u*p)+v*(+e*d*m-e*h*E-a*l*m+s*l*E+a*h*p-s*d*p)+g*(-r*h*p-e*u*m+e*h*_+r*l*m-s*l*_+s*u*p)}transpose(){const t=this.elements;let 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,s){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=s),this}invert(){const t=this.elements,e=t[0],s=t[1],r=t[2],a=t[3],l=t[4],h=t[5],u=t[6],d=t[7],p=t[8],m=t[9],_=t[10],E=t[11],w=t[12],S=t[13],v=t[14],g=t[15],R=m*v*d-S*_*d+S*u*E-h*v*E-m*u*g+h*_*g,P=w*_*d-p*v*d-w*u*E+l*v*E+p*u*g-l*_*g,T=p*S*d-w*m*d+w*h*E-l*S*E-p*h*g+l*m*g,U=w*m*u-p*S*u-w*h*_+l*S*_+p*h*v-l*m*v,B=e*R+s*P+r*T+a*U;if(B===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const N=1/B;return t[0]=R*N,t[1]=(S*_*a-m*v*a-S*r*E+s*v*E+m*r*g-s*_*g)*N,t[2]=(h*v*a-S*u*a+S*r*d-s*v*d-h*r*g+s*u*g)*N,t[3]=(m*u*a-h*_*a-m*r*d+s*_*d+h*r*E-s*u*E)*N,t[4]=P*N,t[5]=(p*v*a-w*_*a+w*r*E-e*v*E-p*r*g+e*_*g)*N,t[6]=(w*u*a-l*v*a-w*r*d+e*v*d+l*r*g-e*u*g)*N,t[7]=(l*_*a-p*u*a+p*r*d-e*_*d-l*r*E+e*u*E)*N,t[8]=T*N,t[9]=(w*m*a-p*S*a-w*s*E+e*S*E+p*s*g-e*m*g)*N,t[10]=(l*S*a-w*h*a+w*s*d-e*S*d-l*s*g+e*h*g)*N,t[11]=(p*h*a-l*m*a-p*s*d+e*m*d+l*s*E-e*h*E)*N,t[12]=U*N,t[13]=(p*S*r-w*m*r+w*s*_-e*S*_-p*s*v+e*m*v)*N,t[14]=(w*h*r-l*S*r-w*s*u+e*S*u+l*s*v-e*h*v)*N,t[15]=(l*m*r-p*h*r+p*s*u-e*m*u-l*s*_+e*h*_)*N,this}scale(t){const e=this.elements,s=t.x,r=t.y,a=t.z;return e[0]*=s,e[4]*=r,e[8]*=a,e[1]*=s,e[5]*=r,e[9]*=a,e[2]*=s,e[6]*=r,e[10]*=a,e[3]*=s,e[7]*=r,e[11]*=a,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,r))}makeTranslation(t,e,s){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,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),r=Math.sin(e),a=1-s,l=t.x,h=t.y,u=t.z,d=a*l,p=a*h;return this.set(d*l+s,d*h-r*u,d*u+r*h,0,d*h+r*u,p*h+s,p*u-r*l,0,d*u-r*h,p*u+r*l,a*u*u+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,r,a,l){return this.set(1,s,a,0,t,1,l,0,e,r,1,0,0,0,0,1),this}compose(t,e,s){const r=this.elements,a=e._x,l=e._y,h=e._z,u=e._w,d=a+a,p=l+l,m=h+h,_=a*d,E=a*p,w=a*m,S=l*p,v=l*m,g=h*m,R=u*d,P=u*p,T=u*m,U=s.x,B=s.y,N=s.z;return r[0]=(1-(S+g))*U,r[1]=(E+T)*U,r[2]=(w-P)*U,r[3]=0,r[4]=(E-T)*B,r[5]=(1-(_+g))*B,r[6]=(v+R)*B,r[7]=0,r[8]=(w+P)*N,r[9]=(v-R)*N,r[10]=(1-(_+S))*N,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,s){const r=this.elements;let a=Bs.set(r[0],r[1],r[2]).length();const l=Bs.set(r[4],r[5],r[6]).length(),h=Bs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(a=-a),t.x=r[12],t.y=r[13],t.z=r[14],Vn.copy(this);const d=1/a,p=1/l,m=1/h;return Vn.elements[0]*=d,Vn.elements[1]*=d,Vn.elements[2]*=d,Vn.elements[4]*=p,Vn.elements[5]*=p,Vn.elements[6]*=p,Vn.elements[8]*=m,Vn.elements[9]*=m,Vn.elements[10]*=m,e.setFromRotationMatrix(Vn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2*a/(e-t),m=2*a/(s-r),_=(e+t)/(e-t),E=(s+r)/(s-r);let w,S;if(u)w=a/(l-a),S=l*a/(l-a);else if(h===jn)w=-(l+a)/(l-a),S=-2*l*a/(l-a);else if(h===bo)w=-l/(l-a),S=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=_,d[12]=0,d[1]=0,d[5]=m,d[9]=E,d[13]=0,d[2]=0,d[6]=0,d[10]=w,d[14]=S,d[3]=0,d[7]=0,d[11]=-1,d[15]=0,this}makeOrthographic(t,e,s,r,a,l,h=jn,u=!1){const d=this.elements,p=2/(e-t),m=2/(s-r),_=-(e+t)/(e-t),E=-(s+r)/(s-r);let w,S;if(u)w=1/(l-a),S=l/(l-a);else if(h===jn)w=-2/(l-a),S=-(l+a)/(l-a);else if(h===bo)w=-1/(l-a),S=-a/(l-a);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+h);return d[0]=p,d[4]=0,d[8]=0,d[12]=_,d[1]=0,d[5]=m,d[9]=0,d[13]=E,d[2]=0,d[6]=0,d[10]=w,d[14]=S,d[3]=0,d[7]=0,d[11]=0,d[15]=1,this}equals(t){const e=this.elements,s=t.elements;for(let r=0;r<16;r++)if(e[r]!==s[r])return!1;return!0}fromArray(t,e=0){for(let s=0;s<16;s++)this.elements[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.elements;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}}const Bs=new q,Vn=new Oe,p0=new q(0,0,0),m0=new q(1,1,1),Oi=new q,Do=new q,xn=new q,Su=new Oe,Mu=new ss;class Jn{constructor(t=0,e=0,s=0,r=Jn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=s,this._order=r}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,s,r=this._order){return this._x=t,this._y=e,this._z=s,this._order=r,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,s=!0){const r=t.elements,a=r[0],l=r[4],h=r[8],u=r[1],d=r[5],p=r[9],m=r[2],_=r[6],E=r[10];switch(e){case"XYZ":this._y=Math.asin(_e(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-p,E),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(_,d),this._z=0);break;case"YXZ":this._x=Math.asin(-_e(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(h,E),this._z=Math.atan2(u,d)):(this._y=Math.atan2(-m,a),this._z=0);break;case"ZXY":this._x=Math.asin(_e(_,-1,1)),Math.abs(_)<.9999999?(this._y=Math.atan2(-m,E),this._z=Math.atan2(-l,d)):(this._y=0,this._z=Math.atan2(u,a));break;case"ZYX":this._y=Math.asin(-_e(m,-1,1)),Math.abs(m)<.9999999?(this._x=Math.atan2(_,E),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-l,d));break;case"YZX":this._z=Math.asin(_e(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-p,d),this._y=Math.atan2(-m,a)):(this._x=0,this._y=Math.atan2(h,E));break;case"XZY":this._z=Math.asin(-_e(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(_,d),this._y=Math.atan2(h,a)):(this._x=Math.atan2(-p,E),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,s===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,s){return Su.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Su,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Mu.setFromEuler(this),this.setFromQuaternion(Mu,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}}Jn.DEFAULT_ORDER="XYZ";class lc{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}}let g0=0;const Tu=new q,Fs=new ss,mi=new Oe,ko=new q,Ar=new q,_0=new q,v0=new ss,bu=new q(1,0,0),Au=new q(0,1,0),Cu=new q(0,0,1),Pu={type:"added"},y0={type:"removed"},zs={type:"childadded",child:null},cc={type:"childremoved",child:null};class an extends Cs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:g0++}),this.uuid=Ps(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=an.DEFAULT_UP.clone();const t=new q,e=new Jn,s=new ss,r=new q(1,1,1);function a(){s.setFromEuler(e,!1)}function l(){e.setFromQuaternion(s,void 0,!1)}e._onChange(a),s._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:s},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Oe},normalMatrix:{value:new ue}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=an.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new lc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,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 Fs.setFromAxisAngle(t,e),this.quaternion.multiply(Fs),this}rotateOnWorldAxis(t,e){return Fs.setFromAxisAngle(t,e),this.quaternion.premultiply(Fs),this}rotateX(t){return this.rotateOnAxis(bu,t)}rotateY(t){return this.rotateOnAxis(Au,t)}rotateZ(t){return this.rotateOnAxis(Cu,t)}translateOnAxis(t,e){return Tu.copy(t).applyQuaternion(this.quaternion),this.position.add(Tu.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(bu,t)}translateY(t){return this.translateOnAxis(Au,t)}translateZ(t){return this.translateOnAxis(Cu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(mi.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?ko.copy(t):ko.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),Ar.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?mi.lookAt(Ar,ko,this.up):mi.lookAt(ko,Ar,this.up),this.quaternion.setFromRotationMatrix(mi),r&&(mi.extractRotation(r.matrixWorld),Fs.setFromRotationMatrix(mi),this.quaternion.premultiply(Fs.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(Pu),zs.child=t,this.dispatchEvent(zs),zs.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let s=0;s<arguments.length;s++)this.remove(arguments[s]);return this}const e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(y0),cc.child=t,this.dispatchEvent(cc),cc.child=null),this}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),mi.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),mi.multiply(t.parent.matrixWorld)),t.applyMatrix4(mi),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(Pu),zs.child=t,this.dispatchEvent(zs),zs.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 s=0,r=this.children.length;s<r;s++){const l=this.children[s].getObjectByProperty(t,e);if(l!==void 0)return l}}getObjectsByProperty(t,e,s=[]){this[t]===e&&s.push(this);const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].getObjectsByProperty(t,e,s);return s}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,t,_0),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ar,v0,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].traverseVisible(t)}traverseAncestors(t){const 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.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let s=0,r=e.length;s<r;s++)e[s].updateMatrixWorld(t)}updateWorldMatrix(t,e){const s=this.parent;if(t===!0&&s!==null&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),e===!0){const r=this.children;for(let a=0,l=r.length;a<l;a++)r[a].updateWorldMatrix(!1,!0)}}toJSON(t){const e=t===void 0||typeof t=="string",s={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},s.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(h=>({...h,boundingBox:h.boundingBox?h.boundingBox.toJSON():void 0,boundingSphere:h.boundingSphere?h.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(h=>({...h})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(t)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function a(h,u){return h[u.uuid]===void 0&&(h[u.uuid]=u.toJSON(t)),u.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=a(t.geometries,this.geometry);const h=this.geometry.parameters;if(h!==void 0&&h.shapes!==void 0){const u=h.shapes;if(Array.isArray(u))for(let d=0,p=u.length;d<p;d++){const m=u[d];a(t.shapes,m)}else a(t.shapes,u)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const h=[];for(let u=0,d=this.material.length;u<d;u++)h.push(a(t.materials,this.material[u]));r.material=h}else r.material=a(t.materials,this.material);if(this.children.length>0){r.children=[];for(let h=0;h<this.children.length;h++)r.children.push(this.children[h].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let h=0;h<this.animations.length;h++){const u=this.animations[h];r.animations.push(a(t.animations,u))}}if(e){const h=l(t.geometries),u=l(t.materials),d=l(t.textures),p=l(t.images),m=l(t.shapes),_=l(t.skeletons),E=l(t.animations),w=l(t.nodes);h.length>0&&(s.geometries=h),u.length>0&&(s.materials=u),d.length>0&&(s.textures=d),p.length>0&&(s.images=p),m.length>0&&(s.shapes=m),_.length>0&&(s.skeletons=_),E.length>0&&(s.animations=E),w.length>0&&(s.nodes=w)}return s.object=r,s;function l(h){const u=[];for(const d in h){const p=h[d];delete p.metadata,u.push(p)}return u}}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 s=0;s<t.children.length;s++){const r=t.children[s];this.add(r.clone())}return this}}an.DEFAULT_UP=new q(0,1,0),an.DEFAULT_MATRIX_AUTO_UPDATE=!0,an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Gn=new q,gi=new q,hc=new q,_i=new q,Hs=new q,Vs=new q,Ru=new q,uc=new q,dc=new q,fc=new q,pc=new He,mc=new He,gc=new He;class Wn{constructor(t=new q,e=new q,s=new q){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Gn.subVectors(t,e),r.cross(Gn);const a=r.lengthSq();return a>0?r.multiplyScalar(1/Math.sqrt(a)):r.set(0,0,0)}static getBarycoord(t,e,s,r,a){Gn.subVectors(r,e),gi.subVectors(s,e),hc.subVectors(t,e);const l=Gn.dot(Gn),h=Gn.dot(gi),u=Gn.dot(hc),d=gi.dot(gi),p=gi.dot(hc),m=l*d-h*h;if(m===0)return a.set(0,0,0),null;const _=1/m,E=(d*u-h*p)*_,w=(l*p-h*u)*_;return a.set(1-E-w,w,E)}static containsPoint(t,e,s,r){return this.getBarycoord(t,e,s,r,_i)===null?!1:_i.x>=0&&_i.y>=0&&_i.x+_i.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,_i)===null?(u.x=0,u.y=0,"z"in u&&(u.z=0),"w"in u&&(u.w=0),null):(u.setScalar(0),u.addScaledVector(a,_i.x),u.addScaledVector(l,_i.y),u.addScaledVector(h,_i.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return pc.setScalar(0),mc.setScalar(0),gc.setScalar(0),pc.fromBufferAttribute(t,e),mc.fromBufferAttribute(t,s),gc.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(pc,a.x),l.addScaledVector(mc,a.y),l.addScaledVector(gc,a.z),l}static isFrontFacing(t,e,s,r){return Gn.subVectors(s,e),gi.subVectors(t,e),Gn.cross(gi).dot(r)<0}set(t,e,s){return this.a.copy(t),this.b.copy(e),this.c.copy(s),this}setFromPointsAndIndices(t,e,s,r){return this.a.copy(t[e]),this.b.copy(t[s]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,s,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,s),this.c.fromBufferAttribute(t,r),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 Gn.subVectors(this.c,this.b),gi.subVectors(this.a,this.b),Gn.cross(gi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Wn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Wn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return Wn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return Wn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Wn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const s=this.a,r=this.b,a=this.c;let l,h;Hs.subVectors(r,s),Vs.subVectors(a,s),uc.subVectors(t,s);const u=Hs.dot(uc),d=Vs.dot(uc);if(u<=0&&d<=0)return e.copy(s);dc.subVectors(t,r);const p=Hs.dot(dc),m=Vs.dot(dc);if(p>=0&&m<=p)return e.copy(r);const _=u*m-p*d;if(_<=0&&u>=0&&p<=0)return l=u/(u-p),e.copy(s).addScaledVector(Hs,l);fc.subVectors(t,a);const E=Hs.dot(fc),w=Vs.dot(fc);if(w>=0&&E<=w)return e.copy(a);const S=E*d-u*w;if(S<=0&&d>=0&&w<=0)return h=d/(d-w),e.copy(s).addScaledVector(Vs,h);const v=p*w-E*m;if(v<=0&&m-p>=0&&E-w>=0)return Ru.subVectors(a,r),h=(m-p)/(m-p+(E-w)),e.copy(r).addScaledVector(Ru,h);const g=1/(v+S+_);return l=S*g,h=_*g,e.copy(s).addScaledVector(Hs,l).addScaledVector(Vs,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Lu={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},Ni={h:0,s:0,l:0},Uo={h:0,s:0,l:0};function _c(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}class Pe{constructor(t,e,s){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,s)}set(t,e,s){if(e===void 0&&s===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,s);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rn){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Me.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=Me.workingColorSpace){return this.r=t,this.g=e,this.b=s,Me.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=Me.workingColorSpace){if(t=jl(t,1),e=_e(e,0,1),s=_e(s,0,1),e===0)this.r=this.g=this.b=s;else{const a=s<=.5?s*(1+e):s+e-s*e,l=2*s-a;this.r=_c(l,a,t+1/3),this.g=_c(l,a,t),this.b=_c(l,a,t-1/3)}return Me.colorSpaceToWorking(this,r),this}setStyle(t,e=Rn){function s(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let a;const l=r[1],h=r[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,e);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,e);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(h))return s(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const a=r[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,e);if(l===6)return this.setHex(parseInt(a,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=Rn){const s=Lu[t.toLowerCase()];return s!==void 0?this.setHex(s,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=di(t.r),this.g=di(t.g),this.b=di(t.b),this}copyLinearToSRGB(t){return this.r=Is(t.r),this.g=Is(t.g),this.b=Is(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rn){return Me.workingToColorSpace(rn.copy(this),t),Math.round(_e(rn.r*255,0,255))*65536+Math.round(_e(rn.g*255,0,255))*256+Math.round(_e(rn.b*255,0,255))}getHexString(t=Rn){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Me.workingColorSpace){Me.workingToColorSpace(rn.copy(this),e);const s=rn.r,r=rn.g,a=rn.b,l=Math.max(s,r,a),h=Math.min(s,r,a);let u,d;const p=(h+l)/2;if(h===l)u=0,d=0;else{const m=l-h;switch(d=p<=.5?m/(l+h):m/(2-l-h),l){case s:u=(r-a)/m+(r<a?6:0);break;case r:u=(a-s)/m+2;break;case a:u=(s-r)/m+4;break}u/=6}return t.h=u,t.s=d,t.l=p,t}getRGB(t,e=Me.workingColorSpace){return Me.workingToColorSpace(rn.copy(this),e),t.r=rn.r,t.g=rn.g,t.b=rn.b,t}getStyle(t=Rn){Me.workingToColorSpace(rn.copy(this),t);const e=rn.r,s=rn.g,r=rn.b;return t!==Rn?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(s*255)},${Math.round(r*255)})`}offsetHSL(t,e,s){return this.getHSL(Ni),this.setHSL(Ni.h+t,Ni.s+e,Ni.l+s)}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,s){return this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}lerpHSL(t,e){this.getHSL(Ni),t.getHSL(Uo);const s=Sr(Ni.h,Uo.h,e),r=Sr(Ni.s,Uo.s,e),a=Sr(Ni.l,Uo.l,e);return this.setHSL(s,r,a),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,r=this.b,a=t.elements;return this.r=a[0]*e+a[3]*s+a[6]*r,this.g=a[1]*e+a[4]*s+a[7]*r,this.b=a[2]*e+a[5]*s+a[8]*r,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}}const rn=new Pe;Pe.NAMES=Lu;let E0=0;class Cr extends Cs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:E0++}),this.uuid=Ps(),this.name="",this.type="Material",this.blending=Ss,this.side=Ai,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=sl,this.blendDst=rl,this.blendEquation=ts,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Pe(0,0,0),this.blendAlpha=0,this.depthFunc=Ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=du,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=As,this.stencilZFail=As,this.stencilZPass=As,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.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const s=t[e];if(s===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(s):r&&r.isVector3&&s&&s.isVector3?r.copy(s):this[e]=s}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const s={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.color&&this.color.isColor&&(s.color=this.color.getHex()),this.roughness!==void 0&&(s.roughness=this.roughness),this.metalness!==void 0&&(s.metalness=this.metalness),this.sheen!==void 0&&(s.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(s.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(s.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(s.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(s.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(s.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(s.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(s.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(s.shininess=this.shininess),this.clearcoat!==void 0&&(s.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(s.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(s.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(s.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,s.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(s.dispersion=this.dispersion),this.iridescence!==void 0&&(s.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(s.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(s.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(s.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(s.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(s.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(s.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(s.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(s.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(s.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(s.lightMap=this.lightMap.toJSON(t).uuid,s.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(s.aoMap=this.aoMap.toJSON(t).uuid,s.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(s.bumpMap=this.bumpMap.toJSON(t).uuid,s.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(s.normalMap=this.normalMap.toJSON(t).uuid,s.normalMapType=this.normalMapType,s.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(s.displacementMap=this.displacementMap.toJSON(t).uuid,s.displacementScale=this.displacementScale,s.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(s.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(s.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(s.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(s.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(s.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(s.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(s.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(s.combine=this.combine)),this.envMapRotation!==void 0&&(s.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(s.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(s.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(s.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(s.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(s.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(s.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(s.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(s.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(s.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(s.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(s.size=this.size),this.shadowSide!==null&&(s.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(s.sizeAttenuation=this.sizeAttenuation),this.blending!==Ss&&(s.blending=this.blending),this.side!==Ai&&(s.side=this.side),this.vertexColors===!0&&(s.vertexColors=!0),this.opacity<1&&(s.opacity=this.opacity),this.transparent===!0&&(s.transparent=!0),this.blendSrc!==sl&&(s.blendSrc=this.blendSrc),this.blendDst!==rl&&(s.blendDst=this.blendDst),this.blendEquation!==ts&&(s.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(s.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(s.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(s.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(s.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(s.blendAlpha=this.blendAlpha),this.depthFunc!==Ms&&(s.depthFunc=this.depthFunc),this.depthTest===!1&&(s.depthTest=this.depthTest),this.depthWrite===!1&&(s.depthWrite=this.depthWrite),this.colorWrite===!1&&(s.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(s.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==du&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==As&&(s.stencilFail=this.stencilFail),this.stencilZFail!==As&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==As&&(s.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(s.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(s.rotation=this.rotation),this.polygonOffset===!0&&(s.polygonOffset=!0),this.polygonOffsetFactor!==0&&(s.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(s.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(s.linewidth=this.linewidth),this.dashSize!==void 0&&(s.dashSize=this.dashSize),this.gapSize!==void 0&&(s.gapSize=this.gapSize),this.scale!==void 0&&(s.scale=this.scale),this.dithering===!0&&(s.dithering=!0),this.alphaTest>0&&(s.alphaTest=this.alphaTest),this.alphaHash===!0&&(s.alphaHash=!0),this.alphaToCoverage===!0&&(s.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(s.premultipliedAlpha=!0),this.forceSinglePass===!0&&(s.forceSinglePass=!0),this.wireframe===!0&&(s.wireframe=!0),this.wireframeLinewidth>1&&(s.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(s.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(s.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(s.flatShading=!0),this.visible===!1&&(s.visible=!1),this.toneMapped===!1&&(s.toneMapped=!1),this.fog===!1&&(s.fog=!1),Object.keys(this.userData).length>0&&(s.userData=this.userData);function r(a){const l=[];for(const h in a){const u=a[h];delete u.metadata,l.push(u)}return l}if(e){const a=r(t.textures),l=r(t.images);a.length>0&&(s.textures=a),l.length>0&&(s.images=l)}return s}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let s=null;if(e!==null){const r=e.length;s=new Array(r);for(let a=0;a!==r;++a)s[a]=e[a].clone()}return this.clippingPlanes=s,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class Bi extends Cr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pe(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 Jn,this.combine=eu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Ve=new q,Oo=new Ae;let x0=0;class Kn{constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:x0++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=pu,this.updateRanges=[],this.gpuType=ui,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let r=0,a=this.itemSize;r<a;r++)this.array[t+r]=e.array[s+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Oo.fromBufferAttribute(this,e),Oo.applyMatrix3(t),this.setXY(e,Oo.x,Oo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix3(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyMatrix4(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.applyNormalMatrix(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)Ve.fromBufferAttribute(this,e),Ve.transformDirection(t),this.setXYZ(e,Ve.x,Ve.y,Ve.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Rs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=on(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Rs(e,this.array)),e}setX(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Rs(e,this.array)),e}setY(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Rs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Rs(e,this.array)),e}setW(t,e){return this.normalized&&(e=on(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,r){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this}setXYZW(t,e,s,r,a){return t*=this.itemSize,this.normalized&&(e=on(e,this.array),s=on(s,this.array),r=on(r,this.array),a=on(a,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=r,this.array[t+3]=a,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==pu&&(t.usage=this.usage),t}}class Iu extends Kn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class Du extends Kn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class wn extends Kn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let w0=0;const Ln=new Oe,vc=new an,Gs=new q,Sn=new ks,Pr=new ks,Ye=new q;class $n extends Cs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:w0++}),this.uuid=Ps(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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(vu(t)?Du:Iu)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,s=0){this.groups.push({start:t,count:e,materialIndex:s})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);const s=this.attributes.normal;if(s!==void 0){const a=new ue().getNormalMatrix(t);s.applyNormalMatrix(a),s.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ln.makeRotationFromQuaternion(t),this.applyMatrix4(Ln),this}rotateX(t){return Ln.makeRotationX(t),this.applyMatrix4(Ln),this}rotateY(t){return Ln.makeRotationY(t),this.applyMatrix4(Ln),this}rotateZ(t){return Ln.makeRotationZ(t),this.applyMatrix4(Ln),this}translate(t,e,s){return Ln.makeTranslation(t,e,s),this.applyMatrix4(Ln),this}scale(t,e,s){return Ln.makeScale(t,e,s),this.applyMatrix4(Ln),this}lookAt(t){return vc.lookAt(t),vc.updateMatrix(),this.applyMatrix4(vc.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Gs).negate(),this.translate(Gs.x,Gs.y,Gs.z),this}setFromPoints(t){const e=this.getAttribute("position");if(e===void 0){const s=[];for(let r=0,a=t.length;r<a;r++){const l=t[r];s.push(l.x,l.y,l.z||0)}this.setAttribute("position",new wn(s,3))}else{const s=Math.min(t.length,e.count);for(let r=0;r<s;r++){const a=t[r];e.setXYZ(r,a.x,a.y,a.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ks);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new q(-1/0,-1/0,-1/0),new q(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let s=0,r=e.length;s<r;s++){const a=e[s];Sn.setFromBufferAttribute(a),this.morphTargetsRelative?(Ye.addVectors(this.boundingBox.min,Sn.min),this.boundingBox.expandByPoint(Ye),Ye.addVectors(this.boundingBox.max,Sn.max),this.boundingBox.expandByPoint(Ye)):(this.boundingBox.expandByPoint(Sn.min),this.boundingBox.expandByPoint(Sn.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 Ro);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new q,1/0);return}if(t){const s=this.boundingSphere.center;if(Sn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];Pr.setFromBufferAttribute(h),this.morphTargetsRelative?(Ye.addVectors(Sn.min,Pr.min),Sn.expandByPoint(Ye),Ye.addVectors(Sn.max,Pr.max),Sn.expandByPoint(Ye)):(Sn.expandByPoint(Pr.min),Sn.expandByPoint(Pr.max))}Sn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Ye.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Ye));if(e)for(let a=0,l=e.length;a<l;a++){const h=e[a],u=this.morphTargetsRelative;for(let d=0,p=h.count;d<p;d++)Ye.fromBufferAttribute(h,d),u&&(Gs.fromBufferAttribute(t,d),Ye.add(Gs)),r=Math.max(r,s.distanceToSquared(Ye))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const s=e.position,r=e.normal,a=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Kn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let z=0;z<s.count;z++)h[z]=new q,u[z]=new q;const d=new q,p=new q,m=new q,_=new Ae,E=new Ae,w=new Ae,S=new q,v=new q;function g(z,D,M){d.fromBufferAttribute(s,z),p.fromBufferAttribute(s,D),m.fromBufferAttribute(s,M),_.fromBufferAttribute(a,z),E.fromBufferAttribute(a,D),w.fromBufferAttribute(a,M),p.sub(d),m.sub(d),E.sub(_),w.sub(_);const k=1/(E.x*w.y-w.x*E.y);isFinite(k)&&(S.copy(p).multiplyScalar(w.y).addScaledVector(m,-E.y).multiplyScalar(k),v.copy(m).multiplyScalar(E.x).addScaledVector(p,-w.x).multiplyScalar(k),h[z].add(S),h[D].add(S),h[M].add(S),u[z].add(v),u[D].add(v),u[M].add(v))}let R=this.groups;R.length===0&&(R=[{start:0,count:t.count}]);for(let z=0,D=R.length;z<D;++z){const M=R[z],k=M.start,Z=M.count;for(let J=k,V=k+Z;J<V;J+=3)g(t.getX(J+0),t.getX(J+1),t.getX(J+2))}const P=new q,T=new q,U=new q,B=new q;function N(z){U.fromBufferAttribute(r,z),B.copy(U);const D=h[z];P.copy(D),P.sub(U.multiplyScalar(U.dot(D))).normalize(),T.crossVectors(B,D);const k=T.dot(u[z])<0?-1:1;l.setXYZW(z,P.x,P.y,P.z,k)}for(let z=0,D=R.length;z<D;++z){const M=R[z],k=M.start,Z=M.count;for(let J=k,V=k+Z;J<V;J+=3)N(t.getX(J+0)),N(t.getX(J+1)),N(t.getX(J+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(e!==void 0){let s=this.getAttribute("normal");if(s===void 0)s=new Kn(new Float32Array(e.count*3),3),this.setAttribute("normal",s);else for(let _=0,E=s.count;_<E;_++)s.setXYZ(_,0,0,0);const r=new q,a=new q,l=new q,h=new q,u=new q,d=new q,p=new q,m=new q;if(t)for(let _=0,E=t.count;_<E;_+=3){const w=t.getX(_+0),S=t.getX(_+1),v=t.getX(_+2);r.fromBufferAttribute(e,w),a.fromBufferAttribute(e,S),l.fromBufferAttribute(e,v),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),h.fromBufferAttribute(s,w),u.fromBufferAttribute(s,S),d.fromBufferAttribute(s,v),h.add(p),u.add(p),d.add(p),s.setXYZ(w,h.x,h.y,h.z),s.setXYZ(S,u.x,u.y,u.z),s.setXYZ(v,d.x,d.y,d.z)}else for(let _=0,E=e.count;_<E;_+=3)r.fromBufferAttribute(e,_+0),a.fromBufferAttribute(e,_+1),l.fromBufferAttribute(e,_+2),p.subVectors(l,a),m.subVectors(r,a),p.cross(m),s.setXYZ(_+0,p.x,p.y,p.z),s.setXYZ(_+1,p.x,p.y,p.z),s.setXYZ(_+2,p.x,p.y,p.z);this.normalizeNormals(),s.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,s=t.count;e<s;e++)Ye.fromBufferAttribute(t,e),Ye.normalize(),t.setXYZ(e,Ye.x,Ye.y,Ye.z)}toNonIndexed(){function t(h,u){const d=h.array,p=h.itemSize,m=h.normalized,_=new d.constructor(u.length*p);let E=0,w=0;for(let S=0,v=u.length;S<v;S++){h.isInterleavedBufferAttribute?E=u[S]*h.data.stride+h.offset:E=u[S]*p;for(let g=0;g<p;g++)_[w++]=d[E++]}return new Kn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new $n,s=this.index.array,r=this.attributes;for(const h in r){const u=r[h],d=t(u,s);e.setAttribute(h,d)}const a=this.morphAttributes;for(const h in a){const u=[],d=a[h];for(let p=0,m=d.length;p<m;p++){const _=d[p],E=t(_,s);u.push(E)}e.morphAttributes[h]=u}e.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let h=0,u=l.length;h<u;h++){const d=l[h];e.addGroup(d.start,d.count,d.materialIndex)}return e}toJSON(){const t={metadata:{version:4.7,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){const u=this.parameters;for(const d in u)u[d]!==void 0&&(t[d]=u[d]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const s=this.attributes;for(const u in s){const d=s[u];t.data.attributes[u]=d.toJSON(t.data)}const r={};let a=!1;for(const u in this.morphAttributes){const d=this.morphAttributes[u],p=[];for(let m=0,_=d.length;m<_;m++){const E=d[m];p.push(E.toJSON(t.data))}p.length>0&&(r[u]=p,a=!0)}a&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(t.data.groups=JSON.parse(JSON.stringify(l)));const h=this.boundingSphere;return h!==null&&(t.data.boundingSphere=h.toJSON()),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;const e={};this.name=t.name;const s=t.index;s!==null&&this.setIndex(s.clone());const r=t.attributes;for(const d in r){const p=r[d];this.setAttribute(d,p.clone(e))}const a=t.morphAttributes;for(const d in a){const p=[],m=a[d];for(let _=0,E=m.length;_<E;_++)p.push(m[_].clone(e));this.morphAttributes[d]=p}this.morphTargetsRelative=t.morphTargetsRelative;const l=t.groups;for(let d=0,p=l.length;d<p;d++){const m=l[d];this.addGroup(m.start,m.count,m.materialIndex)}const h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());const u=t.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const ku=new Oe,as=new ac,No=new Ro,Uu=new q,Bo=new q,Fo=new q,zo=new q,yc=new q,Ho=new q,Ou=new q,Vo=new q;class pn extends an{constructor(t=new $n,e=new Bi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}getVertexPosition(t,e){const s=this.geometry,r=s.attributes.position,a=s.morphAttributes.position,l=s.morphTargetsRelative;e.fromBufferAttribute(r,t);const h=this.morphTargetInfluences;if(a&&h){Ho.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(yc.fromBufferAttribute(m,t),l?Ho.addScaledVector(yc,p):Ho.addScaledVector(yc.sub(e),p))}e.add(Ho)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),No.copy(s.boundingSphere),No.applyMatrix4(a),as.copy(t.ray).recast(t.near),!(No.containsPoint(as.origin)===!1&&(as.intersectSphere(No,Uu)===null||as.origin.distanceToSquared(Uu)>(t.far-t.near)**2))&&(ku.copy(a).invert(),as.copy(t.ray).applyMatrix4(ku),!(s.boundingBox!==null&&as.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,as)))}_computeIntersections(t,e,s){let r;const a=this.geometry,l=this.material,h=a.index,u=a.attributes.position,d=a.attributes.uv,p=a.attributes.uv1,m=a.attributes.normal,_=a.groups,E=a.drawRange;if(h!==null)if(Array.isArray(l))for(let w=0,S=_.length;w<S;w++){const v=_[w],g=l[v.materialIndex],R=Math.max(v.start,E.start),P=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let T=R,U=P;T<U;T+=3){const B=h.getX(T),N=h.getX(T+1),z=h.getX(T+2);r=Go(this,g,t,s,d,p,m,B,N,z),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const w=Math.max(0,E.start),S=Math.min(h.count,E.start+E.count);for(let v=w,g=S;v<g;v+=3){const R=h.getX(v),P=h.getX(v+1),T=h.getX(v+2);r=Go(this,l,t,s,d,p,m,R,P,T),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}else if(u!==void 0)if(Array.isArray(l))for(let w=0,S=_.length;w<S;w++){const v=_[w],g=l[v.materialIndex],R=Math.max(v.start,E.start),P=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let T=R,U=P;T<U;T+=3){const B=T,N=T+1,z=T+2;r=Go(this,g,t,s,d,p,m,B,N,z),r&&(r.faceIndex=Math.floor(T/3),r.face.materialIndex=v.materialIndex,e.push(r))}}else{const w=Math.max(0,E.start),S=Math.min(u.count,E.start+E.count);for(let v=w,g=S;v<g;v+=3){const R=v,P=v+1,T=v+2;r=Go(this,l,t,s,d,p,m,R,P,T),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function S0(n,t,e,s,r,a,l,h){let u;if(t.side===fn?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Ai,h),u===null)return null;Vo.copy(h),Vo.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Vo);return d<e.near||d>e.far?null:{distance:d,point:Vo.clone(),object:n}}function Go(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,Bo),n.getVertexPosition(u,Fo),n.getVertexPosition(d,zo);const p=S0(n,t,e,s,Bo,Fo,zo,Ou);if(p){const m=new q;Wn.getBarycoord(Ou,Bo,Fo,zo,m),r&&(p.uv=Wn.getInterpolatedAttribute(r,h,u,d,m,new Ae)),a&&(p.uv1=Wn.getInterpolatedAttribute(a,h,u,d,m,new Ae)),l&&(p.normal=Wn.getInterpolatedAttribute(l,h,u,d,m,new q),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new q,materialIndex:0};Wn.getNormal(Bo,Fo,zo,_.normal),p.face=_,p.barycoord=m}return p}class Rr extends $n{constructor(t=1,e=1,s=1,r=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:s,widthSegments:r,heightSegments:a,depthSegments:l};const h=this;r=Math.floor(r),a=Math.floor(a),l=Math.floor(l);const u=[],d=[],p=[],m=[];let _=0,E=0;w("z","y","x",-1,-1,s,e,t,l,a,0),w("z","y","x",1,-1,s,e,-t,l,a,1),w("x","z","y",1,1,t,s,e,r,l,2),w("x","z","y",1,-1,t,s,-e,r,l,3),w("x","y","z",1,-1,t,e,s,r,a,4),w("x","y","z",-1,-1,t,e,-s,r,a,5),this.setIndex(u),this.setAttribute("position",new wn(d,3)),this.setAttribute("normal",new wn(p,3)),this.setAttribute("uv",new wn(m,2));function w(S,v,g,R,P,T,U,B,N,z,D){const M=T/N,k=U/z,Z=T/2,J=U/2,V=B/2,$=N+1,K=z+1;let ut=0,G=0;const Tt=new q;for(let lt=0;lt<K;lt++){const Mt=lt*k-J;for(let Gt=0;Gt<$;Gt++){const pt=Gt*M-Z;Tt[S]=pt*R,Tt[v]=Mt*P,Tt[g]=V,d.push(Tt.x,Tt.y,Tt.z),Tt[S]=0,Tt[v]=0,Tt[g]=B>0?1:-1,p.push(Tt.x,Tt.y,Tt.z),m.push(Gt/N),m.push(1-lt/z),ut+=1}}for(let lt=0;lt<z;lt++)for(let Mt=0;Mt<N;Mt++){const Gt=_+Mt+$*lt,pt=_+Mt+$*(lt+1),Rt=_+(Mt+1)+$*(lt+1),Y=_+(Mt+1)+$*lt;u.push(Gt,pt,Y),u.push(pt,Rt,Y),G+=6}h.addGroup(E,G,D),E+=G,_+=ut}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Rr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ws(n){const t={};for(const e in n){t[e]={};for(const s in n[e]){const r=n[e][s];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][s]=null):t[e][s]=r.clone():Array.isArray(r)?t[e][s]=r.slice():t[e][s]=r}}return t}function ln(n){const t={};for(let e=0;e<n.length;e++){const s=Ws(n[e]);for(const r in s)t[r]=s[r]}return t}function M0(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function Nu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Me.workingColorSpace}const T0={clone:Ws,merge:ln};var b0=`void main() {
15
15
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
16
16
  }`,A0=`void main() {
17
17
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
18
- }`;class vi extends Cr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=b0,this.fragmentShader=A0,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ws(t.uniforms),this.uniformsGroups=M0(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?e.uniforms[r]={type:"t",value:l.toJSON(t).uuid}:l&&l.isColor?e.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?e.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?e.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?e.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?e.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?e.uniforms[r]={type:"m4",value:l.toArray()}:e.uniforms[r]={value:l}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const s={};for(const r in this.extensions)this.extensions[r]===!0&&(s[r]=!0);return Object.keys(s).length>0&&(e.extensions=s),e}}class Bu extends an{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=jn,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Fi=new q,Fu=new be,zu=new be;class In extends Bu{constructor(t=50,e=1,s=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=wr*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(xr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return wr*2*Math.atan(Math.tan(xr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,s){Fi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Fi.x,Fi.y).multiplyScalar(-t/Fi.z),Fi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(Fi.x,Fi.y).multiplyScalar(-t/Fi.z)}getViewSize(t,e){return this.getViewBounds(t,Fu,zu),e.subVectors(zu,Fu)}setViewOffset(t,e,s,r,a,l){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=s,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(xr*.5*this.fov)/this.zoom,s=2*e,r=this.aspect*s,a=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,d=l.fullHeight;a+=l.offsetX*r/u,e-=l.offsetY*s/d,r*=l.width/u,s*=l.height/d}const h=this.filmOffset;h!==0&&(a+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,e,e-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Zs=-90,Xs=1;class C0 extends an{constructor(t,e,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new In(Zs,Xs,t,e);r.layers=this.layers,this.add(r);const a=new In(Zs,Xs,t,e);a.layers=this.layers,this.add(a);const l=new In(Zs,Xs,t,e);l.layers=this.layers,this.add(l);const h=new In(Zs,Xs,t,e);h.layers=this.layers,this.add(h);const u=new In(Zs,Xs,t,e);u.layers=this.layers,this.add(u);const d=new In(Zs,Xs,t,e);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[s,r,a,l,h,u]=e;for(const d of e)this.remove(d);if(t===jn)s.up.set(0,1,0),s.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),h.up.set(0,1,0),h.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(t===bo)s.up.set(0,-1,0),s.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),h.up.set(0,-1,0),h.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const d of e)this.add(d),d.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[a,l,h,u,d,p]=this.children,m=t.getRenderTarget(),_=t.getActiveCubeFace(),E=t.getActiveMipmapLevel(),S=t.xr.enabled;t.xr.enabled=!1;const w=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,t.setRenderTarget(s,0,r),t.render(e,a),t.setRenderTarget(s,1,r),t.render(e,l),t.setRenderTarget(s,2,r),t.render(e,h),t.setRenderTarget(s,3,r),t.render(e,u),t.setRenderTarget(s,4,r),t.render(e,d),s.texture.generateMipmaps=w,t.setRenderTarget(s,5,r),t.render(e,p),t.setRenderTarget(m,_,E),t.xr.enabled=S,s.texture.needsPMREMUpdate=!0}}class Hu extends Je{constructor(t=[],e=Ts,s,r,a,l,h,u,d,p){super(t,e,s,r,a,l,h,u,d,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class P0 extends Ii{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const s={width:t,height:t,depth:1},r=[s,s,s,s,s,s];this.texture=new Hu(r),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
18
+ }`;class vi extends Cr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=b0,this.fragmentShader=A0,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ws(t.uniforms),this.uniformsGroups=M0(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const r in this.uniforms){const l=this.uniforms[r].value;l&&l.isTexture?e.uniforms[r]={type:"t",value:l.toJSON(t).uuid}:l&&l.isColor?e.uniforms[r]={type:"c",value:l.getHex()}:l&&l.isVector2?e.uniforms[r]={type:"v2",value:l.toArray()}:l&&l.isVector3?e.uniforms[r]={type:"v3",value:l.toArray()}:l&&l.isVector4?e.uniforms[r]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?e.uniforms[r]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?e.uniforms[r]={type:"m4",value:l.toArray()}:e.uniforms[r]={value:l}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const s={};for(const r in this.extensions)this.extensions[r]===!0&&(s[r]=!0);return Object.keys(s).length>0&&(e.extensions=s),e}}class Bu extends an{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=jn,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Fi=new q,Fu=new Ae,zu=new Ae;class In extends Bu{constructor(t=50,e=1,s=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=s,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=wr*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(xr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return wr*2*Math.atan(Math.tan(xr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,s){Fi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Fi.x,Fi.y).multiplyScalar(-t/Fi.z),Fi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(Fi.x,Fi.y).multiplyScalar(-t/Fi.z)}getViewSize(t,e){return this.getViewBounds(t,Fu,zu),e.subVectors(zu,Fu)}setViewOffset(t,e,s,r,a,l){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=s,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(xr*.5*this.fov)/this.zoom,s=2*e,r=this.aspect*s,a=-.5*r;const l=this.view;if(this.view!==null&&this.view.enabled){const u=l.fullWidth,d=l.fullHeight;a+=l.offsetX*r/u,e-=l.offsetY*s/d,r*=l.width/u,s*=l.height/d}const h=this.filmOffset;h!==0&&(a+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+r,e,e-s,t,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const Zs=-90,Xs=1;class C0 extends an{constructor(t,e,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new In(Zs,Xs,t,e);r.layers=this.layers,this.add(r);const a=new In(Zs,Xs,t,e);a.layers=this.layers,this.add(a);const l=new In(Zs,Xs,t,e);l.layers=this.layers,this.add(l);const h=new In(Zs,Xs,t,e);h.layers=this.layers,this.add(h);const u=new In(Zs,Xs,t,e);u.layers=this.layers,this.add(u);const d=new In(Zs,Xs,t,e);d.layers=this.layers,this.add(d)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[s,r,a,l,h,u]=e;for(const d of e)this.remove(d);if(t===jn)s.up.set(0,1,0),s.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),h.up.set(0,1,0),h.lookAt(0,0,1),u.up.set(0,1,0),u.lookAt(0,0,-1);else if(t===bo)s.up.set(0,-1,0),s.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),h.up.set(0,-1,0),h.lookAt(0,0,1),u.up.set(0,-1,0),u.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const d of e)this.add(d),d.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const{renderTarget:s,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[a,l,h,u,d,p]=this.children,m=t.getRenderTarget(),_=t.getActiveCubeFace(),E=t.getActiveMipmapLevel(),w=t.xr.enabled;t.xr.enabled=!1;const S=s.texture.generateMipmaps;s.texture.generateMipmaps=!1,t.setRenderTarget(s,0,r),t.render(e,a),t.setRenderTarget(s,1,r),t.render(e,l),t.setRenderTarget(s,2,r),t.render(e,h),t.setRenderTarget(s,3,r),t.render(e,u),t.setRenderTarget(s,4,r),t.render(e,d),s.texture.generateMipmaps=S,t.setRenderTarget(s,5,r),t.render(e,p),t.setRenderTarget(m,_,E),t.xr.enabled=w,s.texture.needsPMREMUpdate=!0}}class Hu extends Je{constructor(t=[],e=Ts,s,r,a,l,h,u,d,p){super(t,e,s,r,a,l,h,u,d,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class P0 extends Ii{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const s={width:t,height:t,depth:1},r=[s,s,s,s,s,s];this.texture=new Hu(r),this._setTextureOptions(e),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const s={uniforms:{tEquirect:{value:null}},vertexShader:`
19
19
 
20
20
  varying vec3 vWorldDirection;
21
21
 
@@ -50,11 +50,11 @@
50
50
  gl_FragColor = texture2D( tEquirect, sampleUV );
51
51
 
52
52
  }
53
- `},r=new Rr(5,5,5),a=new vi({name:"CubemapFromEquirect",uniforms:Ws(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:fn,blending:Ci});a.uniforms.tEquirect.value=e;const l=new pn(r,a),h=e.minFilter;return e.minFilter===Ri&&(e.minFilter=En),new C0(1,10,this).update(t,l),e.minFilter=h,l.geometry.dispose(),l.material.dispose(),this}clear(t,e=!0,s=!0,r=!0){const a=t.getRenderTarget();for(let l=0;l<6;l++)t.setRenderTarget(this,l),t.clear(e,s,r);t.setRenderTarget(a)}}class zi extends an{constructor(){super(),this.isGroup=!0,this.type="Group"}}const R0={type:"move"};class Ec{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zi,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 zi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const s of t.hand.values())this._getHandJoint(e,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,s){let r=null,a=null,l=null;const h=this._targetRay,u=this._grip,d=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(d&&t.hand){l=!0;for(const w of t.hand.values()){const v=e.getJointPose(w,s),g=this._getHandJoint(d,w);v!==null&&(g.matrix.fromArray(v.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=v.radius),g.visible=v!==null}const p=d.joints["index-finger-tip"],m=d.joints["thumb-tip"],_=p.position.distanceTo(m.position),E=.02,S=.005;d.inputState.pinching&&_>E+S?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!d.inputState.pinching&&_<=E-S&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,s),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));h!==null&&(r=e.getPose(t.targetRaySpace,s),r===null&&a!==null&&(r=a),r!==null&&(h.matrix.fromArray(r.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,r.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(r.linearVelocity)):h.hasLinearVelocity=!1,r.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(r.angularVelocity)):h.hasAngularVelocity=!1,this.dispatchEvent(R0)))}return h!==null&&(h.visible=r!==null),u!==null&&(u.visible=a!==null),d!==null&&(d.visible=l!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const s=new zi;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[e.jointName]=s,t.add(s)}return t.joints[e.jointName]}}class xc extends an{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 Jn,this.environmentIntensity=1,this.environmentRotation=new Jn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}const wc=new q,L0=new q,I0=new ue;class ls{constructor(t=new q(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,s,r){return this.normal.set(t,e,s),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,s){const r=wc.subVectors(s,e).cross(L0.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const s=t.delta(wc),r=this.normal.dot(s);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const a=-(t.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:e.copy(t.start).addScaledVector(s,a)}intersectsLine(t){const e=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return e<0&&s>0||s<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const s=e||I0.getNormalMatrix(t),r=this.coplanarPoint(wc).applyMatrix4(t),a=this.normal.applyMatrix3(s).normalize();return this.constant=-r.dot(a),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const cs=new Ro,D0=new be(.5,.5),Wo=new q;class Sc{constructor(t=new ls,e=new ls,s=new ls,r=new ls,a=new ls,l=new ls){this.planes=[t,e,s,r,a,l]}set(t,e,s,r,a,l){const h=this.planes;return h[0].copy(t),h[1].copy(e),h[2].copy(s),h[3].copy(r),h[4].copy(a),h[5].copy(l),this}copy(t){const e=this.planes;for(let s=0;s<6;s++)e[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,e=jn,s=!1){const r=this.planes,a=t.elements,l=a[0],h=a[1],u=a[2],d=a[3],p=a[4],m=a[5],_=a[6],E=a[7],S=a[8],w=a[9],v=a[10],g=a[11],I=a[12],C=a[13],T=a[14],U=a[15];if(r[0].setComponents(d-l,E-p,g-S,U-I).normalize(),r[1].setComponents(d+l,E+p,g+S,U+I).normalize(),r[2].setComponents(d+h,E+m,g+w,U+C).normalize(),r[3].setComponents(d-h,E-m,g-w,U-C).normalize(),s)r[4].setComponents(u,_,v,T).normalize(),r[5].setComponents(d-u,E-_,g-v,U-T).normalize();else if(r[4].setComponents(d-u,E-_,g-v,U-T).normalize(),e===jn)r[5].setComponents(d+u,E+_,g+v,U+T).normalize();else if(e===bo)r[5].setComponents(u,_,v,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),cs.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),cs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(cs)}intersectsSprite(t){cs.center.set(0,0,0);const e=D0.distanceTo(t.center);return cs.radius=.7071067811865476+e,cs.applyMatrix4(t.matrixWorld),this.intersectsSphere(cs)}intersectsSphere(t){const e=this.planes,s=t.center,r=-t.radius;for(let a=0;a<6;a++)if(e[a].distanceToPoint(s)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let s=0;s<6;s++){const r=e[s];if(Wo.x=r.normal.x>0?t.max.x:t.min.x,Wo.y=r.normal.y>0?t.max.y:t.min.y,Wo.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Wo)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let s=0;s<6;s++)if(e[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class k0 extends Cr{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Pe(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Zo=new q,Xo=new q,Vu=new Oe,Lr=new ac,Yo=new Ro,Mc=new q,Gu=new q;class U0 extends an{constructor(t=new $n,e=new k0){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,s=[0];for(let r=1,a=e.count;r<a;r++)Zo.fromBufferAttribute(e,r-1),Xo.fromBufferAttribute(e,r),s[r]=s[r-1],s[r]+=Zo.distanceTo(Xo);t.setAttribute("lineDistance",new wn(s,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const s=this.geometry,r=this.matrixWorld,a=t.params.Line.threshold,l=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Yo.copy(s.boundingSphere),Yo.applyMatrix4(r),Yo.radius+=a,t.ray.intersectsSphere(Yo)===!1)return;Vu.copy(r).invert(),Lr.copy(t.ray).applyMatrix4(Vu);const h=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=h*h,d=this.isLineSegments?2:1,p=s.index,_=s.attributes.position;if(p!==null){const E=Math.max(0,l.start),S=Math.min(p.count,l.start+l.count);for(let w=E,v=S-1;w<v;w+=d){const g=p.getX(w),I=p.getX(w+1),C=qo(this,t,Lr,u,g,I,w);C&&e.push(C)}if(this.isLineLoop){const w=p.getX(S-1),v=p.getX(E),g=qo(this,t,Lr,u,w,v,S-1);g&&e.push(g)}}else{const E=Math.max(0,l.start),S=Math.min(_.count,l.start+l.count);for(let w=E,v=S-1;w<v;w+=d){const g=qo(this,t,Lr,u,w,w+1,w);g&&e.push(g)}if(this.isLineLoop){const w=qo(this,t,Lr,u,S-1,E,S-1);w&&e.push(w)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}}function qo(n,t,e,s,r,a,l){const h=n.geometry.attributes.position;if(Zo.fromBufferAttribute(h,r),Xo.fromBufferAttribute(h,a),e.distanceSqToSegment(Zo,Xo,Mc,Gu)>s)return;Mc.applyMatrix4(n.matrixWorld);const d=t.ray.origin.distanceTo(Mc);if(!(d<t.near||d>t.far))return{distance:d,point:Gu.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const Wu=new q,Zu=new q;class O0 extends U0{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,s=[];for(let r=0,a=e.count;r<a;r+=2)Wu.fromBufferAttribute(e,r),Zu.fromBufferAttribute(e,r+1),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+Wu.distanceTo(Zu);t.setAttribute("lineDistance",new wn(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class N0 extends Je{constructor(t,e,s,r,a=En,l=En,h,u,d){super(t,e,s,r,a,l,h,u,d),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const p=this;function m(){p.needsUpdate=!0,p._requestVideoFrameCallbackId=t.requestVideoFrameCallback(m)}"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(m))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}}class Xu extends Je{constructor(t,e,s=ns,r,a,l,h=Fn,u=Fn,d,p=yr,m=1){if(p!==yr&&p!==Er)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const _={width:t,height:e,depth:m};super(_,r,a,l,h,u,p,s,d),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new $l(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class Ir extends $n{constructor(t=1,e=1,s=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:s,heightSegments:r};const a=t/2,l=e/2,h=Math.floor(s),u=Math.floor(r),d=h+1,p=u+1,m=t/h,_=e/u,E=[],S=[],w=[],v=[];for(let g=0;g<p;g++){const I=g*_-l;for(let C=0;C<d;C++){const T=C*m-a;S.push(T,-I,0),w.push(0,0,1),v.push(C/h),v.push(1-g/u)}}for(let g=0;g<u;g++)for(let I=0;I<h;I++){const C=I+d*g,T=I+d*(g+1),U=I+1+d*(g+1),N=I+1+d*g;E.push(C,T,N),E.push(T,U,N)}this.setIndex(E),this.setAttribute("position",new wn(S,3)),this.setAttribute("normal",new wn(w,3)),this.setAttribute("uv",new wn(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ir(t.width,t.height,t.widthSegments,t.heightSegments)}}class Ys extends $n{constructor(t=1,e=32,s=16,r=0,a=Math.PI*2,l=0,h=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:s,phiStart:r,phiLength:a,thetaStart:l,thetaLength:h},e=Math.max(3,Math.floor(e)),s=Math.max(2,Math.floor(s));const u=Math.min(l+h,Math.PI);let d=0;const p=[],m=new q,_=new q,E=[],S=[],w=[],v=[];for(let g=0;g<=s;g++){const I=[],C=g/s;let T=0;g===0&&l===0?T=.5/e:g===s&&u===Math.PI&&(T=-.5/e);for(let U=0;U<=e;U++){const N=U/e;m.x=-t*Math.cos(r+N*a)*Math.sin(l+C*h),m.y=t*Math.cos(l+C*h),m.z=t*Math.sin(r+N*a)*Math.sin(l+C*h),S.push(m.x,m.y,m.z),_.copy(m).normalize(),w.push(_.x,_.y,_.z),v.push(N+T,1-C),I.push(d++)}p.push(I)}for(let g=0;g<s;g++)for(let I=0;I<e;I++){const C=p[g][I+1],T=p[g][I],U=p[g+1][I],N=p[g+1][I+1];(g!==0||l>0)&&E.push(C,T,N),(g!==s-1||u<Math.PI)&&E.push(T,U,N)}this.setIndex(E),this.setAttribute("position",new wn(S,3)),this.setAttribute("normal",new wn(w,3)),this.setAttribute("uv",new wn(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ys(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class B0 extends $n{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],s=new Set,r=new q,a=new q;if(t.index!==null){const l=t.attributes.position,h=t.index;let u=t.groups;u.length===0&&(u=[{start:0,count:h.count,materialIndex:0}]);for(let d=0,p=u.length;d<p;++d){const m=u[d],_=m.start,E=m.count;for(let S=_,w=_+E;S<w;S+=3)for(let v=0;v<3;v++){const g=h.getX(S+v),I=h.getX(S+(v+1)%3);r.fromBufferAttribute(l,g),a.fromBufferAttribute(l,I),Yu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}}else{const l=t.attributes.position;for(let h=0,u=l.count/3;h<u;h++)for(let d=0;d<3;d++){const p=3*h+d,m=3*h+(d+1)%3;r.fromBufferAttribute(l,p),a.fromBufferAttribute(l,m),Yu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}this.setAttribute("position",new wn(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Yu(n,t,e){const s=`${n.x},${n.y},${n.z}-${t.x},${t.y},${t.z}`,r=`${t.x},${t.y},${t.z}-${n.x},${n.y},${n.z}`;return e.has(s)===!0||e.has(r)===!0?!1:(e.add(s),e.add(r),!0)}class F0 extends Cr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Iv,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class z0 extends Cr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const Hi={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class H0{constructor(t,e,s){const r=this;let a=!1,l=0,h=0,u;const d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=s,this.abortController=new AbortController,this.itemStart=function(p){h++,a===!1&&r.onStart!==void 0&&r.onStart(p,l,h),a=!0},this.itemEnd=function(p){l++,r.onProgress!==void 0&&r.onProgress(p,l,h),l===h&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(p){r.onError!==void 0&&r.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,m){return d.push(p,m),this},this.removeHandler=function(p){const m=d.indexOf(p);return m!==-1&&d.splice(m,2),this},this.getHandler=function(p){for(let m=0,_=d.length;m<_;m+=2){const E=d[m],S=d[m+1];if(E.global&&(E.lastIndex=0),E.test(p))return S}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}const V0=new H0;let Tc=class{constructor(t){this.manager=t!==void 0?t:V0,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const s=this;return new Promise(function(r,a){s.load(t,r,e,a)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}};Tc.DEFAULT_MATERIAL_NAME="__DEFAULT";const yi={};class G0 extends Error{constructor(t,e){super(t),this.response=e}}class W0 extends Tc{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,s,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const a=Hi.get(`file:${t}`);if(a!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(a),this.manager.itemEnd(t)},0),a;if(yi[t]!==void 0){yi[t].push({onLoad:e,onProgress:s,onError:r});return}yi[t]=[],yi[t].push({onLoad:e,onProgress:s,onError:r});const l=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),h=this.mimeType,u=this.responseType;fetch(l).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;const p=yi[t],m=d.body.getReader(),_=d.headers.get("X-File-Size")||d.headers.get("Content-Length"),E=_?parseInt(_):0,S=E!==0;let w=0;const v=new ReadableStream({start(g){I();function I(){m.read().then(({done:C,value:T})=>{if(C)g.close();else{w+=T.byteLength;const U=new ProgressEvent("progress",{lengthComputable:S,loaded:w,total:E});for(let N=0,B=p.length;N<B;N++){const z=p[N];z.onProgress&&z.onProgress(U)}g.enqueue(T),I()}},C=>{g.error(C)})}}});return new Response(v)}else throw new G0(`fetch for "${d.url}" responded with ${d.status}: ${d.statusText}`,d)}).then(d=>{switch(u){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(p=>new DOMParser().parseFromString(p,h));case"json":return d.json();default:if(h==="")return d.text();{const m=/charset="?([^;"\s]*)"?/i.exec(h),_=m&&m[1]?m[1].toLowerCase():void 0,E=new TextDecoder(_);return d.arrayBuffer().then(S=>E.decode(S))}}}).then(d=>{Hi.add(`file:${t}`,d);const p=yi[t];delete yi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onLoad&&E.onLoad(d)}}).catch(d=>{const p=yi[t];if(p===void 0)throw this.manager.itemError(t),d;delete yi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onError&&E.onError(d)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const qs=new WeakMap;class Z0 extends Tc{constructor(t){super(t)}load(t,e,s,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const a=this,l=Hi.get(`image:${t}`);if(l!==void 0){if(l.complete===!0)a.manager.itemStart(t),setTimeout(function(){e&&e(l),a.manager.itemEnd(t)},0);else{let m=qs.get(l);m===void 0&&(m=[],qs.set(l,m)),m.push({onLoad:e,onError:r})}return l}const h=Mr("img");function u(){p(),e&&e(this);const m=qs.get(this)||[];for(let _=0;_<m.length;_++){const E=m[_];E.onLoad&&E.onLoad(this)}qs.delete(this),a.manager.itemEnd(t)}function d(m){p(),r&&r(m),Hi.remove(`image:${t}`);const _=qs.get(this)||[];for(let E=0;E<_.length;E++){const S=_[E];S.onError&&S.onError(m)}qs.delete(this),a.manager.itemError(t),a.manager.itemEnd(t)}function p(){h.removeEventListener("load",u,!1),h.removeEventListener("error",d,!1)}return h.addEventListener("load",u,!1),h.addEventListener("error",d,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(h.crossOrigin=this.crossOrigin),Hi.add(`image:${t}`,h),a.manager.itemStart(t),h.src=t,h}}class X0 extends Bu{constructor(t=-1,e=1,s=1,r=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=s,this.bottom=r,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,s,r,a,l){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=t,this.view.fullHeight=e,this.view.offsetX=s,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=s-t,l=s+t,h=r+e,u=r-e;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=d*this.view.offsetX,l=a+d*this.view.width,h-=p*this.view.offsetY,u=h-p*this.view.height}this.projectionMatrix.makeOrthographic(a,l,h,u,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}class Y0 extends In{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const qu=new Oe;class q0{constructor(t,e,s=0,r=1/0){this.ray=new ac(t,e),this.near=s,this.far=r,this.camera=null,this.layers=new lc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return qu.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(qu),this}intersectObject(t,e=!0,s=[]){return bc(t,this,s,e),s.sort(Qu),s}intersectObjects(t,e=!0,s=[]){for(let r=0,a=t.length;r<a;r++)bc(t[r],this,s,e);return s.sort(Qu),s}}function Qu(n,t){return n.distance-t.distance}function bc(n,t,e,s){let r=!0;if(n.layers.test(t.layers)&&n.raycast(t,e)===!1&&(r=!1),r===!0&&s===!0){const a=n.children;for(let l=0,h=a.length;l<h;l++)bc(a[l],t,e,!0)}}function ju(n,t,e,s){const r=Q0(s);switch(e){case au:return n*t;case cu:return n*t/r.components*r.byteLength;case xl:return n*t/r.components*r.byteLength;case hu:return n*t*2/r.components*r.byteLength;case wl:return n*t*2/r.components*r.byteLength;case lu:return n*t*3/r.components*r.byteLength;case zn:return n*t*4/r.components*r.byteLength;case Sl:return n*t*4/r.components*r.byteLength;case Eo:case xo:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case wo:case So:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Tl:case Al:return Math.max(n,16)*Math.max(t,8)/4;case Ml:case bl:return Math.max(n,8)*Math.max(t,8)/2;case Cl:case Pl:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Rl:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Ll:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Il:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case Dl:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case kl:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case Ul:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case Ol:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case Nl:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case Bl:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case Fl:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case zl:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case Hl:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case Vl:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case Gl:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case Wl:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Mo:case Zl:case Xl:return Math.ceil(n/4)*Math.ceil(t/4)*16;case uu:case Yl:return Math.ceil(n/4)*Math.ceil(t/4)*8;case ql:case Ql:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function Q0(n){switch(n){case hi:case su:return{byteLength:1,components:1};case gr:case ru:case _r:return{byteLength:2,components:1};case yl:case El:return{byteLength:2,components:4};case ns:case vl:case ui:return{byteLength:4,components:1};case ou:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:il}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=il);/**
53
+ `},r=new Rr(5,5,5),a=new vi({name:"CubemapFromEquirect",uniforms:Ws(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:fn,blending:Ci});a.uniforms.tEquirect.value=e;const l=new pn(r,a),h=e.minFilter;return e.minFilter===Ri&&(e.minFilter=En),new C0(1,10,this).update(t,l),e.minFilter=h,l.geometry.dispose(),l.material.dispose(),this}clear(t,e=!0,s=!0,r=!0){const a=t.getRenderTarget();for(let l=0;l<6;l++)t.setRenderTarget(this,l),t.clear(e,s,r);t.setRenderTarget(a)}}class zi extends an{constructor(){super(),this.isGroup=!0,this.type="Group"}}const R0={type:"move"};class Ec{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new zi,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 zi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new zi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new q),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const s of t.hand.values())this._getHandJoint(e,s)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,s){let r=null,a=null,l=null;const h=this._targetRay,u=this._grip,d=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(d&&t.hand){l=!0;for(const S of t.hand.values()){const v=e.getJointPose(S,s),g=this._getHandJoint(d,S);v!==null&&(g.matrix.fromArray(v.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=v.radius),g.visible=v!==null}const p=d.joints["index-finger-tip"],m=d.joints["thumb-tip"],_=p.position.distanceTo(m.position),E=.02,w=.005;d.inputState.pinching&&_>E+w?(d.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!d.inputState.pinching&&_<=E-w&&(d.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else u!==null&&t.gripSpace&&(a=e.getPose(t.gripSpace,s),a!==null&&(u.matrix.fromArray(a.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,a.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(a.linearVelocity)):u.hasLinearVelocity=!1,a.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(a.angularVelocity)):u.hasAngularVelocity=!1));h!==null&&(r=e.getPose(t.targetRaySpace,s),r===null&&a!==null&&(r=a),r!==null&&(h.matrix.fromArray(r.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,r.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(r.linearVelocity)):h.hasLinearVelocity=!1,r.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(r.angularVelocity)):h.hasAngularVelocity=!1,this.dispatchEvent(R0)))}return h!==null&&(h.visible=r!==null),u!==null&&(u.visible=a!==null),d!==null&&(d.visible=l!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const s=new zi;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[e.jointName]=s,t.add(s)}return t.joints[e.jointName]}}class xc extends an{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 Jn,this.environmentIntensity=1,this.environmentRotation=new Jn,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}}const wc=new q,L0=new q,I0=new ue;class ls{constructor(t=new q(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,s,r){return this.normal.set(t,e,s),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,s){const r=wc.subVectors(s,e).cross(L0.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const s=t.delta(wc),r=this.normal.dot(s);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const a=-(t.start.dot(this.normal)+this.constant)/r;return a<0||a>1?null:e.copy(t.start).addScaledVector(s,a)}intersectsLine(t){const e=this.distanceToPoint(t.start),s=this.distanceToPoint(t.end);return e<0&&s>0||s<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const s=e||I0.getNormalMatrix(t),r=this.coplanarPoint(wc).applyMatrix4(t),a=this.normal.applyMatrix3(s).normalize();return this.constant=-r.dot(a),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const cs=new Ro,D0=new Ae(.5,.5),Wo=new q;class Sc{constructor(t=new ls,e=new ls,s=new ls,r=new ls,a=new ls,l=new ls){this.planes=[t,e,s,r,a,l]}set(t,e,s,r,a,l){const h=this.planes;return h[0].copy(t),h[1].copy(e),h[2].copy(s),h[3].copy(r),h[4].copy(a),h[5].copy(l),this}copy(t){const e=this.planes;for(let s=0;s<6;s++)e[s].copy(t.planes[s]);return this}setFromProjectionMatrix(t,e=jn,s=!1){const r=this.planes,a=t.elements,l=a[0],h=a[1],u=a[2],d=a[3],p=a[4],m=a[5],_=a[6],E=a[7],w=a[8],S=a[9],v=a[10],g=a[11],R=a[12],P=a[13],T=a[14],U=a[15];if(r[0].setComponents(d-l,E-p,g-w,U-R).normalize(),r[1].setComponents(d+l,E+p,g+w,U+R).normalize(),r[2].setComponents(d+h,E+m,g+S,U+P).normalize(),r[3].setComponents(d-h,E-m,g-S,U-P).normalize(),s)r[4].setComponents(u,_,v,T).normalize(),r[5].setComponents(d-u,E-_,g-v,U-T).normalize();else if(r[4].setComponents(d-u,E-_,g-v,U-T).normalize(),e===jn)r[5].setComponents(d+u,E+_,g+v,U+T).normalize();else if(e===bo)r[5].setComponents(u,_,v,T).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),cs.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),cs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(cs)}intersectsSprite(t){cs.center.set(0,0,0);const e=D0.distanceTo(t.center);return cs.radius=.7071067811865476+e,cs.applyMatrix4(t.matrixWorld),this.intersectsSphere(cs)}intersectsSphere(t){const e=this.planes,s=t.center,r=-t.radius;for(let a=0;a<6;a++)if(e[a].distanceToPoint(s)<r)return!1;return!0}intersectsBox(t){const e=this.planes;for(let s=0;s<6;s++){const r=e[s];if(Wo.x=r.normal.x>0?t.max.x:t.min.x,Wo.y=r.normal.y>0?t.max.y:t.min.y,Wo.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Wo)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let s=0;s<6;s++)if(e[s].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class k0 extends Cr{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Pe(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Zo=new q,Xo=new q,Vu=new Oe,Lr=new ac,Yo=new Ro,Mc=new q,Gu=new q;class U0 extends an{constructor(t=new $n,e=new k0){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,s=[0];for(let r=1,a=e.count;r<a;r++)Zo.fromBufferAttribute(e,r-1),Xo.fromBufferAttribute(e,r),s[r]=s[r-1],s[r]+=Zo.distanceTo(Xo);t.setAttribute("lineDistance",new wn(s,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const s=this.geometry,r=this.matrixWorld,a=t.params.Line.threshold,l=s.drawRange;if(s.boundingSphere===null&&s.computeBoundingSphere(),Yo.copy(s.boundingSphere),Yo.applyMatrix4(r),Yo.radius+=a,t.ray.intersectsSphere(Yo)===!1)return;Vu.copy(r).invert(),Lr.copy(t.ray).applyMatrix4(Vu);const h=a/((this.scale.x+this.scale.y+this.scale.z)/3),u=h*h,d=this.isLineSegments?2:1,p=s.index,_=s.attributes.position;if(p!==null){const E=Math.max(0,l.start),w=Math.min(p.count,l.start+l.count);for(let S=E,v=w-1;S<v;S+=d){const g=p.getX(S),R=p.getX(S+1),P=qo(this,t,Lr,u,g,R,S);P&&e.push(P)}if(this.isLineLoop){const S=p.getX(w-1),v=p.getX(E),g=qo(this,t,Lr,u,S,v,w-1);g&&e.push(g)}}else{const E=Math.max(0,l.start),w=Math.min(_.count,l.start+l.count);for(let S=E,v=w-1;S<v;S+=d){const g=qo(this,t,Lr,u,S,S+1,S);g&&e.push(g)}if(this.isLineLoop){const S=qo(this,t,Lr,u,w-1,E,w-1);S&&e.push(S)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,s=Object.keys(e);if(s.length>0){const r=e[s[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=r.length;a<l;a++){const h=r[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[h]=a}}}}}function qo(n,t,e,s,r,a,l){const h=n.geometry.attributes.position;if(Zo.fromBufferAttribute(h,r),Xo.fromBufferAttribute(h,a),e.distanceSqToSegment(Zo,Xo,Mc,Gu)>s)return;Mc.applyMatrix4(n.matrixWorld);const d=t.ray.origin.distanceTo(Mc);if(!(d<t.near||d>t.far))return{distance:d,point:Gu.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const Wu=new q,Zu=new q;class O0 extends U0{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,s=[];for(let r=0,a=e.count;r<a;r+=2)Wu.fromBufferAttribute(e,r),Zu.fromBufferAttribute(e,r+1),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+Wu.distanceTo(Zu);t.setAttribute("lineDistance",new wn(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class N0 extends Je{constructor(t,e,s,r,a=En,l=En,h,u,d){super(t,e,s,r,a,l,h,u,d),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const p=this;function m(){p.needsUpdate=!0,p._requestVideoFrameCallbackId=t.requestVideoFrameCallback(m)}"requestVideoFrameCallback"in t&&(this._requestVideoFrameCallbackId=t.requestVideoFrameCallback(m))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}}class Xu extends Je{constructor(t,e,s=ns,r,a,l,h=Fn,u=Fn,d,p=yr,m=1){if(p!==yr&&p!==Er)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const _={width:t,height:e,depth:m};super(_,r,a,l,h,u,p,s,d),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.source=new $l(Object.assign({},t.image)),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class Ir extends $n{constructor(t=1,e=1,s=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:s,heightSegments:r};const a=t/2,l=e/2,h=Math.floor(s),u=Math.floor(r),d=h+1,p=u+1,m=t/h,_=e/u,E=[],w=[],S=[],v=[];for(let g=0;g<p;g++){const R=g*_-l;for(let P=0;P<d;P++){const T=P*m-a;w.push(T,-R,0),S.push(0,0,1),v.push(P/h),v.push(1-g/u)}}for(let g=0;g<u;g++)for(let R=0;R<h;R++){const P=R+d*g,T=R+d*(g+1),U=R+1+d*(g+1),B=R+1+d*g;E.push(P,T,B),E.push(T,U,B)}this.setIndex(E),this.setAttribute("position",new wn(w,3)),this.setAttribute("normal",new wn(S,3)),this.setAttribute("uv",new wn(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ir(t.width,t.height,t.widthSegments,t.heightSegments)}}class Ys extends $n{constructor(t=1,e=32,s=16,r=0,a=Math.PI*2,l=0,h=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:s,phiStart:r,phiLength:a,thetaStart:l,thetaLength:h},e=Math.max(3,Math.floor(e)),s=Math.max(2,Math.floor(s));const u=Math.min(l+h,Math.PI);let d=0;const p=[],m=new q,_=new q,E=[],w=[],S=[],v=[];for(let g=0;g<=s;g++){const R=[],P=g/s;let T=0;g===0&&l===0?T=.5/e:g===s&&u===Math.PI&&(T=-.5/e);for(let U=0;U<=e;U++){const B=U/e;m.x=-t*Math.cos(r+B*a)*Math.sin(l+P*h),m.y=t*Math.cos(l+P*h),m.z=t*Math.sin(r+B*a)*Math.sin(l+P*h),w.push(m.x,m.y,m.z),_.copy(m).normalize(),S.push(_.x,_.y,_.z),v.push(B+T,1-P),R.push(d++)}p.push(R)}for(let g=0;g<s;g++)for(let R=0;R<e;R++){const P=p[g][R+1],T=p[g][R],U=p[g+1][R],B=p[g+1][R+1];(g!==0||l>0)&&E.push(P,T,B),(g!==s-1||u<Math.PI)&&E.push(T,U,B)}this.setIndex(E),this.setAttribute("position",new wn(w,3)),this.setAttribute("normal",new wn(S,3)),this.setAttribute("uv",new wn(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ys(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class B0 extends $n{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],s=new Set,r=new q,a=new q;if(t.index!==null){const l=t.attributes.position,h=t.index;let u=t.groups;u.length===0&&(u=[{start:0,count:h.count,materialIndex:0}]);for(let d=0,p=u.length;d<p;++d){const m=u[d],_=m.start,E=m.count;for(let w=_,S=_+E;w<S;w+=3)for(let v=0;v<3;v++){const g=h.getX(w+v),R=h.getX(w+(v+1)%3);r.fromBufferAttribute(l,g),a.fromBufferAttribute(l,R),Yu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}}else{const l=t.attributes.position;for(let h=0,u=l.count/3;h<u;h++)for(let d=0;d<3;d++){const p=3*h+d,m=3*h+(d+1)%3;r.fromBufferAttribute(l,p),a.fromBufferAttribute(l,m),Yu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}this.setAttribute("position",new wn(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Yu(n,t,e){const s=`${n.x},${n.y},${n.z}-${t.x},${t.y},${t.z}`,r=`${t.x},${t.y},${t.z}-${n.x},${n.y},${n.z}`;return e.has(s)===!0||e.has(r)===!0?!1:(e.add(s),e.add(r),!0)}class F0 extends Cr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Iv,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class z0 extends Cr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const Hi={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class H0{constructor(t,e,s){const r=this;let a=!1,l=0,h=0,u;const d=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=s,this.abortController=new AbortController,this.itemStart=function(p){h++,a===!1&&r.onStart!==void 0&&r.onStart(p,l,h),a=!0},this.itemEnd=function(p){l++,r.onProgress!==void 0&&r.onProgress(p,l,h),l===h&&(a=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(p){r.onError!==void 0&&r.onError(p)},this.resolveURL=function(p){return u?u(p):p},this.setURLModifier=function(p){return u=p,this},this.addHandler=function(p,m){return d.push(p,m),this},this.removeHandler=function(p){const m=d.indexOf(p);return m!==-1&&d.splice(m,2),this},this.getHandler=function(p){for(let m=0,_=d.length;m<_;m+=2){const E=d[m],w=d[m+1];if(E.global&&(E.lastIndex=0),E.test(p))return w}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}const V0=new H0;let Tc=class{constructor(t){this.manager=t!==void 0?t:V0,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const s=this;return new Promise(function(r,a){s.load(t,r,e,a)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}abort(){return this}};Tc.DEFAULT_MATERIAL_NAME="__DEFAULT";const yi={};class G0 extends Error{constructor(t,e){super(t),this.response=e}}class W0 extends Tc{constructor(t){super(t),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(t,e,s,r){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const a=Hi.get(`file:${t}`);if(a!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(a),this.manager.itemEnd(t)},0),a;if(yi[t]!==void 0){yi[t].push({onLoad:e,onProgress:s,onError:r});return}yi[t]=[],yi[t].push({onLoad:e,onProgress:s,onError:r});const l=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),h=this.mimeType,u=this.responseType;fetch(l).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;const p=yi[t],m=d.body.getReader(),_=d.headers.get("X-File-Size")||d.headers.get("Content-Length"),E=_?parseInt(_):0,w=E!==0;let S=0;const v=new ReadableStream({start(g){R();function R(){m.read().then(({done:P,value:T})=>{if(P)g.close();else{S+=T.byteLength;const U=new ProgressEvent("progress",{lengthComputable:w,loaded:S,total:E});for(let B=0,N=p.length;B<N;B++){const z=p[B];z.onProgress&&z.onProgress(U)}g.enqueue(T),R()}},P=>{g.error(P)})}}});return new Response(v)}else throw new G0(`fetch for "${d.url}" responded with ${d.status}: ${d.statusText}`,d)}).then(d=>{switch(u){case"arraybuffer":return d.arrayBuffer();case"blob":return d.blob();case"document":return d.text().then(p=>new DOMParser().parseFromString(p,h));case"json":return d.json();default:if(h==="")return d.text();{const m=/charset="?([^;"\s]*)"?/i.exec(h),_=m&&m[1]?m[1].toLowerCase():void 0,E=new TextDecoder(_);return d.arrayBuffer().then(w=>E.decode(w))}}}).then(d=>{Hi.add(`file:${t}`,d);const p=yi[t];delete yi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onLoad&&E.onLoad(d)}}).catch(d=>{const p=yi[t];if(p===void 0)throw this.manager.itemError(t),d;delete yi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onError&&E.onError(d)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const qs=new WeakMap;class Z0 extends Tc{constructor(t){super(t)}load(t,e,s,r){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const a=this,l=Hi.get(`image:${t}`);if(l!==void 0){if(l.complete===!0)a.manager.itemStart(t),setTimeout(function(){e&&e(l),a.manager.itemEnd(t)},0);else{let m=qs.get(l);m===void 0&&(m=[],qs.set(l,m)),m.push({onLoad:e,onError:r})}return l}const h=Mr("img");function u(){p(),e&&e(this);const m=qs.get(this)||[];for(let _=0;_<m.length;_++){const E=m[_];E.onLoad&&E.onLoad(this)}qs.delete(this),a.manager.itemEnd(t)}function d(m){p(),r&&r(m),Hi.remove(`image:${t}`);const _=qs.get(this)||[];for(let E=0;E<_.length;E++){const w=_[E];w.onError&&w.onError(m)}qs.delete(this),a.manager.itemError(t),a.manager.itemEnd(t)}function p(){h.removeEventListener("load",u,!1),h.removeEventListener("error",d,!1)}return h.addEventListener("load",u,!1),h.addEventListener("error",d,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(h.crossOrigin=this.crossOrigin),Hi.add(`image:${t}`,h),a.manager.itemStart(t),h.src=t,h}}class X0 extends Bu{constructor(t=-1,e=1,s=1,r=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=s,this.bottom=r,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,s,r,a,l){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=t,this.view.fullHeight=e,this.view.offsetX=s,this.view.offsetY=r,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=s-t,l=s+t,h=r+e,u=r-e;if(this.view!==null&&this.view.enabled){const d=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=d*this.view.offsetX,l=a+d*this.view.width,h-=p*this.view.offsetY,u=h-p*this.view.height}this.projectionMatrix.makeOrthographic(a,l,h,u,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}class Y0 extends In{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const qu=new Oe;class q0{constructor(t,e,s=0,r=1/0){this.ray=new ac(t,e),this.near=s,this.far=r,this.camera=null,this.layers=new lc,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}setFromXRController(t){return qu.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(qu),this}intersectObject(t,e=!0,s=[]){return bc(t,this,s,e),s.sort(Qu),s}intersectObjects(t,e=!0,s=[]){for(let r=0,a=t.length;r<a;r++)bc(t[r],this,s,e);return s.sort(Qu),s}}function Qu(n,t){return n.distance-t.distance}function bc(n,t,e,s){let r=!0;if(n.layers.test(t.layers)&&n.raycast(t,e)===!1&&(r=!1),r===!0&&s===!0){const a=n.children;for(let l=0,h=a.length;l<h;l++)bc(a[l],t,e,!0)}}function ju(n,t,e,s){const r=Q0(s);switch(e){case au:return n*t;case cu:return n*t/r.components*r.byteLength;case xl:return n*t/r.components*r.byteLength;case hu:return n*t*2/r.components*r.byteLength;case wl:return n*t*2/r.components*r.byteLength;case lu:return n*t*3/r.components*r.byteLength;case zn:return n*t*4/r.components*r.byteLength;case Sl:return n*t*4/r.components*r.byteLength;case Eo:case xo:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case wo:case So:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Tl:case Al:return Math.max(n,16)*Math.max(t,8)/4;case Ml:case bl:return Math.max(n,8)*Math.max(t,8)/2;case Cl:case Pl:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case Rl:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Ll:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case Il:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case Dl:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case kl:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case Ul:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case Ol:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case Nl:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case Bl:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case Fl:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case zl:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case Hl:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case Vl:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case Gl:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case Wl:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case Mo:case Zl:case Xl:return Math.ceil(n/4)*Math.ceil(t/4)*16;case uu:case Yl:return Math.ceil(n/4)*Math.ceil(t/4)*8;case ql:case Ql:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function Q0(n){switch(n){case hi:case su:return{byteLength:1,components:1};case gr:case ru:case _r:return{byteLength:2,components:1};case yl:case El:return{byteLength:2,components:4};case ns:case vl:case ui:return{byteLength:4,components:1};case ou:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:il}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=il);/**
54
54
  * @license
55
55
  * Copyright 2010-2025 Three.js Authors
56
56
  * SPDX-License-Identifier: MIT
57
- */function Ju(){let n=null,t=!1,e=null,s=null;function r(a,l){e(a,l),s=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(s=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(a){e=a},setContext:function(a){n=a}}}function j0(n){const t=new WeakMap;function e(h,u){const d=h.array,p=h.usage,m=d.byteLength,_=n.createBuffer();n.bindBuffer(u,_),n.bufferData(u,d,p),h.onUploadCallback();let E;if(d instanceof Float32Array)E=n.FLOAT;else if(typeof Float16Array<"u"&&d instanceof Float16Array)E=n.HALF_FLOAT;else if(d instanceof Uint16Array)h.isFloat16BufferAttribute?E=n.HALF_FLOAT:E=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)E=n.SHORT;else if(d instanceof Uint32Array)E=n.UNSIGNED_INT;else if(d instanceof Int32Array)E=n.INT;else if(d instanceof Int8Array)E=n.BYTE;else if(d instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)E=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:_,type:E,bytesPerElement:d.BYTES_PER_ELEMENT,version:h.version,size:m}}function s(h,u,d){const p=u.array,m=u.updateRanges;if(n.bindBuffer(d,h),m.length===0)n.bufferSubData(d,0,p);else{m.sort((E,S)=>E.start-S.start);let _=0;for(let E=1;E<m.length;E++){const S=m[_],w=m[E];w.start<=S.start+S.count+1?S.count=Math.max(S.count,w.start+w.count-S.start):(++_,m[_]=w)}m.length=_+1;for(let E=0,S=m.length;E<S;E++){const w=m[E];n.bufferSubData(d,w.start*p.BYTES_PER_ELEMENT,p,w.start,w.count)}u.clearUpdateRanges()}u.onUploadCallback()}function r(h){return h.isInterleavedBufferAttribute&&(h=h.data),t.get(h)}function a(h){h.isInterleavedBufferAttribute&&(h=h.data);const u=t.get(h);u&&(n.deleteBuffer(u.buffer),t.delete(h))}function l(h,u){if(h.isInterleavedBufferAttribute&&(h=h.data),h.isGLBufferAttribute){const p=t.get(h);(!p||p.version<h.version)&&t.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}const d=t.get(h);if(d===void 0)t.set(h,e(h,u));else if(d.version<h.version){if(d.size!==h.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.");s(d.buffer,h,u),d.version=h.version}}return{get:r,remove:a,update:l}}var J0=`#ifdef USE_ALPHAHASH
57
+ */function Ju(){let n=null,t=!1,e=null,s=null;function r(a,l){e(a,l),s=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(s=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(s),t=!1},setAnimationLoop:function(a){e=a},setContext:function(a){n=a}}}function j0(n){const t=new WeakMap;function e(h,u){const d=h.array,p=h.usage,m=d.byteLength,_=n.createBuffer();n.bindBuffer(u,_),n.bufferData(u,d,p),h.onUploadCallback();let E;if(d instanceof Float32Array)E=n.FLOAT;else if(typeof Float16Array<"u"&&d instanceof Float16Array)E=n.HALF_FLOAT;else if(d instanceof Uint16Array)h.isFloat16BufferAttribute?E=n.HALF_FLOAT:E=n.UNSIGNED_SHORT;else if(d instanceof Int16Array)E=n.SHORT;else if(d instanceof Uint32Array)E=n.UNSIGNED_INT;else if(d instanceof Int32Array)E=n.INT;else if(d instanceof Int8Array)E=n.BYTE;else if(d instanceof Uint8Array)E=n.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)E=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:_,type:E,bytesPerElement:d.BYTES_PER_ELEMENT,version:h.version,size:m}}function s(h,u,d){const p=u.array,m=u.updateRanges;if(n.bindBuffer(d,h),m.length===0)n.bufferSubData(d,0,p);else{m.sort((E,w)=>E.start-w.start);let _=0;for(let E=1;E<m.length;E++){const w=m[_],S=m[E];S.start<=w.start+w.count+1?w.count=Math.max(w.count,S.start+S.count-w.start):(++_,m[_]=S)}m.length=_+1;for(let E=0,w=m.length;E<w;E++){const S=m[E];n.bufferSubData(d,S.start*p.BYTES_PER_ELEMENT,p,S.start,S.count)}u.clearUpdateRanges()}u.onUploadCallback()}function r(h){return h.isInterleavedBufferAttribute&&(h=h.data),t.get(h)}function a(h){h.isInterleavedBufferAttribute&&(h=h.data);const u=t.get(h);u&&(n.deleteBuffer(u.buffer),t.delete(h))}function l(h,u){if(h.isInterleavedBufferAttribute&&(h=h.data),h.isGLBufferAttribute){const p=t.get(h);(!p||p.version<h.version)&&t.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}const d=t.get(h);if(d===void 0)t.set(h,e(h,u));else if(d.version<h.version){if(d.size!==h.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.");s(d.buffer,h,u),d.version=h.version}}return{get:r,remove:a,update:l}}var J0=`#ifdef USE_ALPHAHASH
58
58
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
59
59
  #endif`,K0=`#ifdef USE_ALPHAHASH
60
60
  const float ALPHA_HASH_SCALE = 0.05;
@@ -3593,7 +3593,7 @@ void main() {
3593
3593
  #include <tonemapping_fragment>
3594
3594
  #include <colorspace_fragment>
3595
3595
  #include <fog_fragment>
3596
- }`},Rt={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ue}},envmap:{envMap:{value:null},envMapRotation:{value:new ue},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ue}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ue}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ue},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ue},normalScale:{value:new be(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ue},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ue}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ue}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ue}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0},uvTransform:{value:new ue}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new be(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}}},ti={basic:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.fog]),vertexShader:de.meshbasic_vert,fragmentShader:de.meshbasic_frag},lambert:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Pe(0)}}]),vertexShader:de.meshlambert_vert,fragmentShader:de.meshlambert_frag},phong:{uniforms:ln([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,Rt.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:de.meshphong_vert,fragmentShader:de.meshphong_frag},standard:{uniforms:ln([Rt.common,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.roughnessmap,Rt.metalnessmap,Rt.fog,Rt.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag},toon:{uniforms:ln([Rt.common,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.gradientmap,Rt.fog,Rt.lights,{emissive:{value:new Pe(0)}}]),vertexShader:de.meshtoon_vert,fragmentShader:de.meshtoon_frag},matcap:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,{matcap:{value:null}}]),vertexShader:de.meshmatcap_vert,fragmentShader:de.meshmatcap_frag},points:{uniforms:ln([Rt.points,Rt.fog]),vertexShader:de.points_vert,fragmentShader:de.points_frag},dashed:{uniforms:ln([Rt.common,Rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:de.linedashed_vert,fragmentShader:de.linedashed_frag},depth:{uniforms:ln([Rt.common,Rt.displacementmap]),vertexShader:de.depth_vert,fragmentShader:de.depth_frag},normal:{uniforms:ln([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,{opacity:{value:1}}]),vertexShader:de.meshnormal_vert,fragmentShader:de.meshnormal_frag},sprite:{uniforms:ln([Rt.sprite,Rt.fog]),vertexShader:de.sprite_vert,fragmentShader:de.sprite_frag},background:{uniforms:{uvTransform:{value:new ue},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:de.background_vert,fragmentShader:de.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ue}},vertexShader:de.backgroundCube_vert,fragmentShader:de.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:de.cube_vert,fragmentShader:de.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:de.equirect_vert,fragmentShader:de.equirect_frag},distanceRGBA:{uniforms:ln([Rt.common,Rt.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:de.distanceRGBA_vert,fragmentShader:de.distanceRGBA_frag},shadow:{uniforms:ln([Rt.lights,Rt.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:de.shadow_vert,fragmentShader:de.shadow_frag}};ti.physical={uniforms:ln([ti.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ue},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ue},clearcoatNormalScale:{value:new be(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ue},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ue},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ue},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ue},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ue},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ue},transmissionSamplerSize:{value:new be},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ue},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ue},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ue},anisotropyVector:{value:new be},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ue}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag};const Qo={r:0,b:0,g:0},hs=new Jn,jE=new Oe;function JE(n,t,e,s,r,a,l){const h=new Pe(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function S(C){let T=C.isScene===!0?C.background:null;return T&&T.isTexture&&(T=(C.backgroundBlurriness>0?e:t).get(T)),T}function w(C){let T=!1;const U=S(C);U===null?g(h,u):U&&U.isColor&&(g(U,1),T=!0);const N=n.xr.getEnvironmentBlendMode();N==="additive"?s.buffers.color.setClear(0,0,0,1,l):N==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,l),(n.autoClear||T)&&(s.buffers.depth.setTest(!0),s.buffers.depth.setMask(!0),s.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function v(C,T){const U=S(T);U&&(U.isCubeTexture||U.mapping===vo)?(p===void 0&&(p=new pn(new Rr(1,1,1),new vi({name:"BackgroundCubeMaterial",uniforms:Ws(ti.backgroundCube.uniforms),vertexShader:ti.backgroundCube.vertexShader,fragmentShader:ti.backgroundCube.fragmentShader,side:fn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(N,B,z){this.matrixWorld.copyPosition(z.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),hs.copy(T.backgroundRotation),hs.x*=-1,hs.y*=-1,hs.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(hs.y*=-1,hs.z*=-1),p.material.uniforms.envMap.value=U,p.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=T.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(jE.makeRotationFromEuler(hs)),p.material.toneMapped=Se.getTransfer(U.colorSpace)!==Ie,(m!==U||_!==U.version||E!==n.toneMapping)&&(p.material.needsUpdate=!0,m=U,_=U.version,E=n.toneMapping),p.layers.enableAll(),C.unshift(p,p.geometry,p.material,0,0,null)):U&&U.isTexture&&(d===void 0&&(d=new pn(new Ir(2,2),new vi({name:"BackgroundMaterial",uniforms:Ws(ti.background.uniforms),vertexShader:ti.background.vertexShader,fragmentShader:ti.background.fragmentShader,side:Ai,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=U,d.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,d.material.toneMapped=Se.getTransfer(U.colorSpace)!==Ie,U.matrixAutoUpdate===!0&&U.updateMatrix(),d.material.uniforms.uvTransform.value.copy(U.matrix),(m!==U||_!==U.version||E!==n.toneMapping)&&(d.material.needsUpdate=!0,m=U,_=U.version,E=n.toneMapping),d.layers.enableAll(),C.unshift(d,d.geometry,d.material,0,0,null))}function g(C,T){C.getRGB(Qo,Nu(n)),s.buffers.color.setClear(Qo.r,Qo.g,Qo.b,T,l)}function I(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}return{getClearColor:function(){return h},setClearColor:function(C,T=1){h.set(C),u=T,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(C){u=C,g(h,u)},render:w,addToRenderList:v,dispose:I}}function KE(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(M,k,Z,J,V){let $=!1;const K=m(J,Z,k);a!==K&&(a=K,d(a.object)),$=E(M,J,Z,V),$&&S(M,J,Z,V),V!==null&&t.update(V,n.ELEMENT_ARRAY_BUFFER),($||l)&&(l=!1,T(M,k,Z,J),V!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function u(){return n.createVertexArray()}function d(M){return n.bindVertexArray(M)}function p(M){return n.deleteVertexArray(M)}function m(M,k,Z){const J=Z.wireframe===!0;let V=s[M.id];V===void 0&&(V={},s[M.id]=V);let $=V[k.id];$===void 0&&($={},V[k.id]=$);let K=$[J];return K===void 0&&(K=_(u()),$[J]=K),K}function _(M){const k=[],Z=[],J=[];for(let V=0;V<e;V++)k[V]=0,Z[V]=0,J[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:Z,attributeDivisors:J,object:M,attributes:{},index:null}}function E(M,k,Z,J){const V=a.attributes,$=k.attributes;let K=0;const ut=Z.getAttributes();for(const G in ut)if(ut[G].location>=0){const ot=V[G];let St=$[G];if(St===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(St=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(St=M.instanceColor)),ot===void 0||ot.attribute!==St||St&&ot.data!==St.data)return!0;K++}return a.attributesNum!==K||a.index!==J}function S(M,k,Z,J){const V={},$=k.attributes;let K=0;const ut=Z.getAttributes();for(const G in ut)if(ut[G].location>=0){let ot=$[G];ot===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(ot=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(ot=M.instanceColor));const St={};St.attribute=ot,ot&&ot.data&&(St.data=ot.data),V[G]=St,K++}a.attributes=V,a.attributesNum=K,a.index=J}function w(){const M=a.newAttributes;for(let k=0,Z=M.length;k<Z;k++)M[k]=0}function v(M){g(M,0)}function g(M,k){const Z=a.newAttributes,J=a.enabledAttributes,V=a.attributeDivisors;Z[M]=1,J[M]===0&&(n.enableVertexAttribArray(M),J[M]=1),V[M]!==k&&(n.vertexAttribDivisor(M,k),V[M]=k)}function I(){const M=a.newAttributes,k=a.enabledAttributes;for(let Z=0,J=k.length;Z<J;Z++)k[Z]!==M[Z]&&(n.disableVertexAttribArray(Z),k[Z]=0)}function C(M,k,Z,J,V,$,K){K===!0?n.vertexAttribIPointer(M,k,Z,V,$):n.vertexAttribPointer(M,k,Z,J,V,$)}function T(M,k,Z,J){w();const V=J.attributes,$=Z.getAttributes(),K=k.defaultAttributeValues;for(const ut in $){const G=$[ut];if(G.location>=0){let Tt=V[ut];if(Tt===void 0&&(ut==="instanceMatrix"&&M.instanceMatrix&&(Tt=M.instanceMatrix),ut==="instanceColor"&&M.instanceColor&&(Tt=M.instanceColor)),Tt!==void 0){const ot=Tt.normalized,St=Tt.itemSize,Gt=t.get(Tt);if(Gt===void 0)continue;const pt=Gt.buffer,Lt=Gt.type,Y=Gt.bytesPerElement,it=Lt===n.INT||Lt===n.UNSIGNED_INT||Tt.gpuType===vl;if(Tt.isInterleavedBufferAttribute){const ft=Tt.data,kt=ft.stride,Ot=Tt.offset;if(ft.isInstancedInterleavedBuffer){for(let zt=0;zt<G.locationSize;zt++)g(G.location+zt,ft.meshPerAttribute);M.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=ft.meshPerAttribute*ft.count)}else for(let zt=0;zt<G.locationSize;zt++)v(G.location+zt);n.bindBuffer(n.ARRAY_BUFFER,pt);for(let zt=0;zt<G.locationSize;zt++)C(G.location+zt,St/G.locationSize,Lt,ot,kt*Y,(Ot+St/G.locationSize*zt)*Y,it)}else{if(Tt.isInstancedBufferAttribute){for(let ft=0;ft<G.locationSize;ft++)g(G.location+ft,Tt.meshPerAttribute);M.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=Tt.meshPerAttribute*Tt.count)}else for(let ft=0;ft<G.locationSize;ft++)v(G.location+ft);n.bindBuffer(n.ARRAY_BUFFER,pt);for(let ft=0;ft<G.locationSize;ft++)C(G.location+ft,St/G.locationSize,Lt,ot,St*Y,St/G.locationSize*ft*Y,it)}}else if(K!==void 0){const ot=K[ut];if(ot!==void 0)switch(ot.length){case 2:n.vertexAttrib2fv(G.location,ot);break;case 3:n.vertexAttrib3fv(G.location,ot);break;case 4:n.vertexAttrib4fv(G.location,ot);break;default:n.vertexAttrib1fv(G.location,ot)}}}}I()}function U(){z();for(const M in s){const k=s[M];for(const Z in k){const J=k[Z];for(const V in J)p(J[V].object),delete J[V];delete k[Z]}delete s[M]}}function N(M){if(s[M.id]===void 0)return;const k=s[M.id];for(const Z in k){const J=k[Z];for(const V in J)p(J[V].object),delete J[V];delete k[Z]}delete s[M.id]}function B(M){for(const k in s){const Z=s[k];if(Z[M.id]===void 0)continue;const J=Z[M.id];for(const V in J)p(J[V].object),delete J[V];delete Z[M.id]}}function z(){D(),l=!0,a!==r&&(a=r,d(a.object))}function D(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:z,resetDefaultState:D,dispose:U,releaseStatesOfGeometry:N,releaseStatesOfProgram:B,initAttributes:w,enableAttribute:v,disableUnusedAttributes:I}}function $E(n,t,e){let s;function r(d){s=d}function a(d,p){n.drawArrays(s,d,p),e.update(p,s,1)}function l(d,p,m){m!==0&&(n.drawArraysInstanced(s,d,p,m),e.update(p,s,m))}function h(d,p,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,d,0,p,0,m);let E=0;for(let S=0;S<m;S++)E+=p[S];e.update(E,s,1)}function u(d,p,m,_){if(m===0)return;const E=t.get("WEBGL_multi_draw");if(E===null)for(let S=0;S<d.length;S++)l(d[S],p[S],_[S]);else{E.multiDrawArraysInstancedWEBGL(s,d,0,p,0,_,0,m);let S=0;for(let w=0;w<m;w++)S+=p[w]*_[w];e.update(S,s,1)}}this.setMode=r,this.render=a,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function tx(n,t,e,s){let r;function a(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){const B=t.get("EXT_texture_filter_anisotropic");r=n.getParameter(B.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function l(B){return!(B!==zn&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(B){const z=B===_r&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(B!==hi&&s.convert(B)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&B!==ui&&!z)}function u(B){if(B==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=e.precision!==void 0?e.precision:"highp";const p=u(d);p!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=e.logarithmicDepthBuffer===!0,_=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),E=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),I=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),T=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=S>0,N=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:l,textureTypeReadable:h,precision:d,logarithmicDepthBuffer:m,reversedDepthBuffer:_,maxTextures:E,maxVertexTextures:S,maxTextureSize:w,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:I,maxVaryings:C,maxFragmentUniforms:T,vertexTextures:U,maxSamples:N}}function ex(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ls,h=new ue,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(m,_){const E=m.length!==0||_||s!==0||r;return r=_,s=m.length,E},this.beginShadows=function(){a=!0,p(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,_){e=p(m,_,0)},this.setState=function(m,_,E){const S=m.clippingPlanes,w=m.clipIntersection,v=m.clipShadows,g=n.get(m);if(!r||S===null||S.length===0||a&&!v)a?p(null):d();else{const I=a?0:s,C=I*4;let T=g.clippingState||null;u.value=T,T=p(S,_,C,E);for(let U=0;U!==C;++U)T[U]=e[U];g.clippingState=T,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=I}};function d(){u.value!==e&&(u.value=e,u.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function p(m,_,E,S){const w=m!==null?m.length:0;let v=null;if(w!==0){if(v=u.value,S!==!0||v===null){const g=E+w*4,I=_.matrixWorldInverse;h.getNormalMatrix(I),(v===null||v.length<g)&&(v=new Float32Array(g));for(let C=0,T=E;C!==w;++C,T+=4)l.copy(m[C]).applyMatrix4(I,h),l.normal.toArray(v,T),v[T+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=w,t.numIntersection=0,v}}function nx(n){let t=new WeakMap;function e(l,h){return h===fl?l.mapping=Ts:h===pl&&(l.mapping=bs),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===fl||h===pl)if(t.has(l)){const u=t.get(l).texture;return e(u,l.mapping)}else{const u=l.image;if(u&&u.height>0){const d=new P0(u.height);return d.fromEquirectangularTexture(n,l),t.set(l,d),l.addEventListener("dispose",r),e(d.texture,l.mapping)}else return null}}return l}function r(l){const h=l.target;h.removeEventListener("dispose",r);const u=t.get(h);u!==void 0&&(t.delete(h),u.dispose())}function a(){t=new WeakMap}return{get:s,dispose:a}}const Qs=4,Ku=[.125,.215,.35,.446,.526,.582],us=20,Ac=new X0,$u=new Pe;let Cc=null,Pc=0,Rc=0,Lc=!1;const ds=(1+Math.sqrt(5))/2,js=1/ds,td=[new q(-ds,js,0),new q(ds,js,0),new q(-js,0,ds),new q(js,0,ds),new q(0,ds,-js),new q(0,ds,js),new q(-1,1,-1),new q(1,1,-1),new q(-1,1,1),new q(1,1,1)],ix=new q;class ed{constructor(t){this._renderer=t,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(t,e=0,s=.1,r=100,a={}){const{size:l=256,position:h=ix}=a;Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(t,s,r,u,h),e>0&&this._blur(u,0,0,e),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sd(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=id(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Cc,Pc,Rc),this._renderer.xr.enabled=Lc,t.scissorTest=!1,jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ts||t.mapping===bs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=e||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,s={magFilter:En,minFilter:En,generateMipmaps:!1,type:_r,format:zn,colorSpace:is,depthBuffer:!1},r=nd(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=nd(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=sx(a)),this._blurMaterial=rx(a,t,e)}return r}_compileMaterial(t){const e=new pn(this._lodPlanes[0],t);this._renderer.compile(e,Ac)}_sceneToCubeUV(t,e,s,r,a){const u=new In(90,1,e,s),d=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],m=this._renderer,_=m.autoClear,E=m.toneMapping;m.getClearColor($u),m.toneMapping=Pi,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const w=new Bi({name:"PMREM.Background",side:fn,depthWrite:!1,depthTest:!1}),v=new pn(new Rr,w);let g=!1;const I=t.background;I?I.isColor&&(w.color.copy(I),t.background=null,g=!0):(w.color.copy($u),g=!0);for(let C=0;C<6;C++){const T=C%3;T===0?(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x+p[C],a.y,a.z)):T===1?(u.up.set(0,0,d[C]),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y+p[C],a.z)):(u.up.set(0,d[C],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y,a.z+p[C]));const U=this._cubeSize;jo(r,T*U,C>2?U:0,U,U),m.setRenderTarget(r),g&&m.render(v,u),m.render(t,u)}v.geometry.dispose(),v.material.dispose(),m.toneMapping=E,m.autoClear=_,t.background=I}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===Ts||t.mapping===bs;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=sd()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=id());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new pn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;jo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,Ac)}_applyPMREM(t){const e=this._renderer,s=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const l=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),h=td[(r-a-1)%td.length];this._blur(t,a-1,a,l,h)}e.autoClear=s}_blur(t,e,s,r,a){const l=this._pingPongRenderTarget;this._halfBlur(t,l,e,s,r,"latitudinal",a),this._halfBlur(l,t,s,s,r,"longitudinal",a)}_halfBlur(t,e,s,r,a,l,h){const u=this._renderer,d=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,m=new pn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,S=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*us-1),w=a/S,v=isFinite(a)?1+Math.floor(p*w):us;v>us&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${us}`);const g=[];let I=0;for(let B=0;B<us;++B){const z=B/w,D=Math.exp(-z*z/2);g.push(D),B===0?I+=D:B<v&&(I+=2*D)}for(let B=0;B<g.length;B++)g[B]=g[B]/I;_.envMap.value=t.texture,_.samples.value=v,_.weights.value=g,_.latitudinal.value=l==="latitudinal",h&&(_.poleAxis.value=h);const{_lodMax:C}=this;_.dTheta.value=S,_.mipInt.value=C-s;const T=this._sizeLods[r],U=3*T*(r>C-Qs?r-C+Qs:0),N=4*(this._cubeSize-T);jo(e,U,N,3*T,2*T),u.setRenderTarget(e),u.render(m,Ac)}}function sx(n){const t=[],e=[],s=[];let r=n;const a=n-Qs+1+Ku.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-Qs?u=Ku[l-n+Qs-1]:l===0&&(u=0),s.push(u);const d=1/(h-2),p=-d,m=1+d,_=[p,p,m,p,m,m,p,p,m,m,p,m],E=6,S=6,w=3,v=2,g=1,I=new Float32Array(w*S*E),C=new Float32Array(v*S*E),T=new Float32Array(g*S*E);for(let N=0;N<E;N++){const B=N%3*2/3-1,z=N>2?0:-1,D=[B,z,0,B+2/3,z,0,B+2/3,z+1,0,B,z,0,B+2/3,z+1,0,B,z+1,0];I.set(D,w*S*N),C.set(_,v*S*N);const M=[N,N,N,N,N,N];T.set(M,g*S*N)}const U=new $n;U.setAttribute("position",new Kn(I,w)),U.setAttribute("uv",new Kn(C,v)),U.setAttribute("faceIndex",new Kn(T,g)),t.push(U),r>Qs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function nd(n,t,e){const s=new Ii(n,t,e);return s.texture.mapping=vo,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function jo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function rx(n,t,e){const s=new Float32Array(us),r=new q(0,1,0);return new vi({name:"SphericalGaussianBlur",defines:{n:us,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ic(),fragmentShader:`
3596
+ }`},Pt={common:{diffuse:{value:new Pe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ue}},envmap:{envMap:{value:null},envMapRotation:{value:new ue},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ue}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ue}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ue},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ue},normalScale:{value:new Ae(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ue},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ue}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ue}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ue}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,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 Pe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0},uvTransform:{value:new ue}},sprite:{diffuse:{value:new Pe(16777215)},opacity:{value:1},center:{value:new Ae(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ue},alphaMap:{value:null},alphaMapTransform:{value:new ue},alphaTest:{value:0}}},ti={basic:{uniforms:ln([Pt.common,Pt.specularmap,Pt.envmap,Pt.aomap,Pt.lightmap,Pt.fog]),vertexShader:de.meshbasic_vert,fragmentShader:de.meshbasic_frag},lambert:{uniforms:ln([Pt.common,Pt.specularmap,Pt.envmap,Pt.aomap,Pt.lightmap,Pt.emissivemap,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.fog,Pt.lights,{emissive:{value:new Pe(0)}}]),vertexShader:de.meshlambert_vert,fragmentShader:de.meshlambert_frag},phong:{uniforms:ln([Pt.common,Pt.specularmap,Pt.envmap,Pt.aomap,Pt.lightmap,Pt.emissivemap,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.fog,Pt.lights,{emissive:{value:new Pe(0)},specular:{value:new Pe(1118481)},shininess:{value:30}}]),vertexShader:de.meshphong_vert,fragmentShader:de.meshphong_frag},standard:{uniforms:ln([Pt.common,Pt.envmap,Pt.aomap,Pt.lightmap,Pt.emissivemap,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.roughnessmap,Pt.metalnessmap,Pt.fog,Pt.lights,{emissive:{value:new Pe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag},toon:{uniforms:ln([Pt.common,Pt.aomap,Pt.lightmap,Pt.emissivemap,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.gradientmap,Pt.fog,Pt.lights,{emissive:{value:new Pe(0)}}]),vertexShader:de.meshtoon_vert,fragmentShader:de.meshtoon_frag},matcap:{uniforms:ln([Pt.common,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.fog,{matcap:{value:null}}]),vertexShader:de.meshmatcap_vert,fragmentShader:de.meshmatcap_frag},points:{uniforms:ln([Pt.points,Pt.fog]),vertexShader:de.points_vert,fragmentShader:de.points_frag},dashed:{uniforms:ln([Pt.common,Pt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:de.linedashed_vert,fragmentShader:de.linedashed_frag},depth:{uniforms:ln([Pt.common,Pt.displacementmap]),vertexShader:de.depth_vert,fragmentShader:de.depth_frag},normal:{uniforms:ln([Pt.common,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,{opacity:{value:1}}]),vertexShader:de.meshnormal_vert,fragmentShader:de.meshnormal_frag},sprite:{uniforms:ln([Pt.sprite,Pt.fog]),vertexShader:de.sprite_vert,fragmentShader:de.sprite_frag},background:{uniforms:{uvTransform:{value:new ue},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:de.background_vert,fragmentShader:de.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new ue}},vertexShader:de.backgroundCube_vert,fragmentShader:de.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:de.cube_vert,fragmentShader:de.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:de.equirect_vert,fragmentShader:de.equirect_frag},distanceRGBA:{uniforms:ln([Pt.common,Pt.displacementmap,{referencePosition:{value:new q},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:de.distanceRGBA_vert,fragmentShader:de.distanceRGBA_frag},shadow:{uniforms:ln([Pt.lights,Pt.fog,{color:{value:new Pe(0)},opacity:{value:1}}]),vertexShader:de.shadow_vert,fragmentShader:de.shadow_frag}};ti.physical={uniforms:ln([ti.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ue},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ue},clearcoatNormalScale:{value:new Ae(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ue},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ue},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ue},sheen:{value:0},sheenColor:{value:new Pe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ue},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ue},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ue},transmissionSamplerSize:{value:new Ae},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ue},attenuationDistance:{value:0},attenuationColor:{value:new Pe(0)},specularColor:{value:new Pe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ue},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ue},anisotropyVector:{value:new Ae},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ue}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag};const Qo={r:0,b:0,g:0},hs=new Jn,jE=new Oe;function JE(n,t,e,s,r,a,l){const h=new Pe(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function w(P){let T=P.isScene===!0?P.background:null;return T&&T.isTexture&&(T=(P.backgroundBlurriness>0?e:t).get(T)),T}function S(P){let T=!1;const U=w(P);U===null?g(h,u):U&&U.isColor&&(g(U,1),T=!0);const B=n.xr.getEnvironmentBlendMode();B==="additive"?s.buffers.color.setClear(0,0,0,1,l):B==="alpha-blend"&&s.buffers.color.setClear(0,0,0,0,l),(n.autoClear||T)&&(s.buffers.depth.setTest(!0),s.buffers.depth.setMask(!0),s.buffers.color.setMask(!0),n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil))}function v(P,T){const U=w(T);U&&(U.isCubeTexture||U.mapping===vo)?(p===void 0&&(p=new pn(new Rr(1,1,1),new vi({name:"BackgroundCubeMaterial",uniforms:Ws(ti.backgroundCube.uniforms),vertexShader:ti.backgroundCube.vertexShader,fragmentShader:ti.backgroundCube.fragmentShader,side:fn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(B,N,z){this.matrixWorld.copyPosition(z.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),hs.copy(T.backgroundRotation),hs.x*=-1,hs.y*=-1,hs.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(hs.y*=-1,hs.z*=-1),p.material.uniforms.envMap.value=U,p.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=T.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(jE.makeRotationFromEuler(hs)),p.material.toneMapped=Me.getTransfer(U.colorSpace)!==Ie,(m!==U||_!==U.version||E!==n.toneMapping)&&(p.material.needsUpdate=!0,m=U,_=U.version,E=n.toneMapping),p.layers.enableAll(),P.unshift(p,p.geometry,p.material,0,0,null)):U&&U.isTexture&&(d===void 0&&(d=new pn(new Ir(2,2),new vi({name:"BackgroundMaterial",uniforms:Ws(ti.background.uniforms),vertexShader:ti.background.vertexShader,fragmentShader:ti.background.fragmentShader,side:Ai,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),d.geometry.deleteAttribute("normal"),Object.defineProperty(d.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(d)),d.material.uniforms.t2D.value=U,d.material.uniforms.backgroundIntensity.value=T.backgroundIntensity,d.material.toneMapped=Me.getTransfer(U.colorSpace)!==Ie,U.matrixAutoUpdate===!0&&U.updateMatrix(),d.material.uniforms.uvTransform.value.copy(U.matrix),(m!==U||_!==U.version||E!==n.toneMapping)&&(d.material.needsUpdate=!0,m=U,_=U.version,E=n.toneMapping),d.layers.enableAll(),P.unshift(d,d.geometry,d.material,0,0,null))}function g(P,T){P.getRGB(Qo,Nu(n)),s.buffers.color.setClear(Qo.r,Qo.g,Qo.b,T,l)}function R(){p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0),d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0)}return{getClearColor:function(){return h},setClearColor:function(P,T=1){h.set(P),u=T,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(P){u=P,g(h,u)},render:S,addToRenderList:v,dispose:R}}function KE(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(M,k,Z,J,V){let $=!1;const K=m(J,Z,k);a!==K&&(a=K,d(a.object)),$=E(M,J,Z,V),$&&w(M,J,Z,V),V!==null&&t.update(V,n.ELEMENT_ARRAY_BUFFER),($||l)&&(l=!1,T(M,k,Z,J),V!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function u(){return n.createVertexArray()}function d(M){return n.bindVertexArray(M)}function p(M){return n.deleteVertexArray(M)}function m(M,k,Z){const J=Z.wireframe===!0;let V=s[M.id];V===void 0&&(V={},s[M.id]=V);let $=V[k.id];$===void 0&&($={},V[k.id]=$);let K=$[J];return K===void 0&&(K=_(u()),$[J]=K),K}function _(M){const k=[],Z=[],J=[];for(let V=0;V<e;V++)k[V]=0,Z[V]=0,J[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:Z,attributeDivisors:J,object:M,attributes:{},index:null}}function E(M,k,Z,J){const V=a.attributes,$=k.attributes;let K=0;const ut=Z.getAttributes();for(const G in ut)if(ut[G].location>=0){const lt=V[G];let Mt=$[G];if(Mt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(Mt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(Mt=M.instanceColor)),lt===void 0||lt.attribute!==Mt||Mt&&lt.data!==Mt.data)return!0;K++}return a.attributesNum!==K||a.index!==J}function w(M,k,Z,J){const V={},$=k.attributes;let K=0;const ut=Z.getAttributes();for(const G in ut)if(ut[G].location>=0){let lt=$[G];lt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(lt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(lt=M.instanceColor));const Mt={};Mt.attribute=lt,lt&&lt.data&&(Mt.data=lt.data),V[G]=Mt,K++}a.attributes=V,a.attributesNum=K,a.index=J}function S(){const M=a.newAttributes;for(let k=0,Z=M.length;k<Z;k++)M[k]=0}function v(M){g(M,0)}function g(M,k){const Z=a.newAttributes,J=a.enabledAttributes,V=a.attributeDivisors;Z[M]=1,J[M]===0&&(n.enableVertexAttribArray(M),J[M]=1),V[M]!==k&&(n.vertexAttribDivisor(M,k),V[M]=k)}function R(){const M=a.newAttributes,k=a.enabledAttributes;for(let Z=0,J=k.length;Z<J;Z++)k[Z]!==M[Z]&&(n.disableVertexAttribArray(Z),k[Z]=0)}function P(M,k,Z,J,V,$,K){K===!0?n.vertexAttribIPointer(M,k,Z,V,$):n.vertexAttribPointer(M,k,Z,J,V,$)}function T(M,k,Z,J){S();const V=J.attributes,$=Z.getAttributes(),K=k.defaultAttributeValues;for(const ut in $){const G=$[ut];if(G.location>=0){let Tt=V[ut];if(Tt===void 0&&(ut==="instanceMatrix"&&M.instanceMatrix&&(Tt=M.instanceMatrix),ut==="instanceColor"&&M.instanceColor&&(Tt=M.instanceColor)),Tt!==void 0){const lt=Tt.normalized,Mt=Tt.itemSize,Gt=t.get(Tt);if(Gt===void 0)continue;const pt=Gt.buffer,Rt=Gt.type,Y=Gt.bytesPerElement,st=Rt===n.INT||Rt===n.UNSIGNED_INT||Tt.gpuType===vl;if(Tt.isInterleavedBufferAttribute){const ft=Tt.data,Dt=ft.stride,Ut=Tt.offset;if(ft.isInstancedInterleavedBuffer){for(let zt=0;zt<G.locationSize;zt++)g(G.location+zt,ft.meshPerAttribute);M.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=ft.meshPerAttribute*ft.count)}else for(let zt=0;zt<G.locationSize;zt++)v(G.location+zt);n.bindBuffer(n.ARRAY_BUFFER,pt);for(let zt=0;zt<G.locationSize;zt++)P(G.location+zt,Mt/G.locationSize,Rt,lt,Dt*Y,(Ut+Mt/G.locationSize*zt)*Y,st)}else{if(Tt.isInstancedBufferAttribute){for(let ft=0;ft<G.locationSize;ft++)g(G.location+ft,Tt.meshPerAttribute);M.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=Tt.meshPerAttribute*Tt.count)}else for(let ft=0;ft<G.locationSize;ft++)v(G.location+ft);n.bindBuffer(n.ARRAY_BUFFER,pt);for(let ft=0;ft<G.locationSize;ft++)P(G.location+ft,Mt/G.locationSize,Rt,lt,Mt*Y,Mt/G.locationSize*ft*Y,st)}}else if(K!==void 0){const lt=K[ut];if(lt!==void 0)switch(lt.length){case 2:n.vertexAttrib2fv(G.location,lt);break;case 3:n.vertexAttrib3fv(G.location,lt);break;case 4:n.vertexAttrib4fv(G.location,lt);break;default:n.vertexAttrib1fv(G.location,lt)}}}}R()}function U(){z();for(const M in s){const k=s[M];for(const Z in k){const J=k[Z];for(const V in J)p(J[V].object),delete J[V];delete k[Z]}delete s[M]}}function B(M){if(s[M.id]===void 0)return;const k=s[M.id];for(const Z in k){const J=k[Z];for(const V in J)p(J[V].object),delete J[V];delete k[Z]}delete s[M.id]}function N(M){for(const k in s){const Z=s[k];if(Z[M.id]===void 0)continue;const J=Z[M.id];for(const V in J)p(J[V].object),delete J[V];delete Z[M.id]}}function z(){D(),l=!0,a!==r&&(a=r,d(a.object))}function D(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:z,resetDefaultState:D,dispose:U,releaseStatesOfGeometry:B,releaseStatesOfProgram:N,initAttributes:S,enableAttribute:v,disableUnusedAttributes:R}}function $E(n,t,e){let s;function r(d){s=d}function a(d,p){n.drawArrays(s,d,p),e.update(p,s,1)}function l(d,p,m){m!==0&&(n.drawArraysInstanced(s,d,p,m),e.update(p,s,m))}function h(d,p,m){if(m===0)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(s,d,0,p,0,m);let E=0;for(let w=0;w<m;w++)E+=p[w];e.update(E,s,1)}function u(d,p,m,_){if(m===0)return;const E=t.get("WEBGL_multi_draw");if(E===null)for(let w=0;w<d.length;w++)l(d[w],p[w],_[w]);else{E.multiDrawArraysInstancedWEBGL(s,d,0,p,0,_,0,m);let w=0;for(let S=0;S<m;S++)w+=p[S]*_[S];e.update(w,s,1)}}this.setMode=r,this.render=a,this.renderInstances=l,this.renderMultiDraw=h,this.renderMultiDrawInstances=u}function tx(n,t,e,s){let r;function a(){if(r!==void 0)return r;if(t.has("EXT_texture_filter_anisotropic")===!0){const N=t.get("EXT_texture_filter_anisotropic");r=n.getParameter(N.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function l(N){return!(N!==zn&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(N){const z=N===_r&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(N!==hi&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&N!==ui&&!z)}function u(N){if(N==="highp"){if(n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";N="mediump"}return N==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let d=e.precision!==void 0?e.precision:"highp";const p=u(d);p!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",p,"instead."),d=p);const m=e.logarithmicDepthBuffer===!0,_=e.reversedDepthBuffer===!0&&t.has("EXT_clip_control"),E=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),w=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),S=n.getParameter(n.MAX_TEXTURE_SIZE),v=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),g=n.getParameter(n.MAX_VERTEX_ATTRIBS),R=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),P=n.getParameter(n.MAX_VARYING_VECTORS),T=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=w>0,B=n.getParameter(n.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:u,textureFormatReadable:l,textureTypeReadable:h,precision:d,logarithmicDepthBuffer:m,reversedDepthBuffer:_,maxTextures:E,maxVertexTextures:w,maxTextureSize:S,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:R,maxVaryings:P,maxFragmentUniforms:T,vertexTextures:U,maxSamples:B}}function ex(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ls,h=new ue,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(m,_){const E=m.length!==0||_||s!==0||r;return r=_,s=m.length,E},this.beginShadows=function(){a=!0,p(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(m,_){e=p(m,_,0)},this.setState=function(m,_,E){const w=m.clippingPlanes,S=m.clipIntersection,v=m.clipShadows,g=n.get(m);if(!r||w===null||w.length===0||a&&!v)a?p(null):d();else{const R=a?0:s,P=R*4;let T=g.clippingState||null;u.value=T,T=p(w,_,P,E);for(let U=0;U!==P;++U)T[U]=e[U];g.clippingState=T,this.numIntersection=S?this.numPlanes:0,this.numPlanes+=R}};function d(){u.value!==e&&(u.value=e,u.needsUpdate=s>0),t.numPlanes=s,t.numIntersection=0}function p(m,_,E,w){const S=m!==null?m.length:0;let v=null;if(S!==0){if(v=u.value,w!==!0||v===null){const g=E+S*4,R=_.matrixWorldInverse;h.getNormalMatrix(R),(v===null||v.length<g)&&(v=new Float32Array(g));for(let P=0,T=E;P!==S;++P,T+=4)l.copy(m[P]).applyMatrix4(R,h),l.normal.toArray(v,T),v[T+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=S,t.numIntersection=0,v}}function nx(n){let t=new WeakMap;function e(l,h){return h===fl?l.mapping=Ts:h===pl&&(l.mapping=bs),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===fl||h===pl)if(t.has(l)){const u=t.get(l).texture;return e(u,l.mapping)}else{const u=l.image;if(u&&u.height>0){const d=new P0(u.height);return d.fromEquirectangularTexture(n,l),t.set(l,d),l.addEventListener("dispose",r),e(d.texture,l.mapping)}else return null}}return l}function r(l){const h=l.target;h.removeEventListener("dispose",r);const u=t.get(h);u!==void 0&&(t.delete(h),u.dispose())}function a(){t=new WeakMap}return{get:s,dispose:a}}const Qs=4,Ku=[.125,.215,.35,.446,.526,.582],us=20,Ac=new X0,$u=new Pe;let Cc=null,Pc=0,Rc=0,Lc=!1;const ds=(1+Math.sqrt(5))/2,js=1/ds,td=[new q(-ds,js,0),new q(ds,js,0),new q(-js,0,ds),new q(js,0,ds),new q(0,ds,-js),new q(0,ds,js),new q(-1,1,-1),new q(1,1,-1),new q(-1,1,1),new q(1,1,1)],ix=new q;class ed{constructor(t){this._renderer=t,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(t,e=0,s=.1,r=100,a={}){const{size:l=256,position:h=ix}=a;Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const u=this._allocateTargets();return u.depthBuffer=!0,this._sceneToCubeUV(t,s,r,u,h),e>0&&this._blur(u,0,0,e),this._applyPMREM(u),this._cleanup(u),u}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=sd(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=id(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Cc,Pc,Rc),this._renderer.xr.enabled=Lc,t.scissorTest=!1,jo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===Ts||t.mapping===bs?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Cc=this._renderer.getRenderTarget(),Pc=this._renderer.getActiveCubeFace(),Rc=this._renderer.getActiveMipmapLevel(),Lc=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const s=e||this._allocateTargets();return this._textureToCubeUV(t,s),this._applyPMREM(s),this._cleanup(s),s}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,s={magFilter:En,minFilter:En,generateMipmaps:!1,type:_r,format:zn,colorSpace:is,depthBuffer:!1},r=nd(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=nd(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=sx(a)),this._blurMaterial=rx(a,t,e)}return r}_compileMaterial(t){const e=new pn(this._lodPlanes[0],t);this._renderer.compile(e,Ac)}_sceneToCubeUV(t,e,s,r,a){const u=new In(90,1,e,s),d=[1,-1,1,1,1,1],p=[1,1,1,-1,-1,-1],m=this._renderer,_=m.autoClear,E=m.toneMapping;m.getClearColor($u),m.toneMapping=Pi,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const S=new Bi({name:"PMREM.Background",side:fn,depthWrite:!1,depthTest:!1}),v=new pn(new Rr,S);let g=!1;const R=t.background;R?R.isColor&&(S.color.copy(R),t.background=null,g=!0):(S.color.copy($u),g=!0);for(let P=0;P<6;P++){const T=P%3;T===0?(u.up.set(0,d[P],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x+p[P],a.y,a.z)):T===1?(u.up.set(0,0,d[P]),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y+p[P],a.z)):(u.up.set(0,d[P],0),u.position.set(a.x,a.y,a.z),u.lookAt(a.x,a.y,a.z+p[P]));const U=this._cubeSize;jo(r,T*U,P>2?U:0,U,U),m.setRenderTarget(r),g&&m.render(v,u),m.render(t,u)}v.geometry.dispose(),v.material.dispose(),m.toneMapping=E,m.autoClear=_,t.background=R}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===Ts||t.mapping===bs;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=sd()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=id());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new pn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;jo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,Ac)}_applyPMREM(t){const e=this._renderer,s=e.autoClear;e.autoClear=!1;const r=this._lodPlanes.length;for(let a=1;a<r;a++){const l=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),h=td[(r-a-1)%td.length];this._blur(t,a-1,a,l,h)}e.autoClear=s}_blur(t,e,s,r,a){const l=this._pingPongRenderTarget;this._halfBlur(t,l,e,s,r,"latitudinal",a),this._halfBlur(l,t,s,s,r,"longitudinal",a)}_halfBlur(t,e,s,r,a,l,h){const u=this._renderer,d=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const p=3,m=new pn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,w=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*us-1),S=a/w,v=isFinite(a)?1+Math.floor(p*S):us;v>us&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${us}`);const g=[];let R=0;for(let N=0;N<us;++N){const z=N/S,D=Math.exp(-z*z/2);g.push(D),N===0?R+=D:N<v&&(R+=2*D)}for(let N=0;N<g.length;N++)g[N]=g[N]/R;_.envMap.value=t.texture,_.samples.value=v,_.weights.value=g,_.latitudinal.value=l==="latitudinal",h&&(_.poleAxis.value=h);const{_lodMax:P}=this;_.dTheta.value=w,_.mipInt.value=P-s;const T=this._sizeLods[r],U=3*T*(r>P-Qs?r-P+Qs:0),B=4*(this._cubeSize-T);jo(e,U,B,3*T,2*T),u.setRenderTarget(e),u.render(m,Ac)}}function sx(n){const t=[],e=[],s=[];let r=n;const a=n-Qs+1+Ku.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-Qs?u=Ku[l-n+Qs-1]:l===0&&(u=0),s.push(u);const d=1/(h-2),p=-d,m=1+d,_=[p,p,m,p,m,m,p,p,m,m,p,m],E=6,w=6,S=3,v=2,g=1,R=new Float32Array(S*w*E),P=new Float32Array(v*w*E),T=new Float32Array(g*w*E);for(let B=0;B<E;B++){const N=B%3*2/3-1,z=B>2?0:-1,D=[N,z,0,N+2/3,z,0,N+2/3,z+1,0,N,z,0,N+2/3,z+1,0,N,z+1,0];R.set(D,S*w*B),P.set(_,v*w*B);const M=[B,B,B,B,B,B];T.set(M,g*w*B)}const U=new $n;U.setAttribute("position",new Kn(R,S)),U.setAttribute("uv",new Kn(P,v)),U.setAttribute("faceIndex",new Kn(T,g)),t.push(U),r>Qs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function nd(n,t,e){const s=new Ii(n,t,e);return s.texture.mapping=vo,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function jo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function rx(n,t,e){const s=new Float32Array(us),r=new q(0,1,0);return new vi({name:"SphericalGaussianBlur",defines:{n:us,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:s},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Ic(),fragmentShader:`
3597
3597
 
3598
3598
  precision mediump float;
3599
3599
  precision mediump int;
@@ -3743,14 +3743,14 @@ void main() {
3743
3743
  gl_Position = vec4( position, 1.0 );
3744
3744
 
3745
3745
  }
3746
- `}function ox(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===fl||u===pl,p=u===Ts||u===bs;if(d||p){let m=t.get(h);const _=m!==void 0?m.texture.pmremVersion:0;if(h.isRenderTargetTexture&&h.pmremVersion!==_)return e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h,m):e.fromCubemap(h,m),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),m.texture;if(m!==void 0)return m.texture;{const E=h.image;return d&&E&&E.height>0||p&&E&&r(E)?(e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h):e.fromCubemap(h),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),h.addEventListener("dispose",a),m.texture):null}}}return h}function r(h){let u=0;const d=6;for(let p=0;p<d;p++)h[p]!==void 0&&u++;return u===d}function a(h){const u=h.target;u.removeEventListener("dispose",a);const d=t.get(u);d!==void 0&&(t.delete(u),d.dispose())}function l(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:s,dispose:l}}function ax(n){const t={};function e(s){if(t[s]!==void 0)return t[s];let r;switch(s){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(s)}return t[s]=r,r}return{has:function(s){return e(s)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(s){const r=e(s);return r===null&&Ls("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function lx(n,t,e,s){const r={},a=new WeakMap;function l(m){const _=m.target;_.index!==null&&t.remove(_.index);for(const S in _.attributes)t.remove(_.attributes[S]);_.removeEventListener("dispose",l),delete r[_.id];const E=a.get(_);E&&(t.remove(E),a.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,e.memory.geometries--}function h(m,_){return r[_.id]===!0||(_.addEventListener("dispose",l),r[_.id]=!0,e.memory.geometries++),_}function u(m){const _=m.attributes;for(const E in _)t.update(_[E],n.ARRAY_BUFFER)}function d(m){const _=[],E=m.index,S=m.attributes.position;let w=0;if(E!==null){const I=E.array;w=E.version;for(let C=0,T=I.length;C<T;C+=3){const U=I[C+0],N=I[C+1],B=I[C+2];_.push(U,N,N,B,B,U)}}else if(S!==void 0){const I=S.array;w=S.version;for(let C=0,T=I.length/3-1;C<T;C+=3){const U=C+0,N=C+1,B=C+2;_.push(U,N,N,B,B,U)}}else return;const v=new(vu(_)?Du:Iu)(_,1);v.version=w;const g=a.get(m);g&&t.remove(g),a.set(m,v)}function p(m){const _=a.get(m);if(_){const E=m.index;E!==null&&_.version<E.version&&d(m)}else d(m);return a.get(m)}return{get:h,update:u,getWireframeAttribute:p}}function cx(n,t,e){let s;function r(_){s=_}let a,l;function h(_){a=_.type,l=_.bytesPerElement}function u(_,E){n.drawElements(s,E,a,_*l),e.update(E,s,1)}function d(_,E,S){S!==0&&(n.drawElementsInstanced(s,E,a,_*l,S),e.update(E,s,S))}function p(_,E,S){if(S===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,E,0,a,_,0,S);let v=0;for(let g=0;g<S;g++)v+=E[g];e.update(v,s,1)}function m(_,E,S,w){if(S===0)return;const v=t.get("WEBGL_multi_draw");if(v===null)for(let g=0;g<_.length;g++)d(_[g]/l,E[g],w[g]);else{v.multiDrawElementsInstancedWEBGL(s,E,0,a,_,0,w,0,S);let g=0;for(let I=0;I<S;I++)g+=E[I]*w[I];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function hx(n){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function s(a,l,h){switch(e.calls++,l){case n.TRIANGLES:e.triangles+=h*(a/3);break;case n.LINES:e.lines+=h*(a/2);break;case n.LINE_STRIP:e.lines+=h*(a-1);break;case n.LINE_LOOP:e.lines+=h*a;break;case n.POINTS:e.points+=h*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:r,update:s}}function ux(n,t,e){const s=new WeakMap,r=new ze;function a(l,h,u){const d=l.morphTargetInfluences,p=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,m=p!==void 0?p.length:0;let _=s.get(h);if(_===void 0||_.count!==m){let D=function(){B.dispose(),s.delete(h),h.removeEventListener("dispose",D)};_!==void 0&&_.texture.dispose();const E=h.morphAttributes.position!==void 0,S=h.morphAttributes.normal!==void 0,w=h.morphAttributes.color!==void 0,v=h.morphAttributes.position||[],g=h.morphAttributes.normal||[],I=h.morphAttributes.color||[];let C=0;E===!0&&(C=1),S===!0&&(C=2),w===!0&&(C=3);let T=h.attributes.position.count*C,U=1;T>t.maxTextureSize&&(U=Math.ceil(T/t.maxTextureSize),T=t.maxTextureSize);const N=new Float32Array(T*U*4*m),B=new wu(N,T,U,m);B.type=ui,B.needsUpdate=!0;const z=C*4;for(let M=0;M<m;M++){const k=v[M],Z=g[M],J=I[M],V=T*U*4*M;for(let $=0;$<k.count;$++){const K=$*z;E===!0&&(r.fromBufferAttribute(k,$),N[V+K+0]=r.x,N[V+K+1]=r.y,N[V+K+2]=r.z,N[V+K+3]=0),S===!0&&(r.fromBufferAttribute(Z,$),N[V+K+4]=r.x,N[V+K+5]=r.y,N[V+K+6]=r.z,N[V+K+7]=0),w===!0&&(r.fromBufferAttribute(J,$),N[V+K+8]=r.x,N[V+K+9]=r.y,N[V+K+10]=r.z,N[V+K+11]=J.itemSize===4?r.w:1)}}_={count:m,texture:B,size:new be(T,U)},s.set(h,_),h.addEventListener("dispose",D)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)u.getUniforms().setValue(n,"morphTexture",l.morphTexture,e);else{let E=0;for(let w=0;w<d.length;w++)E+=d[w];const S=h.morphTargetsRelative?1:1-E;u.getUniforms().setValue(n,"morphTargetBaseInfluence",S),u.getUniforms().setValue(n,"morphTargetInfluences",d)}u.getUniforms().setValue(n,"morphTargetsTexture",_.texture,e),u.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}return{update:a}}function dx(n,t,e,s){let r=new WeakMap;function a(u){const d=s.render.frame,p=u.geometry,m=t.get(u,p);if(r.get(m)!==d&&(t.update(m),r.set(m,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",h)===!1&&u.addEventListener("dispose",h),r.get(u)!==d&&(e.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&e.update(u.instanceColor,n.ARRAY_BUFFER),r.set(u,d))),u.isSkinnedMesh){const _=u.skeleton;r.get(_)!==d&&(_.update(),r.set(_,d))}return m}function l(){r=new WeakMap}function h(u){const d=u.target;d.removeEventListener("dispose",h),e.remove(d.instanceMatrix),d.instanceColor!==null&&e.remove(d.instanceColor)}return{update:a,dispose:l}}const rd=new Je,od=new Xu(1,1),ad=new wu,ld=new d0,cd=new Hu,hd=[],ud=[],dd=new Float32Array(16),fd=new Float32Array(9),pd=new Float32Array(4);function Js(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=hd[r];if(a===void 0&&(a=new Float32Array(r),hd[r]=a),t!==0){s.toArray(a,0);for(let l=1,h=0;l!==t;++l)h+=e,n[l].toArray(a,h)}return a}function Ze(n,t){if(n.length!==t.length)return!1;for(let e=0,s=n.length;e<s;e++)if(n[e]!==t[e])return!1;return!0}function Xe(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Jo(n,t){let e=ud[t];e===void 0&&(e=new Int32Array(t),ud[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function fx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function px(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2fv(this.addr,t),Xe(e,t)}}function mx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(n.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Ze(e,t))return;n.uniform3fv(this.addr,t),Xe(e,t)}}function gx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4fv(this.addr,t),Xe(e,t)}}function _x(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;pd.set(s),n.uniformMatrix2fv(this.addr,!1,pd),Xe(e,s)}}function vx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;fd.set(s),n.uniformMatrix3fv(this.addr,!1,fd),Xe(e,s)}}function yx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;dd.set(s),n.uniformMatrix4fv(this.addr,!1,dd),Xe(e,s)}}function Ex(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function xx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2iv(this.addr,t),Xe(e,t)}}function wx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3iv(this.addr,t),Xe(e,t)}}function Sx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4iv(this.addr,t),Xe(e,t)}}function Mx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function Tx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2uiv(this.addr,t),Xe(e,t)}}function bx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3uiv(this.addr,t),Xe(e,t)}}function Ax(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4uiv(this.addr,t),Xe(e,t)}}function Cx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r);let a;this.type===n.SAMPLER_2D_SHADOW?(od.compareFunction=fu,a=od):a=rd,e.setTexture2D(t||a,r)}function Px(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||ld,r)}function Rx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||cd,r)}function Lx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||ad,r)}function Ix(n){switch(n){case 5126:return fx;case 35664:return px;case 35665:return mx;case 35666:return gx;case 35674:return _x;case 35675:return vx;case 35676:return yx;case 5124:case 35670:return Ex;case 35667:case 35671:return xx;case 35668:case 35672:return wx;case 35669:case 35673:return Sx;case 5125:return Mx;case 36294:return Tx;case 36295:return bx;case 36296:return Ax;case 35678:case 36198:case 36298:case 36306:case 35682:return Cx;case 35679:case 36299:case 36307:return Px;case 35680:case 36300:case 36308:case 36293:return Rx;case 36289:case 36303:case 36311:case 36292:return Lx}}function Dx(n,t){n.uniform1fv(this.addr,t)}function kx(n,t){const e=Js(t,this.size,2);n.uniform2fv(this.addr,e)}function Ux(n,t){const e=Js(t,this.size,3);n.uniform3fv(this.addr,e)}function Ox(n,t){const e=Js(t,this.size,4);n.uniform4fv(this.addr,e)}function Nx(n,t){const e=Js(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function Bx(n,t){const e=Js(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function Fx(n,t){const e=Js(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function zx(n,t){n.uniform1iv(this.addr,t)}function Hx(n,t){n.uniform2iv(this.addr,t)}function Vx(n,t){n.uniform3iv(this.addr,t)}function Gx(n,t){n.uniform4iv(this.addr,t)}function Wx(n,t){n.uniform1uiv(this.addr,t)}function Zx(n,t){n.uniform2uiv(this.addr,t)}function Xx(n,t){n.uniform3uiv(this.addr,t)}function Yx(n,t){n.uniform4uiv(this.addr,t)}function qx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||rd,a[l])}function Qx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||ld,a[l])}function jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||cd,a[l])}function Jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||ad,a[l])}function Kx(n){switch(n){case 5126:return Dx;case 35664:return kx;case 35665:return Ux;case 35666:return Ox;case 35674:return Nx;case 35675:return Bx;case 35676:return Fx;case 5124:case 35670:return zx;case 35667:case 35671:return Hx;case 35668:case 35672:return Vx;case 35669:case 35673:return Gx;case 5125:return Wx;case 36294:return Zx;case 36295:return Xx;case 36296:return Yx;case 35678:case 36198:case 36298:case 36306:case 35682:return qx;case 35679:case 36299:case 36307:return Qx;case 35680:case 36300:case 36308:case 36293:return jx;case 36289:case 36303:case 36311:case 36292:return Jx}}class $x{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=Ix(e.type)}}class tw{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=Kx(e.type)}}class ew{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,s){const r=this.seq;for(let a=0,l=r.length;a!==l;++a){const h=r[a];h.setValue(t,e[h.id],s)}}}const Dc=/(\w+)(\])?(\[|\.)?/g;function md(n,t){n.seq.push(t),n.map[t.id]=t}function nw(n,t,e){const s=n.name,r=s.length;for(Dc.lastIndex=0;;){const a=Dc.exec(s),l=Dc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){md(e,d===void 0?new $x(h,n,t):new tw(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new ew(h),md(e,m)),e=m}}}class Ko{constructor(t,e){this.seq=[],this.map={};const s=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<s;++r){const a=t.getActiveUniform(e,r),l=t.getUniformLocation(e,a.name);nw(a,l,this)}}setValue(t,e,s,r){const a=this.map[e];a!==void 0&&a.setValue(t,s,r)}setOptional(t,e,s){const r=e[s];r!==void 0&&this.setValue(t,s,r)}static upload(t,e,s,r){for(let a=0,l=e.length;a!==l;++a){const h=e[a],u=s[h.id];u.needsUpdate!==!1&&h.setValue(t,u.value,r)}}static seqWithValue(t,e){const s=[];for(let r=0,a=t.length;r!==a;++r){const l=t[r];l.id in e&&s.push(l)}return s}}function gd(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const iw=37297;let sw=0;function rw(n,t){const e=n.split(`
3746
+ `}function ox(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===fl||u===pl,p=u===Ts||u===bs;if(d||p){let m=t.get(h);const _=m!==void 0?m.texture.pmremVersion:0;if(h.isRenderTargetTexture&&h.pmremVersion!==_)return e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h,m):e.fromCubemap(h,m),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),m.texture;if(m!==void 0)return m.texture;{const E=h.image;return d&&E&&E.height>0||p&&E&&r(E)?(e===null&&(e=new ed(n)),m=d?e.fromEquirectangular(h):e.fromCubemap(h),m.texture.pmremVersion=h.pmremVersion,t.set(h,m),h.addEventListener("dispose",a),m.texture):null}}}return h}function r(h){let u=0;const d=6;for(let p=0;p<d;p++)h[p]!==void 0&&u++;return u===d}function a(h){const u=h.target;u.removeEventListener("dispose",a);const d=t.get(u);d!==void 0&&(t.delete(u),d.dispose())}function l(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:s,dispose:l}}function ax(n){const t={};function e(s){if(t[s]!==void 0)return t[s];let r;switch(s){case"WEBGL_depth_texture":r=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=n.getExtension(s)}return t[s]=r,r}return{has:function(s){return e(s)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(s){const r=e(s);return r===null&&Ls("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function lx(n,t,e,s){const r={},a=new WeakMap;function l(m){const _=m.target;_.index!==null&&t.remove(_.index);for(const w in _.attributes)t.remove(_.attributes[w]);_.removeEventListener("dispose",l),delete r[_.id];const E=a.get(_);E&&(t.remove(E),a.delete(_)),s.releaseStatesOfGeometry(_),_.isInstancedBufferGeometry===!0&&delete _._maxInstanceCount,e.memory.geometries--}function h(m,_){return r[_.id]===!0||(_.addEventListener("dispose",l),r[_.id]=!0,e.memory.geometries++),_}function u(m){const _=m.attributes;for(const E in _)t.update(_[E],n.ARRAY_BUFFER)}function d(m){const _=[],E=m.index,w=m.attributes.position;let S=0;if(E!==null){const R=E.array;S=E.version;for(let P=0,T=R.length;P<T;P+=3){const U=R[P+0],B=R[P+1],N=R[P+2];_.push(U,B,B,N,N,U)}}else if(w!==void 0){const R=w.array;S=w.version;for(let P=0,T=R.length/3-1;P<T;P+=3){const U=P+0,B=P+1,N=P+2;_.push(U,B,B,N,N,U)}}else return;const v=new(vu(_)?Du:Iu)(_,1);v.version=S;const g=a.get(m);g&&t.remove(g),a.set(m,v)}function p(m){const _=a.get(m);if(_){const E=m.index;E!==null&&_.version<E.version&&d(m)}else d(m);return a.get(m)}return{get:h,update:u,getWireframeAttribute:p}}function cx(n,t,e){let s;function r(_){s=_}let a,l;function h(_){a=_.type,l=_.bytesPerElement}function u(_,E){n.drawElements(s,E,a,_*l),e.update(E,s,1)}function d(_,E,w){w!==0&&(n.drawElementsInstanced(s,E,a,_*l,w),e.update(E,s,w))}function p(_,E,w){if(w===0)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(s,E,0,a,_,0,w);let v=0;for(let g=0;g<w;g++)v+=E[g];e.update(v,s,1)}function m(_,E,w,S){if(w===0)return;const v=t.get("WEBGL_multi_draw");if(v===null)for(let g=0;g<_.length;g++)d(_[g]/l,E[g],S[g]);else{v.multiDrawElementsInstancedWEBGL(s,E,0,a,_,0,S,0,w);let g=0;for(let R=0;R<w;R++)g+=E[R]*S[R];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function hx(n){const t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function s(a,l,h){switch(e.calls++,l){case n.TRIANGLES:e.triangles+=h*(a/3);break;case n.LINES:e.lines+=h*(a/2);break;case n.LINE_STRIP:e.lines+=h*(a-1);break;case n.LINE_LOOP:e.lines+=h*a;break;case n.POINTS:e.points+=h*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function r(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:r,update:s}}function ux(n,t,e){const s=new WeakMap,r=new He;function a(l,h,u){const d=l.morphTargetInfluences,p=h.morphAttributes.position||h.morphAttributes.normal||h.morphAttributes.color,m=p!==void 0?p.length:0;let _=s.get(h);if(_===void 0||_.count!==m){let D=function(){N.dispose(),s.delete(h),h.removeEventListener("dispose",D)};_!==void 0&&_.texture.dispose();const E=h.morphAttributes.position!==void 0,w=h.morphAttributes.normal!==void 0,S=h.morphAttributes.color!==void 0,v=h.morphAttributes.position||[],g=h.morphAttributes.normal||[],R=h.morphAttributes.color||[];let P=0;E===!0&&(P=1),w===!0&&(P=2),S===!0&&(P=3);let T=h.attributes.position.count*P,U=1;T>t.maxTextureSize&&(U=Math.ceil(T/t.maxTextureSize),T=t.maxTextureSize);const B=new Float32Array(T*U*4*m),N=new wu(B,T,U,m);N.type=ui,N.needsUpdate=!0;const z=P*4;for(let M=0;M<m;M++){const k=v[M],Z=g[M],J=R[M],V=T*U*4*M;for(let $=0;$<k.count;$++){const K=$*z;E===!0&&(r.fromBufferAttribute(k,$),B[V+K+0]=r.x,B[V+K+1]=r.y,B[V+K+2]=r.z,B[V+K+3]=0),w===!0&&(r.fromBufferAttribute(Z,$),B[V+K+4]=r.x,B[V+K+5]=r.y,B[V+K+6]=r.z,B[V+K+7]=0),S===!0&&(r.fromBufferAttribute(J,$),B[V+K+8]=r.x,B[V+K+9]=r.y,B[V+K+10]=r.z,B[V+K+11]=J.itemSize===4?r.w:1)}}_={count:m,texture:N,size:new Ae(T,U)},s.set(h,_),h.addEventListener("dispose",D)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)u.getUniforms().setValue(n,"morphTexture",l.morphTexture,e);else{let E=0;for(let S=0;S<d.length;S++)E+=d[S];const w=h.morphTargetsRelative?1:1-E;u.getUniforms().setValue(n,"morphTargetBaseInfluence",w),u.getUniforms().setValue(n,"morphTargetInfluences",d)}u.getUniforms().setValue(n,"morphTargetsTexture",_.texture,e),u.getUniforms().setValue(n,"morphTargetsTextureSize",_.size)}return{update:a}}function dx(n,t,e,s){let r=new WeakMap;function a(u){const d=s.render.frame,p=u.geometry,m=t.get(u,p);if(r.get(m)!==d&&(t.update(m),r.set(m,d)),u.isInstancedMesh&&(u.hasEventListener("dispose",h)===!1&&u.addEventListener("dispose",h),r.get(u)!==d&&(e.update(u.instanceMatrix,n.ARRAY_BUFFER),u.instanceColor!==null&&e.update(u.instanceColor,n.ARRAY_BUFFER),r.set(u,d))),u.isSkinnedMesh){const _=u.skeleton;r.get(_)!==d&&(_.update(),r.set(_,d))}return m}function l(){r=new WeakMap}function h(u){const d=u.target;d.removeEventListener("dispose",h),e.remove(d.instanceMatrix),d.instanceColor!==null&&e.remove(d.instanceColor)}return{update:a,dispose:l}}const rd=new Je,od=new Xu(1,1),ad=new wu,ld=new d0,cd=new Hu,hd=[],ud=[],dd=new Float32Array(16),fd=new Float32Array(9),pd=new Float32Array(4);function Js(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=hd[r];if(a===void 0&&(a=new Float32Array(r),hd[r]=a),t!==0){s.toArray(a,0);for(let l=1,h=0;l!==t;++l)h+=e,n[l].toArray(a,h)}return a}function Ze(n,t){if(n.length!==t.length)return!1;for(let e=0,s=n.length;e<s;e++)if(n[e]!==t[e])return!1;return!0}function Xe(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Jo(n,t){let e=ud[t];e===void 0&&(e=new Int32Array(t),ud[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function fx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function px(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2fv(this.addr,t),Xe(e,t)}}function mx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(n.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(Ze(e,t))return;n.uniform3fv(this.addr,t),Xe(e,t)}}function gx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4fv(this.addr,t),Xe(e,t)}}function _x(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;pd.set(s),n.uniformMatrix2fv(this.addr,!1,pd),Xe(e,s)}}function vx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;fd.set(s),n.uniformMatrix3fv(this.addr,!1,fd),Xe(e,s)}}function yx(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ze(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),Xe(e,t)}else{if(Ze(e,s))return;dd.set(s),n.uniformMatrix4fv(this.addr,!1,dd),Xe(e,s)}}function Ex(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function xx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2iv(this.addr,t),Xe(e,t)}}function wx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3iv(this.addr,t),Xe(e,t)}}function Sx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4iv(this.addr,t),Xe(e,t)}}function Mx(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function Tx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(n.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(Ze(e,t))return;n.uniform2uiv(this.addr,t),Xe(e,t)}}function bx(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(n.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(Ze(e,t))return;n.uniform3uiv(this.addr,t),Xe(e,t)}}function Ax(n,t){const e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(n.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(Ze(e,t))return;n.uniform4uiv(this.addr,t),Xe(e,t)}}function Cx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r);let a;this.type===n.SAMPLER_2D_SHADOW?(od.compareFunction=fu,a=od):a=rd,e.setTexture2D(t||a,r)}function Px(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||ld,r)}function Rx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||cd,r)}function Lx(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||ad,r)}function Ix(n){switch(n){case 5126:return fx;case 35664:return px;case 35665:return mx;case 35666:return gx;case 35674:return _x;case 35675:return vx;case 35676:return yx;case 5124:case 35670:return Ex;case 35667:case 35671:return xx;case 35668:case 35672:return wx;case 35669:case 35673:return Sx;case 5125:return Mx;case 36294:return Tx;case 36295:return bx;case 36296:return Ax;case 35678:case 36198:case 36298:case 36306:case 35682:return Cx;case 35679:case 36299:case 36307:return Px;case 35680:case 36300:case 36308:case 36293:return Rx;case 36289:case 36303:case 36311:case 36292:return Lx}}function Dx(n,t){n.uniform1fv(this.addr,t)}function kx(n,t){const e=Js(t,this.size,2);n.uniform2fv(this.addr,e)}function Ux(n,t){const e=Js(t,this.size,3);n.uniform3fv(this.addr,e)}function Ox(n,t){const e=Js(t,this.size,4);n.uniform4fv(this.addr,e)}function Nx(n,t){const e=Js(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function Bx(n,t){const e=Js(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function Fx(n,t){const e=Js(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function zx(n,t){n.uniform1iv(this.addr,t)}function Hx(n,t){n.uniform2iv(this.addr,t)}function Vx(n,t){n.uniform3iv(this.addr,t)}function Gx(n,t){n.uniform4iv(this.addr,t)}function Wx(n,t){n.uniform1uiv(this.addr,t)}function Zx(n,t){n.uniform2uiv(this.addr,t)}function Xx(n,t){n.uniform3uiv(this.addr,t)}function Yx(n,t){n.uniform4uiv(this.addr,t)}function qx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||rd,a[l])}function Qx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||ld,a[l])}function jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||cd,a[l])}function Jx(n,t,e){const s=this.cache,r=t.length,a=Jo(e,r);Ze(s,a)||(n.uniform1iv(this.addr,a),Xe(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||ad,a[l])}function Kx(n){switch(n){case 5126:return Dx;case 35664:return kx;case 35665:return Ux;case 35666:return Ox;case 35674:return Nx;case 35675:return Bx;case 35676:return Fx;case 5124:case 35670:return zx;case 35667:case 35671:return Hx;case 35668:case 35672:return Vx;case 35669:case 35673:return Gx;case 5125:return Wx;case 36294:return Zx;case 36295:return Xx;case 36296:return Yx;case 35678:case 36198:case 36298:case 36306:case 35682:return qx;case 35679:case 36299:case 36307:return Qx;case 35680:case 36300:case 36308:case 36293:return jx;case 36289:case 36303:case 36311:case 36292:return Jx}}class $x{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=Ix(e.type)}}class tw{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=Kx(e.type)}}class ew{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,s){const r=this.seq;for(let a=0,l=r.length;a!==l;++a){const h=r[a];h.setValue(t,e[h.id],s)}}}const Dc=/(\w+)(\])?(\[|\.)?/g;function md(n,t){n.seq.push(t),n.map[t.id]=t}function nw(n,t,e){const s=n.name,r=s.length;for(Dc.lastIndex=0;;){const a=Dc.exec(s),l=Dc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){md(e,d===void 0?new $x(h,n,t):new tw(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new ew(h),md(e,m)),e=m}}}class Ko{constructor(t,e){this.seq=[],this.map={};const s=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<s;++r){const a=t.getActiveUniform(e,r),l=t.getUniformLocation(e,a.name);nw(a,l,this)}}setValue(t,e,s,r){const a=this.map[e];a!==void 0&&a.setValue(t,s,r)}setOptional(t,e,s){const r=e[s];r!==void 0&&this.setValue(t,s,r)}static upload(t,e,s,r){for(let a=0,l=e.length;a!==l;++a){const h=e[a],u=s[h.id];u.needsUpdate!==!1&&h.setValue(t,u.value,r)}}static seqWithValue(t,e){const s=[];for(let r=0,a=t.length;r!==a;++r){const l=t[r];l.id in e&&s.push(l)}return s}}function gd(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const iw=37297;let sw=0;function rw(n,t){const e=n.split(`
3747
3747
  `),s=[],r=Math.max(t-6,0),a=Math.min(t+6,e.length);for(let l=r;l<a;l++){const h=l+1;s.push(`${h===t?">":" "} ${h}: ${e[l]}`)}return s.join(`
3748
- `)}const _d=new ue;function ow(n){Se._getMatrix(_d,Se.workingColorSpace,n);const t=`mat3( ${_d.elements.map(e=>e.toFixed(4))} )`;switch(Se.getTransfer(n)){case To:return[t,"LinearTransferOETF"];case Ie:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function vd(n,t,e){const s=n.getShaderParameter(t,n.COMPILE_STATUS),a=(n.getShaderInfoLog(t)||"").trim();if(s&&a==="")return"";const l=/ERROR: 0:(\d+)/.exec(a);if(l){const h=parseInt(l[1]);return e.toUpperCase()+`
3748
+ `)}const _d=new ue;function ow(n){Me._getMatrix(_d,Me.workingColorSpace,n);const t=`mat3( ${_d.elements.map(e=>e.toFixed(4))} )`;switch(Me.getTransfer(n)){case To:return[t,"LinearTransferOETF"];case Ie:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function vd(n,t,e){const s=n.getShaderParameter(t,n.COMPILE_STATUS),a=(n.getShaderInfoLog(t)||"").trim();if(s&&a==="")return"";const l=/ERROR: 0:(\d+)/.exec(a);if(l){const h=parseInt(l[1]);return e.toUpperCase()+`
3749
3749
 
3750
3750
  `+a+`
3751
3751
 
3752
3752
  `+rw(n.getShaderSource(t),h)}else return a}function aw(n,t){const e=ow(t);return[`vec4 ${n}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(`
3753
- `)}function lw(n,t){let e;switch(t){case nu:e="Linear";break;case Tv:e="Reinhard";break;case bv:e="Cineon";break;case Av:e="ACESFilmic";break;case Pv:e="AgX";break;case Rv:e="Neutral";break;case Cv:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const $o=new q;function cw(){Se.getLuminanceCoefficients($o);const n=$o.x.toFixed(4),t=$o.y.toFixed(4),e=$o.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
3753
+ `)}function lw(n,t){let e;switch(t){case nu:e="Linear";break;case Tv:e="Reinhard";break;case bv:e="Cineon";break;case Av:e="ACESFilmic";break;case Pv:e="AgX";break;case Rv:e="Neutral";break;case Cv:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const $o=new q;function cw(){Me.getLuminanceCoefficients($o);const n=$o.x.toFixed(4),t=$o.y.toFixed(4),e=$o.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
3754
3754
  `)}function hw(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Dr).join(`
3755
3755
  `)}function uw(n){const t=[];for(const e in n){const s=n[e];s!==!1&&t.push("#define "+e+" "+s)}return t.join(`
3756
3756
  `)}function dw(n,t){const e={},s=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES);for(let r=0;r<s;r++){const a=n.getActiveAttrib(t,r),l=a.name;let h=1;a.type===n.FLOAT_MAT2&&(h=2),a.type===n.FLOAT_MAT3&&(h=3),a.type===n.FLOAT_MAT4&&(h=4),e[l]={type:a.type,location:n.getAttribLocation(t,l),locationSize:h}}return e}function Dr(n){return n!==""}function yd(n,t){const e=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return n.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,e).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 Ed(n,t){return n.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const fw=/^[ \t]*#include +<([\w\d./]+)>/gm;function kc(n){return n.replace(fw,mw)}const pw=new Map;function mw(n,t){let e=de[t];if(e===void 0){const s=pw.get(t);if(s!==void 0)e=de[s],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,s);else throw new Error("Can not resolve #include <"+t+">")}return kc(e)}const gw=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function xd(n){return n.replace(gw,_w)}function _w(n,t,e,s){let r="";for(let a=parseInt(t);a<parseInt(e);a++)r+=s.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function wd(n){let t=`precision ${n.precision} float;
@@ -3773,28 +3773,28 @@ void main() {
3773
3773
  `;return n.precision==="highp"?t+=`
3774
3774
  #define HIGH_PRECISION`:n.precision==="mediump"?t+=`
3775
3775
  #define MEDIUM_PRECISION`:n.precision==="lowp"&&(t+=`
3776
- #define LOW_PRECISION`),t}function vw(n){let t="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Jh?t="SHADOWMAP_TYPE_PCF":n.shadowMapType===sv?t="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===li&&(t="SHADOWMAP_TYPE_VSM"),t}function yw(n){let t="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Ts:case bs:t="ENVMAP_TYPE_CUBE";break;case vo:t="ENVMAP_TYPE_CUBE_UV";break}return t}function Ew(n){let t="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case bs:t="ENVMAP_MODE_REFRACTION";break}return t}function xw(n){let t="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case eu:t="ENVMAP_BLENDING_MULTIPLY";break;case Sv:t="ENVMAP_BLENDING_MIX";break;case Mv:t="ENVMAP_BLENDING_ADD";break}return t}function ww(n){const t=n.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,s=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:s,maxMip:e}}function Sw(n,t,e,s){const r=n.getContext(),a=e.defines;let l=e.vertexShader,h=e.fragmentShader;const u=vw(e),d=yw(e),p=Ew(e),m=xw(e),_=ww(e),E=hw(e),S=uw(a),w=r.createProgram();let v,g,I=e.glslVersion?"#version "+e.glslVersion+`
3777
- `:"";e.isRawShaderMaterial?(v=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S].filter(Dr).join(`
3776
+ #define LOW_PRECISION`),t}function vw(n){let t="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Jh?t="SHADOWMAP_TYPE_PCF":n.shadowMapType===sv?t="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===li&&(t="SHADOWMAP_TYPE_VSM"),t}function yw(n){let t="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case Ts:case bs:t="ENVMAP_TYPE_CUBE";break;case vo:t="ENVMAP_TYPE_CUBE_UV";break}return t}function Ew(n){let t="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case bs:t="ENVMAP_MODE_REFRACTION";break}return t}function xw(n){let t="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case eu:t="ENVMAP_BLENDING_MULTIPLY";break;case Sv:t="ENVMAP_BLENDING_MIX";break;case Mv:t="ENVMAP_BLENDING_ADD";break}return t}function ww(n){const t=n.envMapCubeUVHeight;if(t===null)return null;const e=Math.log2(t)-2,s=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),112)),texelHeight:s,maxMip:e}}function Sw(n,t,e,s){const r=n.getContext(),a=e.defines;let l=e.vertexShader,h=e.fragmentShader;const u=vw(e),d=yw(e),p=Ew(e),m=xw(e),_=ww(e),E=hw(e),w=uw(a),S=r.createProgram();let v,g,R=e.glslVersion?"#version "+e.glslVersion+`
3777
+ `:"";e.isRawShaderMaterial?(v=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w].filter(Dr).join(`
3778
3778
  `),v.length>0&&(v+=`
3779
- `),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S].filter(Dr).join(`
3779
+ `),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w].filter(Dr).join(`
3780
3780
  `),g.length>0&&(g+=`
3781
- `)):(v=[wd(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+p:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+u:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3781
+ `)):(v=[wd(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.batchingColor?"#define USE_BATCHING_COLOR":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+p:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+u:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","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","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
3782
3782
  `].filter(Dr).join(`
3783
- `),g=[wd(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+d:"",e.envMap?"#define "+p:"",e.envMap?"#define "+m:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+u:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Pi?"#define TONE_MAPPING":"",e.toneMapping!==Pi?de.tonemapping_pars_fragment:"",e.toneMapping!==Pi?lw("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",de.colorspace_pars_fragment,aw("linearToOutputTexel",e.outputColorSpace),cw(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3783
+ `),g=[wd(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+d:"",e.envMap?"#define "+p:"",e.envMap?"#define "+m:"",_?"#define CUBEUV_TEXEL_WIDTH "+_.texelWidth:"",_?"#define CUBEUV_TEXEL_HEIGHT "+_.texelHeight:"",_?"#define CUBEUV_MAX_MIP "+_.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor||e.batchingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+u:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.reversedDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Pi?"#define TONE_MAPPING":"",e.toneMapping!==Pi?de.tonemapping_pars_fragment:"",e.toneMapping!==Pi?lw("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",de.colorspace_pars_fragment,aw("linearToOutputTexel",e.outputColorSpace),cw(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
3784
3784
  `].filter(Dr).join(`
3785
- `)),l=kc(l),l=yd(l,e),l=Ed(l,e),h=kc(h),h=yd(h,e),h=Ed(h,e),l=xd(l),h=xd(h),e.isRawShaderMaterial!==!0&&(I=`#version 300 es
3785
+ `)),l=kc(l),l=yd(l,e),l=Ed(l,e),h=kc(h),h=yd(h,e),h=Ed(h,e),l=xd(l),h=xd(h),e.isRawShaderMaterial!==!0&&(R=`#version 300 es
3786
3786
  `,v=[E,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3787
3787
  `)+`
3788
3788
  `+v,g=["#define varying in",e.glslVersion===mu?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===mu?"":"#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(`
3789
3789
  `)+`
3790
- `+g);const C=I+v+l,T=I+g+h,U=gd(r,r.VERTEX_SHADER,C),N=gd(r,r.FRAGMENT_SHADER,T);r.attachShader(w,U),r.attachShader(w,N),e.index0AttributeName!==void 0?r.bindAttribLocation(w,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(w,0,"position"),r.linkProgram(w);function B(k){if(n.debug.checkShaderErrors){const Z=r.getProgramInfoLog(w)||"",J=r.getShaderInfoLog(U)||"",V=r.getShaderInfoLog(N)||"",$=Z.trim(),K=J.trim(),ut=V.trim();let G=!0,Tt=!0;if(r.getProgramParameter(w,r.LINK_STATUS)===!1)if(G=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,w,U,N);else{const ot=vd(r,U,"vertex"),St=vd(r,N,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(w,r.VALIDATE_STATUS)+`
3790
+ `+g);const P=R+v+l,T=R+g+h,U=gd(r,r.VERTEX_SHADER,P),B=gd(r,r.FRAGMENT_SHADER,T);r.attachShader(S,U),r.attachShader(S,B),e.index0AttributeName!==void 0?r.bindAttribLocation(S,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(S,0,"position"),r.linkProgram(S);function N(k){if(n.debug.checkShaderErrors){const Z=r.getProgramInfoLog(S)||"",J=r.getShaderInfoLog(U)||"",V=r.getShaderInfoLog(B)||"",$=Z.trim(),K=J.trim(),ut=V.trim();let G=!0,Tt=!0;if(r.getProgramParameter(S,r.LINK_STATUS)===!1)if(G=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,S,U,B);else{const lt=vd(r,U,"vertex"),Mt=vd(r,B,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(S,r.VALIDATE_STATUS)+`
3791
3791
 
3792
3792
  Material Name: `+k.name+`
3793
3793
  Material Type: `+k.type+`
3794
3794
 
3795
3795
  Program Info Log: `+$+`
3796
- `+ot+`
3797
- `+St)}else $!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$):(K===""||ut==="")&&(Tt=!1);Tt&&(k.diagnostics={runnable:G,programLog:$,vertexShader:{log:K,prefix:v},fragmentShader:{log:ut,prefix:g}})}r.deleteShader(U),r.deleteShader(N),z=new Ko(r,w),D=dw(r,w)}let z;this.getUniforms=function(){return z===void 0&&B(this),z};let D;this.getAttributes=function(){return D===void 0&&B(this),D};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(w,iw)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=sw++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=U,this.fragmentShader=N,this}let Mw=0;class Tw{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,s=t.fragmentShader,r=this._getShaderStage(e),a=this._getShaderStage(s),l=this._getShaderCacheForMaterial(t);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const s of e)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let s=e.get(t);return s===void 0&&(s=new Set,e.set(t,s)),s}_getShaderStage(t){const e=this.shaderCache;let s=e.get(t);return s===void 0&&(s=new bw(t),e.set(t,s)),s}}class bw{constructor(t){this.id=Mw++,this.code=t,this.usedTimes=0}}function Aw(n,t,e,s,r,a,l){const h=new lc,u=new Tw,d=new Set,p=[],m=r.logarithmicDepthBuffer,_=r.vertexTextures;let E=r.precision;const S={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 w(D){return d.add(D),D===0?"uv":`uv${D}`}function v(D,M,k,Z,J){const V=Z.fog,$=J.geometry,K=D.isMeshStandardMaterial?Z.environment:null,ut=(D.isMeshStandardMaterial?e:t).get(D.envMap||K),G=ut&&ut.mapping===vo?ut.image.height:null,Tt=S[D.type];D.precision!==null&&(E=r.getMaxPrecision(D.precision),E!==D.precision&&console.warn("THREE.WebGLProgram.getParameters:",D.precision,"not supported, using",E,"instead."));const ot=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,St=ot!==void 0?ot.length:0;let Gt=0;$.morphAttributes.position!==void 0&&(Gt=1),$.morphAttributes.normal!==void 0&&(Gt=2),$.morphAttributes.color!==void 0&&(Gt=3);let pt,Lt,Y,it;if(Tt){const Me=ti[Tt];pt=Me.vertexShader,Lt=Me.fragmentShader}else pt=D.vertexShader,Lt=D.fragmentShader,u.update(D),Y=u.getVertexShaderID(D),it=u.getFragmentShaderID(D);const ft=n.getRenderTarget(),kt=n.state.buffers.depth.getReversed(),Ot=J.isInstancedMesh===!0,zt=J.isBatchedMesh===!0,ct=!!D.map,ht=!!D.matcap,P=!!ut,lt=!!D.aoMap,at=!!D.lightMap,vt=!!D.bumpMap,gt=!!D.normalMap,Bt=!!D.displacementMap,bt=!!D.emissiveMap,Zt=!!D.metalnessMap,ve=!!D.roughnessMap,Ae=D.anisotropy>0,O=D.clearcoat>0,A=D.dispersion>0,j=D.iridescence>0,rt=D.sheen>0,_t=D.transmission>0,st=Ae&&!!D.anisotropyMap,Xt=O&&!!D.clearcoatMap,At=O&&!!D.clearcoatNormalMap,Ht=O&&!!D.clearcoatRoughnessMap,Yt=j&&!!D.iridescenceMap,xt=j&&!!D.iridescenceThicknessMap,It=rt&&!!D.sheenColorMap,se=rt&&!!D.sheenRoughnessMap,qt=!!D.specularMap,Pt=!!D.specularColorMap,ce=!!D.specularIntensityMap,H=_t&&!!D.transmissionMap,wt=_t&&!!D.thicknessMap,Ct=!!D.gradientMap,Ft=!!D.alphaMap,yt=D.alphaTest>0,dt=!!D.alphaHash,Wt=!!D.extensions;let le=Pi;D.toneMapped&&(ft===null||ft.isXRRenderTarget===!0)&&(le=n.toneMapping);const De={shaderID:Tt,shaderType:D.type,shaderName:D.name,vertexShader:pt,fragmentShader:Lt,defines:D.defines,customVertexShaderID:Y,customFragmentShaderID:it,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:E,batching:zt,batchingColor:zt&&J._colorsTexture!==null,instancing:Ot,instancingColor:Ot&&J.instanceColor!==null,instancingMorph:Ot&&J.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:ft===null?n.outputColorSpace:ft.isXRRenderTarget===!0?ft.texture.colorSpace:is,alphaToCoverage:!!D.alphaToCoverage,map:ct,matcap:ht,envMap:P,envMapMode:P&&ut.mapping,envMapCubeUVHeight:G,aoMap:lt,lightMap:at,bumpMap:vt,normalMap:gt,displacementMap:_&&Bt,emissiveMap:bt,normalMapObjectSpace:gt&&D.normalMapType===Uv,normalMapTangentSpace:gt&&D.normalMapType===kv,metalnessMap:Zt,roughnessMap:ve,anisotropy:Ae,anisotropyMap:st,clearcoat:O,clearcoatMap:Xt,clearcoatNormalMap:At,clearcoatRoughnessMap:Ht,dispersion:A,iridescence:j,iridescenceMap:Yt,iridescenceThicknessMap:xt,sheen:rt,sheenColorMap:It,sheenRoughnessMap:se,specularMap:qt,specularColorMap:Pt,specularIntensityMap:ce,transmission:_t,transmissionMap:H,thicknessMap:wt,gradientMap:Ct,opaque:D.transparent===!1&&D.blending===Ss&&D.alphaToCoverage===!1,alphaMap:Ft,alphaTest:yt,alphaHash:dt,combine:D.combine,mapUv:ct&&w(D.map.channel),aoMapUv:lt&&w(D.aoMap.channel),lightMapUv:at&&w(D.lightMap.channel),bumpMapUv:vt&&w(D.bumpMap.channel),normalMapUv:gt&&w(D.normalMap.channel),displacementMapUv:Bt&&w(D.displacementMap.channel),emissiveMapUv:bt&&w(D.emissiveMap.channel),metalnessMapUv:Zt&&w(D.metalnessMap.channel),roughnessMapUv:ve&&w(D.roughnessMap.channel),anisotropyMapUv:st&&w(D.anisotropyMap.channel),clearcoatMapUv:Xt&&w(D.clearcoatMap.channel),clearcoatNormalMapUv:At&&w(D.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&w(D.clearcoatRoughnessMap.channel),iridescenceMapUv:Yt&&w(D.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&w(D.iridescenceThicknessMap.channel),sheenColorMapUv:It&&w(D.sheenColorMap.channel),sheenRoughnessMapUv:se&&w(D.sheenRoughnessMap.channel),specularMapUv:qt&&w(D.specularMap.channel),specularColorMapUv:Pt&&w(D.specularColorMap.channel),specularIntensityMapUv:ce&&w(D.specularIntensityMap.channel),transmissionMapUv:H&&w(D.transmissionMap.channel),thicknessMapUv:wt&&w(D.thicknessMap.channel),alphaMapUv:Ft&&w(D.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(gt||Ae),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!$.attributes.uv&&(ct||Ft),fog:!!V,useFog:D.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:D.flatShading===!0&&D.wireframe===!1,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:kt,skinning:J.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:St,morphTextureStride:Gt,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:l.numPlanes,numClipIntersection:l.numIntersection,dithering:D.dithering,shadowMapEnabled:n.shadowMap.enabled&&k.length>0,shadowMapType:n.shadowMap.type,toneMapping:le,decodeVideoTexture:ct&&D.map.isVideoTexture===!0&&Se.getTransfer(D.map.colorSpace)===Ie,decodeVideoTextureEmissive:bt&&D.emissiveMap.isVideoTexture===!0&&Se.getTransfer(D.emissiveMap.colorSpace)===Ie,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===ci,flipSided:D.side===fn,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:Wt&&D.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Wt&&D.extensions.multiDraw===!0||zt)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return De.vertexUv1s=d.has(1),De.vertexUv2s=d.has(2),De.vertexUv3s=d.has(3),d.clear(),De}function g(D){const M=[];if(D.shaderID?M.push(D.shaderID):(M.push(D.customVertexShaderID),M.push(D.customFragmentShaderID)),D.defines!==void 0)for(const k in D.defines)M.push(k),M.push(D.defines[k]);return D.isRawShaderMaterial===!1&&(I(M,D),C(M,D),M.push(n.outputColorSpace)),M.push(D.customProgramCacheKey),M.join()}function I(D,M){D.push(M.precision),D.push(M.outputColorSpace),D.push(M.envMapMode),D.push(M.envMapCubeUVHeight),D.push(M.mapUv),D.push(M.alphaMapUv),D.push(M.lightMapUv),D.push(M.aoMapUv),D.push(M.bumpMapUv),D.push(M.normalMapUv),D.push(M.displacementMapUv),D.push(M.emissiveMapUv),D.push(M.metalnessMapUv),D.push(M.roughnessMapUv),D.push(M.anisotropyMapUv),D.push(M.clearcoatMapUv),D.push(M.clearcoatNormalMapUv),D.push(M.clearcoatRoughnessMapUv),D.push(M.iridescenceMapUv),D.push(M.iridescenceThicknessMapUv),D.push(M.sheenColorMapUv),D.push(M.sheenRoughnessMapUv),D.push(M.specularMapUv),D.push(M.specularColorMapUv),D.push(M.specularIntensityMapUv),D.push(M.transmissionMapUv),D.push(M.thicknessMapUv),D.push(M.combine),D.push(M.fogExp2),D.push(M.sizeAttenuation),D.push(M.morphTargetsCount),D.push(M.morphAttributeCount),D.push(M.numDirLights),D.push(M.numPointLights),D.push(M.numSpotLights),D.push(M.numSpotLightMaps),D.push(M.numHemiLights),D.push(M.numRectAreaLights),D.push(M.numDirLightShadows),D.push(M.numPointLightShadows),D.push(M.numSpotLightShadows),D.push(M.numSpotLightShadowsWithMaps),D.push(M.numLightProbes),D.push(M.shadowMapType),D.push(M.toneMapping),D.push(M.numClippingPlanes),D.push(M.numClipIntersection),D.push(M.depthPacking)}function C(D,M){h.disableAll(),M.supportsVertexTextures&&h.enable(0),M.instancing&&h.enable(1),M.instancingColor&&h.enable(2),M.instancingMorph&&h.enable(3),M.matcap&&h.enable(4),M.envMap&&h.enable(5),M.normalMapObjectSpace&&h.enable(6),M.normalMapTangentSpace&&h.enable(7),M.clearcoat&&h.enable(8),M.iridescence&&h.enable(9),M.alphaTest&&h.enable(10),M.vertexColors&&h.enable(11),M.vertexAlphas&&h.enable(12),M.vertexUv1s&&h.enable(13),M.vertexUv2s&&h.enable(14),M.vertexUv3s&&h.enable(15),M.vertexTangents&&h.enable(16),M.anisotropy&&h.enable(17),M.alphaHash&&h.enable(18),M.batching&&h.enable(19),M.dispersion&&h.enable(20),M.batchingColor&&h.enable(21),M.gradientMap&&h.enable(22),D.push(h.mask),h.disableAll(),M.fog&&h.enable(0),M.useFog&&h.enable(1),M.flatShading&&h.enable(2),M.logarithmicDepthBuffer&&h.enable(3),M.reversedDepthBuffer&&h.enable(4),M.skinning&&h.enable(5),M.morphTargets&&h.enable(6),M.morphNormals&&h.enable(7),M.morphColors&&h.enable(8),M.premultipliedAlpha&&h.enable(9),M.shadowMapEnabled&&h.enable(10),M.doubleSided&&h.enable(11),M.flipSided&&h.enable(12),M.useDepthPacking&&h.enable(13),M.dithering&&h.enable(14),M.transmission&&h.enable(15),M.sheen&&h.enable(16),M.opaque&&h.enable(17),M.pointsUvs&&h.enable(18),M.decodeVideoTexture&&h.enable(19),M.decodeVideoTextureEmissive&&h.enable(20),M.alphaToCoverage&&h.enable(21),D.push(h.mask)}function T(D){const M=S[D.type];let k;if(M){const Z=ti[M];k=T0.clone(Z.uniforms)}else k=D.uniforms;return k}function U(D,M){let k;for(let Z=0,J=p.length;Z<J;Z++){const V=p[Z];if(V.cacheKey===M){k=V,++k.usedTimes;break}}return k===void 0&&(k=new Sw(n,M,D,a),p.push(k)),k}function N(D){if(--D.usedTimes===0){const M=p.indexOf(D);p[M]=p[p.length-1],p.pop(),D.destroy()}}function B(D){u.remove(D)}function z(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:T,acquireProgram:U,releaseProgram:N,releaseShaderCache:B,programs:p,dispose:z}}function Cw(){let n=new WeakMap;function t(l){return n.has(l)}function e(l){let h=n.get(l);return h===void 0&&(h={},n.set(l,h)),h}function s(l){n.delete(l)}function r(l,h,u){n.get(l)[h]=u}function a(){n=new WeakMap}return{has:t,get:e,remove:s,update:r,dispose:a}}function Pw(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function Sd(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function Md(){const n=[];let t=0;const e=[],s=[],r=[];function a(){t=0,e.length=0,s.length=0,r.length=0}function l(m,_,E,S,w,v){let g=n[t];return g===void 0?(g={id:m.id,object:m,geometry:_,material:E,groupOrder:S,renderOrder:m.renderOrder,z:w,group:v},n[t]=g):(g.id=m.id,g.object=m,g.geometry=_,g.material=E,g.groupOrder=S,g.renderOrder=m.renderOrder,g.z=w,g.group=v),t++,g}function h(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.push(g):E.transparent===!0?r.push(g):e.push(g)}function u(m,_,E,S,w,v){const g=l(m,_,E,S,w,v);E.transmission>0?s.unshift(g):E.transparent===!0?r.unshift(g):e.unshift(g)}function d(m,_){e.length>1&&e.sort(m||Pw),s.length>1&&s.sort(_||Sd),r.length>1&&r.sort(_||Sd)}function p(){for(let m=t,_=n.length;m<_;m++){const E=n[m];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:e,transmissive:s,transparent:r,init:a,push:h,unshift:u,finish:p,sort:d}}function Rw(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new Md,n.set(s,[l])):r>=a.length?(l=new Md,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Lw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new q,color:new Pe};break;case"SpotLight":e={position:new q,direction:new q,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new q,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":e={direction:new q,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":e={color:new Pe,position:new q,halfWidth:new q,halfHeight:new q};break}return n[t.id]=e,e}}}function Iw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new be,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let Dw=0;function kw(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Uw(n){const t=new Lw,e=Iw(),s={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 d=0;d<9;d++)s.probe.push(new q);const r=new q,a=new Oe,l=new Oe;function h(d){let p=0,m=0,_=0;for(let D=0;D<9;D++)s.probe[D].set(0,0,0);let E=0,S=0,w=0,v=0,g=0,I=0,C=0,T=0,U=0,N=0,B=0;d.sort(kw);for(let D=0,M=d.length;D<M;D++){const k=d[D],Z=k.color,J=k.intensity,V=k.distance,$=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)p+=Z.r*J,m+=Z.g*J,_+=Z.b*J;else if(k.isLightProbe){for(let K=0;K<9;K++)s.probe[K].addScaledVector(k.sh.coefficients[K],J);B++}else if(k.isDirectionalLight){const K=t.get(k);if(K.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const ut=k.shadow,G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,s.directionalShadow[E]=G,s.directionalShadowMap[E]=$,s.directionalShadowMatrix[E]=k.shadow.matrix,I++}s.directional[E]=K,E++}else if(k.isSpotLight){const K=t.get(k);K.position.setFromMatrixPosition(k.matrixWorld),K.color.copy(Z).multiplyScalar(J),K.distance=V,K.coneCos=Math.cos(k.angle),K.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),K.decay=k.decay,s.spot[w]=K;const ut=k.shadow;if(k.map&&(s.spotLightMap[U]=k.map,U++,ut.updateMatrices(k),k.castShadow&&N++),s.spotLightMatrix[w]=ut.matrix,k.castShadow){const G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,s.spotShadow[w]=G,s.spotShadowMap[w]=$,T++}w++}else if(k.isRectAreaLight){const K=t.get(k);K.color.copy(Z).multiplyScalar(J),K.halfWidth.set(k.width*.5,0,0),K.halfHeight.set(0,k.height*.5,0),s.rectArea[v]=K,v++}else if(k.isPointLight){const K=t.get(k);if(K.color.copy(k.color).multiplyScalar(k.intensity),K.distance=k.distance,K.decay=k.decay,k.castShadow){const ut=k.shadow,G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,G.shadowCameraNear=ut.camera.near,G.shadowCameraFar=ut.camera.far,s.pointShadow[S]=G,s.pointShadowMap[S]=$,s.pointShadowMatrix[S]=k.shadow.matrix,C++}s.point[S]=K,S++}else if(k.isHemisphereLight){const K=t.get(k);K.skyColor.copy(k.color).multiplyScalar(J),K.groundColor.copy(k.groundColor).multiplyScalar(J),s.hemi[g]=K,g++}}v>0&&(n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Rt.LTC_FLOAT_1,s.rectAreaLTC2=Rt.LTC_FLOAT_2):(s.rectAreaLTC1=Rt.LTC_HALF_1,s.rectAreaLTC2=Rt.LTC_HALF_2)),s.ambient[0]=p,s.ambient[1]=m,s.ambient[2]=_;const z=s.hash;(z.directionalLength!==E||z.pointLength!==S||z.spotLength!==w||z.rectAreaLength!==v||z.hemiLength!==g||z.numDirectionalShadows!==I||z.numPointShadows!==C||z.numSpotShadows!==T||z.numSpotMaps!==U||z.numLightProbes!==B)&&(s.directional.length=E,s.spot.length=w,s.rectArea.length=v,s.point.length=S,s.hemi.length=g,s.directionalShadow.length=I,s.directionalShadowMap.length=I,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=T,s.spotShadowMap.length=T,s.directionalShadowMatrix.length=I,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=T+U-N,s.spotLightMap.length=U,s.numSpotLightShadowsWithMaps=N,s.numLightProbes=B,z.directionalLength=E,z.pointLength=S,z.spotLength=w,z.rectAreaLength=v,z.hemiLength=g,z.numDirectionalShadows=I,z.numPointShadows=C,z.numSpotShadows=T,z.numSpotMaps=U,z.numLightProbes=B,s.version=Dw++)}function u(d,p){let m=0,_=0,E=0,S=0,w=0;const v=p.matrixWorldInverse;for(let g=0,I=d.length;g<I;g++){const C=d[g];if(C.isDirectionalLight){const T=s.directional[m];T.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),m++}else if(C.isSpotLight){const T=s.spot[E];T.position.setFromMatrixPosition(C.matrixWorld),T.position.applyMatrix4(v),T.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),E++}else if(C.isRectAreaLight){const T=s.rectArea[S];T.position.setFromMatrixPosition(C.matrixWorld),T.position.applyMatrix4(v),l.identity(),a.copy(C.matrixWorld),a.premultiply(v),l.extractRotation(a),T.halfWidth.set(C.width*.5,0,0),T.halfHeight.set(0,C.height*.5,0),T.halfWidth.applyMatrix4(l),T.halfHeight.applyMatrix4(l),S++}else if(C.isPointLight){const T=s.point[_];T.position.setFromMatrixPosition(C.matrixWorld),T.position.applyMatrix4(v),_++}else if(C.isHemisphereLight){const T=s.hemi[w];T.direction.setFromMatrixPosition(C.matrixWorld),T.direction.transformDirection(v),w++}}}return{setup:h,setupView:u,state:s}}function Td(n){const t=new Uw(n),e=[],s=[];function r(p){d.camera=p,e.length=0,s.length=0}function a(p){e.push(p)}function l(p){s.push(p)}function h(){t.setup(e)}function u(p){t.setupView(e,p)}const d={lightsArray:e,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:d,setupLights:h,setupLightsView:u,pushLight:a,pushShadow:l}}function Ow(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new Td(n),t.set(r,[h])):a>=l.length?(h=new Td(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const Nw=`void main() {
3796
+ `+lt+`
3797
+ `+Mt)}else $!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$):(K===""||ut==="")&&(Tt=!1);Tt&&(k.diagnostics={runnable:G,programLog:$,vertexShader:{log:K,prefix:v},fragmentShader:{log:ut,prefix:g}})}r.deleteShader(U),r.deleteShader(B),z=new Ko(r,S),D=dw(r,S)}let z;this.getUniforms=function(){return z===void 0&&N(this),z};let D;this.getAttributes=function(){return D===void 0&&N(this),D};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(S,iw)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(S),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=sw++,this.cacheKey=t,this.usedTimes=1,this.program=S,this.vertexShader=U,this.fragmentShader=B,this}let Mw=0;class Tw{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,s=t.fragmentShader,r=this._getShaderStage(e),a=this._getShaderStage(s),l=this._getShaderCacheForMaterial(t);return l.has(r)===!1&&(l.add(r),r.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const s of e)s.usedTimes--,s.usedTimes===0&&this.shaderCache.delete(s.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let s=e.get(t);return s===void 0&&(s=new Set,e.set(t,s)),s}_getShaderStage(t){const e=this.shaderCache;let s=e.get(t);return s===void 0&&(s=new bw(t),e.set(t,s)),s}}class bw{constructor(t){this.id=Mw++,this.code=t,this.usedTimes=0}}function Aw(n,t,e,s,r,a,l){const h=new lc,u=new Tw,d=new Set,p=[],m=r.logarithmicDepthBuffer,_=r.vertexTextures;let E=r.precision;const w={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(D){return d.add(D),D===0?"uv":`uv${D}`}function v(D,M,k,Z,J){const V=Z.fog,$=J.geometry,K=D.isMeshStandardMaterial?Z.environment:null,ut=(D.isMeshStandardMaterial?e:t).get(D.envMap||K),G=ut&&ut.mapping===vo?ut.image.height:null,Tt=w[D.type];D.precision!==null&&(E=r.getMaxPrecision(D.precision),E!==D.precision&&console.warn("THREE.WebGLProgram.getParameters:",D.precision,"not supported, using",E,"instead."));const lt=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,Mt=lt!==void 0?lt.length:0;let Gt=0;$.morphAttributes.position!==void 0&&(Gt=1),$.morphAttributes.normal!==void 0&&(Gt=2),$.morphAttributes.color!==void 0&&(Gt=3);let pt,Rt,Y,st;if(Tt){const Te=ti[Tt];pt=Te.vertexShader,Rt=Te.fragmentShader}else pt=D.vertexShader,Rt=D.fragmentShader,u.update(D),Y=u.getVertexShaderID(D),st=u.getFragmentShaderID(D);const ft=n.getRenderTarget(),Dt=n.state.buffers.depth.getReversed(),Ut=J.isInstancedMesh===!0,zt=J.isBatchedMesh===!0,ce=!!D.map,at=!!D.matcap,C=!!ut,it=!!D.aoMap,ct=!!D.lightMap,_t=!!D.bumpMap,ht=!!D.normalMap,Ot=!!D.displacementMap,yt=!!D.emissiveMap,Nt=!!D.metalnessMap,pe=!!D.roughnessMap,ge=D.anisotropy>0,O=D.clearcoat>0,b=D.dispersion>0,Q=D.iridescence>0,ot=D.sheen>0,gt=D.transmission>0,rt=ge&&!!D.anisotropyMap,Zt=O&&!!D.clearcoatMap,bt=O&&!!D.clearcoatNormalMap,Ht=O&&!!D.clearcoatRoughnessMap,Xt=Q&&!!D.iridescenceMap,wt=Q&&!!D.iridescenceThicknessMap,Lt=ot&&!!D.sheenColorMap,ie=ot&&!!D.sheenRoughnessMap,Yt=!!D.specularMap,Ct=!!D.specularColorMap,le=!!D.specularIntensityMap,H=gt&&!!D.transmissionMap,St=gt&&!!D.thicknessMap,At=!!D.gradientMap,Ft=!!D.alphaMap,vt=D.alphaTest>0,dt=!!D.alphaHash,Wt=!!D.extensions;let ae=Pi;D.toneMapped&&(ft===null||ft.isXRRenderTarget===!0)&&(ae=n.toneMapping);const De={shaderID:Tt,shaderType:D.type,shaderName:D.name,vertexShader:pt,fragmentShader:Rt,defines:D.defines,customVertexShaderID:Y,customFragmentShaderID:st,isRawShaderMaterial:D.isRawShaderMaterial===!0,glslVersion:D.glslVersion,precision:E,batching:zt,batchingColor:zt&&J._colorsTexture!==null,instancing:Ut,instancingColor:Ut&&J.instanceColor!==null,instancingMorph:Ut&&J.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:ft===null?n.outputColorSpace:ft.isXRRenderTarget===!0?ft.texture.colorSpace:is,alphaToCoverage:!!D.alphaToCoverage,map:ce,matcap:at,envMap:C,envMapMode:C&&ut.mapping,envMapCubeUVHeight:G,aoMap:it,lightMap:ct,bumpMap:_t,normalMap:ht,displacementMap:_&&Ot,emissiveMap:yt,normalMapObjectSpace:ht&&D.normalMapType===Uv,normalMapTangentSpace:ht&&D.normalMapType===kv,metalnessMap:Nt,roughnessMap:pe,anisotropy:ge,anisotropyMap:rt,clearcoat:O,clearcoatMap:Zt,clearcoatNormalMap:bt,clearcoatRoughnessMap:Ht,dispersion:b,iridescence:Q,iridescenceMap:Xt,iridescenceThicknessMap:wt,sheen:ot,sheenColorMap:Lt,sheenRoughnessMap:ie,specularMap:Yt,specularColorMap:Ct,specularIntensityMap:le,transmission:gt,transmissionMap:H,thicknessMap:St,gradientMap:At,opaque:D.transparent===!1&&D.blending===Ss&&D.alphaToCoverage===!1,alphaMap:Ft,alphaTest:vt,alphaHash:dt,combine:D.combine,mapUv:ce&&S(D.map.channel),aoMapUv:it&&S(D.aoMap.channel),lightMapUv:ct&&S(D.lightMap.channel),bumpMapUv:_t&&S(D.bumpMap.channel),normalMapUv:ht&&S(D.normalMap.channel),displacementMapUv:Ot&&S(D.displacementMap.channel),emissiveMapUv:yt&&S(D.emissiveMap.channel),metalnessMapUv:Nt&&S(D.metalnessMap.channel),roughnessMapUv:pe&&S(D.roughnessMap.channel),anisotropyMapUv:rt&&S(D.anisotropyMap.channel),clearcoatMapUv:Zt&&S(D.clearcoatMap.channel),clearcoatNormalMapUv:bt&&S(D.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ht&&S(D.clearcoatRoughnessMap.channel),iridescenceMapUv:Xt&&S(D.iridescenceMap.channel),iridescenceThicknessMapUv:wt&&S(D.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&S(D.sheenColorMap.channel),sheenRoughnessMapUv:ie&&S(D.sheenRoughnessMap.channel),specularMapUv:Yt&&S(D.specularMap.channel),specularColorMapUv:Ct&&S(D.specularColorMap.channel),specularIntensityMapUv:le&&S(D.specularIntensityMap.channel),transmissionMapUv:H&&S(D.transmissionMap.channel),thicknessMapUv:St&&S(D.thicknessMap.channel),alphaMapUv:Ft&&S(D.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(ht||ge),vertexColors:D.vertexColors,vertexAlphas:D.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!$.attributes.uv&&(ce||Ft),fog:!!V,useFog:D.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:D.flatShading===!0&&D.wireframe===!1,sizeAttenuation:D.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Dt,skinning:J.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:Mt,morphTextureStride:Gt,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:l.numPlanes,numClipIntersection:l.numIntersection,dithering:D.dithering,shadowMapEnabled:n.shadowMap.enabled&&k.length>0,shadowMapType:n.shadowMap.type,toneMapping:ae,decodeVideoTexture:ce&&D.map.isVideoTexture===!0&&Me.getTransfer(D.map.colorSpace)===Ie,decodeVideoTextureEmissive:yt&&D.emissiveMap.isVideoTexture===!0&&Me.getTransfer(D.emissiveMap.colorSpace)===Ie,premultipliedAlpha:D.premultipliedAlpha,doubleSided:D.side===ci,flipSided:D.side===fn,useDepthPacking:D.depthPacking>=0,depthPacking:D.depthPacking||0,index0AttributeName:D.index0AttributeName,extensionClipCullDistance:Wt&&D.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Wt&&D.extensions.multiDraw===!0||zt)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:D.customProgramCacheKey()};return De.vertexUv1s=d.has(1),De.vertexUv2s=d.has(2),De.vertexUv3s=d.has(3),d.clear(),De}function g(D){const M=[];if(D.shaderID?M.push(D.shaderID):(M.push(D.customVertexShaderID),M.push(D.customFragmentShaderID)),D.defines!==void 0)for(const k in D.defines)M.push(k),M.push(D.defines[k]);return D.isRawShaderMaterial===!1&&(R(M,D),P(M,D),M.push(n.outputColorSpace)),M.push(D.customProgramCacheKey),M.join()}function R(D,M){D.push(M.precision),D.push(M.outputColorSpace),D.push(M.envMapMode),D.push(M.envMapCubeUVHeight),D.push(M.mapUv),D.push(M.alphaMapUv),D.push(M.lightMapUv),D.push(M.aoMapUv),D.push(M.bumpMapUv),D.push(M.normalMapUv),D.push(M.displacementMapUv),D.push(M.emissiveMapUv),D.push(M.metalnessMapUv),D.push(M.roughnessMapUv),D.push(M.anisotropyMapUv),D.push(M.clearcoatMapUv),D.push(M.clearcoatNormalMapUv),D.push(M.clearcoatRoughnessMapUv),D.push(M.iridescenceMapUv),D.push(M.iridescenceThicknessMapUv),D.push(M.sheenColorMapUv),D.push(M.sheenRoughnessMapUv),D.push(M.specularMapUv),D.push(M.specularColorMapUv),D.push(M.specularIntensityMapUv),D.push(M.transmissionMapUv),D.push(M.thicknessMapUv),D.push(M.combine),D.push(M.fogExp2),D.push(M.sizeAttenuation),D.push(M.morphTargetsCount),D.push(M.morphAttributeCount),D.push(M.numDirLights),D.push(M.numPointLights),D.push(M.numSpotLights),D.push(M.numSpotLightMaps),D.push(M.numHemiLights),D.push(M.numRectAreaLights),D.push(M.numDirLightShadows),D.push(M.numPointLightShadows),D.push(M.numSpotLightShadows),D.push(M.numSpotLightShadowsWithMaps),D.push(M.numLightProbes),D.push(M.shadowMapType),D.push(M.toneMapping),D.push(M.numClippingPlanes),D.push(M.numClipIntersection),D.push(M.depthPacking)}function P(D,M){h.disableAll(),M.supportsVertexTextures&&h.enable(0),M.instancing&&h.enable(1),M.instancingColor&&h.enable(2),M.instancingMorph&&h.enable(3),M.matcap&&h.enable(4),M.envMap&&h.enable(5),M.normalMapObjectSpace&&h.enable(6),M.normalMapTangentSpace&&h.enable(7),M.clearcoat&&h.enable(8),M.iridescence&&h.enable(9),M.alphaTest&&h.enable(10),M.vertexColors&&h.enable(11),M.vertexAlphas&&h.enable(12),M.vertexUv1s&&h.enable(13),M.vertexUv2s&&h.enable(14),M.vertexUv3s&&h.enable(15),M.vertexTangents&&h.enable(16),M.anisotropy&&h.enable(17),M.alphaHash&&h.enable(18),M.batching&&h.enable(19),M.dispersion&&h.enable(20),M.batchingColor&&h.enable(21),M.gradientMap&&h.enable(22),D.push(h.mask),h.disableAll(),M.fog&&h.enable(0),M.useFog&&h.enable(1),M.flatShading&&h.enable(2),M.logarithmicDepthBuffer&&h.enable(3),M.reversedDepthBuffer&&h.enable(4),M.skinning&&h.enable(5),M.morphTargets&&h.enable(6),M.morphNormals&&h.enable(7),M.morphColors&&h.enable(8),M.premultipliedAlpha&&h.enable(9),M.shadowMapEnabled&&h.enable(10),M.doubleSided&&h.enable(11),M.flipSided&&h.enable(12),M.useDepthPacking&&h.enable(13),M.dithering&&h.enable(14),M.transmission&&h.enable(15),M.sheen&&h.enable(16),M.opaque&&h.enable(17),M.pointsUvs&&h.enable(18),M.decodeVideoTexture&&h.enable(19),M.decodeVideoTextureEmissive&&h.enable(20),M.alphaToCoverage&&h.enable(21),D.push(h.mask)}function T(D){const M=w[D.type];let k;if(M){const Z=ti[M];k=T0.clone(Z.uniforms)}else k=D.uniforms;return k}function U(D,M){let k;for(let Z=0,J=p.length;Z<J;Z++){const V=p[Z];if(V.cacheKey===M){k=V,++k.usedTimes;break}}return k===void 0&&(k=new Sw(n,M,D,a),p.push(k)),k}function B(D){if(--D.usedTimes===0){const M=p.indexOf(D);p[M]=p[p.length-1],p.pop(),D.destroy()}}function N(D){u.remove(D)}function z(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:T,acquireProgram:U,releaseProgram:B,releaseShaderCache:N,programs:p,dispose:z}}function Cw(){let n=new WeakMap;function t(l){return n.has(l)}function e(l){let h=n.get(l);return h===void 0&&(h={},n.set(l,h)),h}function s(l){n.delete(l)}function r(l,h,u){n.get(l)[h]=u}function a(){n=new WeakMap}return{has:t,get:e,remove:s,update:r,dispose:a}}function Pw(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.material.id!==t.material.id?n.material.id-t.material.id:n.z!==t.z?n.z-t.z:n.id-t.id}function Sd(n,t){return n.groupOrder!==t.groupOrder?n.groupOrder-t.groupOrder:n.renderOrder!==t.renderOrder?n.renderOrder-t.renderOrder:n.z!==t.z?t.z-n.z:n.id-t.id}function Md(){const n=[];let t=0;const e=[],s=[],r=[];function a(){t=0,e.length=0,s.length=0,r.length=0}function l(m,_,E,w,S,v){let g=n[t];return g===void 0?(g={id:m.id,object:m,geometry:_,material:E,groupOrder:w,renderOrder:m.renderOrder,z:S,group:v},n[t]=g):(g.id=m.id,g.object=m,g.geometry=_,g.material=E,g.groupOrder=w,g.renderOrder=m.renderOrder,g.z=S,g.group=v),t++,g}function h(m,_,E,w,S,v){const g=l(m,_,E,w,S,v);E.transmission>0?s.push(g):E.transparent===!0?r.push(g):e.push(g)}function u(m,_,E,w,S,v){const g=l(m,_,E,w,S,v);E.transmission>0?s.unshift(g):E.transparent===!0?r.unshift(g):e.unshift(g)}function d(m,_){e.length>1&&e.sort(m||Pw),s.length>1&&s.sort(_||Sd),r.length>1&&r.sort(_||Sd)}function p(){for(let m=t,_=n.length;m<_;m++){const E=n[m];if(E.id===null)break;E.id=null,E.object=null,E.geometry=null,E.material=null,E.group=null}}return{opaque:e,transmissive:s,transparent:r,init:a,push:h,unshift:u,finish:p,sort:d}}function Rw(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new Md,n.set(s,[l])):r>=a.length?(l=new Md,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Lw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new q,color:new Pe};break;case"SpotLight":e={position:new q,direction:new q,color:new Pe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new q,color:new Pe,distance:0,decay:0};break;case"HemisphereLight":e={direction:new q,skyColor:new Pe,groundColor:new Pe};break;case"RectAreaLight":e={color:new Pe,position:new q,halfWidth:new q,halfHeight:new q};break}return n[t.id]=e,e}}}function Iw(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"SpotLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae};break;case"PointLight":e={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ae,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let Dw=0;function kw(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Uw(n){const t=new Lw,e=Iw(),s={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 d=0;d<9;d++)s.probe.push(new q);const r=new q,a=new Oe,l=new Oe;function h(d){let p=0,m=0,_=0;for(let D=0;D<9;D++)s.probe[D].set(0,0,0);let E=0,w=0,S=0,v=0,g=0,R=0,P=0,T=0,U=0,B=0,N=0;d.sort(kw);for(let D=0,M=d.length;D<M;D++){const k=d[D],Z=k.color,J=k.intensity,V=k.distance,$=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)p+=Z.r*J,m+=Z.g*J,_+=Z.b*J;else if(k.isLightProbe){for(let K=0;K<9;K++)s.probe[K].addScaledVector(k.sh.coefficients[K],J);N++}else if(k.isDirectionalLight){const K=t.get(k);if(K.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const ut=k.shadow,G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,s.directionalShadow[E]=G,s.directionalShadowMap[E]=$,s.directionalShadowMatrix[E]=k.shadow.matrix,R++}s.directional[E]=K,E++}else if(k.isSpotLight){const K=t.get(k);K.position.setFromMatrixPosition(k.matrixWorld),K.color.copy(Z).multiplyScalar(J),K.distance=V,K.coneCos=Math.cos(k.angle),K.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),K.decay=k.decay,s.spot[S]=K;const ut=k.shadow;if(k.map&&(s.spotLightMap[U]=k.map,U++,ut.updateMatrices(k),k.castShadow&&B++),s.spotLightMatrix[S]=ut.matrix,k.castShadow){const G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,s.spotShadow[S]=G,s.spotShadowMap[S]=$,T++}S++}else if(k.isRectAreaLight){const K=t.get(k);K.color.copy(Z).multiplyScalar(J),K.halfWidth.set(k.width*.5,0,0),K.halfHeight.set(0,k.height*.5,0),s.rectArea[v]=K,v++}else if(k.isPointLight){const K=t.get(k);if(K.color.copy(k.color).multiplyScalar(k.intensity),K.distance=k.distance,K.decay=k.decay,k.castShadow){const ut=k.shadow,G=e.get(k);G.shadowIntensity=ut.intensity,G.shadowBias=ut.bias,G.shadowNormalBias=ut.normalBias,G.shadowRadius=ut.radius,G.shadowMapSize=ut.mapSize,G.shadowCameraNear=ut.camera.near,G.shadowCameraFar=ut.camera.far,s.pointShadow[w]=G,s.pointShadowMap[w]=$,s.pointShadowMatrix[w]=k.shadow.matrix,P++}s.point[w]=K,w++}else if(k.isHemisphereLight){const K=t.get(k);K.skyColor.copy(k.color).multiplyScalar(J),K.groundColor.copy(k.groundColor).multiplyScalar(J),s.hemi[g]=K,g++}}v>0&&(n.has("OES_texture_float_linear")===!0?(s.rectAreaLTC1=Pt.LTC_FLOAT_1,s.rectAreaLTC2=Pt.LTC_FLOAT_2):(s.rectAreaLTC1=Pt.LTC_HALF_1,s.rectAreaLTC2=Pt.LTC_HALF_2)),s.ambient[0]=p,s.ambient[1]=m,s.ambient[2]=_;const z=s.hash;(z.directionalLength!==E||z.pointLength!==w||z.spotLength!==S||z.rectAreaLength!==v||z.hemiLength!==g||z.numDirectionalShadows!==R||z.numPointShadows!==P||z.numSpotShadows!==T||z.numSpotMaps!==U||z.numLightProbes!==N)&&(s.directional.length=E,s.spot.length=S,s.rectArea.length=v,s.point.length=w,s.hemi.length=g,s.directionalShadow.length=R,s.directionalShadowMap.length=R,s.pointShadow.length=P,s.pointShadowMap.length=P,s.spotShadow.length=T,s.spotShadowMap.length=T,s.directionalShadowMatrix.length=R,s.pointShadowMatrix.length=P,s.spotLightMatrix.length=T+U-B,s.spotLightMap.length=U,s.numSpotLightShadowsWithMaps=B,s.numLightProbes=N,z.directionalLength=E,z.pointLength=w,z.spotLength=S,z.rectAreaLength=v,z.hemiLength=g,z.numDirectionalShadows=R,z.numPointShadows=P,z.numSpotShadows=T,z.numSpotMaps=U,z.numLightProbes=N,s.version=Dw++)}function u(d,p){let m=0,_=0,E=0,w=0,S=0;const v=p.matrixWorldInverse;for(let g=0,R=d.length;g<R;g++){const P=d[g];if(P.isDirectionalLight){const T=s.directional[m];T.direction.setFromMatrixPosition(P.matrixWorld),r.setFromMatrixPosition(P.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),m++}else if(P.isSpotLight){const T=s.spot[E];T.position.setFromMatrixPosition(P.matrixWorld),T.position.applyMatrix4(v),T.direction.setFromMatrixPosition(P.matrixWorld),r.setFromMatrixPosition(P.target.matrixWorld),T.direction.sub(r),T.direction.transformDirection(v),E++}else if(P.isRectAreaLight){const T=s.rectArea[w];T.position.setFromMatrixPosition(P.matrixWorld),T.position.applyMatrix4(v),l.identity(),a.copy(P.matrixWorld),a.premultiply(v),l.extractRotation(a),T.halfWidth.set(P.width*.5,0,0),T.halfHeight.set(0,P.height*.5,0),T.halfWidth.applyMatrix4(l),T.halfHeight.applyMatrix4(l),w++}else if(P.isPointLight){const T=s.point[_];T.position.setFromMatrixPosition(P.matrixWorld),T.position.applyMatrix4(v),_++}else if(P.isHemisphereLight){const T=s.hemi[S];T.direction.setFromMatrixPosition(P.matrixWorld),T.direction.transformDirection(v),S++}}}return{setup:h,setupView:u,state:s}}function Td(n){const t=new Uw(n),e=[],s=[];function r(p){d.camera=p,e.length=0,s.length=0}function a(p){e.push(p)}function l(p){s.push(p)}function h(){t.setup(e)}function u(p){t.setupView(e,p)}const d={lightsArray:e,shadowsArray:s,camera:null,lights:t,transmissionRenderTarget:{}};return{init:r,state:d,setupLights:h,setupLightsView:u,pushLight:a,pushShadow:l}}function Ow(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new Td(n),t.set(r,[h])):a>=l.length?(h=new Td(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const Nw=`void main() {
3798
3798
  gl_Position = vec4( position, 1.0 );
3799
3799
  }`,Bw=`uniform sampler2D shadow_pass;
3800
3800
  uniform vec2 resolution;
@@ -3822,7 +3822,7 @@ void main() {
3822
3822
  squared_mean = squared_mean / samples;
3823
3823
  float std_dev = sqrt( squared_mean - mean * mean );
3824
3824
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3825
- }`;function Fw(n,t,e){let s=new Sc;const r=new be,a=new be,l=new ze,h=new F0({depthPacking:Dv}),u=new z0,d={},p=e.maxTextureSize,m={[Ai]:fn,[fn]:Ai,[ci]:ci},_=new vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:Nw,fragmentShader:Bw}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const S=new $n;S.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new pn(S,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jh;let g=this.type;this.render=function(N,B,z){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||N.length===0)return;const D=n.getRenderTarget(),M=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),Z=n.state;Z.setBlending(Ci),Z.buffers.depth.getReversed()?Z.buffers.color.setClear(0,0,0,0):Z.buffers.color.setClear(1,1,1,1),Z.buffers.depth.setTest(!0),Z.setScissorTest(!1);const J=g!==li&&this.type===li,V=g===li&&this.type!==li;for(let $=0,K=N.length;$<K;$++){const ut=N[$],G=ut.shadow;if(G===void 0){console.warn("THREE.WebGLShadowMap:",ut,"has no shadow.");continue}if(G.autoUpdate===!1&&G.needsUpdate===!1)continue;r.copy(G.mapSize);const Tt=G.getFrameExtents();if(r.multiply(Tt),a.copy(G.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/Tt.x),r.x=a.x*Tt.x,G.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/Tt.y),r.y=a.y*Tt.y,G.mapSize.y=a.y)),G.map===null||J===!0||V===!0){const St=this.type!==li?{minFilter:Fn,magFilter:Fn}:{};G.map!==null&&G.map.dispose(),G.map=new Ii(r.x,r.y,St),G.map.texture.name=ut.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const ot=G.getViewportCount();for(let St=0;St<ot;St++){const Gt=G.getViewport(St);l.set(a.x*Gt.x,a.y*Gt.y,a.x*Gt.z,a.y*Gt.w),Z.viewport(l),G.updateMatrices(ut,St),s=G.getFrustum(),T(B,z,G.camera,ut,this.type)}G.isPointLightShadow!==!0&&this.type===li&&I(G,z),G.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(D,M,k)};function I(N,B){const z=t.update(w);_.defines.VSM_SAMPLES!==N.blurSamples&&(_.defines.VSM_SAMPLES=N.blurSamples,E.defines.VSM_SAMPLES=N.blurSamples,_.needsUpdate=!0,E.needsUpdate=!0),N.mapPass===null&&(N.mapPass=new Ii(r.x,r.y)),_.uniforms.shadow_pass.value=N.map.texture,_.uniforms.resolution.value=N.mapSize,_.uniforms.radius.value=N.radius,n.setRenderTarget(N.mapPass),n.clear(),n.renderBufferDirect(B,null,z,_,w,null),E.uniforms.shadow_pass.value=N.mapPass.texture,E.uniforms.resolution.value=N.mapSize,E.uniforms.radius.value=N.radius,n.setRenderTarget(N.map),n.clear(),n.renderBufferDirect(B,null,z,E,w,null)}function C(N,B,z,D){let M=null;const k=z.isPointLight===!0?N.customDistanceMaterial:N.customDepthMaterial;if(k!==void 0)M=k;else if(M=z.isPointLight===!0?u:h,n.localClippingEnabled&&B.clipShadows===!0&&Array.isArray(B.clippingPlanes)&&B.clippingPlanes.length!==0||B.displacementMap&&B.displacementScale!==0||B.alphaMap&&B.alphaTest>0||B.map&&B.alphaTest>0||B.alphaToCoverage===!0){const Z=M.uuid,J=B.uuid;let V=d[Z];V===void 0&&(V={},d[Z]=V);let $=V[J];$===void 0&&($=M.clone(),V[J]=$,B.addEventListener("dispose",U)),M=$}if(M.visible=B.visible,M.wireframe=B.wireframe,D===li?M.side=B.shadowSide!==null?B.shadowSide:B.side:M.side=B.shadowSide!==null?B.shadowSide:m[B.side],M.alphaMap=B.alphaMap,M.alphaTest=B.alphaToCoverage===!0?.5:B.alphaTest,M.map=B.map,M.clipShadows=B.clipShadows,M.clippingPlanes=B.clippingPlanes,M.clipIntersection=B.clipIntersection,M.displacementMap=B.displacementMap,M.displacementScale=B.displacementScale,M.displacementBias=B.displacementBias,M.wireframeLinewidth=B.wireframeLinewidth,M.linewidth=B.linewidth,z.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const Z=n.properties.get(M);Z.light=z}return M}function T(N,B,z,D,M){if(N.visible===!1)return;if(N.layers.test(B.layers)&&(N.isMesh||N.isLine||N.isPoints)&&(N.castShadow||N.receiveShadow&&M===li)&&(!N.frustumCulled||s.intersectsObject(N))){N.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse,N.matrixWorld);const J=t.update(N),V=N.material;if(Array.isArray(V)){const $=J.groups;for(let K=0,ut=$.length;K<ut;K++){const G=$[K],Tt=V[G.materialIndex];if(Tt&&Tt.visible){const ot=C(N,Tt,D,M);N.onBeforeShadow(n,N,B,z,J,ot,G),n.renderBufferDirect(z,null,J,ot,N,G),N.onAfterShadow(n,N,B,z,J,ot,G)}}}else if(V.visible){const $=C(N,V,D,M);N.onBeforeShadow(n,N,B,z,J,$,null),n.renderBufferDirect(z,null,J,$,N,null),N.onAfterShadow(n,N,B,z,J,$,null)}}const Z=N.children;for(let J=0,V=Z.length;J<V;J++)T(Z[J],B,z,D,M)}function U(N){N.target.removeEventListener("dispose",U);for(const z in d){const D=d[z],M=N.target.uuid;M in D&&(D[M].dispose(),delete D[M])}}}const zw={[ol]:al,[ll]:ul,[cl]:dl,[Ms]:hl,[al]:ol,[ul]:ll,[dl]:cl,[hl]:Ms};function Hw(n,t){function e(){let H=!1;const wt=new ze;let Ct=null;const Ft=new ze(0,0,0,0);return{setMask:function(yt){Ct!==yt&&!H&&(n.colorMask(yt,yt,yt,yt),Ct=yt)},setLocked:function(yt){H=yt},setClear:function(yt,dt,Wt,le,De){De===!0&&(yt*=le,dt*=le,Wt*=le),wt.set(yt,dt,Wt,le),Ft.equals(wt)===!1&&(n.clearColor(yt,dt,Wt,le),Ft.copy(wt))},reset:function(){H=!1,Ct=null,Ft.set(-1,0,0,0)}}}function s(){let H=!1,wt=!1,Ct=null,Ft=null,yt=null;return{setReversed:function(dt){if(wt!==dt){const Wt=t.get("EXT_clip_control");dt?Wt.clipControlEXT(Wt.LOWER_LEFT_EXT,Wt.ZERO_TO_ONE_EXT):Wt.clipControlEXT(Wt.LOWER_LEFT_EXT,Wt.NEGATIVE_ONE_TO_ONE_EXT),wt=dt;const le=yt;yt=null,this.setClear(le)}},getReversed:function(){return wt},setTest:function(dt){dt?ft(n.DEPTH_TEST):kt(n.DEPTH_TEST)},setMask:function(dt){Ct!==dt&&!H&&(n.depthMask(dt),Ct=dt)},setFunc:function(dt){if(wt&&(dt=zw[dt]),Ft!==dt){switch(dt){case ol:n.depthFunc(n.NEVER);break;case al:n.depthFunc(n.ALWAYS);break;case ll:n.depthFunc(n.LESS);break;case Ms:n.depthFunc(n.LEQUAL);break;case cl:n.depthFunc(n.EQUAL);break;case hl:n.depthFunc(n.GEQUAL);break;case ul:n.depthFunc(n.GREATER);break;case dl:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ft=dt}},setLocked:function(dt){H=dt},setClear:function(dt){yt!==dt&&(wt&&(dt=1-dt),n.clearDepth(dt),yt=dt)},reset:function(){H=!1,Ct=null,Ft=null,yt=null,wt=!1}}}function r(){let H=!1,wt=null,Ct=null,Ft=null,yt=null,dt=null,Wt=null,le=null,De=null;return{setTest:function(Me){H||(Me?ft(n.STENCIL_TEST):kt(n.STENCIL_TEST))},setMask:function(Me){wt!==Me&&!H&&(n.stencilMask(Me),wt=Me)},setFunc:function(Me,bn,On){(Ct!==Me||Ft!==bn||yt!==On)&&(n.stencilFunc(Me,bn,On),Ct=Me,Ft=bn,yt=On)},setOp:function(Me,bn,On){(dt!==Me||Wt!==bn||le!==On)&&(n.stencilOp(Me,bn,On),dt=Me,Wt=bn,le=On)},setLocked:function(Me){H=Me},setClear:function(Me){De!==Me&&(n.clearStencil(Me),De=Me)},reset:function(){H=!1,wt=null,Ct=null,Ft=null,yt=null,dt=null,Wt=null,le=null,De=null}}}const a=new e,l=new s,h=new r,u=new WeakMap,d=new WeakMap;let p={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,T=null,U=null,N=null,B=new Pe(0,0,0),z=0,D=!1,M=null,k=null,Z=null,J=null,V=null;const $=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let K=!1,ut=0;const G=n.getParameter(n.VERSION);G.indexOf("WebGL")!==-1?(ut=parseFloat(/^WebGL (\d)/.exec(G)[1]),K=ut>=1):G.indexOf("OpenGL ES")!==-1&&(ut=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),K=ut>=2);let Tt=null,ot={};const St=n.getParameter(n.SCISSOR_BOX),Gt=n.getParameter(n.VIEWPORT),pt=new ze().fromArray(St),Lt=new ze().fromArray(Gt);function Y(H,wt,Ct,Ft){const yt=new Uint8Array(4),dt=n.createTexture();n.bindTexture(H,dt),n.texParameteri(H,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(H,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Wt=0;Wt<Ct;Wt++)H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY?n.texImage3D(wt,0,n.RGBA,1,1,Ft,0,n.RGBA,n.UNSIGNED_BYTE,yt):n.texImage2D(wt+Wt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,yt);return dt}const it={};it[n.TEXTURE_2D]=Y(n.TEXTURE_2D,n.TEXTURE_2D,1),it[n.TEXTURE_CUBE_MAP]=Y(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),it[n.TEXTURE_2D_ARRAY]=Y(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),it[n.TEXTURE_3D]=Y(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),ft(n.DEPTH_TEST),l.setFunc(Ms),vt(!1),gt(jh),ft(n.CULL_FACE),lt(Ci);function ft(H){p[H]!==!0&&(n.enable(H),p[H]=!0)}function kt(H){p[H]!==!1&&(n.disable(H),p[H]=!1)}function Ot(H,wt){return m[H]!==wt?(n.bindFramebuffer(H,wt),m[H]=wt,H===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=wt),H===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=wt),!0):!1}function zt(H,wt){let Ct=E,Ft=!1;if(H){Ct=_.get(wt),Ct===void 0&&(Ct=[],_.set(wt,Ct));const yt=H.textures;if(Ct.length!==yt.length||Ct[0]!==n.COLOR_ATTACHMENT0){for(let dt=0,Wt=yt.length;dt<Wt;dt++)Ct[dt]=n.COLOR_ATTACHMENT0+dt;Ct.length=yt.length,Ft=!0}}else Ct[0]!==n.BACK&&(Ct[0]=n.BACK,Ft=!0);Ft&&n.drawBuffers(Ct)}function ct(H){return S!==H?(n.useProgram(H),S=H,!0):!1}const ht={[ts]:n.FUNC_ADD,[ov]:n.FUNC_SUBTRACT,[av]:n.FUNC_REVERSE_SUBTRACT};ht[lv]=n.MIN,ht[cv]=n.MAX;const P={[hv]:n.ZERO,[uv]:n.ONE,[dv]:n.SRC_COLOR,[sl]:n.SRC_ALPHA,[vv]:n.SRC_ALPHA_SATURATE,[gv]:n.DST_COLOR,[pv]:n.DST_ALPHA,[fv]:n.ONE_MINUS_SRC_COLOR,[rl]:n.ONE_MINUS_SRC_ALPHA,[_v]:n.ONE_MINUS_DST_COLOR,[mv]:n.ONE_MINUS_DST_ALPHA,[yv]:n.CONSTANT_COLOR,[Ev]:n.ONE_MINUS_CONSTANT_COLOR,[xv]:n.CONSTANT_ALPHA,[wv]:n.ONE_MINUS_CONSTANT_ALPHA};function lt(H,wt,Ct,Ft,yt,dt,Wt,le,De,Me){if(H===Ci){w===!0&&(kt(n.BLEND),w=!1);return}if(w===!1&&(ft(n.BLEND),w=!0),H!==rv){if(H!==v||Me!==D){if((g!==ts||T!==ts)&&(n.blendEquation(n.FUNC_ADD),g=ts,T=ts),Me)switch(H){case Ss:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFunc(n.ONE,n.ONE);break;case $h:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case tu:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Ss:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case $h:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case tu:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}I=null,C=null,U=null,N=null,B.set(0,0,0),z=0,v=H,D=Me}return}yt=yt||wt,dt=dt||Ct,Wt=Wt||Ft,(wt!==g||yt!==T)&&(n.blendEquationSeparate(ht[wt],ht[yt]),g=wt,T=yt),(Ct!==I||Ft!==C||dt!==U||Wt!==N)&&(n.blendFuncSeparate(P[Ct],P[Ft],P[dt],P[Wt]),I=Ct,C=Ft,U=dt,N=Wt),(le.equals(B)===!1||De!==z)&&(n.blendColor(le.r,le.g,le.b,De),B.copy(le),z=De),v=H,D=!1}function at(H,wt){H.side===ci?kt(n.CULL_FACE):ft(n.CULL_FACE);let Ct=H.side===fn;wt&&(Ct=!Ct),vt(Ct),H.blending===Ss&&H.transparent===!1?lt(Ci):lt(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),l.setFunc(H.depthFunc),l.setTest(H.depthTest),l.setMask(H.depthWrite),a.setMask(H.colorWrite);const Ft=H.stencilWrite;h.setTest(Ft),Ft&&(h.setMask(H.stencilWriteMask),h.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),h.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),bt(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?ft(n.SAMPLE_ALPHA_TO_COVERAGE):kt(n.SAMPLE_ALPHA_TO_COVERAGE)}function vt(H){M!==H&&(H?n.frontFace(n.CW):n.frontFace(n.CCW),M=H)}function gt(H){H!==nv?(ft(n.CULL_FACE),H!==k&&(H===jh?n.cullFace(n.BACK):H===iv?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):kt(n.CULL_FACE),k=H}function Bt(H){H!==Z&&(K&&n.lineWidth(H),Z=H)}function bt(H,wt,Ct){H?(ft(n.POLYGON_OFFSET_FILL),(J!==wt||V!==Ct)&&(n.polygonOffset(wt,Ct),J=wt,V=Ct)):kt(n.POLYGON_OFFSET_FILL)}function Zt(H){H?ft(n.SCISSOR_TEST):kt(n.SCISSOR_TEST)}function ve(H){H===void 0&&(H=n.TEXTURE0+$-1),Tt!==H&&(n.activeTexture(H),Tt=H)}function Ae(H,wt,Ct){Ct===void 0&&(Tt===null?Ct=n.TEXTURE0+$-1:Ct=Tt);let Ft=ot[Ct];Ft===void 0&&(Ft={type:void 0,texture:void 0},ot[Ct]=Ft),(Ft.type!==H||Ft.texture!==wt)&&(Tt!==Ct&&(n.activeTexture(Ct),Tt=Ct),n.bindTexture(H,wt||it[H]),Ft.type=H,Ft.texture=wt)}function O(){const H=ot[Tt];H!==void 0&&H.type!==void 0&&(n.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function A(){try{n.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function j(){try{n.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function rt(){try{n.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function _t(){try{n.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function st(){try{n.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Xt(){try{n.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function At(){try{n.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ht(){try{n.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Yt(){try{n.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function xt(){try{n.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function It(H){pt.equals(H)===!1&&(n.scissor(H.x,H.y,H.z,H.w),pt.copy(H))}function se(H){Lt.equals(H)===!1&&(n.viewport(H.x,H.y,H.z,H.w),Lt.copy(H))}function qt(H,wt){let Ct=d.get(wt);Ct===void 0&&(Ct=new WeakMap,d.set(wt,Ct));let Ft=Ct.get(H);Ft===void 0&&(Ft=n.getUniformBlockIndex(wt,H.name),Ct.set(H,Ft))}function Pt(H,wt){const Ft=d.get(wt).get(H);u.get(wt)!==Ft&&(n.uniformBlockBinding(wt,Ft,H.__bindingPointIndex),u.set(wt,Ft))}function ce(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),l.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},Tt=null,ot={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,I=null,C=null,T=null,U=null,N=null,B=new Pe(0,0,0),z=0,D=!1,M=null,k=null,Z=null,J=null,V=null,pt.set(0,0,n.canvas.width,n.canvas.height),Lt.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:ft,disable:kt,bindFramebuffer:Ot,drawBuffers:zt,useProgram:ct,setBlending:lt,setMaterial:at,setFlipSided:vt,setCullFace:gt,setLineWidth:Bt,setPolygonOffset:bt,setScissorTest:Zt,activeTexture:ve,bindTexture:Ae,unbindTexture:O,compressedTexImage2D:A,compressedTexImage3D:j,texImage2D:Yt,texImage3D:xt,updateUBOMapping:qt,uniformBlockBinding:Pt,texStorage2D:At,texStorage3D:Ht,texSubImage2D:rt,texSubImage3D:_t,compressedTexSubImage2D:st,compressedTexSubImage3D:Xt,scissor:It,viewport:se,reset:ce}}function Vw(n,t,e,s,r,a,l){const h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new be,p=new WeakMap;let m;const _=new WeakMap;let E=!1;try{E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function S(O,A){return E?new OffscreenCanvas(O,A):Mr("canvas")}function w(O,A,j){let rt=1;const _t=Ae(O);if((_t.width>j||_t.height>j)&&(rt=j/Math.max(_t.width,_t.height)),rt<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const st=Math.floor(rt*_t.width),Xt=Math.floor(rt*_t.height);m===void 0&&(m=S(st,Xt));const At=A?S(st,Xt):m;return At.width=st,At.height=Xt,At.getContext("2d").drawImage(O,0,0,st,Xt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+_t.width+"x"+_t.height+") to ("+st+"x"+Xt+")."),At}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+_t.width+"x"+_t.height+")."),O;return O}function v(O){return O.generateMipmaps}function g(O){n.generateMipmap(O)}function I(O){return O.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?n.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function C(O,A,j,rt,_t=!1){if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let st=A;if(A===n.RED&&(j===n.FLOAT&&(st=n.R32F),j===n.HALF_FLOAT&&(st=n.R16F),j===n.UNSIGNED_BYTE&&(st=n.R8)),A===n.RED_INTEGER&&(j===n.UNSIGNED_BYTE&&(st=n.R8UI),j===n.UNSIGNED_SHORT&&(st=n.R16UI),j===n.UNSIGNED_INT&&(st=n.R32UI),j===n.BYTE&&(st=n.R8I),j===n.SHORT&&(st=n.R16I),j===n.INT&&(st=n.R32I)),A===n.RG&&(j===n.FLOAT&&(st=n.RG32F),j===n.HALF_FLOAT&&(st=n.RG16F),j===n.UNSIGNED_BYTE&&(st=n.RG8)),A===n.RG_INTEGER&&(j===n.UNSIGNED_BYTE&&(st=n.RG8UI),j===n.UNSIGNED_SHORT&&(st=n.RG16UI),j===n.UNSIGNED_INT&&(st=n.RG32UI),j===n.BYTE&&(st=n.RG8I),j===n.SHORT&&(st=n.RG16I),j===n.INT&&(st=n.RG32I)),A===n.RGB_INTEGER&&(j===n.UNSIGNED_BYTE&&(st=n.RGB8UI),j===n.UNSIGNED_SHORT&&(st=n.RGB16UI),j===n.UNSIGNED_INT&&(st=n.RGB32UI),j===n.BYTE&&(st=n.RGB8I),j===n.SHORT&&(st=n.RGB16I),j===n.INT&&(st=n.RGB32I)),A===n.RGBA_INTEGER&&(j===n.UNSIGNED_BYTE&&(st=n.RGBA8UI),j===n.UNSIGNED_SHORT&&(st=n.RGBA16UI),j===n.UNSIGNED_INT&&(st=n.RGBA32UI),j===n.BYTE&&(st=n.RGBA8I),j===n.SHORT&&(st=n.RGBA16I),j===n.INT&&(st=n.RGBA32I)),A===n.RGB&&j===n.UNSIGNED_INT_5_9_9_9_REV&&(st=n.RGB9_E5),A===n.RGBA){const Xt=_t?To:Se.getTransfer(rt);j===n.FLOAT&&(st=n.RGBA32F),j===n.HALF_FLOAT&&(st=n.RGBA16F),j===n.UNSIGNED_BYTE&&(st=Xt===Ie?n.SRGB8_ALPHA8:n.RGBA8),j===n.UNSIGNED_SHORT_4_4_4_4&&(st=n.RGBA4),j===n.UNSIGNED_SHORT_5_5_5_1&&(st=n.RGB5_A1)}return(st===n.R16F||st===n.R32F||st===n.RG16F||st===n.RG32F||st===n.RGBA16F||st===n.RGBA32F)&&t.get("EXT_color_buffer_float"),st}function T(O,A){let j;return O?A===null||A===ns||A===vr?j=n.DEPTH24_STENCIL8:A===ui?j=n.DEPTH32F_STENCIL8:A===gr&&(j=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):A===null||A===ns||A===vr?j=n.DEPTH_COMPONENT24:A===ui?j=n.DEPTH_COMPONENT32F:A===gr&&(j=n.DEPTH_COMPONENT16),j}function U(O,A){return v(O)===!0||O.isFramebufferTexture&&O.minFilter!==Fn&&O.minFilter!==En?Math.log2(Math.max(A.width,A.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?A.mipmaps.length:1}function N(O){const A=O.target;A.removeEventListener("dispose",N),z(A),A.isVideoTexture&&p.delete(A)}function B(O){const A=O.target;A.removeEventListener("dispose",B),M(A)}function z(O){const A=s.get(O);if(A.__webglInit===void 0)return;const j=O.source,rt=_.get(j);if(rt){const _t=rt[A.__cacheKey];_t.usedTimes--,_t.usedTimes===0&&D(O),Object.keys(rt).length===0&&_.delete(j)}s.remove(O)}function D(O){const A=s.get(O);n.deleteTexture(A.__webglTexture);const j=O.source,rt=_.get(j);delete rt[A.__cacheKey],l.memory.textures--}function M(O){const A=s.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),s.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let rt=0;rt<6;rt++){if(Array.isArray(A.__webglFramebuffer[rt]))for(let _t=0;_t<A.__webglFramebuffer[rt].length;_t++)n.deleteFramebuffer(A.__webglFramebuffer[rt][_t]);else n.deleteFramebuffer(A.__webglFramebuffer[rt]);A.__webglDepthbuffer&&n.deleteRenderbuffer(A.__webglDepthbuffer[rt])}else{if(Array.isArray(A.__webglFramebuffer))for(let rt=0;rt<A.__webglFramebuffer.length;rt++)n.deleteFramebuffer(A.__webglFramebuffer[rt]);else n.deleteFramebuffer(A.__webglFramebuffer);if(A.__webglDepthbuffer&&n.deleteRenderbuffer(A.__webglDepthbuffer),A.__webglMultisampledFramebuffer&&n.deleteFramebuffer(A.__webglMultisampledFramebuffer),A.__webglColorRenderbuffer)for(let rt=0;rt<A.__webglColorRenderbuffer.length;rt++)A.__webglColorRenderbuffer[rt]&&n.deleteRenderbuffer(A.__webglColorRenderbuffer[rt]);A.__webglDepthRenderbuffer&&n.deleteRenderbuffer(A.__webglDepthRenderbuffer)}const j=O.textures;for(let rt=0,_t=j.length;rt<_t;rt++){const st=s.get(j[rt]);st.__webglTexture&&(n.deleteTexture(st.__webglTexture),l.memory.textures--),s.remove(j[rt])}s.remove(O)}let k=0;function Z(){k=0}function J(){const O=k;return O>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+r.maxTextures),k+=1,O}function V(O){const A=[];return A.push(O.wrapS),A.push(O.wrapT),A.push(O.wrapR||0),A.push(O.magFilter),A.push(O.minFilter),A.push(O.anisotropy),A.push(O.internalFormat),A.push(O.format),A.push(O.type),A.push(O.generateMipmaps),A.push(O.premultiplyAlpha),A.push(O.flipY),A.push(O.unpackAlignment),A.push(O.colorSpace),A.join()}function $(O,A){const j=s.get(O);if(O.isVideoTexture&&Zt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&j.__version!==O.version){const rt=O.image;if(rt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(rt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{it(j,O,A);return}}else O.isExternalTexture&&(j.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,j.__webglTexture,n.TEXTURE0+A)}function K(O,A){const j=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&j.__version!==O.version){it(j,O,A);return}e.bindTexture(n.TEXTURE_2D_ARRAY,j.__webglTexture,n.TEXTURE0+A)}function ut(O,A){const j=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&j.__version!==O.version){it(j,O,A);return}e.bindTexture(n.TEXTURE_3D,j.__webglTexture,n.TEXTURE0+A)}function G(O,A){const j=s.get(O);if(O.version>0&&j.__version!==O.version){ft(j,O,A);return}e.bindTexture(n.TEXTURE_CUBE_MAP,j.__webglTexture,n.TEXTURE0+A)}const Tt={[ml]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[gl]:n.MIRRORED_REPEAT},ot={[Fn]:n.NEAREST,[Lv]:n.NEAREST_MIPMAP_NEAREST,[yo]:n.NEAREST_MIPMAP_LINEAR,[En]:n.LINEAR,[_l]:n.LINEAR_MIPMAP_NEAREST,[Ri]:n.LINEAR_MIPMAP_LINEAR},St={[Ov]:n.NEVER,[Vv]:n.ALWAYS,[Nv]:n.LESS,[fu]:n.LEQUAL,[Bv]:n.EQUAL,[Hv]:n.GEQUAL,[Fv]:n.GREATER,[zv]:n.NOTEQUAL};function Gt(O,A){if(A.type===ui&&t.has("OES_texture_float_linear")===!1&&(A.magFilter===En||A.magFilter===_l||A.magFilter===yo||A.magFilter===Ri||A.minFilter===En||A.minFilter===_l||A.minFilter===yo||A.minFilter===Ri)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(O,n.TEXTURE_WRAP_S,Tt[A.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,Tt[A.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,Tt[A.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,ot[A.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,ot[A.minFilter]),A.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,St[A.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(A.magFilter===Fn||A.minFilter!==yo&&A.minFilter!==Ri||A.type===ui&&t.has("OES_texture_float_linear")===!1)return;if(A.anisotropy>1||s.get(A).__currentAnisotropy){const j=t.get("EXT_texture_filter_anisotropic");n.texParameterf(O,j.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(A.anisotropy,r.getMaxAnisotropy())),s.get(A).__currentAnisotropy=A.anisotropy}}}function pt(O,A){let j=!1;O.__webglInit===void 0&&(O.__webglInit=!0,A.addEventListener("dispose",N));const rt=A.source;let _t=_.get(rt);_t===void 0&&(_t={},_.set(rt,_t));const st=V(A);if(st!==O.__cacheKey){_t[st]===void 0&&(_t[st]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,j=!0),_t[st].usedTimes++;const Xt=_t[O.__cacheKey];Xt!==void 0&&(_t[O.__cacheKey].usedTimes--,Xt.usedTimes===0&&D(A)),O.__cacheKey=st,O.__webglTexture=_t[st].texture}return j}function Lt(O,A,j){return Math.floor(Math.floor(O/j)/A)}function Y(O,A,j,rt){const st=O.updateRanges;if(st.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,A.width,A.height,j,rt,A.data);else{st.sort((xt,It)=>xt.start-It.start);let Xt=0;for(let xt=1;xt<st.length;xt++){const It=st[Xt],se=st[xt],qt=It.start+It.count,Pt=Lt(se.start,A.width,4),ce=Lt(It.start,A.width,4);se.start<=qt+1&&Pt===ce&&Lt(se.start+se.count-1,A.width,4)===Pt?It.count=Math.max(It.count,se.start+se.count-It.start):(++Xt,st[Xt]=se)}st.length=Xt+1;const At=n.getParameter(n.UNPACK_ROW_LENGTH),Ht=n.getParameter(n.UNPACK_SKIP_PIXELS),Yt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,A.width);for(let xt=0,It=st.length;xt<It;xt++){const se=st[xt],qt=Math.floor(se.start/4),Pt=Math.ceil(se.count/4),ce=qt%A.width,H=Math.floor(qt/A.width),wt=Pt,Ct=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,H),e.texSubImage2D(n.TEXTURE_2D,0,ce,H,wt,Ct,j,rt,A.data)}O.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,At),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ht),n.pixelStorei(n.UNPACK_SKIP_ROWS,Yt)}}function it(O,A,j){let rt=n.TEXTURE_2D;(A.isDataArrayTexture||A.isCompressedArrayTexture)&&(rt=n.TEXTURE_2D_ARRAY),A.isData3DTexture&&(rt=n.TEXTURE_3D);const _t=pt(O,A),st=A.source;e.bindTexture(rt,O.__webglTexture,n.TEXTURE0+j);const Xt=s.get(st);if(st.version!==Xt.__version||_t===!0){e.activeTexture(n.TEXTURE0+j);const At=Se.getPrimaries(Se.workingColorSpace),Ht=A.colorSpace===Li?null:Se.getPrimaries(A.colorSpace),Yt=A.colorSpace===Li||At===Ht?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,A.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,A.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Yt);let xt=w(A.image,!1,r.maxTextureSize);xt=ve(A,xt);const It=a.convert(A.format,A.colorSpace),se=a.convert(A.type);let qt=C(A.internalFormat,It,se,A.colorSpace,A.isVideoTexture);Gt(rt,A);let Pt;const ce=A.mipmaps,H=A.isVideoTexture!==!0,wt=Xt.__version===void 0||_t===!0,Ct=st.dataReady,Ft=U(A,xt);if(A.isDepthTexture)qt=T(A.format===Er,A.type),wt&&(H?e.texStorage2D(n.TEXTURE_2D,1,qt,xt.width,xt.height):e.texImage2D(n.TEXTURE_2D,0,qt,xt.width,xt.height,0,It,se,null));else if(A.isDataTexture)if(ce.length>0){H&&wt&&e.texStorage2D(n.TEXTURE_2D,Ft,qt,ce[0].width,ce[0].height);for(let yt=0,dt=ce.length;yt<dt;yt++)Pt=ce[yt],H?Ct&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,It,se,Pt.data):e.texImage2D(n.TEXTURE_2D,yt,qt,Pt.width,Pt.height,0,It,se,Pt.data);A.generateMipmaps=!1}else H?(wt&&e.texStorage2D(n.TEXTURE_2D,Ft,qt,xt.width,xt.height),Ct&&Y(A,xt,It,se)):e.texImage2D(n.TEXTURE_2D,0,qt,xt.width,xt.height,0,It,se,xt.data);else if(A.isCompressedTexture)if(A.isCompressedArrayTexture){H&&wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ft,qt,ce[0].width,ce[0].height,xt.depth);for(let yt=0,dt=ce.length;yt<dt;yt++)if(Pt=ce[yt],A.format!==zn)if(It!==null)if(H){if(Ct)if(A.layerUpdates.size>0){const Wt=ju(Pt.width,Pt.height,A.format,A.type);for(const le of A.layerUpdates){const De=Pt.data.subarray(le*Wt/Pt.data.BYTES_PER_ELEMENT,(le+1)*Wt/Pt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,le,Pt.width,Pt.height,1,It,De)}A.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Pt.width,Pt.height,xt.depth,It,Pt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,yt,qt,Pt.width,Pt.height,xt.depth,0,Pt.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?Ct&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Pt.width,Pt.height,xt.depth,It,se,Pt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,yt,qt,Pt.width,Pt.height,xt.depth,0,It,se,Pt.data)}else{H&&wt&&e.texStorage2D(n.TEXTURE_2D,Ft,qt,ce[0].width,ce[0].height);for(let yt=0,dt=ce.length;yt<dt;yt++)Pt=ce[yt],A.format!==zn?It!==null?H?Ct&&e.compressedTexSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,It,Pt.data):e.compressedTexImage2D(n.TEXTURE_2D,yt,qt,Pt.width,Pt.height,0,Pt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?Ct&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,It,se,Pt.data):e.texImage2D(n.TEXTURE_2D,yt,qt,Pt.width,Pt.height,0,It,se,Pt.data)}else if(A.isDataArrayTexture)if(H){if(wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ft,qt,xt.width,xt.height,xt.depth),Ct)if(A.layerUpdates.size>0){const yt=ju(xt.width,xt.height,A.format,A.type);for(const dt of A.layerUpdates){const Wt=xt.data.subarray(dt*yt/xt.data.BYTES_PER_ELEMENT,(dt+1)*yt/xt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,dt,xt.width,xt.height,1,It,se,Wt)}A.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,It,se,xt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,qt,xt.width,xt.height,xt.depth,0,It,se,xt.data);else if(A.isData3DTexture)H?(wt&&e.texStorage3D(n.TEXTURE_3D,Ft,qt,xt.width,xt.height,xt.depth),Ct&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,It,se,xt.data)):e.texImage3D(n.TEXTURE_3D,0,qt,xt.width,xt.height,xt.depth,0,It,se,xt.data);else if(A.isFramebufferTexture){if(wt)if(H)e.texStorage2D(n.TEXTURE_2D,Ft,qt,xt.width,xt.height);else{let yt=xt.width,dt=xt.height;for(let Wt=0;Wt<Ft;Wt++)e.texImage2D(n.TEXTURE_2D,Wt,qt,yt,dt,0,It,se,null),yt>>=1,dt>>=1}}else if(ce.length>0){if(H&&wt){const yt=Ae(ce[0]);e.texStorage2D(n.TEXTURE_2D,Ft,qt,yt.width,yt.height)}for(let yt=0,dt=ce.length;yt<dt;yt++)Pt=ce[yt],H?Ct&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,It,se,Pt):e.texImage2D(n.TEXTURE_2D,yt,qt,It,se,Pt);A.generateMipmaps=!1}else if(H){if(wt){const yt=Ae(xt);e.texStorage2D(n.TEXTURE_2D,Ft,qt,yt.width,yt.height)}Ct&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,It,se,xt)}else e.texImage2D(n.TEXTURE_2D,0,qt,It,se,xt);v(A)&&g(rt),Xt.__version=st.version,A.onUpdate&&A.onUpdate(A)}O.__version=A.version}function ft(O,A,j){if(A.image.length!==6)return;const rt=pt(O,A),_t=A.source;e.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+j);const st=s.get(_t);if(_t.version!==st.__version||rt===!0){e.activeTexture(n.TEXTURE0+j);const Xt=Se.getPrimaries(Se.workingColorSpace),At=A.colorSpace===Li?null:Se.getPrimaries(A.colorSpace),Ht=A.colorSpace===Li||Xt===At?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,A.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,A.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,A.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const Yt=A.isCompressedTexture||A.image[0].isCompressedTexture,xt=A.image[0]&&A.image[0].isDataTexture,It=[];for(let dt=0;dt<6;dt++)!Yt&&!xt?It[dt]=w(A.image[dt],!0,r.maxCubemapSize):It[dt]=xt?A.image[dt].image:A.image[dt],It[dt]=ve(A,It[dt]);const se=It[0],qt=a.convert(A.format,A.colorSpace),Pt=a.convert(A.type),ce=C(A.internalFormat,qt,Pt,A.colorSpace),H=A.isVideoTexture!==!0,wt=st.__version===void 0||rt===!0,Ct=_t.dataReady;let Ft=U(A,se);Gt(n.TEXTURE_CUBE_MAP,A);let yt;if(Yt){H&&wt&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ft,ce,se.width,se.height);for(let dt=0;dt<6;dt++){yt=It[dt].mipmaps;for(let Wt=0;Wt<yt.length;Wt++){const le=yt[Wt];A.format!==zn?qt!==null?H?Ct&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,0,0,le.width,le.height,qt,le.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,ce,le.width,le.height,0,le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,0,0,le.width,le.height,qt,Pt,le.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,ce,le.width,le.height,0,qt,Pt,le.data)}}}else{if(yt=A.mipmaps,H&&wt){yt.length>0&&Ft++;const dt=Ae(It[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ft,ce,dt.width,dt.height)}for(let dt=0;dt<6;dt++)if(xt){H?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,It[dt].width,It[dt].height,qt,Pt,It[dt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,ce,It[dt].width,It[dt].height,0,qt,Pt,It[dt].data);for(let Wt=0;Wt<yt.length;Wt++){const De=yt[Wt].image[dt].image;H?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,0,0,De.width,De.height,qt,Pt,De.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,ce,De.width,De.height,0,qt,Pt,De.data)}}else{H?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,qt,Pt,It[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,ce,qt,Pt,It[dt]);for(let Wt=0;Wt<yt.length;Wt++){const le=yt[Wt];H?Ct&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,0,0,qt,Pt,le.image[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,ce,qt,Pt,le.image[dt])}}}v(A)&&g(n.TEXTURE_CUBE_MAP),st.__version=_t.version,A.onUpdate&&A.onUpdate(A)}O.__version=A.version}function kt(O,A,j,rt,_t,st){const Xt=a.convert(j.format,j.colorSpace),At=a.convert(j.type),Ht=C(j.internalFormat,Xt,At,j.colorSpace),Yt=s.get(A),xt=s.get(j);if(xt.__renderTarget=A,!Yt.__hasExternalTextures){const It=Math.max(1,A.width>>st),se=Math.max(1,A.height>>st);_t===n.TEXTURE_3D||_t===n.TEXTURE_2D_ARRAY?e.texImage3D(_t,st,Ht,It,se,A.depth,0,Xt,At,null):e.texImage2D(_t,st,Ht,It,se,0,Xt,At,null)}e.bindFramebuffer(n.FRAMEBUFFER,O),bt(A)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,rt,_t,xt.__webglTexture,0,Bt(A)):(_t===n.TEXTURE_2D||_t>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_t<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,rt,_t,xt.__webglTexture,st),e.bindFramebuffer(n.FRAMEBUFFER,null)}function Ot(O,A,j){if(n.bindRenderbuffer(n.RENDERBUFFER,O),A.depthBuffer){const rt=A.depthTexture,_t=rt&&rt.isDepthTexture?rt.type:null,st=T(A.stencilBuffer,_t),Xt=A.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,At=Bt(A);bt(A)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,At,st,A.width,A.height):j?n.renderbufferStorageMultisample(n.RENDERBUFFER,At,st,A.width,A.height):n.renderbufferStorage(n.RENDERBUFFER,st,A.width,A.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Xt,n.RENDERBUFFER,O)}else{const rt=A.textures;for(let _t=0;_t<rt.length;_t++){const st=rt[_t],Xt=a.convert(st.format,st.colorSpace),At=a.convert(st.type),Ht=C(st.internalFormat,Xt,At,st.colorSpace),Yt=Bt(A);j&&bt(A)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Yt,Ht,A.width,A.height):bt(A)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Yt,Ht,A.width,A.height):n.renderbufferStorage(n.RENDERBUFFER,Ht,A.width,A.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function zt(O,A){if(A&&A.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(n.FRAMEBUFFER,O),!(A.depthTexture&&A.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const rt=s.get(A.depthTexture);rt.__renderTarget=A,(!rt.__webglTexture||A.depthTexture.image.width!==A.width||A.depthTexture.image.height!==A.height)&&(A.depthTexture.image.width=A.width,A.depthTexture.image.height=A.height,A.depthTexture.needsUpdate=!0),$(A.depthTexture,0);const _t=rt.__webglTexture,st=Bt(A);if(A.depthTexture.format===yr)bt(A)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0,st):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0);else if(A.depthTexture.format===Er)bt(A)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0,st):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0);else throw new Error("Unknown depthTexture format")}function ct(O){const A=s.get(O),j=O.isWebGLCubeRenderTarget===!0;if(A.__boundDepthTexture!==O.depthTexture){const rt=O.depthTexture;if(A.__depthDisposeCallback&&A.__depthDisposeCallback(),rt){const _t=()=>{delete A.__boundDepthTexture,delete A.__depthDisposeCallback,rt.removeEventListener("dispose",_t)};rt.addEventListener("dispose",_t),A.__depthDisposeCallback=_t}A.__boundDepthTexture=rt}if(O.depthTexture&&!A.__autoAllocateDepthBuffer){if(j)throw new Error("target.depthTexture not supported in Cube render targets");const rt=O.texture.mipmaps;rt&&rt.length>0?zt(A.__webglFramebuffer[0],O):zt(A.__webglFramebuffer,O)}else if(j){A.__webglDepthbuffer=[];for(let rt=0;rt<6;rt++)if(e.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer[rt]),A.__webglDepthbuffer[rt]===void 0)A.__webglDepthbuffer[rt]=n.createRenderbuffer(),Ot(A.__webglDepthbuffer[rt],O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,st=A.__webglDepthbuffer[rt];n.bindRenderbuffer(n.RENDERBUFFER,st),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,st)}}else{const rt=O.texture.mipmaps;if(rt&&rt.length>0?e.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer[0]):e.bindFramebuffer(n.FRAMEBUFFER,A.__webglFramebuffer),A.__webglDepthbuffer===void 0)A.__webglDepthbuffer=n.createRenderbuffer(),Ot(A.__webglDepthbuffer,O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,st=A.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,st),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,st)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function ht(O,A,j){const rt=s.get(O);A!==void 0&&kt(rt.__webglFramebuffer,O,O.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),j!==void 0&&ct(O)}function P(O){const A=O.texture,j=s.get(O),rt=s.get(A);O.addEventListener("dispose",B);const _t=O.textures,st=O.isWebGLCubeRenderTarget===!0,Xt=_t.length>1;if(Xt||(rt.__webglTexture===void 0&&(rt.__webglTexture=n.createTexture()),rt.__version=A.version,l.memory.textures++),st){j.__webglFramebuffer=[];for(let At=0;At<6;At++)if(A.mipmaps&&A.mipmaps.length>0){j.__webglFramebuffer[At]=[];for(let Ht=0;Ht<A.mipmaps.length;Ht++)j.__webglFramebuffer[At][Ht]=n.createFramebuffer()}else j.__webglFramebuffer[At]=n.createFramebuffer()}else{if(A.mipmaps&&A.mipmaps.length>0){j.__webglFramebuffer=[];for(let At=0;At<A.mipmaps.length;At++)j.__webglFramebuffer[At]=n.createFramebuffer()}else j.__webglFramebuffer=n.createFramebuffer();if(Xt)for(let At=0,Ht=_t.length;At<Ht;At++){const Yt=s.get(_t[At]);Yt.__webglTexture===void 0&&(Yt.__webglTexture=n.createTexture(),l.memory.textures++)}if(O.samples>0&&bt(O)===!1){j.__webglMultisampledFramebuffer=n.createFramebuffer(),j.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,j.__webglMultisampledFramebuffer);for(let At=0;At<_t.length;At++){const Ht=_t[At];j.__webglColorRenderbuffer[At]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,j.__webglColorRenderbuffer[At]);const Yt=a.convert(Ht.format,Ht.colorSpace),xt=a.convert(Ht.type),It=C(Ht.internalFormat,Yt,xt,Ht.colorSpace,O.isXRRenderTarget===!0),se=Bt(O);n.renderbufferStorageMultisample(n.RENDERBUFFER,se,It,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+At,n.RENDERBUFFER,j.__webglColorRenderbuffer[At])}n.bindRenderbuffer(n.RENDERBUFFER,null),O.depthBuffer&&(j.__webglDepthRenderbuffer=n.createRenderbuffer(),Ot(j.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(st){e.bindTexture(n.TEXTURE_CUBE_MAP,rt.__webglTexture),Gt(n.TEXTURE_CUBE_MAP,A);for(let At=0;At<6;At++)if(A.mipmaps&&A.mipmaps.length>0)for(let Ht=0;Ht<A.mipmaps.length;Ht++)kt(j.__webglFramebuffer[At][Ht],O,A,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+At,Ht);else kt(j.__webglFramebuffer[At],O,A,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+At,0);v(A)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Xt){for(let At=0,Ht=_t.length;At<Ht;At++){const Yt=_t[At],xt=s.get(Yt);let It=n.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(It=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(It,xt.__webglTexture),Gt(It,Yt),kt(j.__webglFramebuffer,O,Yt,n.COLOR_ATTACHMENT0+At,It,0),v(Yt)&&g(It)}e.unbindTexture()}else{let At=n.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(At=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(At,rt.__webglTexture),Gt(At,A),A.mipmaps&&A.mipmaps.length>0)for(let Ht=0;Ht<A.mipmaps.length;Ht++)kt(j.__webglFramebuffer[Ht],O,A,n.COLOR_ATTACHMENT0,At,Ht);else kt(j.__webglFramebuffer,O,A,n.COLOR_ATTACHMENT0,At,0);v(A)&&g(At),e.unbindTexture()}O.depthBuffer&&ct(O)}function lt(O){const A=O.textures;for(let j=0,rt=A.length;j<rt;j++){const _t=A[j];if(v(_t)){const st=I(O),Xt=s.get(_t).__webglTexture;e.bindTexture(st,Xt),g(st),e.unbindTexture()}}}const at=[],vt=[];function gt(O){if(O.samples>0){if(bt(O)===!1){const A=O.textures,j=O.width,rt=O.height;let _t=n.COLOR_BUFFER_BIT;const st=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Xt=s.get(O),At=A.length>1;if(At)for(let Yt=0;Yt<A.length;Yt++)e.bindFramebuffer(n.FRAMEBUFFER,Xt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Yt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Xt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Yt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Xt.__webglMultisampledFramebuffer);const Ht=O.texture.mipmaps;Ht&&Ht.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Xt.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Xt.__webglFramebuffer);for(let Yt=0;Yt<A.length;Yt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(_t|=n.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(_t|=n.STENCIL_BUFFER_BIT)),At){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Xt.__webglColorRenderbuffer[Yt]);const xt=s.get(A[Yt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,xt,0)}n.blitFramebuffer(0,0,j,rt,0,0,j,rt,_t,n.NEAREST),u===!0&&(at.length=0,vt.length=0,at.push(n.COLOR_ATTACHMENT0+Yt),O.depthBuffer&&O.resolveDepthBuffer===!1&&(at.push(st),vt.push(st),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,vt)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,at))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),At)for(let Yt=0;Yt<A.length;Yt++){e.bindFramebuffer(n.FRAMEBUFFER,Xt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Yt,n.RENDERBUFFER,Xt.__webglColorRenderbuffer[Yt]);const xt=s.get(A[Yt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Xt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Yt,n.TEXTURE_2D,xt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Xt.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&u){const A=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[A])}}}function Bt(O){return Math.min(r.maxSamples,O.samples)}function bt(O){const A=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&A.__useRenderToTexture!==!1}function Zt(O){const A=l.render.frame;p.get(O)!==A&&(p.set(O,A),O.update())}function ve(O,A){const j=O.colorSpace,rt=O.format,_t=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||j!==is&&j!==Li&&(Se.getTransfer(j)===Ie?(rt!==zn||_t!==hi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",j)),A}function Ae(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(d.width=O.naturalWidth||O.width,d.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(d.width=O.displayWidth,d.height=O.displayHeight):(d.width=O.width,d.height=O.height),d}this.allocateTextureUnit=J,this.resetTextureUnits=Z,this.setTexture2D=$,this.setTexture2DArray=K,this.setTexture3D=ut,this.setTextureCube=G,this.rebindTextures=ht,this.setupRenderTarget=P,this.updateRenderTargetMipmap=lt,this.updateMultisampleRenderTarget=gt,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=kt,this.useMultisampledRTT=bt}function Gw(n,t){function e(s,r=Li){let a;const l=Se.getTransfer(r);if(s===hi)return n.UNSIGNED_BYTE;if(s===yl)return n.UNSIGNED_SHORT_4_4_4_4;if(s===El)return n.UNSIGNED_SHORT_5_5_5_1;if(s===ou)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===su)return n.BYTE;if(s===ru)return n.SHORT;if(s===gr)return n.UNSIGNED_SHORT;if(s===vl)return n.INT;if(s===ns)return n.UNSIGNED_INT;if(s===ui)return n.FLOAT;if(s===_r)return n.HALF_FLOAT;if(s===au)return n.ALPHA;if(s===lu)return n.RGB;if(s===zn)return n.RGBA;if(s===yr)return n.DEPTH_COMPONENT;if(s===Er)return n.DEPTH_STENCIL;if(s===cu)return n.RED;if(s===xl)return n.RED_INTEGER;if(s===hu)return n.RG;if(s===wl)return n.RG_INTEGER;if(s===Sl)return n.RGBA_INTEGER;if(s===Eo||s===xo||s===wo||s===So)if(l===Ie)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Eo)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Eo)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ml||s===Tl||s===bl||s===Al)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Ml)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Tl)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===bl)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Al)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Cl||s===Pl||s===Rl)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Cl||s===Pl)return l===Ie?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Rl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Ll||s===Il||s===Dl||s===kl||s===Ul||s===Ol||s===Nl||s===Bl||s===Fl||s===zl||s===Hl||s===Vl||s===Gl||s===Wl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Ll)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Il)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Dl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===kl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ul)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Ol)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Nl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Bl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Fl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===zl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Hl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Vl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Gl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Wl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Mo||s===Zl||s===Xl)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===Mo)return l===Ie?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Zl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Xl)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===uu||s===Yl||s===ql||s===Ql)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===Mo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Yl)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ql)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Ql)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===vr?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class bd extends Je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const Ww=`
3825
+ }`;function Fw(n,t,e){let s=new Sc;const r=new Ae,a=new Ae,l=new He,h=new F0({depthPacking:Dv}),u=new z0,d={},p=e.maxTextureSize,m={[Ai]:fn,[fn]:Ai,[ci]:ci},_=new vi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:Nw,fragmentShader:Bw}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const w=new $n;w.setAttribute("position",new Kn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const S=new pn(w,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jh;let g=this.type;this.render=function(B,N,z){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||B.length===0)return;const D=n.getRenderTarget(),M=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),Z=n.state;Z.setBlending(Ci),Z.buffers.depth.getReversed()?Z.buffers.color.setClear(0,0,0,0):Z.buffers.color.setClear(1,1,1,1),Z.buffers.depth.setTest(!0),Z.setScissorTest(!1);const J=g!==li&&this.type===li,V=g===li&&this.type!==li;for(let $=0,K=B.length;$<K;$++){const ut=B[$],G=ut.shadow;if(G===void 0){console.warn("THREE.WebGLShadowMap:",ut,"has no shadow.");continue}if(G.autoUpdate===!1&&G.needsUpdate===!1)continue;r.copy(G.mapSize);const Tt=G.getFrameExtents();if(r.multiply(Tt),a.copy(G.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/Tt.x),r.x=a.x*Tt.x,G.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/Tt.y),r.y=a.y*Tt.y,G.mapSize.y=a.y)),G.map===null||J===!0||V===!0){const Mt=this.type!==li?{minFilter:Fn,magFilter:Fn}:{};G.map!==null&&G.map.dispose(),G.map=new Ii(r.x,r.y,Mt),G.map.texture.name=ut.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const lt=G.getViewportCount();for(let Mt=0;Mt<lt;Mt++){const Gt=G.getViewport(Mt);l.set(a.x*Gt.x,a.y*Gt.y,a.x*Gt.z,a.y*Gt.w),Z.viewport(l),G.updateMatrices(ut,Mt),s=G.getFrustum(),T(N,z,G.camera,ut,this.type)}G.isPointLightShadow!==!0&&this.type===li&&R(G,z),G.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(D,M,k)};function R(B,N){const z=t.update(S);_.defines.VSM_SAMPLES!==B.blurSamples&&(_.defines.VSM_SAMPLES=B.blurSamples,E.defines.VSM_SAMPLES=B.blurSamples,_.needsUpdate=!0,E.needsUpdate=!0),B.mapPass===null&&(B.mapPass=new Ii(r.x,r.y)),_.uniforms.shadow_pass.value=B.map.texture,_.uniforms.resolution.value=B.mapSize,_.uniforms.radius.value=B.radius,n.setRenderTarget(B.mapPass),n.clear(),n.renderBufferDirect(N,null,z,_,S,null),E.uniforms.shadow_pass.value=B.mapPass.texture,E.uniforms.resolution.value=B.mapSize,E.uniforms.radius.value=B.radius,n.setRenderTarget(B.map),n.clear(),n.renderBufferDirect(N,null,z,E,S,null)}function P(B,N,z,D){let M=null;const k=z.isPointLight===!0?B.customDistanceMaterial:B.customDepthMaterial;if(k!==void 0)M=k;else if(M=z.isPointLight===!0?u:h,n.localClippingEnabled&&N.clipShadows===!0&&Array.isArray(N.clippingPlanes)&&N.clippingPlanes.length!==0||N.displacementMap&&N.displacementScale!==0||N.alphaMap&&N.alphaTest>0||N.map&&N.alphaTest>0||N.alphaToCoverage===!0){const Z=M.uuid,J=N.uuid;let V=d[Z];V===void 0&&(V={},d[Z]=V);let $=V[J];$===void 0&&($=M.clone(),V[J]=$,N.addEventListener("dispose",U)),M=$}if(M.visible=N.visible,M.wireframe=N.wireframe,D===li?M.side=N.shadowSide!==null?N.shadowSide:N.side:M.side=N.shadowSide!==null?N.shadowSide:m[N.side],M.alphaMap=N.alphaMap,M.alphaTest=N.alphaToCoverage===!0?.5:N.alphaTest,M.map=N.map,M.clipShadows=N.clipShadows,M.clippingPlanes=N.clippingPlanes,M.clipIntersection=N.clipIntersection,M.displacementMap=N.displacementMap,M.displacementScale=N.displacementScale,M.displacementBias=N.displacementBias,M.wireframeLinewidth=N.wireframeLinewidth,M.linewidth=N.linewidth,z.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const Z=n.properties.get(M);Z.light=z}return M}function T(B,N,z,D,M){if(B.visible===!1)return;if(B.layers.test(N.layers)&&(B.isMesh||B.isLine||B.isPoints)&&(B.castShadow||B.receiveShadow&&M===li)&&(!B.frustumCulled||s.intersectsObject(B))){B.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse,B.matrixWorld);const J=t.update(B),V=B.material;if(Array.isArray(V)){const $=J.groups;for(let K=0,ut=$.length;K<ut;K++){const G=$[K],Tt=V[G.materialIndex];if(Tt&&Tt.visible){const lt=P(B,Tt,D,M);B.onBeforeShadow(n,B,N,z,J,lt,G),n.renderBufferDirect(z,null,J,lt,B,G),B.onAfterShadow(n,B,N,z,J,lt,G)}}}else if(V.visible){const $=P(B,V,D,M);B.onBeforeShadow(n,B,N,z,J,$,null),n.renderBufferDirect(z,null,J,$,B,null),B.onAfterShadow(n,B,N,z,J,$,null)}}const Z=B.children;for(let J=0,V=Z.length;J<V;J++)T(Z[J],N,z,D,M)}function U(B){B.target.removeEventListener("dispose",U);for(const z in d){const D=d[z],M=B.target.uuid;M in D&&(D[M].dispose(),delete D[M])}}}const zw={[ol]:al,[ll]:ul,[cl]:dl,[Ms]:hl,[al]:ol,[ul]:ll,[dl]:cl,[hl]:Ms};function Hw(n,t){function e(){let H=!1;const St=new He;let At=null;const Ft=new He(0,0,0,0);return{setMask:function(vt){At!==vt&&!H&&(n.colorMask(vt,vt,vt,vt),At=vt)},setLocked:function(vt){H=vt},setClear:function(vt,dt,Wt,ae,De){De===!0&&(vt*=ae,dt*=ae,Wt*=ae),St.set(vt,dt,Wt,ae),Ft.equals(St)===!1&&(n.clearColor(vt,dt,Wt,ae),Ft.copy(St))},reset:function(){H=!1,At=null,Ft.set(-1,0,0,0)}}}function s(){let H=!1,St=!1,At=null,Ft=null,vt=null;return{setReversed:function(dt){if(St!==dt){const Wt=t.get("EXT_clip_control");dt?Wt.clipControlEXT(Wt.LOWER_LEFT_EXT,Wt.ZERO_TO_ONE_EXT):Wt.clipControlEXT(Wt.LOWER_LEFT_EXT,Wt.NEGATIVE_ONE_TO_ONE_EXT),St=dt;const ae=vt;vt=null,this.setClear(ae)}},getReversed:function(){return St},setTest:function(dt){dt?ft(n.DEPTH_TEST):Dt(n.DEPTH_TEST)},setMask:function(dt){At!==dt&&!H&&(n.depthMask(dt),At=dt)},setFunc:function(dt){if(St&&(dt=zw[dt]),Ft!==dt){switch(dt){case ol:n.depthFunc(n.NEVER);break;case al:n.depthFunc(n.ALWAYS);break;case ll:n.depthFunc(n.LESS);break;case Ms:n.depthFunc(n.LEQUAL);break;case cl:n.depthFunc(n.EQUAL);break;case hl:n.depthFunc(n.GEQUAL);break;case ul:n.depthFunc(n.GREATER);break;case dl:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ft=dt}},setLocked:function(dt){H=dt},setClear:function(dt){vt!==dt&&(St&&(dt=1-dt),n.clearDepth(dt),vt=dt)},reset:function(){H=!1,At=null,Ft=null,vt=null,St=!1}}}function r(){let H=!1,St=null,At=null,Ft=null,vt=null,dt=null,Wt=null,ae=null,De=null;return{setTest:function(Te){H||(Te?ft(n.STENCIL_TEST):Dt(n.STENCIL_TEST))},setMask:function(Te){St!==Te&&!H&&(n.stencilMask(Te),St=Te)},setFunc:function(Te,bn,On){(At!==Te||Ft!==bn||vt!==On)&&(n.stencilFunc(Te,bn,On),At=Te,Ft=bn,vt=On)},setOp:function(Te,bn,On){(dt!==Te||Wt!==bn||ae!==On)&&(n.stencilOp(Te,bn,On),dt=Te,Wt=bn,ae=On)},setLocked:function(Te){H=Te},setClear:function(Te){De!==Te&&(n.clearStencil(Te),De=Te)},reset:function(){H=!1,St=null,At=null,Ft=null,vt=null,dt=null,Wt=null,ae=null,De=null}}}const a=new e,l=new s,h=new r,u=new WeakMap,d=new WeakMap;let p={},m={},_=new WeakMap,E=[],w=null,S=!1,v=null,g=null,R=null,P=null,T=null,U=null,B=null,N=new Pe(0,0,0),z=0,D=!1,M=null,k=null,Z=null,J=null,V=null;const $=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let K=!1,ut=0;const G=n.getParameter(n.VERSION);G.indexOf("WebGL")!==-1?(ut=parseFloat(/^WebGL (\d)/.exec(G)[1]),K=ut>=1):G.indexOf("OpenGL ES")!==-1&&(ut=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),K=ut>=2);let Tt=null,lt={};const Mt=n.getParameter(n.SCISSOR_BOX),Gt=n.getParameter(n.VIEWPORT),pt=new He().fromArray(Mt),Rt=new He().fromArray(Gt);function Y(H,St,At,Ft){const vt=new Uint8Array(4),dt=n.createTexture();n.bindTexture(H,dt),n.texParameteri(H,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(H,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Wt=0;Wt<At;Wt++)H===n.TEXTURE_3D||H===n.TEXTURE_2D_ARRAY?n.texImage3D(St,0,n.RGBA,1,1,Ft,0,n.RGBA,n.UNSIGNED_BYTE,vt):n.texImage2D(St+Wt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,vt);return dt}const st={};st[n.TEXTURE_2D]=Y(n.TEXTURE_2D,n.TEXTURE_2D,1),st[n.TEXTURE_CUBE_MAP]=Y(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),st[n.TEXTURE_2D_ARRAY]=Y(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),st[n.TEXTURE_3D]=Y(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),ft(n.DEPTH_TEST),l.setFunc(Ms),_t(!1),ht(jh),ft(n.CULL_FACE),it(Ci);function ft(H){p[H]!==!0&&(n.enable(H),p[H]=!0)}function Dt(H){p[H]!==!1&&(n.disable(H),p[H]=!1)}function Ut(H,St){return m[H]!==St?(n.bindFramebuffer(H,St),m[H]=St,H===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=St),H===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=St),!0):!1}function zt(H,St){let At=E,Ft=!1;if(H){At=_.get(St),At===void 0&&(At=[],_.set(St,At));const vt=H.textures;if(At.length!==vt.length||At[0]!==n.COLOR_ATTACHMENT0){for(let dt=0,Wt=vt.length;dt<Wt;dt++)At[dt]=n.COLOR_ATTACHMENT0+dt;At.length=vt.length,Ft=!0}}else At[0]!==n.BACK&&(At[0]=n.BACK,Ft=!0);Ft&&n.drawBuffers(At)}function ce(H){return w!==H?(n.useProgram(H),w=H,!0):!1}const at={[ts]:n.FUNC_ADD,[ov]:n.FUNC_SUBTRACT,[av]:n.FUNC_REVERSE_SUBTRACT};at[lv]=n.MIN,at[cv]=n.MAX;const C={[hv]:n.ZERO,[uv]:n.ONE,[dv]:n.SRC_COLOR,[sl]:n.SRC_ALPHA,[vv]:n.SRC_ALPHA_SATURATE,[gv]:n.DST_COLOR,[pv]:n.DST_ALPHA,[fv]:n.ONE_MINUS_SRC_COLOR,[rl]:n.ONE_MINUS_SRC_ALPHA,[_v]:n.ONE_MINUS_DST_COLOR,[mv]:n.ONE_MINUS_DST_ALPHA,[yv]:n.CONSTANT_COLOR,[Ev]:n.ONE_MINUS_CONSTANT_COLOR,[xv]:n.CONSTANT_ALPHA,[wv]:n.ONE_MINUS_CONSTANT_ALPHA};function it(H,St,At,Ft,vt,dt,Wt,ae,De,Te){if(H===Ci){S===!0&&(Dt(n.BLEND),S=!1);return}if(S===!1&&(ft(n.BLEND),S=!0),H!==rv){if(H!==v||Te!==D){if((g!==ts||T!==ts)&&(n.blendEquation(n.FUNC_ADD),g=ts,T=ts),Te)switch(H){case Ss:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFunc(n.ONE,n.ONE);break;case $h:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case tu:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}else switch(H){case Ss:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Kh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case $h:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case tu:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",H);break}R=null,P=null,U=null,B=null,N.set(0,0,0),z=0,v=H,D=Te}return}vt=vt||St,dt=dt||At,Wt=Wt||Ft,(St!==g||vt!==T)&&(n.blendEquationSeparate(at[St],at[vt]),g=St,T=vt),(At!==R||Ft!==P||dt!==U||Wt!==B)&&(n.blendFuncSeparate(C[At],C[Ft],C[dt],C[Wt]),R=At,P=Ft,U=dt,B=Wt),(ae.equals(N)===!1||De!==z)&&(n.blendColor(ae.r,ae.g,ae.b,De),N.copy(ae),z=De),v=H,D=!1}function ct(H,St){H.side===ci?Dt(n.CULL_FACE):ft(n.CULL_FACE);let At=H.side===fn;St&&(At=!At),_t(At),H.blending===Ss&&H.transparent===!1?it(Ci):it(H.blending,H.blendEquation,H.blendSrc,H.blendDst,H.blendEquationAlpha,H.blendSrcAlpha,H.blendDstAlpha,H.blendColor,H.blendAlpha,H.premultipliedAlpha),l.setFunc(H.depthFunc),l.setTest(H.depthTest),l.setMask(H.depthWrite),a.setMask(H.colorWrite);const Ft=H.stencilWrite;h.setTest(Ft),Ft&&(h.setMask(H.stencilWriteMask),h.setFunc(H.stencilFunc,H.stencilRef,H.stencilFuncMask),h.setOp(H.stencilFail,H.stencilZFail,H.stencilZPass)),yt(H.polygonOffset,H.polygonOffsetFactor,H.polygonOffsetUnits),H.alphaToCoverage===!0?ft(n.SAMPLE_ALPHA_TO_COVERAGE):Dt(n.SAMPLE_ALPHA_TO_COVERAGE)}function _t(H){M!==H&&(H?n.frontFace(n.CW):n.frontFace(n.CCW),M=H)}function ht(H){H!==nv?(ft(n.CULL_FACE),H!==k&&(H===jh?n.cullFace(n.BACK):H===iv?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Dt(n.CULL_FACE),k=H}function Ot(H){H!==Z&&(K&&n.lineWidth(H),Z=H)}function yt(H,St,At){H?(ft(n.POLYGON_OFFSET_FILL),(J!==St||V!==At)&&(n.polygonOffset(St,At),J=St,V=At)):Dt(n.POLYGON_OFFSET_FILL)}function Nt(H){H?ft(n.SCISSOR_TEST):Dt(n.SCISSOR_TEST)}function pe(H){H===void 0&&(H=n.TEXTURE0+$-1),Tt!==H&&(n.activeTexture(H),Tt=H)}function ge(H,St,At){At===void 0&&(Tt===null?At=n.TEXTURE0+$-1:At=Tt);let Ft=lt[At];Ft===void 0&&(Ft={type:void 0,texture:void 0},lt[At]=Ft),(Ft.type!==H||Ft.texture!==St)&&(Tt!==At&&(n.activeTexture(At),Tt=At),n.bindTexture(H,St||st[H]),Ft.type=H,Ft.texture=St)}function O(){const H=lt[Tt];H!==void 0&&H.type!==void 0&&(n.bindTexture(H.type,null),H.type=void 0,H.texture=void 0)}function b(){try{n.compressedTexImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Q(){try{n.compressedTexImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function ot(){try{n.texSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function gt(){try{n.texSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function rt(){try{n.compressedTexSubImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Zt(){try{n.compressedTexSubImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function bt(){try{n.texStorage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Ht(){try{n.texStorage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Xt(){try{n.texImage2D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function wt(){try{n.texImage3D(...arguments)}catch(H){console.error("THREE.WebGLState:",H)}}function Lt(H){pt.equals(H)===!1&&(n.scissor(H.x,H.y,H.z,H.w),pt.copy(H))}function ie(H){Rt.equals(H)===!1&&(n.viewport(H.x,H.y,H.z,H.w),Rt.copy(H))}function Yt(H,St){let At=d.get(St);At===void 0&&(At=new WeakMap,d.set(St,At));let Ft=At.get(H);Ft===void 0&&(Ft=n.getUniformBlockIndex(St,H.name),At.set(H,Ft))}function Ct(H,St){const Ft=d.get(St).get(H);u.get(St)!==Ft&&(n.uniformBlockBinding(St,Ft,H.__bindingPointIndex),u.set(St,Ft))}function le(){n.disable(n.BLEND),n.disable(n.CULL_FACE),n.disable(n.DEPTH_TEST),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SCISSOR_TEST),n.disable(n.STENCIL_TEST),n.disable(n.SAMPLE_ALPHA_TO_COVERAGE),n.blendEquation(n.FUNC_ADD),n.blendFunc(n.ONE,n.ZERO),n.blendFuncSeparate(n.ONE,n.ZERO,n.ONE,n.ZERO),n.blendColor(0,0,0,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(n.LESS),l.setReversed(!1),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(n.ALWAYS,0,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.clearStencil(0),n.cullFace(n.BACK),n.frontFace(n.CCW),n.polygonOffset(0,0),n.activeTexture(n.TEXTURE0),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),p={},Tt=null,lt={},m={},_=new WeakMap,E=[],w=null,S=!1,v=null,g=null,R=null,P=null,T=null,U=null,B=null,N=new Pe(0,0,0),z=0,D=!1,M=null,k=null,Z=null,J=null,V=null,pt.set(0,0,n.canvas.width,n.canvas.height),Rt.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:ft,disable:Dt,bindFramebuffer:Ut,drawBuffers:zt,useProgram:ce,setBlending:it,setMaterial:ct,setFlipSided:_t,setCullFace:ht,setLineWidth:Ot,setPolygonOffset:yt,setScissorTest:Nt,activeTexture:pe,bindTexture:ge,unbindTexture:O,compressedTexImage2D:b,compressedTexImage3D:Q,texImage2D:Xt,texImage3D:wt,updateUBOMapping:Yt,uniformBlockBinding:Ct,texStorage2D:bt,texStorage3D:Ht,texSubImage2D:ot,texSubImage3D:gt,compressedTexSubImage2D:rt,compressedTexSubImage3D:Zt,scissor:Lt,viewport:ie,reset:le}}function Vw(n,t,e,s,r,a,l){const h=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,u=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),d=new Ae,p=new WeakMap;let m;const _=new WeakMap;let E=!1;try{E=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function w(O,b){return E?new OffscreenCanvas(O,b):Mr("canvas")}function S(O,b,Q){let ot=1;const gt=ge(O);if((gt.width>Q||gt.height>Q)&&(ot=Q/Math.max(gt.width,gt.height)),ot<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const rt=Math.floor(ot*gt.width),Zt=Math.floor(ot*gt.height);m===void 0&&(m=w(rt,Zt));const bt=b?w(rt,Zt):m;return bt.width=rt,bt.height=Zt,bt.getContext("2d").drawImage(O,0,0,rt,Zt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+gt.width+"x"+gt.height+") to ("+rt+"x"+Zt+")."),bt}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+gt.width+"x"+gt.height+")."),O;return O}function v(O){return O.generateMipmaps}function g(O){n.generateMipmap(O)}function R(O){return O.isWebGLCubeRenderTarget?n.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?n.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?n.TEXTURE_2D_ARRAY:n.TEXTURE_2D}function P(O,b,Q,ot,gt=!1){if(O!==null){if(n[O]!==void 0)return n[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let rt=b;if(b===n.RED&&(Q===n.FLOAT&&(rt=n.R32F),Q===n.HALF_FLOAT&&(rt=n.R16F),Q===n.UNSIGNED_BYTE&&(rt=n.R8)),b===n.RED_INTEGER&&(Q===n.UNSIGNED_BYTE&&(rt=n.R8UI),Q===n.UNSIGNED_SHORT&&(rt=n.R16UI),Q===n.UNSIGNED_INT&&(rt=n.R32UI),Q===n.BYTE&&(rt=n.R8I),Q===n.SHORT&&(rt=n.R16I),Q===n.INT&&(rt=n.R32I)),b===n.RG&&(Q===n.FLOAT&&(rt=n.RG32F),Q===n.HALF_FLOAT&&(rt=n.RG16F),Q===n.UNSIGNED_BYTE&&(rt=n.RG8)),b===n.RG_INTEGER&&(Q===n.UNSIGNED_BYTE&&(rt=n.RG8UI),Q===n.UNSIGNED_SHORT&&(rt=n.RG16UI),Q===n.UNSIGNED_INT&&(rt=n.RG32UI),Q===n.BYTE&&(rt=n.RG8I),Q===n.SHORT&&(rt=n.RG16I),Q===n.INT&&(rt=n.RG32I)),b===n.RGB_INTEGER&&(Q===n.UNSIGNED_BYTE&&(rt=n.RGB8UI),Q===n.UNSIGNED_SHORT&&(rt=n.RGB16UI),Q===n.UNSIGNED_INT&&(rt=n.RGB32UI),Q===n.BYTE&&(rt=n.RGB8I),Q===n.SHORT&&(rt=n.RGB16I),Q===n.INT&&(rt=n.RGB32I)),b===n.RGBA_INTEGER&&(Q===n.UNSIGNED_BYTE&&(rt=n.RGBA8UI),Q===n.UNSIGNED_SHORT&&(rt=n.RGBA16UI),Q===n.UNSIGNED_INT&&(rt=n.RGBA32UI),Q===n.BYTE&&(rt=n.RGBA8I),Q===n.SHORT&&(rt=n.RGBA16I),Q===n.INT&&(rt=n.RGBA32I)),b===n.RGB&&Q===n.UNSIGNED_INT_5_9_9_9_REV&&(rt=n.RGB9_E5),b===n.RGBA){const Zt=gt?To:Me.getTransfer(ot);Q===n.FLOAT&&(rt=n.RGBA32F),Q===n.HALF_FLOAT&&(rt=n.RGBA16F),Q===n.UNSIGNED_BYTE&&(rt=Zt===Ie?n.SRGB8_ALPHA8:n.RGBA8),Q===n.UNSIGNED_SHORT_4_4_4_4&&(rt=n.RGBA4),Q===n.UNSIGNED_SHORT_5_5_5_1&&(rt=n.RGB5_A1)}return(rt===n.R16F||rt===n.R32F||rt===n.RG16F||rt===n.RG32F||rt===n.RGBA16F||rt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),rt}function T(O,b){let Q;return O?b===null||b===ns||b===vr?Q=n.DEPTH24_STENCIL8:b===ui?Q=n.DEPTH32F_STENCIL8:b===gr&&(Q=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===ns||b===vr?Q=n.DEPTH_COMPONENT24:b===ui?Q=n.DEPTH_COMPONENT32F:b===gr&&(Q=n.DEPTH_COMPONENT16),Q}function U(O,b){return v(O)===!0||O.isFramebufferTexture&&O.minFilter!==Fn&&O.minFilter!==En?Math.log2(Math.max(b.width,b.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?b.mipmaps.length:1}function B(O){const b=O.target;b.removeEventListener("dispose",B),z(b),b.isVideoTexture&&p.delete(b)}function N(O){const b=O.target;b.removeEventListener("dispose",N),M(b)}function z(O){const b=s.get(O);if(b.__webglInit===void 0)return;const Q=O.source,ot=_.get(Q);if(ot){const gt=ot[b.__cacheKey];gt.usedTimes--,gt.usedTimes===0&&D(O),Object.keys(ot).length===0&&_.delete(Q)}s.remove(O)}function D(O){const b=s.get(O);n.deleteTexture(b.__webglTexture);const Q=O.source,ot=_.get(Q);delete ot[b.__cacheKey],l.memory.textures--}function M(O){const b=s.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),s.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let ot=0;ot<6;ot++){if(Array.isArray(b.__webglFramebuffer[ot]))for(let gt=0;gt<b.__webglFramebuffer[ot].length;gt++)n.deleteFramebuffer(b.__webglFramebuffer[ot][gt]);else n.deleteFramebuffer(b.__webglFramebuffer[ot]);b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer[ot])}else{if(Array.isArray(b.__webglFramebuffer))for(let ot=0;ot<b.__webglFramebuffer.length;ot++)n.deleteFramebuffer(b.__webglFramebuffer[ot]);else n.deleteFramebuffer(b.__webglFramebuffer);if(b.__webglDepthbuffer&&n.deleteRenderbuffer(b.__webglDepthbuffer),b.__webglMultisampledFramebuffer&&n.deleteFramebuffer(b.__webglMultisampledFramebuffer),b.__webglColorRenderbuffer)for(let ot=0;ot<b.__webglColorRenderbuffer.length;ot++)b.__webglColorRenderbuffer[ot]&&n.deleteRenderbuffer(b.__webglColorRenderbuffer[ot]);b.__webglDepthRenderbuffer&&n.deleteRenderbuffer(b.__webglDepthRenderbuffer)}const Q=O.textures;for(let ot=0,gt=Q.length;ot<gt;ot++){const rt=s.get(Q[ot]);rt.__webglTexture&&(n.deleteTexture(rt.__webglTexture),l.memory.textures--),s.remove(Q[ot])}s.remove(O)}let k=0;function Z(){k=0}function J(){const O=k;return O>=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+r.maxTextures),k+=1,O}function V(O){const b=[];return b.push(O.wrapS),b.push(O.wrapT),b.push(O.wrapR||0),b.push(O.magFilter),b.push(O.minFilter),b.push(O.anisotropy),b.push(O.internalFormat),b.push(O.format),b.push(O.type),b.push(O.generateMipmaps),b.push(O.premultiplyAlpha),b.push(O.flipY),b.push(O.unpackAlignment),b.push(O.colorSpace),b.join()}function $(O,b){const Q=s.get(O);if(O.isVideoTexture&&Nt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&Q.__version!==O.version){const ot=O.image;if(ot===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ot.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{st(Q,O,b);return}}else O.isExternalTexture&&(Q.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,Q.__webglTexture,n.TEXTURE0+b)}function K(O,b){const Q=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&Q.__version!==O.version){st(Q,O,b);return}e.bindTexture(n.TEXTURE_2D_ARRAY,Q.__webglTexture,n.TEXTURE0+b)}function ut(O,b){const Q=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&Q.__version!==O.version){st(Q,O,b);return}e.bindTexture(n.TEXTURE_3D,Q.__webglTexture,n.TEXTURE0+b)}function G(O,b){const Q=s.get(O);if(O.version>0&&Q.__version!==O.version){ft(Q,O,b);return}e.bindTexture(n.TEXTURE_CUBE_MAP,Q.__webglTexture,n.TEXTURE0+b)}const Tt={[ml]:n.REPEAT,[es]:n.CLAMP_TO_EDGE,[gl]:n.MIRRORED_REPEAT},lt={[Fn]:n.NEAREST,[Lv]:n.NEAREST_MIPMAP_NEAREST,[yo]:n.NEAREST_MIPMAP_LINEAR,[En]:n.LINEAR,[_l]:n.LINEAR_MIPMAP_NEAREST,[Ri]:n.LINEAR_MIPMAP_LINEAR},Mt={[Ov]:n.NEVER,[Vv]:n.ALWAYS,[Nv]:n.LESS,[fu]:n.LEQUAL,[Bv]:n.EQUAL,[Hv]:n.GEQUAL,[Fv]:n.GREATER,[zv]:n.NOTEQUAL};function Gt(O,b){if(b.type===ui&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===En||b.magFilter===_l||b.magFilter===yo||b.magFilter===Ri||b.minFilter===En||b.minFilter===_l||b.minFilter===yo||b.minFilter===Ri)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),n.texParameteri(O,n.TEXTURE_WRAP_S,Tt[b.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,Tt[b.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,Tt[b.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,lt[b.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,lt[b.minFilter]),b.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,Mt[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Fn||b.minFilter!==yo&&b.minFilter!==Ri||b.type===ui&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const Q=t.get("EXT_texture_filter_anisotropic");n.texParameterf(O,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function pt(O,b){let Q=!1;O.__webglInit===void 0&&(O.__webglInit=!0,b.addEventListener("dispose",B));const ot=b.source;let gt=_.get(ot);gt===void 0&&(gt={},_.set(ot,gt));const rt=V(b);if(rt!==O.__cacheKey){gt[rt]===void 0&&(gt[rt]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,Q=!0),gt[rt].usedTimes++;const Zt=gt[O.__cacheKey];Zt!==void 0&&(gt[O.__cacheKey].usedTimes--,Zt.usedTimes===0&&D(b)),O.__cacheKey=rt,O.__webglTexture=gt[rt].texture}return Q}function Rt(O,b,Q){return Math.floor(Math.floor(O/Q)/b)}function Y(O,b,Q,ot){const rt=O.updateRanges;if(rt.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,b.width,b.height,Q,ot,b.data);else{rt.sort((wt,Lt)=>wt.start-Lt.start);let Zt=0;for(let wt=1;wt<rt.length;wt++){const Lt=rt[Zt],ie=rt[wt],Yt=Lt.start+Lt.count,Ct=Rt(ie.start,b.width,4),le=Rt(Lt.start,b.width,4);ie.start<=Yt+1&&Ct===le&&Rt(ie.start+ie.count-1,b.width,4)===Ct?Lt.count=Math.max(Lt.count,ie.start+ie.count-Lt.start):(++Zt,rt[Zt]=ie)}rt.length=Zt+1;const bt=n.getParameter(n.UNPACK_ROW_LENGTH),Ht=n.getParameter(n.UNPACK_SKIP_PIXELS),Xt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,b.width);for(let wt=0,Lt=rt.length;wt<Lt;wt++){const ie=rt[wt],Yt=Math.floor(ie.start/4),Ct=Math.ceil(ie.count/4),le=Yt%b.width,H=Math.floor(Yt/b.width),St=Ct,At=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,le),n.pixelStorei(n.UNPACK_SKIP_ROWS,H),e.texSubImage2D(n.TEXTURE_2D,0,le,H,St,At,Q,ot,b.data)}O.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,bt),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ht),n.pixelStorei(n.UNPACK_SKIP_ROWS,Xt)}}function st(O,b,Q){let ot=n.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(ot=n.TEXTURE_2D_ARRAY),b.isData3DTexture&&(ot=n.TEXTURE_3D);const gt=pt(O,b),rt=b.source;e.bindTexture(ot,O.__webglTexture,n.TEXTURE0+Q);const Zt=s.get(rt);if(rt.version!==Zt.__version||gt===!0){e.activeTexture(n.TEXTURE0+Q);const bt=Me.getPrimaries(Me.workingColorSpace),Ht=b.colorSpace===Li?null:Me.getPrimaries(b.colorSpace),Xt=b.colorSpace===Li||bt===Ht?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xt);let wt=S(b.image,!1,r.maxTextureSize);wt=pe(b,wt);const Lt=a.convert(b.format,b.colorSpace),ie=a.convert(b.type);let Yt=P(b.internalFormat,Lt,ie,b.colorSpace,b.isVideoTexture);Gt(ot,b);let Ct;const le=b.mipmaps,H=b.isVideoTexture!==!0,St=Zt.__version===void 0||gt===!0,At=rt.dataReady,Ft=U(b,wt);if(b.isDepthTexture)Yt=T(b.format===Er,b.type),St&&(H?e.texStorage2D(n.TEXTURE_2D,1,Yt,wt.width,wt.height):e.texImage2D(n.TEXTURE_2D,0,Yt,wt.width,wt.height,0,Lt,ie,null));else if(b.isDataTexture)if(le.length>0){H&&St&&e.texStorage2D(n.TEXTURE_2D,Ft,Yt,le[0].width,le[0].height);for(let vt=0,dt=le.length;vt<dt;vt++)Ct=le[vt],H?At&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Ct.width,Ct.height,Lt,ie,Ct.data):e.texImage2D(n.TEXTURE_2D,vt,Yt,Ct.width,Ct.height,0,Lt,ie,Ct.data);b.generateMipmaps=!1}else H?(St&&e.texStorage2D(n.TEXTURE_2D,Ft,Yt,wt.width,wt.height),At&&Y(b,wt,Lt,ie)):e.texImage2D(n.TEXTURE_2D,0,Yt,wt.width,wt.height,0,Lt,ie,wt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){H&&St&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ft,Yt,le[0].width,le[0].height,wt.depth);for(let vt=0,dt=le.length;vt<dt;vt++)if(Ct=le[vt],b.format!==zn)if(Lt!==null)if(H){if(At)if(b.layerUpdates.size>0){const Wt=ju(Ct.width,Ct.height,b.format,b.type);for(const ae of b.layerUpdates){const De=Ct.data.subarray(ae*Wt/Ct.data.BYTES_PER_ELEMENT,(ae+1)*Wt/Ct.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,ae,Ct.width,Ct.height,1,Lt,De)}b.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Ct.width,Ct.height,wt.depth,Lt,Ct.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,vt,Yt,Ct.width,Ct.height,wt.depth,0,Ct.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else H?At&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,vt,0,0,0,Ct.width,Ct.height,wt.depth,Lt,ie,Ct.data):e.texImage3D(n.TEXTURE_2D_ARRAY,vt,Yt,Ct.width,Ct.height,wt.depth,0,Lt,ie,Ct.data)}else{H&&St&&e.texStorage2D(n.TEXTURE_2D,Ft,Yt,le[0].width,le[0].height);for(let vt=0,dt=le.length;vt<dt;vt++)Ct=le[vt],b.format!==zn?Lt!==null?H?At&&e.compressedTexSubImage2D(n.TEXTURE_2D,vt,0,0,Ct.width,Ct.height,Lt,Ct.data):e.compressedTexImage2D(n.TEXTURE_2D,vt,Yt,Ct.width,Ct.height,0,Ct.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):H?At&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Ct.width,Ct.height,Lt,ie,Ct.data):e.texImage2D(n.TEXTURE_2D,vt,Yt,Ct.width,Ct.height,0,Lt,ie,Ct.data)}else if(b.isDataArrayTexture)if(H){if(St&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ft,Yt,wt.width,wt.height,wt.depth),At)if(b.layerUpdates.size>0){const vt=ju(wt.width,wt.height,b.format,b.type);for(const dt of b.layerUpdates){const Wt=wt.data.subarray(dt*vt/wt.data.BYTES_PER_ELEMENT,(dt+1)*vt/wt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,dt,wt.width,wt.height,1,Lt,ie,Wt)}b.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,wt.width,wt.height,wt.depth,Lt,ie,wt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Yt,wt.width,wt.height,wt.depth,0,Lt,ie,wt.data);else if(b.isData3DTexture)H?(St&&e.texStorage3D(n.TEXTURE_3D,Ft,Yt,wt.width,wt.height,wt.depth),At&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,wt.width,wt.height,wt.depth,Lt,ie,wt.data)):e.texImage3D(n.TEXTURE_3D,0,Yt,wt.width,wt.height,wt.depth,0,Lt,ie,wt.data);else if(b.isFramebufferTexture){if(St)if(H)e.texStorage2D(n.TEXTURE_2D,Ft,Yt,wt.width,wt.height);else{let vt=wt.width,dt=wt.height;for(let Wt=0;Wt<Ft;Wt++)e.texImage2D(n.TEXTURE_2D,Wt,Yt,vt,dt,0,Lt,ie,null),vt>>=1,dt>>=1}}else if(le.length>0){if(H&&St){const vt=ge(le[0]);e.texStorage2D(n.TEXTURE_2D,Ft,Yt,vt.width,vt.height)}for(let vt=0,dt=le.length;vt<dt;vt++)Ct=le[vt],H?At&&e.texSubImage2D(n.TEXTURE_2D,vt,0,0,Lt,ie,Ct):e.texImage2D(n.TEXTURE_2D,vt,Yt,Lt,ie,Ct);b.generateMipmaps=!1}else if(H){if(St){const vt=ge(wt);e.texStorage2D(n.TEXTURE_2D,Ft,Yt,vt.width,vt.height)}At&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,Lt,ie,wt)}else e.texImage2D(n.TEXTURE_2D,0,Yt,Lt,ie,wt);v(b)&&g(ot),Zt.__version=rt.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function ft(O,b,Q){if(b.image.length!==6)return;const ot=pt(O,b),gt=b.source;e.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+Q);const rt=s.get(gt);if(gt.version!==rt.__version||ot===!0){e.activeTexture(n.TEXTURE0+Q);const Zt=Me.getPrimaries(Me.workingColorSpace),bt=b.colorSpace===Li?null:Me.getPrimaries(b.colorSpace),Ht=b.colorSpace===Li||Zt===bt?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,b.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,b.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,b.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ht);const Xt=b.isCompressedTexture||b.image[0].isCompressedTexture,wt=b.image[0]&&b.image[0].isDataTexture,Lt=[];for(let dt=0;dt<6;dt++)!Xt&&!wt?Lt[dt]=S(b.image[dt],!0,r.maxCubemapSize):Lt[dt]=wt?b.image[dt].image:b.image[dt],Lt[dt]=pe(b,Lt[dt]);const ie=Lt[0],Yt=a.convert(b.format,b.colorSpace),Ct=a.convert(b.type),le=P(b.internalFormat,Yt,Ct,b.colorSpace),H=b.isVideoTexture!==!0,St=rt.__version===void 0||ot===!0,At=gt.dataReady;let Ft=U(b,ie);Gt(n.TEXTURE_CUBE_MAP,b);let vt;if(Xt){H&&St&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ft,le,ie.width,ie.height);for(let dt=0;dt<6;dt++){vt=Lt[dt].mipmaps;for(let Wt=0;Wt<vt.length;Wt++){const ae=vt[Wt];b.format!==zn?Yt!==null?H?At&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,0,0,ae.width,ae.height,Yt,ae.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,le,ae.width,ae.height,0,ae.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):H?At&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,0,0,ae.width,ae.height,Yt,Ct,ae.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt,le,ae.width,ae.height,0,Yt,Ct,ae.data)}}}else{if(vt=b.mipmaps,H&&St){vt.length>0&&Ft++;const dt=ge(Lt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ft,le,dt.width,dt.height)}for(let dt=0;dt<6;dt++)if(wt){H?At&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,Lt[dt].width,Lt[dt].height,Yt,Ct,Lt[dt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,le,Lt[dt].width,Lt[dt].height,0,Yt,Ct,Lt[dt].data);for(let Wt=0;Wt<vt.length;Wt++){const De=vt[Wt].image[dt].image;H?At&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,0,0,De.width,De.height,Yt,Ct,De.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,le,De.width,De.height,0,Yt,Ct,De.data)}}else{H?At&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,0,0,Yt,Ct,Lt[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,0,le,Yt,Ct,Lt[dt]);for(let Wt=0;Wt<vt.length;Wt++){const ae=vt[Wt];H?At&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,0,0,Yt,Ct,ae.image[dt]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+dt,Wt+1,le,Yt,Ct,ae.image[dt])}}}v(b)&&g(n.TEXTURE_CUBE_MAP),rt.__version=gt.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function Dt(O,b,Q,ot,gt,rt){const Zt=a.convert(Q.format,Q.colorSpace),bt=a.convert(Q.type),Ht=P(Q.internalFormat,Zt,bt,Q.colorSpace),Xt=s.get(b),wt=s.get(Q);if(wt.__renderTarget=b,!Xt.__hasExternalTextures){const Lt=Math.max(1,b.width>>rt),ie=Math.max(1,b.height>>rt);gt===n.TEXTURE_3D||gt===n.TEXTURE_2D_ARRAY?e.texImage3D(gt,rt,Ht,Lt,ie,b.depth,0,Zt,bt,null):e.texImage2D(gt,rt,Ht,Lt,ie,0,Zt,bt,null)}e.bindFramebuffer(n.FRAMEBUFFER,O),yt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ot,gt,wt.__webglTexture,0,Ot(b)):(gt===n.TEXTURE_2D||gt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&gt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ot,gt,wt.__webglTexture,rt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function Ut(O,b,Q){if(n.bindRenderbuffer(n.RENDERBUFFER,O),b.depthBuffer){const ot=b.depthTexture,gt=ot&&ot.isDepthTexture?ot.type:null,rt=T(b.stencilBuffer,gt),Zt=b.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,bt=Ot(b);yt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,bt,rt,b.width,b.height):Q?n.renderbufferStorageMultisample(n.RENDERBUFFER,bt,rt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,rt,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Zt,n.RENDERBUFFER,O)}else{const ot=b.textures;for(let gt=0;gt<ot.length;gt++){const rt=ot[gt],Zt=a.convert(rt.format,rt.colorSpace),bt=a.convert(rt.type),Ht=P(rt.internalFormat,Zt,bt,rt.colorSpace),Xt=Ot(b);Q&&yt(b)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Xt,Ht,b.width,b.height):yt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Xt,Ht,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,Ht,b.width,b.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function zt(O,b){if(b&&b.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(n.FRAMEBUFFER,O),!(b.depthTexture&&b.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ot=s.get(b.depthTexture);ot.__renderTarget=b,(!ot.__webglTexture||b.depthTexture.image.width!==b.width||b.depthTexture.image.height!==b.height)&&(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0),$(b.depthTexture,0);const gt=ot.__webglTexture,rt=Ot(b);if(b.depthTexture.format===yr)yt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,gt,0);else if(b.depthTexture.format===Er)yt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,gt,0);else throw new Error("Unknown depthTexture format")}function ce(O){const b=s.get(O),Q=O.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==O.depthTexture){const ot=O.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),ot){const gt=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,ot.removeEventListener("dispose",gt)};ot.addEventListener("dispose",gt),b.__depthDisposeCallback=gt}b.__boundDepthTexture=ot}if(O.depthTexture&&!b.__autoAllocateDepthBuffer){if(Q)throw new Error("target.depthTexture not supported in Cube render targets");const ot=O.texture.mipmaps;ot&&ot.length>0?zt(b.__webglFramebuffer[0],O):zt(b.__webglFramebuffer,O)}else if(Q){b.__webglDepthbuffer=[];for(let ot=0;ot<6;ot++)if(e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[ot]),b.__webglDepthbuffer[ot]===void 0)b.__webglDepthbuffer[ot]=n.createRenderbuffer(),Ut(b.__webglDepthbuffer[ot],O,!1);else{const gt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer[ot];n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,rt)}}else{const ot=O.texture.mipmaps;if(ot&&ot.length>0?e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer[0]):e.bindFramebuffer(n.FRAMEBUFFER,b.__webglFramebuffer),b.__webglDepthbuffer===void 0)b.__webglDepthbuffer=n.createRenderbuffer(),Ut(b.__webglDepthbuffer,O,!1);else{const gt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,gt,n.RENDERBUFFER,rt)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function at(O,b,Q){const ot=s.get(O);b!==void 0&&Dt(ot.__webglFramebuffer,O,O.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),Q!==void 0&&ce(O)}function C(O){const b=O.texture,Q=s.get(O),ot=s.get(b);O.addEventListener("dispose",N);const gt=O.textures,rt=O.isWebGLCubeRenderTarget===!0,Zt=gt.length>1;if(Zt||(ot.__webglTexture===void 0&&(ot.__webglTexture=n.createTexture()),ot.__version=b.version,l.memory.textures++),rt){Q.__webglFramebuffer=[];for(let bt=0;bt<6;bt++)if(b.mipmaps&&b.mipmaps.length>0){Q.__webglFramebuffer[bt]=[];for(let Ht=0;Ht<b.mipmaps.length;Ht++)Q.__webglFramebuffer[bt][Ht]=n.createFramebuffer()}else Q.__webglFramebuffer[bt]=n.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){Q.__webglFramebuffer=[];for(let bt=0;bt<b.mipmaps.length;bt++)Q.__webglFramebuffer[bt]=n.createFramebuffer()}else Q.__webglFramebuffer=n.createFramebuffer();if(Zt)for(let bt=0,Ht=gt.length;bt<Ht;bt++){const Xt=s.get(gt[bt]);Xt.__webglTexture===void 0&&(Xt.__webglTexture=n.createTexture(),l.memory.textures++)}if(O.samples>0&&yt(O)===!1){Q.__webglMultisampledFramebuffer=n.createFramebuffer(),Q.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,Q.__webglMultisampledFramebuffer);for(let bt=0;bt<gt.length;bt++){const Ht=gt[bt];Q.__webglColorRenderbuffer[bt]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,Q.__webglColorRenderbuffer[bt]);const Xt=a.convert(Ht.format,Ht.colorSpace),wt=a.convert(Ht.type),Lt=P(Ht.internalFormat,Xt,wt,Ht.colorSpace,O.isXRRenderTarget===!0),ie=Ot(O);n.renderbufferStorageMultisample(n.RENDERBUFFER,ie,Lt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+bt,n.RENDERBUFFER,Q.__webglColorRenderbuffer[bt])}n.bindRenderbuffer(n.RENDERBUFFER,null),O.depthBuffer&&(Q.__webglDepthRenderbuffer=n.createRenderbuffer(),Ut(Q.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(rt){e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture),Gt(n.TEXTURE_CUBE_MAP,b);for(let bt=0;bt<6;bt++)if(b.mipmaps&&b.mipmaps.length>0)for(let Ht=0;Ht<b.mipmaps.length;Ht++)Dt(Q.__webglFramebuffer[bt][Ht],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+bt,Ht);else Dt(Q.__webglFramebuffer[bt],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0);v(b)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Zt){for(let bt=0,Ht=gt.length;bt<Ht;bt++){const Xt=gt[bt],wt=s.get(Xt);let Lt=n.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Lt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(Lt,wt.__webglTexture),Gt(Lt,Xt),Dt(Q.__webglFramebuffer,O,Xt,n.COLOR_ATTACHMENT0+bt,Lt,0),v(Xt)&&g(Lt)}e.unbindTexture()}else{let bt=n.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(bt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(bt,ot.__webglTexture),Gt(bt,b),b.mipmaps&&b.mipmaps.length>0)for(let Ht=0;Ht<b.mipmaps.length;Ht++)Dt(Q.__webglFramebuffer[Ht],O,b,n.COLOR_ATTACHMENT0,bt,Ht);else Dt(Q.__webglFramebuffer,O,b,n.COLOR_ATTACHMENT0,bt,0);v(b)&&g(bt),e.unbindTexture()}O.depthBuffer&&ce(O)}function it(O){const b=O.textures;for(let Q=0,ot=b.length;Q<ot;Q++){const gt=b[Q];if(v(gt)){const rt=R(O),Zt=s.get(gt).__webglTexture;e.bindTexture(rt,Zt),g(rt),e.unbindTexture()}}}const ct=[],_t=[];function ht(O){if(O.samples>0){if(yt(O)===!1){const b=O.textures,Q=O.width,ot=O.height;let gt=n.COLOR_BUFFER_BIT;const rt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Zt=s.get(O),bt=b.length>1;if(bt)for(let Xt=0;Xt<b.length;Xt++)e.bindFramebuffer(n.FRAMEBUFFER,Zt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Zt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Zt.__webglMultisampledFramebuffer);const Ht=O.texture.mipmaps;Ht&&Ht.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Zt.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Zt.__webglFramebuffer);for(let Xt=0;Xt<b.length;Xt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(gt|=n.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(gt|=n.STENCIL_BUFFER_BIT)),bt){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Zt.__webglColorRenderbuffer[Xt]);const wt=s.get(b[Xt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,wt,0)}n.blitFramebuffer(0,0,Q,ot,0,0,Q,ot,gt,n.NEAREST),u===!0&&(ct.length=0,_t.length=0,ct.push(n.COLOR_ATTACHMENT0+Xt),O.depthBuffer&&O.resolveDepthBuffer===!1&&(ct.push(rt),_t.push(rt),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,_t)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,ct))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),bt)for(let Xt=0;Xt<b.length;Xt++){e.bindFramebuffer(n.FRAMEBUFFER,Zt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xt,n.RENDERBUFFER,Zt.__webglColorRenderbuffer[Xt]);const wt=s.get(b[Xt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Zt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Xt,n.TEXTURE_2D,wt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Zt.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&u){const b=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT;n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,[b])}}}function Ot(O){return Math.min(r.maxSamples,O.samples)}function yt(O){const b=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Nt(O){const b=l.render.frame;p.get(O)!==b&&(p.set(O,b),O.update())}function pe(O,b){const Q=O.colorSpace,ot=O.format,gt=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||Q!==is&&Q!==Li&&(Me.getTransfer(Q)===Ie?(ot!==zn||gt!==hi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Q)),b}function ge(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(d.width=O.naturalWidth||O.width,d.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(d.width=O.displayWidth,d.height=O.displayHeight):(d.width=O.width,d.height=O.height),d}this.allocateTextureUnit=J,this.resetTextureUnits=Z,this.setTexture2D=$,this.setTexture2DArray=K,this.setTexture3D=ut,this.setTextureCube=G,this.rebindTextures=at,this.setupRenderTarget=C,this.updateRenderTargetMipmap=it,this.updateMultisampleRenderTarget=ht,this.setupDepthRenderbuffer=ce,this.setupFrameBufferTexture=Dt,this.useMultisampledRTT=yt}function Gw(n,t){function e(s,r=Li){let a;const l=Me.getTransfer(r);if(s===hi)return n.UNSIGNED_BYTE;if(s===yl)return n.UNSIGNED_SHORT_4_4_4_4;if(s===El)return n.UNSIGNED_SHORT_5_5_5_1;if(s===ou)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===su)return n.BYTE;if(s===ru)return n.SHORT;if(s===gr)return n.UNSIGNED_SHORT;if(s===vl)return n.INT;if(s===ns)return n.UNSIGNED_INT;if(s===ui)return n.FLOAT;if(s===_r)return n.HALF_FLOAT;if(s===au)return n.ALPHA;if(s===lu)return n.RGB;if(s===zn)return n.RGBA;if(s===yr)return n.DEPTH_COMPONENT;if(s===Er)return n.DEPTH_STENCIL;if(s===cu)return n.RED;if(s===xl)return n.RED_INTEGER;if(s===hu)return n.RG;if(s===wl)return n.RG_INTEGER;if(s===Sl)return n.RGBA_INTEGER;if(s===Eo||s===xo||s===wo||s===So)if(l===Ie)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===Eo)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===Eo)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===xo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===wo)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===So)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Ml||s===Tl||s===bl||s===Al)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===Ml)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Tl)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===bl)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Al)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Cl||s===Pl||s===Rl)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===Cl||s===Pl)return l===Ie?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===Rl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===Ll||s===Il||s===Dl||s===kl||s===Ul||s===Ol||s===Nl||s===Bl||s===Fl||s===zl||s===Hl||s===Vl||s===Gl||s===Wl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===Ll)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===Il)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===Dl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===kl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Ul)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Ol)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Nl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Bl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===Fl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===zl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Hl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===Vl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===Gl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Wl)return l===Ie?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===Mo||s===Zl||s===Xl)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===Mo)return l===Ie?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Zl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Xl)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===uu||s===Yl||s===ql||s===Ql)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===Mo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Yl)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===ql)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Ql)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===vr?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class bd extends Je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const Ww=`
3826
3826
  void main() {
3827
3827
 
3828
3828
  gl_Position = vec4( position, 1.0 );
@@ -3846,7 +3846,7 @@ void main() {
3846
3846
 
3847
3847
  }
3848
3848
 
3849
- }`;class Xw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new bd(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,s=new vi({vertexShader:Ww,fragmentShader:Zw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new pn(new Ir(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Yw extends Cs{constructor(t,e){super();const s=this;let r=null,a=1,l=null,h="local-floor",u=1,d=null,p=null,m=null,_=null,E=null,S=null;const w=new Xw,v={},g=e.getContextAttributes();let I=null,C=null;const T=[],U=[],N=new be;let B=null;const z=new In;z.viewport=new ze;const D=new In;D.viewport=new ze;const M=[z,D],k=new Y0;let Z=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let it=T[Y];return it===void 0&&(it=new Ec,T[Y]=it),it.getTargetRaySpace()},this.getControllerGrip=function(Y){let it=T[Y];return it===void 0&&(it=new Ec,T[Y]=it),it.getGripSpace()},this.getHand=function(Y){let it=T[Y];return it===void 0&&(it=new Ec,T[Y]=it),it.getHandSpace()};function V(Y){const it=U.indexOf(Y.inputSource);if(it===-1)return;const ft=T[it];ft!==void 0&&(ft.update(Y.inputSource,Y.frame,d||l),ft.dispatchEvent({type:Y.type,data:Y.inputSource}))}function $(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",K);for(let Y=0;Y<T.length;Y++){const it=U[Y];it!==null&&(U[Y]=null,T[Y].disconnect(it))}Z=null,J=null,w.reset();for(const Y in v)delete v[Y];t.setRenderTarget(I),E=null,_=null,m=null,r=null,C=null,Lt.stop(),s.isPresenting=!1,t.setPixelRatio(B),t.setSize(N.width,N.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){a=Y,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){h=Y,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(Y){d=Y},this.getBaseLayer=function(){return _!==null?_:E},this.getBinding=function(){return m},this.getFrame=function(){return S},this.getSession=function(){return r},this.setSession=async function(Y){if(r=Y,r!==null){if(I=t.getRenderTarget(),r.addEventListener("select",V),r.addEventListener("selectstart",V),r.addEventListener("selectend",V),r.addEventListener("squeeze",V),r.addEventListener("squeezestart",V),r.addEventListener("squeezeend",V),r.addEventListener("end",$),r.addEventListener("inputsourceschange",K),g.xrCompatible!==!0&&await e.makeXRCompatible(),B=t.getPixelRatio(),t.getSize(N),typeof XRWebGLBinding<"u"&&(m=new XRWebGLBinding(r,e)),m!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let ft=null,kt=null,Ot=null;g.depth&&(Ot=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ft=g.stencil?Er:yr,kt=g.stencil?vr:ns);const zt={colorFormat:e.RGBA8,depthFormat:Ot,scaleFactor:a};_=m.createProjectionLayer(zt),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),C=new Ii(_.textureWidth,_.textureHeight,{format:zn,type:hi,depthTexture:new Xu(_.textureWidth,_.textureHeight,kt,void 0,void 0,void 0,void 0,void 0,void 0,ft),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const ft={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,ft),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),C=new Ii(E.framebufferWidth,E.framebufferHeight,{format:zn,type:hi,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:E.ignoreDepthValues===!1,resolveStencilBuffer:E.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(u),d=null,l=await r.requestReferenceSpace(h),Lt.setContext(r),Lt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return w.getDepthTexture()};function K(Y){for(let it=0;it<Y.removed.length;it++){const ft=Y.removed[it],kt=U.indexOf(ft);kt>=0&&(U[kt]=null,T[kt].disconnect(ft))}for(let it=0;it<Y.added.length;it++){const ft=Y.added[it];let kt=U.indexOf(ft);if(kt===-1){for(let zt=0;zt<T.length;zt++)if(zt>=U.length){U.push(ft),kt=zt;break}else if(U[zt]===null){U[zt]=ft,kt=zt;break}if(kt===-1)break}const Ot=T[kt];Ot&&Ot.connect(ft)}}const ut=new q,G=new q;function Tt(Y,it,ft){ut.setFromMatrixPosition(it.matrixWorld),G.setFromMatrixPosition(ft.matrixWorld);const kt=ut.distanceTo(G),Ot=it.projectionMatrix.elements,zt=ft.projectionMatrix.elements,ct=Ot[14]/(Ot[10]-1),ht=Ot[14]/(Ot[10]+1),P=(Ot[9]+1)/Ot[5],lt=(Ot[9]-1)/Ot[5],at=(Ot[8]-1)/Ot[0],vt=(zt[8]+1)/zt[0],gt=ct*at,Bt=ct*vt,bt=kt/(-at+vt),Zt=bt*-at;if(it.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Zt),Y.translateZ(bt),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ot[10]===-1)Y.projectionMatrix.copy(it.projectionMatrix),Y.projectionMatrixInverse.copy(it.projectionMatrixInverse);else{const ve=ct+bt,Ae=ht+bt,O=gt-Zt,A=Bt+(kt-Zt),j=P*ht/Ae*ve,rt=lt*ht/Ae*ve;Y.projectionMatrix.makePerspective(O,A,j,rt,ve,Ae),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function ot(Y,it){it===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(it.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(r===null)return;let it=Y.near,ft=Y.far;w.texture!==null&&(w.depthNear>0&&(it=w.depthNear),w.depthFar>0&&(ft=w.depthFar)),k.near=D.near=z.near=it,k.far=D.far=z.far=ft,(Z!==k.near||J!==k.far)&&(r.updateRenderState({depthNear:k.near,depthFar:k.far}),Z=k.near,J=k.far),k.layers.mask=Y.layers.mask|6,z.layers.mask=k.layers.mask&3,D.layers.mask=k.layers.mask&5;const kt=Y.parent,Ot=k.cameras;ot(k,kt);for(let zt=0;zt<Ot.length;zt++)ot(Ot[zt],kt);Ot.length===2?Tt(k,z,D):k.projectionMatrix.copy(z.projectionMatrix),St(Y,k,kt)};function St(Y,it,ft){ft===null?Y.matrix.copy(it.matrixWorld):(Y.matrix.copy(ft.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(it.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(it.projectionMatrix),Y.projectionMatrixInverse.copy(it.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=wr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(Y){u=Y,_!==null&&(_.fixedFoveation=Y),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=Y)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(k)},this.getCameraTexture=function(Y){return v[Y]};let Gt=null;function pt(Y,it){if(p=it.getViewerPose(d||l),S=it,p!==null){const ft=p.views;E!==null&&(t.setRenderTargetFramebuffer(C,E.framebuffer),t.setRenderTarget(C));let kt=!1;ft.length!==k.cameras.length&&(k.cameras.length=0,kt=!0);for(let ht=0;ht<ft.length;ht++){const P=ft[ht];let lt=null;if(E!==null)lt=E.getViewport(P);else{const vt=m.getViewSubImage(_,P);lt=vt.viewport,ht===0&&(t.setRenderTargetTextures(C,vt.colorTexture,vt.depthStencilTexture),t.setRenderTarget(C))}let at=M[ht];at===void 0&&(at=new In,at.layers.enable(ht),at.viewport=new ze,M[ht]=at),at.matrix.fromArray(P.transform.matrix),at.matrix.decompose(at.position,at.quaternion,at.scale),at.projectionMatrix.fromArray(P.projectionMatrix),at.projectionMatrixInverse.copy(at.projectionMatrix).invert(),at.viewport.set(lt.x,lt.y,lt.width,lt.height),ht===0&&(k.matrix.copy(at.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),kt===!0&&k.cameras.push(at)}const Ot=r.enabledFeatures;if(Ot&&Ot.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const ht=m.getDepthInformation(ft[0]);ht&&ht.isValid&&ht.texture&&w.init(ht,r.renderState)}if(Ot&&Ot.includes("camera-access")&&(t.state.unbindTexture(),m))for(let ht=0;ht<ft.length;ht++){const P=ft[ht].camera;if(P){let lt=v[P];lt||(lt=new bd,v[P]=lt);const at=m.getCameraImage(P);lt.sourceTexture=at}}}for(let ft=0;ft<T.length;ft++){const kt=U[ft],Ot=T[ft];kt!==null&&Ot!==void 0&&Ot.update(kt,it,d||l)}Gt&&Gt(Y,it),it.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:it}),S=null}const Lt=new Ju;Lt.setAnimationLoop(pt),this.setAnimationLoop=function(Y){Gt=Y},this.dispose=function(){}}}const fs=new Jn,qw=new Oe;function Qw(n,t){function e(v,g){v.matrixAutoUpdate===!0&&v.updateMatrix(),g.value.copy(v.matrix)}function s(v,g){g.color.getRGB(v.fogColor.value,Nu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,I,C,T){g.isMeshBasicMaterial||g.isMeshLambertMaterial?a(v,g):g.isMeshToonMaterial?(a(v,g),m(v,g)):g.isMeshPhongMaterial?(a(v,g),p(v,g)):g.isMeshStandardMaterial?(a(v,g),_(v,g),g.isMeshPhysicalMaterial&&E(v,g,T)):g.isMeshMatcapMaterial?(a(v,g),S(v,g)):g.isMeshDepthMaterial?a(v,g):g.isMeshDistanceMaterial?(a(v,g),w(v,g)):g.isMeshNormalMaterial?a(v,g):g.isLineBasicMaterial?(l(v,g),g.isLineDashedMaterial&&h(v,g)):g.isPointsMaterial?u(v,g,I,C):g.isSpriteMaterial?d(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function a(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,e(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,g.side===fn&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===fn&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,e(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,e(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const I=t.get(g),C=I.envMap,T=I.envMapRotation;C&&(v.envMap.value=C,fs.copy(T),fs.x*=-1,fs.y*=-1,fs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(fs.y*=-1,fs.z*=-1),v.envMapRotation.value.setFromMatrix4(qw.makeRotationFromEuler(fs)),v.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,v.lightMapTransform)),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,v.aoMapTransform))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform))}function h(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function u(v,g,I,C){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*I,v.scale.value=C*.5,g.map&&(v.map.value=g.map,e(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function d(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function p(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}function m(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}function _(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,v.roughnessMapTransform)),g.envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function E(v,g,I){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fn&&v.clearcoatNormalScale.value.negate())),g.dispersion>0&&(v.dispersion.value=g.dispersion),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=I.texture,v.transmissionSamplerSize.value.set(I.width,I.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,v.specularIntensityMapTransform))}function S(v,g){g.matcap&&(v.matcap.value=g.matcap)}function w(v,g){const I=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(I.matrixWorld),v.nearDistance.value=I.shadow.camera.near,v.farDistance.value=I.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function jw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(I,C){const T=C.program;s.uniformBlockBinding(I,T)}function d(I,C){let T=r[I.id];T===void 0&&(S(I),T=p(I),r[I.id]=T,I.addEventListener("dispose",v));const U=C.program;s.updateUBOMapping(I,U);const N=t.render.frame;a[I.id]!==N&&(_(I),a[I.id]=N)}function p(I){const C=m();I.__bindingPointIndex=C;const T=n.createBuffer(),U=I.__size,N=I.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,U,N),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,T),T}function m(){for(let I=0;I<h;I++)if(l.indexOf(I)===-1)return l.push(I),I;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(I){const C=r[I.id],T=I.uniforms,U=I.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let N=0,B=T.length;N<B;N++){const z=Array.isArray(T[N])?T[N]:[T[N]];for(let D=0,M=z.length;D<M;D++){const k=z[D];if(E(k,N,D,U)===!0){const Z=k.__offset,J=Array.isArray(k.value)?k.value:[k.value];let V=0;for(let $=0;$<J.length;$++){const K=J[$],ut=w(K);typeof K=="number"||typeof K=="boolean"?(k.__data[0]=K,n.bufferSubData(n.UNIFORM_BUFFER,Z+V,k.__data)):K.isMatrix3?(k.__data[0]=K.elements[0],k.__data[1]=K.elements[1],k.__data[2]=K.elements[2],k.__data[3]=0,k.__data[4]=K.elements[3],k.__data[5]=K.elements[4],k.__data[6]=K.elements[5],k.__data[7]=0,k.__data[8]=K.elements[6],k.__data[9]=K.elements[7],k.__data[10]=K.elements[8],k.__data[11]=0):(K.toArray(k.__data,V),V+=ut.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,Z,k.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(I,C,T,U){const N=I.value,B=C+"_"+T;if(U[B]===void 0)return typeof N=="number"||typeof N=="boolean"?U[B]=N:U[B]=N.clone(),!0;{const z=U[B];if(typeof N=="number"||typeof N=="boolean"){if(z!==N)return U[B]=N,!0}else if(z.equals(N)===!1)return z.copy(N),!0}return!1}function S(I){const C=I.uniforms;let T=0;const U=16;for(let B=0,z=C.length;B<z;B++){const D=Array.isArray(C[B])?C[B]:[C[B]];for(let M=0,k=D.length;M<k;M++){const Z=D[M],J=Array.isArray(Z.value)?Z.value:[Z.value];for(let V=0,$=J.length;V<$;V++){const K=J[V],ut=w(K),G=T%U,Tt=G%ut.boundary,ot=G+Tt;T+=Tt,ot!==0&&U-ot<ut.storage&&(T+=U-ot),Z.__data=new Float32Array(ut.storage/Float32Array.BYTES_PER_ELEMENT),Z.__offset=T,T+=ut.storage}}}const N=T%U;return N>0&&(T+=U-N),I.__size=T,I.__cache={},this}function w(I){const C={boundary:0,storage:0};return typeof I=="number"||typeof I=="boolean"?(C.boundary=4,C.storage=4):I.isVector2?(C.boundary=8,C.storage=8):I.isVector3||I.isColor?(C.boundary=16,C.storage=12):I.isVector4?(C.boundary=16,C.storage=16):I.isMatrix3?(C.boundary=48,C.storage=48):I.isMatrix4?(C.boundary=64,C.storage=64):I.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",I),C}function v(I){const C=I.target;C.removeEventListener("dispose",v);const T=l.indexOf(C.__bindingPointIndex);l.splice(T,1),n.deleteBuffer(r[C.id]),delete r[C.id],delete a[C.id]}function g(){for(const I in r)n.deleteBuffer(r[I]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class Jw{constructor(t={}){const{canvas:e=r0(),context:s=null,depth:r=!0,stencil:a=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:_=!1}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=l;const S=new Uint32Array(4),w=new Int32Array(4);let v=null,g=null;const I=[],C=[];this.domElement=e,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.toneMapping=Pi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const T=this;let U=!1;this._outputColorSpace=Rn;let N=0,B=0,z=null,D=-1,M=null;const k=new ze,Z=new ze;let J=null;const V=new Pe(0);let $=0,K=e.width,ut=e.height,G=1,Tt=null,ot=null;const St=new ze(0,0,K,ut),Gt=new ze(0,0,K,ut);let pt=!1;const Lt=new Sc;let Y=!1,it=!1;const ft=new Oe,kt=new q,Ot=new ze,zt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ct=!1;function ht(){return z===null?G:1}let P=s;function lt(R,W){return e.getContext(R,W)}try{const R={alpha:!0,depth:r,stencil:a,antialias:h,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${il}`),e.addEventListener("webglcontextlost",Ct,!1),e.addEventListener("webglcontextrestored",Ft,!1),e.addEventListener("webglcontextcreationerror",yt,!1),P===null){const W="webgl2";if(P=lt(W,R),P===null)throw lt(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(R){throw console.error("THREE.WebGLRenderer: "+R.message),R}let at,vt,gt,Bt,bt,Zt,ve,Ae,O,A,j,rt,_t,st,Xt,At,Ht,Yt,xt,It,se,qt,Pt,ce;function H(){at=new ax(P),at.init(),qt=new Gw(P,at),vt=new tx(P,at,t,qt),gt=new Hw(P,at),vt.reversedDepthBuffer&&_&&gt.buffers.depth.setReversed(!0),Bt=new hx(P),bt=new Cw,Zt=new Vw(P,at,gt,bt,vt,qt,Bt),ve=new nx(T),Ae=new ox(T),O=new j0(P),Pt=new KE(P,O),A=new lx(P,O,Bt,Pt),j=new dx(P,A,O,Bt),xt=new ux(P,vt,Zt),At=new ex(bt),rt=new Aw(T,ve,Ae,at,vt,Pt,At),_t=new Qw(T,bt),st=new Rw,Xt=new Ow(at),Yt=new JE(T,ve,Ae,gt,j,E,u),Ht=new Fw(T,j,vt),ce=new jw(P,Bt,vt,gt),It=new $E(P,at,Bt),se=new cx(P,at,Bt),Bt.programs=rt.programs,T.capabilities=vt,T.extensions=at,T.properties=bt,T.renderLists=st,T.shadowMap=Ht,T.state=gt,T.info=Bt}H();const wt=new Yw(T,P);this.xr=wt,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){const R=at.get("WEBGL_lose_context");R&&R.loseContext()},this.forceContextRestore=function(){const R=at.get("WEBGL_lose_context");R&&R.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(R){R!==void 0&&(G=R,this.setSize(K,ut,!1))},this.getSize=function(R){return R.set(K,ut)},this.setSize=function(R,W,et=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}K=R,ut=W,e.width=Math.floor(R*G),e.height=Math.floor(W*G),et===!0&&(e.style.width=R+"px",e.style.height=W+"px"),this.setViewport(0,0,R,W)},this.getDrawingBufferSize=function(R){return R.set(K*G,ut*G).floor()},this.setDrawingBufferSize=function(R,W,et){K=R,ut=W,G=et,e.width=Math.floor(R*et),e.height=Math.floor(W*et),this.setViewport(0,0,R,W)},this.getCurrentViewport=function(R){return R.copy(k)},this.getViewport=function(R){return R.copy(St)},this.setViewport=function(R,W,et,tt){R.isVector4?St.set(R.x,R.y,R.z,R.w):St.set(R,W,et,tt),gt.viewport(k.copy(St).multiplyScalar(G).round())},this.getScissor=function(R){return R.copy(Gt)},this.setScissor=function(R,W,et,tt){R.isVector4?Gt.set(R.x,R.y,R.z,R.w):Gt.set(R,W,et,tt),gt.scissor(Z.copy(Gt).multiplyScalar(G).round())},this.getScissorTest=function(){return pt},this.setScissorTest=function(R){gt.setScissorTest(pt=R)},this.setOpaqueSort=function(R){Tt=R},this.setTransparentSort=function(R){ot=R},this.getClearColor=function(R){return R.copy(Yt.getClearColor())},this.setClearColor=function(){Yt.setClearColor(...arguments)},this.getClearAlpha=function(){return Yt.getClearAlpha()},this.setClearAlpha=function(){Yt.setClearAlpha(...arguments)},this.clear=function(R=!0,W=!0,et=!0){let tt=0;if(R){let X=!1;if(z!==null){const Et=z.texture.format;X=Et===Sl||Et===wl||Et===xl}if(X){const Et=z.texture.type,Dt=Et===hi||Et===ns||Et===gr||Et===vr||Et===yl||Et===El,Vt=Yt.getClearColor(),Nt=Yt.getClearAlpha(),ne=Vt.r,ie=Vt.g,Kt=Vt.b;Dt?(S[0]=ne,S[1]=ie,S[2]=Kt,S[3]=Nt,P.clearBufferuiv(P.COLOR,0,S)):(w[0]=ne,w[1]=ie,w[2]=Kt,w[3]=Nt,P.clearBufferiv(P.COLOR,0,w))}else tt|=P.COLOR_BUFFER_BIT}W&&(tt|=P.DEPTH_BUFFER_BIT),et&&(tt|=P.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),P.clear(tt)},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(){e.removeEventListener("webglcontextlost",Ct,!1),e.removeEventListener("webglcontextrestored",Ft,!1),e.removeEventListener("webglcontextcreationerror",yt,!1),Yt.dispose(),st.dispose(),Xt.dispose(),bt.dispose(),ve.dispose(),Ae.dispose(),j.dispose(),Pt.dispose(),ce.dispose(),rt.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",On),wt.removeEventListener("sessionend",Ba),wi.stop()};function Ct(R){R.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Ft(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const R=Bt.autoReset,W=Ht.enabled,et=Ht.autoUpdate,tt=Ht.needsUpdate,X=Ht.type;H(),Bt.autoReset=R,Ht.enabled=W,Ht.autoUpdate=et,Ht.needsUpdate=tt,Ht.type=X}function yt(R){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",R.statusMessage)}function dt(R){const W=R.target;W.removeEventListener("dispose",dt),Wt(W)}function Wt(R){le(R),bt.remove(R)}function le(R){const W=bt.get(R).programs;W!==void 0&&(W.forEach(function(et){rt.releaseProgram(et)}),R.isShaderMaterial&&rt.releaseShaderCache(R))}this.renderBufferDirect=function(R,W,et,tt,X,Et){W===null&&(W=zt);const Dt=X.isMesh&&X.matrixWorld.determinant()<0,Vt=Fa(R,W,et,tt,X);gt.setMaterial(tt,Dt);let Nt=et.index,ne=1;if(tt.wireframe===!0){if(Nt=A.getWireframeAttribute(et),Nt===void 0)return;ne=2}const ie=et.drawRange,Kt=et.attributes.position;let fe=ie.start*ne,Ee=(ie.start+ie.count)*ne;Et!==null&&(fe=Math.max(fe,Et.start*ne),Ee=Math.min(Ee,(Et.start+Et.count)*ne)),Nt!==null?(fe=Math.max(fe,0),Ee=Math.min(Ee,Nt.count)):Kt!=null&&(fe=Math.max(fe,0),Ee=Math.min(Ee,Kt.count));const $t=Ee-fe;if($t<0||$t===1/0)return;Pt.setup(X,tt,Vt,et,Nt);let re,Te=It;if(Nt!==null&&(re=O.get(Nt),Te=se,Te.setIndex(re)),X.isMesh)tt.wireframe===!0?(gt.setLineWidth(tt.wireframeLinewidth*ht()),Te.setMode(P.LINES)):Te.setMode(P.TRIANGLES);else if(X.isLine){let jt=tt.linewidth;jt===void 0&&(jt=1),gt.setLineWidth(jt*ht()),X.isLineSegments?Te.setMode(P.LINES):X.isLineLoop?Te.setMode(P.LINE_LOOP):Te.setMode(P.LINE_STRIP)}else X.isPoints?Te.setMode(P.POINTS):X.isSprite&&Te.setMode(P.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)Ls("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Te.renderMultiDrawInstances(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount,X._multiDrawInstances);else if(at.get("WEBGL_multi_draw"))Te.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const jt=X._multiDrawStarts,Le=X._multiDrawCounts,ge=X._multiDrawCount,ee=Nt?O.get(Nt).bytesPerElement:1,ke=bt.get(tt).currentProgram.getUniforms();for(let tn=0;tn<ge;tn++)ke.setValue(P,"_gl_DrawID",tn),Te.render(jt[tn]/ee,Le[tn])}else if(X.isInstancedMesh)Te.renderInstances(fe,$t,X.count);else if(et.isInstancedBufferGeometry){const jt=et._maxInstanceCount!==void 0?et._maxInstanceCount:1/0,Le=Math.min(et.instanceCount,jt);Te.renderInstances(fe,$t,Le)}else Te.render(fe,$t)};function De(R,W,et){R.transparent===!0&&R.side===ci&&R.forceSinglePass===!1?(R.side=fn,R.needsUpdate=!0,vs(R,W,et),R.side=Ai,R.needsUpdate=!0,vs(R,W,et),R.side=ci):vs(R,W,et)}this.compile=function(R,W,et=null){et===null&&(et=R),g=Xt.get(et),g.init(W),C.push(g),et.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),R!==et&&R.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),g.setupLights();const tt=new Set;return R.traverse(function(X){if(!(X.isMesh||X.isPoints||X.isLine||X.isSprite))return;const Et=X.material;if(Et)if(Array.isArray(Et))for(let Dt=0;Dt<Et.length;Dt++){const Vt=Et[Dt];De(Vt,et,X),tt.add(Vt)}else De(Et,et,X),tt.add(Et)}),g=C.pop(),tt},this.compileAsync=function(R,W,et=null){const tt=this.compile(R,W,et);return new Promise(X=>{function Et(){if(tt.forEach(function(Dt){bt.get(Dt).currentProgram.isReady()&&tt.delete(Dt)}),tt.size===0){X(R);return}setTimeout(Et,10)}at.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let Me=null;function bn(R){Me&&Me(R)}function On(){wi.stop()}function Ba(){wi.start()}const wi=new Ju;wi.setAnimationLoop(bn),typeof self<"u"&&wi.setContext(self),this.setAnimationLoop=function(R){Me=R,wt.setAnimationLoop(R),R===null?wi.stop():wi.start()},wt.addEventListener("sessionstart",On),wt.addEventListener("sessionend",Ba),this.render=function(R,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(R.matrixWorldAutoUpdate===!0&&R.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(W),W=wt.getCamera()),R.isScene===!0&&R.onBeforeRender(T,R,W,z),g=Xt.get(R,C.length),g.init(W),C.push(g),ft.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Lt.setFromProjectionMatrix(ft,jn,W.reversedDepth),it=this.localClippingEnabled,Y=At.init(this.clippingPlanes,it),v=st.get(R,I.length),v.init(),I.push(v),wt.enabled===!0&&wt.isPresenting===!0){const Et=T.xr.getDepthSensingMesh();Et!==null&&io(Et,W,-1/0,T.sortObjects)}io(R,W,0,T.sortObjects),v.finish(),T.sortObjects===!0&&v.sort(Tt,ot),ct=wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1,ct&&Yt.addToRenderList(v,R),this.info.render.frame++,Y===!0&&At.beginShadows();const et=g.state.shadowsArray;Ht.render(et,R,W),Y===!0&&At.endShadows(),this.info.autoReset===!0&&this.info.reset();const tt=v.opaque,X=v.transmissive;if(g.setupLights(),W.isArrayCamera){const Et=W.cameras;if(X.length>0)for(let Dt=0,Vt=Et.length;Dt<Vt;Dt++){const Nt=Et[Dt];Qt(tt,X,R,Nt)}ct&&Yt.render(R);for(let Dt=0,Vt=Et.length;Dt<Vt;Dt++){const Nt=Et[Dt];An(v,R,Nt,Nt.viewport)}}else X.length>0&&Qt(tt,X,R,W),ct&&Yt.render(R),An(v,R,W);z!==null&&B===0&&(Zt.updateMultisampleRenderTarget(z),Zt.updateRenderTargetMipmap(z)),R.isScene===!0&&R.onAfterRender(T,R,W),Pt.resetDefaultState(),D=-1,M=null,C.pop(),C.length>0?(g=C[C.length-1],Y===!0&&At.setGlobalState(T.clippingPlanes,g.state.camera)):g=null,I.pop(),I.length>0?v=I[I.length-1]:v=null};function io(R,W,et,tt){if(R.visible===!1)return;if(R.layers.test(W.layers)){if(R.isGroup)et=R.renderOrder;else if(R.isLOD)R.autoUpdate===!0&&R.update(W);else if(R.isLight)g.pushLight(R),R.castShadow&&g.pushShadow(R);else if(R.isSprite){if(!R.frustumCulled||Lt.intersectsSprite(R)){tt&&Ot.setFromMatrixPosition(R.matrixWorld).applyMatrix4(ft);const Dt=j.update(R),Vt=R.material;Vt.visible&&v.push(R,Dt,Vt,et,Ot.z,null)}}else if((R.isMesh||R.isLine||R.isPoints)&&(!R.frustumCulled||Lt.intersectsObject(R))){const Dt=j.update(R),Vt=R.material;if(tt&&(R.boundingSphere!==void 0?(R.boundingSphere===null&&R.computeBoundingSphere(),Ot.copy(R.boundingSphere.center)):(Dt.boundingSphere===null&&Dt.computeBoundingSphere(),Ot.copy(Dt.boundingSphere.center)),Ot.applyMatrix4(R.matrixWorld).applyMatrix4(ft)),Array.isArray(Vt)){const Nt=Dt.groups;for(let ne=0,ie=Nt.length;ne<ie;ne++){const Kt=Nt[ne],fe=Vt[Kt.materialIndex];fe&&fe.visible&&v.push(R,Dt,fe,et,Ot.z,Kt)}}else Vt.visible&&v.push(R,Dt,Vt,et,Ot.z,null)}}const Et=R.children;for(let Dt=0,Vt=Et.length;Dt<Vt;Dt++)io(Et[Dt],W,et,tt)}function An(R,W,et,tt){const X=R.opaque,Et=R.transmissive,Dt=R.transparent;g.setupLightsView(et),Y===!0&&At.setGlobalState(T.clippingPlanes,et),tt&&gt.viewport(k.copy(tt)),X.length>0&&_s(X,W,et),Et.length>0&&_s(Et,W,et),Dt.length>0&&_s(Dt,W,et),gt.buffers.depth.setTest(!0),gt.buffers.depth.setMask(!0),gt.buffers.color.setMask(!0),gt.setPolygonOffset(!1)}function Qt(R,W,et,tt){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[tt.id]===void 0&&(g.state.transmissionRenderTarget[tt.id]=new Ii(1,1,{generateMipmaps:!0,type:at.has("EXT_color_buffer_half_float")||at.has("EXT_color_buffer_float")?_r:hi,minFilter:Ri,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Se.workingColorSpace}));const Et=g.state.transmissionRenderTarget[tt.id],Dt=tt.viewport||k;Et.setSize(Dt.z*T.transmissionResolutionScale,Dt.w*T.transmissionResolutionScale);const Vt=T.getRenderTarget(),Nt=T.getActiveCubeFace(),ne=T.getActiveMipmapLevel();T.setRenderTarget(Et),T.getClearColor(V),$=T.getClearAlpha(),$<1&&T.setClearColor(16777215,.5),T.clear(),ct&&Yt.render(et);const ie=T.toneMapping;T.toneMapping=Pi;const Kt=tt.viewport;if(tt.viewport!==void 0&&(tt.viewport=void 0),g.setupLightsView(tt),Y===!0&&At.setGlobalState(T.clippingPlanes,tt),_s(R,et,tt),Zt.updateMultisampleRenderTarget(Et),Zt.updateRenderTargetMipmap(Et),at.has("WEBGL_multisampled_render_to_texture")===!1){let fe=!1;for(let Ee=0,$t=W.length;Ee<$t;Ee++){const re=W[Ee],Te=re.object,jt=re.geometry,Le=re.material,ge=re.group;if(Le.side===ci&&Te.layers.test(tt.layers)){const ee=Le.side;Le.side=fn,Le.needsUpdate=!0,so(Te,et,tt,jt,Le,ge),Le.side=ee,Le.needsUpdate=!0,fe=!0}}fe===!0&&(Zt.updateMultisampleRenderTarget(Et),Zt.updateRenderTargetMipmap(Et))}T.setRenderTarget(Vt,Nt,ne),T.setClearColor(V,$),Kt!==void 0&&(tt.viewport=Kt),T.toneMapping=ie}function _s(R,W,et){const tt=W.isScene===!0?W.overrideMaterial:null;for(let X=0,Et=R.length;X<Et;X++){const Dt=R[X],Vt=Dt.object,Nt=Dt.geometry,ne=Dt.group;let ie=Dt.material;ie.allowOverride===!0&&tt!==null&&(ie=tt),Vt.layers.test(et.layers)&&so(Vt,W,et,Nt,ie,ne)}}function so(R,W,et,tt,X,Et){R.onBeforeRender(T,W,et,tt,X,Et),R.modelViewMatrix.multiplyMatrices(et.matrixWorldInverse,R.matrixWorld),R.normalMatrix.getNormalMatrix(R.modelViewMatrix),X.onBeforeRender(T,W,et,tt,R,Et),X.transparent===!0&&X.side===ci&&X.forceSinglePass===!1?(X.side=fn,X.needsUpdate=!0,T.renderBufferDirect(et,W,tt,X,R,Et),X.side=Ai,X.needsUpdate=!0,T.renderBufferDirect(et,W,tt,X,R,Et),X.side=ci):T.renderBufferDirect(et,W,tt,X,R,Et),R.onAfterRender(T,W,et,tt,X,Et)}function vs(R,W,et){W.isScene!==!0&&(W=zt);const tt=bt.get(R),X=g.state.lights,Et=g.state.shadowsArray,Dt=X.state.version,Vt=rt.getParameters(R,X.state,Et,W,et),Nt=rt.getProgramCacheKey(Vt);let ne=tt.programs;tt.environment=R.isMeshStandardMaterial?W.environment:null,tt.fog=W.fog,tt.envMap=(R.isMeshStandardMaterial?Ae:ve).get(R.envMap||tt.environment),tt.envMapRotation=tt.environment!==null&&R.envMap===null?W.environmentRotation:R.envMapRotation,ne===void 0&&(R.addEventListener("dispose",dt),ne=new Map,tt.programs=ne);let ie=ne.get(Nt);if(ie!==void 0){if(tt.currentProgram===ie&&tt.lightsStateVersion===Dt)return lr(R,Vt),ie}else Vt.uniforms=rt.getUniforms(R),R.onBeforeCompile(Vt,T),ie=rt.acquireProgram(Vt,Nt),ne.set(Nt,ie),tt.uniforms=Vt.uniforms;const Kt=tt.uniforms;return(!R.isShaderMaterial&&!R.isRawShaderMaterial||R.clipping===!0)&&(Kt.clippingPlanes=At.uniform),lr(R,Vt),tt.needsLights=za(R),tt.lightsStateVersion=Dt,tt.needsLights&&(Kt.ambientLightColor.value=X.state.ambient,Kt.lightProbe.value=X.state.probe,Kt.directionalLights.value=X.state.directional,Kt.directionalLightShadows.value=X.state.directionalShadow,Kt.spotLights.value=X.state.spot,Kt.spotLightShadows.value=X.state.spotShadow,Kt.rectAreaLights.value=X.state.rectArea,Kt.ltc_1.value=X.state.rectAreaLTC1,Kt.ltc_2.value=X.state.rectAreaLTC2,Kt.pointLights.value=X.state.point,Kt.pointLightShadows.value=X.state.pointShadow,Kt.hemisphereLights.value=X.state.hemi,Kt.directionalShadowMap.value=X.state.directionalShadowMap,Kt.directionalShadowMatrix.value=X.state.directionalShadowMatrix,Kt.spotShadowMap.value=X.state.spotShadowMap,Kt.spotLightMatrix.value=X.state.spotLightMatrix,Kt.spotLightMap.value=X.state.spotLightMap,Kt.pointShadowMap.value=X.state.pointShadowMap,Kt.pointShadowMatrix.value=X.state.pointShadowMatrix),tt.currentProgram=ie,tt.uniformsList=null,ie}function ro(R){if(R.uniformsList===null){const W=R.currentProgram.getUniforms();R.uniformsList=Ko.seqWithValue(W.seq,R.uniforms)}return R.uniformsList}function lr(R,W){const et=bt.get(R);et.outputColorSpace=W.outputColorSpace,et.batching=W.batching,et.batchingColor=W.batchingColor,et.instancing=W.instancing,et.instancingColor=W.instancingColor,et.instancingMorph=W.instancingMorph,et.skinning=W.skinning,et.morphTargets=W.morphTargets,et.morphNormals=W.morphNormals,et.morphColors=W.morphColors,et.morphTargetsCount=W.morphTargetsCount,et.numClippingPlanes=W.numClippingPlanes,et.numIntersection=W.numClipIntersection,et.vertexAlphas=W.vertexAlphas,et.vertexTangents=W.vertexTangents,et.toneMapping=W.toneMapping}function Fa(R,W,et,tt,X){W.isScene!==!0&&(W=zt),Zt.resetTextureUnits();const Et=W.fog,Dt=tt.isMeshStandardMaterial?W.environment:null,Vt=z===null?T.outputColorSpace:z.isXRRenderTarget===!0?z.texture.colorSpace:is,Nt=(tt.isMeshStandardMaterial?Ae:ve).get(tt.envMap||Dt),ne=tt.vertexColors===!0&&!!et.attributes.color&&et.attributes.color.itemSize===4,ie=!!et.attributes.tangent&&(!!tt.normalMap||tt.anisotropy>0),Kt=!!et.morphAttributes.position,fe=!!et.morphAttributes.normal,Ee=!!et.morphAttributes.color;let $t=Pi;tt.toneMapped&&(z===null||z.isXRRenderTarget===!0)&&($t=T.toneMapping);const re=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,Te=re!==void 0?re.length:0,jt=bt.get(tt),Le=g.state.lights;if(Y===!0&&(it===!0||R!==M)){const Fe=R===M&&tt.id===D;At.setState(tt,R,Fe)}let ge=!1;tt.version===jt.__version?(jt.needsLights&&jt.lightsStateVersion!==Le.state.version||jt.outputColorSpace!==Vt||X.isBatchedMesh&&jt.batching===!1||!X.isBatchedMesh&&jt.batching===!0||X.isBatchedMesh&&jt.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&jt.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&jt.instancing===!1||!X.isInstancedMesh&&jt.instancing===!0||X.isSkinnedMesh&&jt.skinning===!1||!X.isSkinnedMesh&&jt.skinning===!0||X.isInstancedMesh&&jt.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&jt.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&jt.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&jt.instancingMorph===!1&&X.morphTexture!==null||jt.envMap!==Nt||tt.fog===!0&&jt.fog!==Et||jt.numClippingPlanes!==void 0&&(jt.numClippingPlanes!==At.numPlanes||jt.numIntersection!==At.numIntersection)||jt.vertexAlphas!==ne||jt.vertexTangents!==ie||jt.morphTargets!==Kt||jt.morphNormals!==fe||jt.morphColors!==Ee||jt.toneMapping!==$t||jt.morphTargetsCount!==Te)&&(ge=!0):(ge=!0,jt.__version=tt.version);let ee=jt.currentProgram;ge===!0&&(ee=vs(tt,W,X));let ke=!1,tn=!1,si=!1;const _e=ee.getUniforms(),_n=jt.uniforms;if(gt.useProgram(ee.program)&&(ke=!0,tn=!0,si=!0),tt.id!==D&&(D=tt.id,tn=!0),ke||M!==R){gt.buffers.depth.getReversed()&&R.reversedDepth!==!0&&(R._reversedDepth=!0,R.updateProjectionMatrix()),_e.setValue(P,"projectionMatrix",R.projectionMatrix),_e.setValue(P,"viewMatrix",R.matrixWorldInverse);const ye=_e.map.cameraPosition;ye!==void 0&&ye.setValue(P,kt.setFromMatrixPosition(R.matrixWorld)),vt.logarithmicDepthBuffer&&_e.setValue(P,"logDepthBufFC",2/(Math.log(R.far+1)/Math.LN2)),(tt.isMeshPhongMaterial||tt.isMeshToonMaterial||tt.isMeshLambertMaterial||tt.isMeshBasicMaterial||tt.isMeshStandardMaterial||tt.isShaderMaterial)&&_e.setValue(P,"isOrthographic",R.isOrthographicCamera===!0),M!==R&&(M=R,tn=!0,si=!0)}if(X.isSkinnedMesh){_e.setOptional(P,X,"bindMatrix"),_e.setOptional(P,X,"bindMatrixInverse");const Fe=X.skeleton;Fe&&(Fe.boneTexture===null&&Fe.computeBoneTexture(),_e.setValue(P,"boneTexture",Fe.boneTexture,Zt))}X.isBatchedMesh&&(_e.setOptional(P,X,"batchingTexture"),_e.setValue(P,"batchingTexture",X._matricesTexture,Zt),_e.setOptional(P,X,"batchingIdTexture"),_e.setValue(P,"batchingIdTexture",X._indirectTexture,Zt),_e.setOptional(P,X,"batchingColorTexture"),X._colorsTexture!==null&&_e.setValue(P,"batchingColorTexture",X._colorsTexture,Zt));const en=et.morphAttributes;if((en.position!==void 0||en.normal!==void 0||en.color!==void 0)&&xt.update(X,et,ee),(tn||jt.receiveShadow!==X.receiveShadow)&&(jt.receiveShadow=X.receiveShadow,_e.setValue(P,"receiveShadow",X.receiveShadow)),tt.isMeshGouraudMaterial&&tt.envMap!==null&&(_n.envMap.value=Nt,_n.flipEnvMap.value=Nt.isCubeTexture&&Nt.isRenderTargetTexture===!1?-1:1),tt.isMeshStandardMaterial&&tt.envMap===null&&W.environment!==null&&(_n.envMapIntensity.value=W.environmentIntensity),tn&&(_e.setValue(P,"toneMappingExposure",T.toneMappingExposure),jt.needsLights&&Ji(_n,si),Et&&tt.fog===!0&&_t.refreshFogUniforms(_n,Et),_t.refreshMaterialUniforms(_n,tt,G,ut,g.state.transmissionRenderTarget[R.id]),Ko.upload(P,ro(jt),_n,Zt)),tt.isShaderMaterial&&tt.uniformsNeedUpdate===!0&&(Ko.upload(P,ro(jt),_n,Zt),tt.uniformsNeedUpdate=!1),tt.isSpriteMaterial&&_e.setValue(P,"center",X.center),_e.setValue(P,"modelViewMatrix",X.modelViewMatrix),_e.setValue(P,"normalMatrix",X.normalMatrix),_e.setValue(P,"modelMatrix",X.matrixWorld),tt.isShaderMaterial||tt.isRawShaderMaterial){const Fe=tt.uniformsGroups;for(let ye=0,Yn=Fe.length;ye<Yn;ye++){const Cn=Fe[ye];ce.update(Cn,ee),ce.bind(Cn,ee)}}return ee}function Ji(R,W){R.ambientLightColor.needsUpdate=W,R.lightProbe.needsUpdate=W,R.directionalLights.needsUpdate=W,R.directionalLightShadows.needsUpdate=W,R.pointLights.needsUpdate=W,R.pointLightShadows.needsUpdate=W,R.spotLights.needsUpdate=W,R.spotLightShadows.needsUpdate=W,R.rectAreaLights.needsUpdate=W,R.hemisphereLights.needsUpdate=W}function za(R){return R.isMeshLambertMaterial||R.isMeshToonMaterial||R.isMeshPhongMaterial||R.isMeshStandardMaterial||R.isShadowMaterial||R.isShaderMaterial&&R.lights===!0}this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return z},this.setRenderTargetTextures=function(R,W,et){const tt=bt.get(R);tt.__autoAllocateDepthBuffer=R.resolveDepthBuffer===!1,tt.__autoAllocateDepthBuffer===!1&&(tt.__useRenderToTexture=!1),bt.get(R.texture).__webglTexture=W,bt.get(R.depthTexture).__webglTexture=tt.__autoAllocateDepthBuffer?void 0:et,tt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(R,W){const et=bt.get(R);et.__webglFramebuffer=W,et.__useDefaultFramebuffer=W===void 0};const ph=P.createFramebuffer();this.setRenderTarget=function(R,W=0,et=0){z=R,N=W,B=et;let tt=!0,X=null,Et=!1,Dt=!1;if(R){const Nt=bt.get(R);if(Nt.__useDefaultFramebuffer!==void 0)gt.bindFramebuffer(P.FRAMEBUFFER,null),tt=!1;else if(Nt.__webglFramebuffer===void 0)Zt.setupRenderTarget(R);else if(Nt.__hasExternalTextures)Zt.rebindTextures(R,bt.get(R.texture).__webglTexture,bt.get(R.depthTexture).__webglTexture);else if(R.depthBuffer){const Kt=R.depthTexture;if(Nt.__boundDepthTexture!==Kt){if(Kt!==null&&bt.has(Kt)&&(R.width!==Kt.image.width||R.height!==Kt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Zt.setupDepthRenderbuffer(R)}}const ne=R.texture;(ne.isData3DTexture||ne.isDataArrayTexture||ne.isCompressedArrayTexture)&&(Dt=!0);const ie=bt.get(R).__webglFramebuffer;R.isWebGLCubeRenderTarget?(Array.isArray(ie[W])?X=ie[W][et]:X=ie[W],Et=!0):R.samples>0&&Zt.useMultisampledRTT(R)===!1?X=bt.get(R).__webglMultisampledFramebuffer:Array.isArray(ie)?X=ie[et]:X=ie,k.copy(R.viewport),Z.copy(R.scissor),J=R.scissorTest}else k.copy(St).multiplyScalar(G).floor(),Z.copy(Gt).multiplyScalar(G).floor(),J=pt;if(et!==0&&(X=ph),gt.bindFramebuffer(P.FRAMEBUFFER,X)&&tt&&gt.drawBuffers(R,X),gt.viewport(k),gt.scissor(Z),gt.setScissorTest(J),Et){const Nt=bt.get(R.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_CUBE_MAP_POSITIVE_X+W,Nt.__webglTexture,et)}else if(Dt){const Nt=W;for(let ne=0;ne<R.textures.length;ne++){const ie=bt.get(R.textures[ne]);P.framebufferTextureLayer(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0+ne,ie.__webglTexture,et,Nt)}}else if(R!==null&&et!==0){const Nt=bt.get(R.texture);P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,Nt.__webglTexture,et)}D=-1},this.readRenderTargetPixels=function(R,W,et,tt,X,Et,Dt,Vt=0){if(!(R&&R.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Nt=bt.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Dt!==void 0&&(Nt=Nt[Dt]),Nt){gt.bindFramebuffer(P.FRAMEBUFFER,Nt);try{const ne=R.textures[Vt],ie=ne.format,Kt=ne.type;if(!vt.textureFormatReadable(ie)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!vt.textureTypeReadable(Kt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=R.width-tt&&et>=0&&et<=R.height-X&&(R.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Vt),P.readPixels(W,et,tt,X,qt.convert(ie),qt.convert(Kt),Et))}finally{const ne=z!==null?bt.get(z).__webglFramebuffer:null;gt.bindFramebuffer(P.FRAMEBUFFER,ne)}}},this.readRenderTargetPixelsAsync=async function(R,W,et,tt,X,Et,Dt,Vt=0){if(!(R&&R.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Nt=bt.get(R).__webglFramebuffer;if(R.isWebGLCubeRenderTarget&&Dt!==void 0&&(Nt=Nt[Dt]),Nt)if(W>=0&&W<=R.width-tt&&et>=0&&et<=R.height-X){gt.bindFramebuffer(P.FRAMEBUFFER,Nt);const ne=R.textures[Vt],ie=ne.format,Kt=ne.type;if(!vt.textureFormatReadable(ie))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!vt.textureTypeReadable(Kt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=P.createBuffer();P.bindBuffer(P.PIXEL_PACK_BUFFER,fe),P.bufferData(P.PIXEL_PACK_BUFFER,Et.byteLength,P.STREAM_READ),R.textures.length>1&&P.readBuffer(P.COLOR_ATTACHMENT0+Vt),P.readPixels(W,et,tt,X,qt.convert(ie),qt.convert(Kt),0);const Ee=z!==null?bt.get(z).__webglFramebuffer:null;gt.bindFramebuffer(P.FRAMEBUFFER,Ee);const $t=P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE,0);return P.flush(),await o0(P,$t,4),P.bindBuffer(P.PIXEL_PACK_BUFFER,fe),P.getBufferSubData(P.PIXEL_PACK_BUFFER,0,Et),P.deleteBuffer(fe),P.deleteSync($t),Et}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(R,W=null,et=0){const tt=Math.pow(2,-et),X=Math.floor(R.image.width*tt),Et=Math.floor(R.image.height*tt),Dt=W!==null?W.x:0,Vt=W!==null?W.y:0;Zt.setTexture2D(R,0),P.copyTexSubImage2D(P.TEXTURE_2D,et,0,0,Dt,Vt,X,Et),gt.unbindTexture()};const mh=P.createFramebuffer(),gh=P.createFramebuffer();this.copyTextureToTexture=function(R,W,et=null,tt=null,X=0,Et=null){Et===null&&(X!==0?(Ls("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Et=X,X=0):Et=0);let Dt,Vt,Nt,ne,ie,Kt,fe,Ee,$t;const re=R.isCompressedTexture?R.mipmaps[Et]:R.image;if(et!==null)Dt=et.max.x-et.min.x,Vt=et.max.y-et.min.y,Nt=et.isBox3?et.max.z-et.min.z:1,ne=et.min.x,ie=et.min.y,Kt=et.isBox3?et.min.z:0;else{const en=Math.pow(2,-X);Dt=Math.floor(re.width*en),Vt=Math.floor(re.height*en),R.isDataArrayTexture?Nt=re.depth:R.isData3DTexture?Nt=Math.floor(re.depth*en):Nt=1,ne=0,ie=0,Kt=0}tt!==null?(fe=tt.x,Ee=tt.y,$t=tt.z):(fe=0,Ee=0,$t=0);const Te=qt.convert(W.format),jt=qt.convert(W.type);let Le;W.isData3DTexture?(Zt.setTexture3D(W,0),Le=P.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(Zt.setTexture2DArray(W,0),Le=P.TEXTURE_2D_ARRAY):(Zt.setTexture2D(W,0),Le=P.TEXTURE_2D),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,W.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,W.unpackAlignment);const ge=P.getParameter(P.UNPACK_ROW_LENGTH),ee=P.getParameter(P.UNPACK_IMAGE_HEIGHT),ke=P.getParameter(P.UNPACK_SKIP_PIXELS),tn=P.getParameter(P.UNPACK_SKIP_ROWS),si=P.getParameter(P.UNPACK_SKIP_IMAGES);P.pixelStorei(P.UNPACK_ROW_LENGTH,re.width),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,re.height),P.pixelStorei(P.UNPACK_SKIP_PIXELS,ne),P.pixelStorei(P.UNPACK_SKIP_ROWS,ie),P.pixelStorei(P.UNPACK_SKIP_IMAGES,Kt);const _e=R.isDataArrayTexture||R.isData3DTexture,_n=W.isDataArrayTexture||W.isData3DTexture;if(R.isDepthTexture){const en=bt.get(R),Fe=bt.get(W),ye=bt.get(en.__renderTarget),Yn=bt.get(Fe.__renderTarget);gt.bindFramebuffer(P.READ_FRAMEBUFFER,ye.__webglFramebuffer),gt.bindFramebuffer(P.DRAW_FRAMEBUFFER,Yn.__webglFramebuffer);for(let Cn=0;Cn<Nt;Cn++)_e&&(P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,bt.get(R).__webglTexture,X,Kt+Cn),P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,bt.get(W).__webglTexture,Et,$t+Cn)),P.blitFramebuffer(ne,ie,Dt,Vt,fe,Ee,Dt,Vt,P.DEPTH_BUFFER_BIT,P.NEAREST);gt.bindFramebuffer(P.READ_FRAMEBUFFER,null),gt.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else if(X!==0||R.isRenderTargetTexture||bt.has(R)){const en=bt.get(R),Fe=bt.get(W);gt.bindFramebuffer(P.READ_FRAMEBUFFER,mh),gt.bindFramebuffer(P.DRAW_FRAMEBUFFER,gh);for(let ye=0;ye<Nt;ye++)_e?P.framebufferTextureLayer(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,en.__webglTexture,X,Kt+ye):P.framebufferTexture2D(P.READ_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,en.__webglTexture,X),_n?P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,Fe.__webglTexture,Et,$t+ye):P.framebufferTexture2D(P.DRAW_FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,Fe.__webglTexture,Et),X!==0?P.blitFramebuffer(ne,ie,Dt,Vt,fe,Ee,Dt,Vt,P.COLOR_BUFFER_BIT,P.NEAREST):_n?P.copyTexSubImage3D(Le,Et,fe,Ee,$t+ye,ne,ie,Dt,Vt):P.copyTexSubImage2D(Le,Et,fe,Ee,ne,ie,Dt,Vt);gt.bindFramebuffer(P.READ_FRAMEBUFFER,null),gt.bindFramebuffer(P.DRAW_FRAMEBUFFER,null)}else _n?R.isDataTexture||R.isData3DTexture?P.texSubImage3D(Le,Et,fe,Ee,$t,Dt,Vt,Nt,Te,jt,re.data):W.isCompressedArrayTexture?P.compressedTexSubImage3D(Le,Et,fe,Ee,$t,Dt,Vt,Nt,Te,re.data):P.texSubImage3D(Le,Et,fe,Ee,$t,Dt,Vt,Nt,Te,jt,re):R.isDataTexture?P.texSubImage2D(P.TEXTURE_2D,Et,fe,Ee,Dt,Vt,Te,jt,re.data):R.isCompressedTexture?P.compressedTexSubImage2D(P.TEXTURE_2D,Et,fe,Ee,re.width,re.height,Te,re.data):P.texSubImage2D(P.TEXTURE_2D,Et,fe,Ee,Dt,Vt,Te,jt,re);P.pixelStorei(P.UNPACK_ROW_LENGTH,ge),P.pixelStorei(P.UNPACK_IMAGE_HEIGHT,ee),P.pixelStorei(P.UNPACK_SKIP_PIXELS,ke),P.pixelStorei(P.UNPACK_SKIP_ROWS,tn),P.pixelStorei(P.UNPACK_SKIP_IMAGES,si),Et===0&&W.generateMipmaps&&P.generateMipmap(Le),gt.unbindTexture()},this.copyTextureToTexture3D=function(R,W,et=null,tt=null,X=0){return Ls('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(R,W,et,tt,X)},this.initRenderTarget=function(R){bt.get(R).__webglFramebuffer===void 0&&Zt.setupRenderTarget(R)},this.initTexture=function(R){R.isCubeTexture?Zt.setTextureCube(R,0):R.isData3DTexture?Zt.setTexture3D(R,0):R.isDataArrayTexture||R.isCompressedArrayTexture?Zt.setTexture2DArray(R,0):Zt.setTexture2D(R,0),gt.unbindTexture()},this.resetState=function(){N=0,B=0,z=null,gt.reset(),Pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return jn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Se._getDrawingBufferColorSpace(t),e.unpackColorSpace=Se._getUnpackColorSpace()}}/*!
3849
+ }`;class Xw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new bd(t.texture);(t.depthNear!==e.depthNear||t.depthFar!==e.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(t){if(this.texture!==null&&this.mesh===null){const e=t.cameras[0].viewport,s=new vi({vertexShader:Ww,fragmentShader:Zw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new pn(new Ir(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class Yw extends Cs{constructor(t,e){super();const s=this;let r=null,a=1,l=null,h="local-floor",u=1,d=null,p=null,m=null,_=null,E=null,w=null;const S=new Xw,v={},g=e.getContextAttributes();let R=null,P=null;const T=[],U=[],B=new Ae;let N=null;const z=new In;z.viewport=new He;const D=new In;D.viewport=new He;const M=[z,D],k=new Y0;let Z=null,J=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Y){let st=T[Y];return st===void 0&&(st=new Ec,T[Y]=st),st.getTargetRaySpace()},this.getControllerGrip=function(Y){let st=T[Y];return st===void 0&&(st=new Ec,T[Y]=st),st.getGripSpace()},this.getHand=function(Y){let st=T[Y];return st===void 0&&(st=new Ec,T[Y]=st),st.getHandSpace()};function V(Y){const st=U.indexOf(Y.inputSource);if(st===-1)return;const ft=T[st];ft!==void 0&&(ft.update(Y.inputSource,Y.frame,d||l),ft.dispatchEvent({type:Y.type,data:Y.inputSource}))}function $(){r.removeEventListener("select",V),r.removeEventListener("selectstart",V),r.removeEventListener("selectend",V),r.removeEventListener("squeeze",V),r.removeEventListener("squeezestart",V),r.removeEventListener("squeezeend",V),r.removeEventListener("end",$),r.removeEventListener("inputsourceschange",K);for(let Y=0;Y<T.length;Y++){const st=U[Y];st!==null&&(U[Y]=null,T[Y].disconnect(st))}Z=null,J=null,S.reset();for(const Y in v)delete v[Y];t.setRenderTarget(R),E=null,_=null,m=null,r=null,P=null,Rt.stop(),s.isPresenting=!1,t.setPixelRatio(N),t.setSize(B.width,B.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Y){a=Y,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Y){h=Y,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(Y){d=Y},this.getBaseLayer=function(){return _!==null?_:E},this.getBinding=function(){return m},this.getFrame=function(){return w},this.getSession=function(){return r},this.setSession=async function(Y){if(r=Y,r!==null){if(R=t.getRenderTarget(),r.addEventListener("select",V),r.addEventListener("selectstart",V),r.addEventListener("selectend",V),r.addEventListener("squeeze",V),r.addEventListener("squeezestart",V),r.addEventListener("squeezeend",V),r.addEventListener("end",$),r.addEventListener("inputsourceschange",K),g.xrCompatible!==!0&&await e.makeXRCompatible(),N=t.getPixelRatio(),t.getSize(B),typeof XRWebGLBinding<"u"&&(m=new XRWebGLBinding(r,e)),m!==null&&"createProjectionLayer"in XRWebGLBinding.prototype){let ft=null,Dt=null,Ut=null;g.depth&&(Ut=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ft=g.stencil?Er:yr,Dt=g.stencil?vr:ns);const zt={colorFormat:e.RGBA8,depthFormat:Ut,scaleFactor:a};_=m.createProjectionLayer(zt),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),P=new Ii(_.textureWidth,_.textureHeight,{format:zn,type:hi,depthTexture:new Xu(_.textureWidth,_.textureHeight,Dt,void 0,void 0,void 0,void 0,void 0,void 0,ft),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const ft={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,ft),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),P=new Ii(E.framebufferWidth,E.framebufferHeight,{format:zn,type:hi,colorSpace:t.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:E.ignoreDepthValues===!1,resolveStencilBuffer:E.ignoreDepthValues===!1})}P.isXRRenderTarget=!0,this.setFoveation(u),d=null,l=await r.requestReferenceSpace(h),Rt.setContext(r),Rt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return S.getDepthTexture()};function K(Y){for(let st=0;st<Y.removed.length;st++){const ft=Y.removed[st],Dt=U.indexOf(ft);Dt>=0&&(U[Dt]=null,T[Dt].disconnect(ft))}for(let st=0;st<Y.added.length;st++){const ft=Y.added[st];let Dt=U.indexOf(ft);if(Dt===-1){for(let zt=0;zt<T.length;zt++)if(zt>=U.length){U.push(ft),Dt=zt;break}else if(U[zt]===null){U[zt]=ft,Dt=zt;break}if(Dt===-1)break}const Ut=T[Dt];Ut&&Ut.connect(ft)}}const ut=new q,G=new q;function Tt(Y,st,ft){ut.setFromMatrixPosition(st.matrixWorld),G.setFromMatrixPosition(ft.matrixWorld);const Dt=ut.distanceTo(G),Ut=st.projectionMatrix.elements,zt=ft.projectionMatrix.elements,ce=Ut[14]/(Ut[10]-1),at=Ut[14]/(Ut[10]+1),C=(Ut[9]+1)/Ut[5],it=(Ut[9]-1)/Ut[5],ct=(Ut[8]-1)/Ut[0],_t=(zt[8]+1)/zt[0],ht=ce*ct,Ot=ce*_t,yt=Dt/(-ct+_t),Nt=yt*-ct;if(st.matrixWorld.decompose(Y.position,Y.quaternion,Y.scale),Y.translateX(Nt),Y.translateZ(yt),Y.matrixWorld.compose(Y.position,Y.quaternion,Y.scale),Y.matrixWorldInverse.copy(Y.matrixWorld).invert(),Ut[10]===-1)Y.projectionMatrix.copy(st.projectionMatrix),Y.projectionMatrixInverse.copy(st.projectionMatrixInverse);else{const pe=ce+yt,ge=at+yt,O=ht-Nt,b=Ot+(Dt-Nt),Q=C*at/ge*pe,ot=it*at/ge*pe;Y.projectionMatrix.makePerspective(O,b,Q,ot,pe,ge),Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert()}}function lt(Y,st){st===null?Y.matrixWorld.copy(Y.matrix):Y.matrixWorld.multiplyMatrices(st.matrixWorld,Y.matrix),Y.matrixWorldInverse.copy(Y.matrixWorld).invert()}this.updateCamera=function(Y){if(r===null)return;let st=Y.near,ft=Y.far;S.texture!==null&&(S.depthNear>0&&(st=S.depthNear),S.depthFar>0&&(ft=S.depthFar)),k.near=D.near=z.near=st,k.far=D.far=z.far=ft,(Z!==k.near||J!==k.far)&&(r.updateRenderState({depthNear:k.near,depthFar:k.far}),Z=k.near,J=k.far),k.layers.mask=Y.layers.mask|6,z.layers.mask=k.layers.mask&3,D.layers.mask=k.layers.mask&5;const Dt=Y.parent,Ut=k.cameras;lt(k,Dt);for(let zt=0;zt<Ut.length;zt++)lt(Ut[zt],Dt);Ut.length===2?Tt(k,z,D):k.projectionMatrix.copy(z.projectionMatrix),Mt(Y,k,Dt)};function Mt(Y,st,ft){ft===null?Y.matrix.copy(st.matrixWorld):(Y.matrix.copy(ft.matrixWorld),Y.matrix.invert(),Y.matrix.multiply(st.matrixWorld)),Y.matrix.decompose(Y.position,Y.quaternion,Y.scale),Y.updateMatrixWorld(!0),Y.projectionMatrix.copy(st.projectionMatrix),Y.projectionMatrixInverse.copy(st.projectionMatrixInverse),Y.isPerspectiveCamera&&(Y.fov=wr*2*Math.atan(1/Y.projectionMatrix.elements[5]),Y.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(Y){u=Y,_!==null&&(_.fixedFoveation=Y),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=Y)},this.hasDepthSensing=function(){return S.texture!==null},this.getDepthSensingMesh=function(){return S.getMesh(k)},this.getCameraTexture=function(Y){return v[Y]};let Gt=null;function pt(Y,st){if(p=st.getViewerPose(d||l),w=st,p!==null){const ft=p.views;E!==null&&(t.setRenderTargetFramebuffer(P,E.framebuffer),t.setRenderTarget(P));let Dt=!1;ft.length!==k.cameras.length&&(k.cameras.length=0,Dt=!0);for(let at=0;at<ft.length;at++){const C=ft[at];let it=null;if(E!==null)it=E.getViewport(C);else{const _t=m.getViewSubImage(_,C);it=_t.viewport,at===0&&(t.setRenderTargetTextures(P,_t.colorTexture,_t.depthStencilTexture),t.setRenderTarget(P))}let ct=M[at];ct===void 0&&(ct=new In,ct.layers.enable(at),ct.viewport=new He,M[at]=ct),ct.matrix.fromArray(C.transform.matrix),ct.matrix.decompose(ct.position,ct.quaternion,ct.scale),ct.projectionMatrix.fromArray(C.projectionMatrix),ct.projectionMatrixInverse.copy(ct.projectionMatrix).invert(),ct.viewport.set(it.x,it.y,it.width,it.height),at===0&&(k.matrix.copy(ct.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),Dt===!0&&k.cameras.push(ct)}const Ut=r.enabledFeatures;if(Ut&&Ut.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const at=m.getDepthInformation(ft[0]);at&&at.isValid&&at.texture&&S.init(at,r.renderState)}if(Ut&&Ut.includes("camera-access")&&(t.state.unbindTexture(),m))for(let at=0;at<ft.length;at++){const C=ft[at].camera;if(C){let it=v[C];it||(it=new bd,v[C]=it);const ct=m.getCameraImage(C);it.sourceTexture=ct}}}for(let ft=0;ft<T.length;ft++){const Dt=U[ft],Ut=T[ft];Dt!==null&&Ut!==void 0&&Ut.update(Dt,st,d||l)}Gt&&Gt(Y,st),st.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:st}),w=null}const Rt=new Ju;Rt.setAnimationLoop(pt),this.setAnimationLoop=function(Y){Gt=Y},this.dispose=function(){}}}const fs=new Jn,qw=new Oe;function Qw(n,t){function e(v,g){v.matrixAutoUpdate===!0&&v.updateMatrix(),g.value.copy(v.matrix)}function s(v,g){g.color.getRGB(v.fogColor.value,Nu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,R,P,T){g.isMeshBasicMaterial||g.isMeshLambertMaterial?a(v,g):g.isMeshToonMaterial?(a(v,g),m(v,g)):g.isMeshPhongMaterial?(a(v,g),p(v,g)):g.isMeshStandardMaterial?(a(v,g),_(v,g),g.isMeshPhysicalMaterial&&E(v,g,T)):g.isMeshMatcapMaterial?(a(v,g),w(v,g)):g.isMeshDepthMaterial?a(v,g):g.isMeshDistanceMaterial?(a(v,g),S(v,g)):g.isMeshNormalMaterial?a(v,g):g.isLineBasicMaterial?(l(v,g),g.isLineDashedMaterial&&h(v,g)):g.isPointsMaterial?u(v,g,R,P):g.isSpriteMaterial?d(v,g):g.isShadowMaterial?(v.color.value.copy(g.color),v.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function a(v,g){v.opacity.value=g.opacity,g.color&&v.diffuse.value.copy(g.color),g.emissive&&v.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.bumpMap&&(v.bumpMap.value=g.bumpMap,e(g.bumpMap,v.bumpMapTransform),v.bumpScale.value=g.bumpScale,g.side===fn&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===fn&&v.normalScale.value.negate()),g.displacementMap&&(v.displacementMap.value=g.displacementMap,e(g.displacementMap,v.displacementMapTransform),v.displacementScale.value=g.displacementScale,v.displacementBias.value=g.displacementBias),g.emissiveMap&&(v.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,v.emissiveMapTransform)),g.specularMap&&(v.specularMap.value=g.specularMap,e(g.specularMap,v.specularMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest);const R=t.get(g),P=R.envMap,T=R.envMapRotation;P&&(v.envMap.value=P,fs.copy(T),fs.x*=-1,fs.y*=-1,fs.z*=-1,P.isCubeTexture&&P.isRenderTargetTexture===!1&&(fs.y*=-1,fs.z*=-1),v.envMapRotation.value.setFromMatrix4(qw.makeRotationFromEuler(fs)),v.flipEnvMap.value=P.isCubeTexture&&P.isRenderTargetTexture===!1?-1:1,v.reflectivity.value=g.reflectivity,v.ior.value=g.ior,v.refractionRatio.value=g.refractionRatio),g.lightMap&&(v.lightMap.value=g.lightMap,v.lightMapIntensity.value=g.lightMapIntensity,e(g.lightMap,v.lightMapTransform)),g.aoMap&&(v.aoMap.value=g.aoMap,v.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,v.aoMapTransform))}function l(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform))}function h(v,g){v.dashSize.value=g.dashSize,v.totalSize.value=g.dashSize+g.gapSize,v.scale.value=g.scale}function u(v,g,R,P){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*R,v.scale.value=P*.5,g.map&&(v.map.value=g.map,e(g.map,v.uvTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function d(v,g){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.rotation.value=g.rotation,g.map&&(v.map.value=g.map,e(g.map,v.mapTransform)),g.alphaMap&&(v.alphaMap.value=g.alphaMap,e(g.alphaMap,v.alphaMapTransform)),g.alphaTest>0&&(v.alphaTest.value=g.alphaTest)}function p(v,g){v.specular.value.copy(g.specular),v.shininess.value=Math.max(g.shininess,1e-4)}function m(v,g){g.gradientMap&&(v.gradientMap.value=g.gradientMap)}function _(v,g){v.metalness.value=g.metalness,g.metalnessMap&&(v.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,v.metalnessMapTransform)),v.roughness.value=g.roughness,g.roughnessMap&&(v.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,v.roughnessMapTransform)),g.envMap&&(v.envMapIntensity.value=g.envMapIntensity)}function E(v,g,R){v.ior.value=g.ior,g.sheen>0&&(v.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),v.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(v.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,v.sheenColorMapTransform)),g.sheenRoughnessMap&&(v.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,v.sheenRoughnessMapTransform))),g.clearcoat>0&&(v.clearcoat.value=g.clearcoat,v.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(v.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,v.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(v.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,v.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(v.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,v.clearcoatNormalMapTransform),v.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===fn&&v.clearcoatNormalScale.value.negate())),g.dispersion>0&&(v.dispersion.value=g.dispersion),g.iridescence>0&&(v.iridescence.value=g.iridescence,v.iridescenceIOR.value=g.iridescenceIOR,v.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],v.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(v.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,v.iridescenceMapTransform)),g.iridescenceThicknessMap&&(v.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,v.iridescenceThicknessMapTransform))),g.transmission>0&&(v.transmission.value=g.transmission,v.transmissionSamplerMap.value=R.texture,v.transmissionSamplerSize.value.set(R.width,R.height),g.transmissionMap&&(v.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,v.transmissionMapTransform)),v.thickness.value=g.thickness,g.thicknessMap&&(v.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,v.thicknessMapTransform)),v.attenuationDistance.value=g.attenuationDistance,v.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(v.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(v.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,v.anisotropyMapTransform))),v.specularIntensity.value=g.specularIntensity,v.specularColor.value.copy(g.specularColor),g.specularColorMap&&(v.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,v.specularColorMapTransform)),g.specularIntensityMap&&(v.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,v.specularIntensityMapTransform))}function w(v,g){g.matcap&&(v.matcap.value=g.matcap)}function S(v,g){const R=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(R.matrixWorld),v.nearDistance.value=R.shadow.camera.near,v.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function jw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(R,P){const T=P.program;s.uniformBlockBinding(R,T)}function d(R,P){let T=r[R.id];T===void 0&&(w(R),T=p(R),r[R.id]=T,R.addEventListener("dispose",v));const U=P.program;s.updateUBOMapping(R,U);const B=t.render.frame;a[R.id]!==B&&(_(R),a[R.id]=B)}function p(R){const P=m();R.__bindingPointIndex=P;const T=n.createBuffer(),U=R.__size,B=R.usage;return n.bindBuffer(n.UNIFORM_BUFFER,T),n.bufferData(n.UNIFORM_BUFFER,U,B),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,P,T),T}function m(){for(let R=0;R<h;R++)if(l.indexOf(R)===-1)return l.push(R),R;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(R){const P=r[R.id],T=R.uniforms,U=R.__cache;n.bindBuffer(n.UNIFORM_BUFFER,P);for(let B=0,N=T.length;B<N;B++){const z=Array.isArray(T[B])?T[B]:[T[B]];for(let D=0,M=z.length;D<M;D++){const k=z[D];if(E(k,B,D,U)===!0){const Z=k.__offset,J=Array.isArray(k.value)?k.value:[k.value];let V=0;for(let $=0;$<J.length;$++){const K=J[$],ut=S(K);typeof K=="number"||typeof K=="boolean"?(k.__data[0]=K,n.bufferSubData(n.UNIFORM_BUFFER,Z+V,k.__data)):K.isMatrix3?(k.__data[0]=K.elements[0],k.__data[1]=K.elements[1],k.__data[2]=K.elements[2],k.__data[3]=0,k.__data[4]=K.elements[3],k.__data[5]=K.elements[4],k.__data[6]=K.elements[5],k.__data[7]=0,k.__data[8]=K.elements[6],k.__data[9]=K.elements[7],k.__data[10]=K.elements[8],k.__data[11]=0):(K.toArray(k.__data,V),V+=ut.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,Z,k.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(R,P,T,U){const B=R.value,N=P+"_"+T;if(U[N]===void 0)return typeof B=="number"||typeof B=="boolean"?U[N]=B:U[N]=B.clone(),!0;{const z=U[N];if(typeof B=="number"||typeof B=="boolean"){if(z!==B)return U[N]=B,!0}else if(z.equals(B)===!1)return z.copy(B),!0}return!1}function w(R){const P=R.uniforms;let T=0;const U=16;for(let N=0,z=P.length;N<z;N++){const D=Array.isArray(P[N])?P[N]:[P[N]];for(let M=0,k=D.length;M<k;M++){const Z=D[M],J=Array.isArray(Z.value)?Z.value:[Z.value];for(let V=0,$=J.length;V<$;V++){const K=J[V],ut=S(K),G=T%U,Tt=G%ut.boundary,lt=G+Tt;T+=Tt,lt!==0&&U-lt<ut.storage&&(T+=U-lt),Z.__data=new Float32Array(ut.storage/Float32Array.BYTES_PER_ELEMENT),Z.__offset=T,T+=ut.storage}}}const B=T%U;return B>0&&(T+=U-B),R.__size=T,R.__cache={},this}function S(R){const P={boundary:0,storage:0};return typeof R=="number"||typeof R=="boolean"?(P.boundary=4,P.storage=4):R.isVector2?(P.boundary=8,P.storage=8):R.isVector3||R.isColor?(P.boundary=16,P.storage=12):R.isVector4?(P.boundary=16,P.storage=16):R.isMatrix3?(P.boundary=48,P.storage=48):R.isMatrix4?(P.boundary=64,P.storage=64):R.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",R),P}function v(R){const P=R.target;P.removeEventListener("dispose",v);const T=l.indexOf(P.__bindingPointIndex);l.splice(T,1),n.deleteBuffer(r[P.id]),delete r[P.id],delete a[P.id]}function g(){for(const R in r)n.deleteBuffer(r[R]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class Jw{constructor(t={}){const{canvas:e=r0(),context:s=null,depth:r=!0,stencil:a=!1,alpha:l=!1,antialias:h=!1,premultipliedAlpha:u=!0,preserveDrawingBuffer:d=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:m=!1,reversedDepthBuffer:_=!1}=t;this.isWebGLRenderer=!0;let E;if(s!==null){if(typeof WebGLRenderingContext<"u"&&s instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");E=s.getContextAttributes().alpha}else E=l;const w=new Uint32Array(4),S=new Int32Array(4);let v=null,g=null;const R=[],P=[];this.domElement=e,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.toneMapping=Pi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const T=this;let U=!1;this._outputColorSpace=Rn;let B=0,N=0,z=null,D=-1,M=null;const k=new He,Z=new He;let J=null;const V=new Pe(0);let $=0,K=e.width,ut=e.height,G=1,Tt=null,lt=null;const Mt=new He(0,0,K,ut),Gt=new He(0,0,K,ut);let pt=!1;const Rt=new Sc;let Y=!1,st=!1;const ft=new Oe,Dt=new q,Ut=new He,zt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ce=!1;function at(){return z===null?G:1}let C=s;function it(I,W){return e.getContext(I,W)}try{const I={alpha:!0,depth:r,stencil:a,antialias:h,premultipliedAlpha:u,preserveDrawingBuffer:d,powerPreference:p,failIfMajorPerformanceCaveat:m};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${il}`),e.addEventListener("webglcontextlost",At,!1),e.addEventListener("webglcontextrestored",Ft,!1),e.addEventListener("webglcontextcreationerror",vt,!1),C===null){const W="webgl2";if(C=it(W,I),C===null)throw it(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(I){throw console.error("THREE.WebGLRenderer: "+I.message),I}let ct,_t,ht,Ot,yt,Nt,pe,ge,O,b,Q,ot,gt,rt,Zt,bt,Ht,Xt,wt,Lt,ie,Yt,Ct,le;function H(){ct=new ax(C),ct.init(),Yt=new Gw(C,ct),_t=new tx(C,ct,t,Yt),ht=new Hw(C,ct),_t.reversedDepthBuffer&&_&&ht.buffers.depth.setReversed(!0),Ot=new hx(C),yt=new Cw,Nt=new Vw(C,ct,ht,yt,_t,Yt,Ot),pe=new nx(T),ge=new ox(T),O=new j0(C),Ct=new KE(C,O),b=new lx(C,O,Ot,Ct),Q=new dx(C,b,O,Ot),wt=new ux(C,_t,Nt),bt=new ex(yt),ot=new Aw(T,pe,ge,ct,_t,Ct,bt),gt=new Qw(T,yt),rt=new Rw,Zt=new Ow(ct),Xt=new JE(T,pe,ge,ht,Q,E,u),Ht=new Fw(T,Q,_t),le=new jw(C,Ot,_t,ht),Lt=new $E(C,ct,Ot),ie=new cx(C,ct,Ot),Ot.programs=ot.programs,T.capabilities=_t,T.extensions=ct,T.properties=yt,T.renderLists=rt,T.shadowMap=Ht,T.state=ht,T.info=Ot}H();const St=new Yw(T,C);this.xr=St,this.getContext=function(){return C},this.getContextAttributes=function(){return C.getContextAttributes()},this.forceContextLoss=function(){const I=ct.get("WEBGL_lose_context");I&&I.loseContext()},this.forceContextRestore=function(){const I=ct.get("WEBGL_lose_context");I&&I.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(I){I!==void 0&&(G=I,this.setSize(K,ut,!1))},this.getSize=function(I){return I.set(K,ut)},this.setSize=function(I,W,et=!0){if(St.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}K=I,ut=W,e.width=Math.floor(I*G),e.height=Math.floor(W*G),et===!0&&(e.style.width=I+"px",e.style.height=W+"px"),this.setViewport(0,0,I,W)},this.getDrawingBufferSize=function(I){return I.set(K*G,ut*G).floor()},this.setDrawingBufferSize=function(I,W,et){K=I,ut=W,G=et,e.width=Math.floor(I*et),e.height=Math.floor(W*et),this.setViewport(0,0,I,W)},this.getCurrentViewport=function(I){return I.copy(k)},this.getViewport=function(I){return I.copy(Mt)},this.setViewport=function(I,W,et,tt){I.isVector4?Mt.set(I.x,I.y,I.z,I.w):Mt.set(I,W,et,tt),ht.viewport(k.copy(Mt).multiplyScalar(G).round())},this.getScissor=function(I){return I.copy(Gt)},this.setScissor=function(I,W,et,tt){I.isVector4?Gt.set(I.x,I.y,I.z,I.w):Gt.set(I,W,et,tt),ht.scissor(Z.copy(Gt).multiplyScalar(G).round())},this.getScissorTest=function(){return pt},this.setScissorTest=function(I){ht.setScissorTest(pt=I)},this.setOpaqueSort=function(I){Tt=I},this.setTransparentSort=function(I){lt=I},this.getClearColor=function(I){return I.copy(Xt.getClearColor())},this.setClearColor=function(){Xt.setClearColor(...arguments)},this.getClearAlpha=function(){return Xt.getClearAlpha()},this.setClearAlpha=function(){Xt.setClearAlpha(...arguments)},this.clear=function(I=!0,W=!0,et=!0){let tt=0;if(I){let X=!1;if(z!==null){const Et=z.texture.format;X=Et===Sl||Et===wl||Et===xl}if(X){const Et=z.texture.type,It=Et===hi||Et===ns||Et===gr||Et===vr||Et===yl||Et===El,Vt=Xt.getClearColor(),Bt=Xt.getClearAlpha(),ee=Vt.r,ne=Vt.g,Jt=Vt.b;It?(w[0]=ee,w[1]=ne,w[2]=Jt,w[3]=Bt,C.clearBufferuiv(C.COLOR,0,w)):(S[0]=ee,S[1]=ne,S[2]=Jt,S[3]=Bt,C.clearBufferiv(C.COLOR,0,S))}else tt|=C.COLOR_BUFFER_BIT}W&&(tt|=C.DEPTH_BUFFER_BIT),et&&(tt|=C.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),C.clear(tt)},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(){e.removeEventListener("webglcontextlost",At,!1),e.removeEventListener("webglcontextrestored",Ft,!1),e.removeEventListener("webglcontextcreationerror",vt,!1),Xt.dispose(),rt.dispose(),Zt.dispose(),yt.dispose(),pe.dispose(),ge.dispose(),Q.dispose(),Ct.dispose(),le.dispose(),ot.dispose(),St.dispose(),St.removeEventListener("sessionstart",On),St.removeEventListener("sessionend",Ba),wi.stop()};function At(I){I.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Ft(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const I=Ot.autoReset,W=Ht.enabled,et=Ht.autoUpdate,tt=Ht.needsUpdate,X=Ht.type;H(),Ot.autoReset=I,Ht.enabled=W,Ht.autoUpdate=et,Ht.needsUpdate=tt,Ht.type=X}function vt(I){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",I.statusMessage)}function dt(I){const W=I.target;W.removeEventListener("dispose",dt),Wt(W)}function Wt(I){ae(I),yt.remove(I)}function ae(I){const W=yt.get(I).programs;W!==void 0&&(W.forEach(function(et){ot.releaseProgram(et)}),I.isShaderMaterial&&ot.releaseShaderCache(I))}this.renderBufferDirect=function(I,W,et,tt,X,Et){W===null&&(W=zt);const It=X.isMesh&&X.matrixWorld.determinant()<0,Vt=Fa(I,W,et,tt,X);ht.setMaterial(tt,It);let Bt=et.index,ee=1;if(tt.wireframe===!0){if(Bt=b.getWireframeAttribute(et),Bt===void 0)return;ee=2}const ne=et.drawRange,Jt=et.attributes.position;let fe=ne.start*ee,xe=(ne.start+ne.count)*ee;Et!==null&&(fe=Math.max(fe,Et.start*ee),xe=Math.min(xe,(Et.start+Et.count)*ee)),Bt!==null?(fe=Math.max(fe,0),xe=Math.min(xe,Bt.count)):Jt!=null&&(fe=Math.max(fe,0),xe=Math.min(xe,Jt.count));const Kt=xe-fe;if(Kt<0||Kt===1/0)return;Ct.setup(X,tt,Vt,et,Bt);let se,be=Lt;if(Bt!==null&&(se=O.get(Bt),be=ie,be.setIndex(se)),X.isMesh)tt.wireframe===!0?(ht.setLineWidth(tt.wireframeLinewidth*at()),be.setMode(C.LINES)):be.setMode(C.TRIANGLES);else if(X.isLine){let Qt=tt.linewidth;Qt===void 0&&(Qt=1),ht.setLineWidth(Qt*at()),X.isLineSegments?be.setMode(C.LINES):X.isLineLoop?be.setMode(C.LINE_LOOP):be.setMode(C.LINE_STRIP)}else X.isPoints?be.setMode(C.POINTS):X.isSprite&&be.setMode(C.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)Ls("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),be.renderMultiDrawInstances(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount,X._multiDrawInstances);else if(ct.get("WEBGL_multi_draw"))be.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const Qt=X._multiDrawStarts,Le=X._multiDrawCounts,ve=X._multiDrawCount,te=Bt?O.get(Bt).bytesPerElement:1,ke=yt.get(tt).currentProgram.getUniforms();for(let tn=0;tn<ve;tn++)ke.setValue(C,"_gl_DrawID",tn),be.render(Qt[tn]/te,Le[tn])}else if(X.isInstancedMesh)be.renderInstances(fe,Kt,X.count);else if(et.isInstancedBufferGeometry){const Qt=et._maxInstanceCount!==void 0?et._maxInstanceCount:1/0,Le=Math.min(et.instanceCount,Qt);be.renderInstances(fe,Kt,Le)}else be.render(fe,Kt)};function De(I,W,et){I.transparent===!0&&I.side===ci&&I.forceSinglePass===!1?(I.side=fn,I.needsUpdate=!0,vs(I,W,et),I.side=Ai,I.needsUpdate=!0,vs(I,W,et),I.side=ci):vs(I,W,et)}this.compile=function(I,W,et=null){et===null&&(et=I),g=Zt.get(et),g.init(W),P.push(g),et.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),I!==et&&I.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),g.setupLights();const tt=new Set;return I.traverse(function(X){if(!(X.isMesh||X.isPoints||X.isLine||X.isSprite))return;const Et=X.material;if(Et)if(Array.isArray(Et))for(let It=0;It<Et.length;It++){const Vt=Et[It];De(Vt,et,X),tt.add(Vt)}else De(Et,et,X),tt.add(Et)}),g=P.pop(),tt},this.compileAsync=function(I,W,et=null){const tt=this.compile(I,W,et);return new Promise(X=>{function Et(){if(tt.forEach(function(It){yt.get(It).currentProgram.isReady()&&tt.delete(It)}),tt.size===0){X(I);return}setTimeout(Et,10)}ct.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let Te=null;function bn(I){Te&&Te(I)}function On(){wi.stop()}function Ba(){wi.start()}const wi=new Ju;wi.setAnimationLoop(bn),typeof self<"u"&&wi.setContext(self),this.setAnimationLoop=function(I){Te=I,St.setAnimationLoop(I),I===null?wi.stop():wi.start()},St.addEventListener("sessionstart",On),St.addEventListener("sessionend",Ba),this.render=function(I,W){if(W!==void 0&&W.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(I.matrixWorldAutoUpdate===!0&&I.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),St.enabled===!0&&St.isPresenting===!0&&(St.cameraAutoUpdate===!0&&St.updateCamera(W),W=St.getCamera()),I.isScene===!0&&I.onBeforeRender(T,I,W,z),g=Zt.get(I,P.length),g.init(W),P.push(g),ft.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Rt.setFromProjectionMatrix(ft,jn,W.reversedDepth),st=this.localClippingEnabled,Y=bt.init(this.clippingPlanes,st),v=rt.get(I,R.length),v.init(),R.push(v),St.enabled===!0&&St.isPresenting===!0){const Et=T.xr.getDepthSensingMesh();Et!==null&&io(Et,W,-1/0,T.sortObjects)}io(I,W,0,T.sortObjects),v.finish(),T.sortObjects===!0&&v.sort(Tt,lt),ce=St.enabled===!1||St.isPresenting===!1||St.hasDepthSensing()===!1,ce&&Xt.addToRenderList(v,I),this.info.render.frame++,Y===!0&&bt.beginShadows();const et=g.state.shadowsArray;Ht.render(et,I,W),Y===!0&&bt.endShadows(),this.info.autoReset===!0&&this.info.reset();const tt=v.opaque,X=v.transmissive;if(g.setupLights(),W.isArrayCamera){const Et=W.cameras;if(X.length>0)for(let It=0,Vt=Et.length;It<Vt;It++){const Bt=Et[It];qt(tt,X,I,Bt)}ce&&Xt.render(I);for(let It=0,Vt=Et.length;It<Vt;It++){const Bt=Et[It];An(v,I,Bt,Bt.viewport)}}else X.length>0&&qt(tt,X,I,W),ce&&Xt.render(I),An(v,I,W);z!==null&&N===0&&(Nt.updateMultisampleRenderTarget(z),Nt.updateRenderTargetMipmap(z)),I.isScene===!0&&I.onAfterRender(T,I,W),Ct.resetDefaultState(),D=-1,M=null,P.pop(),P.length>0?(g=P[P.length-1],Y===!0&&bt.setGlobalState(T.clippingPlanes,g.state.camera)):g=null,R.pop(),R.length>0?v=R[R.length-1]:v=null};function io(I,W,et,tt){if(I.visible===!1)return;if(I.layers.test(W.layers)){if(I.isGroup)et=I.renderOrder;else if(I.isLOD)I.autoUpdate===!0&&I.update(W);else if(I.isLight)g.pushLight(I),I.castShadow&&g.pushShadow(I);else if(I.isSprite){if(!I.frustumCulled||Rt.intersectsSprite(I)){tt&&Ut.setFromMatrixPosition(I.matrixWorld).applyMatrix4(ft);const It=Q.update(I),Vt=I.material;Vt.visible&&v.push(I,It,Vt,et,Ut.z,null)}}else if((I.isMesh||I.isLine||I.isPoints)&&(!I.frustumCulled||Rt.intersectsObject(I))){const It=Q.update(I),Vt=I.material;if(tt&&(I.boundingSphere!==void 0?(I.boundingSphere===null&&I.computeBoundingSphere(),Ut.copy(I.boundingSphere.center)):(It.boundingSphere===null&&It.computeBoundingSphere(),Ut.copy(It.boundingSphere.center)),Ut.applyMatrix4(I.matrixWorld).applyMatrix4(ft)),Array.isArray(Vt)){const Bt=It.groups;for(let ee=0,ne=Bt.length;ee<ne;ee++){const Jt=Bt[ee],fe=Vt[Jt.materialIndex];fe&&fe.visible&&v.push(I,It,fe,et,Ut.z,Jt)}}else Vt.visible&&v.push(I,It,Vt,et,Ut.z,null)}}const Et=I.children;for(let It=0,Vt=Et.length;It<Vt;It++)io(Et[It],W,et,tt)}function An(I,W,et,tt){const X=I.opaque,Et=I.transmissive,It=I.transparent;g.setupLightsView(et),Y===!0&&bt.setGlobalState(T.clippingPlanes,et),tt&&ht.viewport(k.copy(tt)),X.length>0&&_s(X,W,et),Et.length>0&&_s(Et,W,et),It.length>0&&_s(It,W,et),ht.buffers.depth.setTest(!0),ht.buffers.depth.setMask(!0),ht.buffers.color.setMask(!0),ht.setPolygonOffset(!1)}function qt(I,W,et,tt){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[tt.id]===void 0&&(g.state.transmissionRenderTarget[tt.id]=new Ii(1,1,{generateMipmaps:!0,type:ct.has("EXT_color_buffer_half_float")||ct.has("EXT_color_buffer_float")?_r:hi,minFilter:Ri,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Me.workingColorSpace}));const Et=g.state.transmissionRenderTarget[tt.id],It=tt.viewport||k;Et.setSize(It.z*T.transmissionResolutionScale,It.w*T.transmissionResolutionScale);const Vt=T.getRenderTarget(),Bt=T.getActiveCubeFace(),ee=T.getActiveMipmapLevel();T.setRenderTarget(Et),T.getClearColor(V),$=T.getClearAlpha(),$<1&&T.setClearColor(16777215,.5),T.clear(),ce&&Xt.render(et);const ne=T.toneMapping;T.toneMapping=Pi;const Jt=tt.viewport;if(tt.viewport!==void 0&&(tt.viewport=void 0),g.setupLightsView(tt),Y===!0&&bt.setGlobalState(T.clippingPlanes,tt),_s(I,et,tt),Nt.updateMultisampleRenderTarget(Et),Nt.updateRenderTargetMipmap(Et),ct.has("WEBGL_multisampled_render_to_texture")===!1){let fe=!1;for(let xe=0,Kt=W.length;xe<Kt;xe++){const se=W[xe],be=se.object,Qt=se.geometry,Le=se.material,ve=se.group;if(Le.side===ci&&be.layers.test(tt.layers)){const te=Le.side;Le.side=fn,Le.needsUpdate=!0,so(be,et,tt,Qt,Le,ve),Le.side=te,Le.needsUpdate=!0,fe=!0}}fe===!0&&(Nt.updateMultisampleRenderTarget(Et),Nt.updateRenderTargetMipmap(Et))}T.setRenderTarget(Vt,Bt,ee),T.setClearColor(V,$),Jt!==void 0&&(tt.viewport=Jt),T.toneMapping=ne}function _s(I,W,et){const tt=W.isScene===!0?W.overrideMaterial:null;for(let X=0,Et=I.length;X<Et;X++){const It=I[X],Vt=It.object,Bt=It.geometry,ee=It.group;let ne=It.material;ne.allowOverride===!0&&tt!==null&&(ne=tt),Vt.layers.test(et.layers)&&so(Vt,W,et,Bt,ne,ee)}}function so(I,W,et,tt,X,Et){I.onBeforeRender(T,W,et,tt,X,Et),I.modelViewMatrix.multiplyMatrices(et.matrixWorldInverse,I.matrixWorld),I.normalMatrix.getNormalMatrix(I.modelViewMatrix),X.onBeforeRender(T,W,et,tt,I,Et),X.transparent===!0&&X.side===ci&&X.forceSinglePass===!1?(X.side=fn,X.needsUpdate=!0,T.renderBufferDirect(et,W,tt,X,I,Et),X.side=Ai,X.needsUpdate=!0,T.renderBufferDirect(et,W,tt,X,I,Et),X.side=ci):T.renderBufferDirect(et,W,tt,X,I,Et),I.onAfterRender(T,W,et,tt,X,Et)}function vs(I,W,et){W.isScene!==!0&&(W=zt);const tt=yt.get(I),X=g.state.lights,Et=g.state.shadowsArray,It=X.state.version,Vt=ot.getParameters(I,X.state,Et,W,et),Bt=ot.getProgramCacheKey(Vt);let ee=tt.programs;tt.environment=I.isMeshStandardMaterial?W.environment:null,tt.fog=W.fog,tt.envMap=(I.isMeshStandardMaterial?ge:pe).get(I.envMap||tt.environment),tt.envMapRotation=tt.environment!==null&&I.envMap===null?W.environmentRotation:I.envMapRotation,ee===void 0&&(I.addEventListener("dispose",dt),ee=new Map,tt.programs=ee);let ne=ee.get(Bt);if(ne!==void 0){if(tt.currentProgram===ne&&tt.lightsStateVersion===It)return lr(I,Vt),ne}else Vt.uniforms=ot.getUniforms(I),I.onBeforeCompile(Vt,T),ne=ot.acquireProgram(Vt,Bt),ee.set(Bt,ne),tt.uniforms=Vt.uniforms;const Jt=tt.uniforms;return(!I.isShaderMaterial&&!I.isRawShaderMaterial||I.clipping===!0)&&(Jt.clippingPlanes=bt.uniform),lr(I,Vt),tt.needsLights=za(I),tt.lightsStateVersion=It,tt.needsLights&&(Jt.ambientLightColor.value=X.state.ambient,Jt.lightProbe.value=X.state.probe,Jt.directionalLights.value=X.state.directional,Jt.directionalLightShadows.value=X.state.directionalShadow,Jt.spotLights.value=X.state.spot,Jt.spotLightShadows.value=X.state.spotShadow,Jt.rectAreaLights.value=X.state.rectArea,Jt.ltc_1.value=X.state.rectAreaLTC1,Jt.ltc_2.value=X.state.rectAreaLTC2,Jt.pointLights.value=X.state.point,Jt.pointLightShadows.value=X.state.pointShadow,Jt.hemisphereLights.value=X.state.hemi,Jt.directionalShadowMap.value=X.state.directionalShadowMap,Jt.directionalShadowMatrix.value=X.state.directionalShadowMatrix,Jt.spotShadowMap.value=X.state.spotShadowMap,Jt.spotLightMatrix.value=X.state.spotLightMatrix,Jt.spotLightMap.value=X.state.spotLightMap,Jt.pointShadowMap.value=X.state.pointShadowMap,Jt.pointShadowMatrix.value=X.state.pointShadowMatrix),tt.currentProgram=ne,tt.uniformsList=null,ne}function ro(I){if(I.uniformsList===null){const W=I.currentProgram.getUniforms();I.uniformsList=Ko.seqWithValue(W.seq,I.uniforms)}return I.uniformsList}function lr(I,W){const et=yt.get(I);et.outputColorSpace=W.outputColorSpace,et.batching=W.batching,et.batchingColor=W.batchingColor,et.instancing=W.instancing,et.instancingColor=W.instancingColor,et.instancingMorph=W.instancingMorph,et.skinning=W.skinning,et.morphTargets=W.morphTargets,et.morphNormals=W.morphNormals,et.morphColors=W.morphColors,et.morphTargetsCount=W.morphTargetsCount,et.numClippingPlanes=W.numClippingPlanes,et.numIntersection=W.numClipIntersection,et.vertexAlphas=W.vertexAlphas,et.vertexTangents=W.vertexTangents,et.toneMapping=W.toneMapping}function Fa(I,W,et,tt,X){W.isScene!==!0&&(W=zt),Nt.resetTextureUnits();const Et=W.fog,It=tt.isMeshStandardMaterial?W.environment:null,Vt=z===null?T.outputColorSpace:z.isXRRenderTarget===!0?z.texture.colorSpace:is,Bt=(tt.isMeshStandardMaterial?ge:pe).get(tt.envMap||It),ee=tt.vertexColors===!0&&!!et.attributes.color&&et.attributes.color.itemSize===4,ne=!!et.attributes.tangent&&(!!tt.normalMap||tt.anisotropy>0),Jt=!!et.morphAttributes.position,fe=!!et.morphAttributes.normal,xe=!!et.morphAttributes.color;let Kt=Pi;tt.toneMapped&&(z===null||z.isXRRenderTarget===!0)&&(Kt=T.toneMapping);const se=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,be=se!==void 0?se.length:0,Qt=yt.get(tt),Le=g.state.lights;if(Y===!0&&(st===!0||I!==M)){const Fe=I===M&&tt.id===D;bt.setState(tt,I,Fe)}let ve=!1;tt.version===Qt.__version?(Qt.needsLights&&Qt.lightsStateVersion!==Le.state.version||Qt.outputColorSpace!==Vt||X.isBatchedMesh&&Qt.batching===!1||!X.isBatchedMesh&&Qt.batching===!0||X.isBatchedMesh&&Qt.batchingColor===!0&&X.colorTexture===null||X.isBatchedMesh&&Qt.batchingColor===!1&&X.colorTexture!==null||X.isInstancedMesh&&Qt.instancing===!1||!X.isInstancedMesh&&Qt.instancing===!0||X.isSkinnedMesh&&Qt.skinning===!1||!X.isSkinnedMesh&&Qt.skinning===!0||X.isInstancedMesh&&Qt.instancingColor===!0&&X.instanceColor===null||X.isInstancedMesh&&Qt.instancingColor===!1&&X.instanceColor!==null||X.isInstancedMesh&&Qt.instancingMorph===!0&&X.morphTexture===null||X.isInstancedMesh&&Qt.instancingMorph===!1&&X.morphTexture!==null||Qt.envMap!==Bt||tt.fog===!0&&Qt.fog!==Et||Qt.numClippingPlanes!==void 0&&(Qt.numClippingPlanes!==bt.numPlanes||Qt.numIntersection!==bt.numIntersection)||Qt.vertexAlphas!==ee||Qt.vertexTangents!==ne||Qt.morphTargets!==Jt||Qt.morphNormals!==fe||Qt.morphColors!==xe||Qt.toneMapping!==Kt||Qt.morphTargetsCount!==be)&&(ve=!0):(ve=!0,Qt.__version=tt.version);let te=Qt.currentProgram;ve===!0&&(te=vs(tt,W,X));let ke=!1,tn=!1,si=!1;const ye=te.getUniforms(),_n=Qt.uniforms;if(ht.useProgram(te.program)&&(ke=!0,tn=!0,si=!0),tt.id!==D&&(D=tt.id,tn=!0),ke||M!==I){ht.buffers.depth.getReversed()&&I.reversedDepth!==!0&&(I._reversedDepth=!0,I.updateProjectionMatrix()),ye.setValue(C,"projectionMatrix",I.projectionMatrix),ye.setValue(C,"viewMatrix",I.matrixWorldInverse);const Ee=ye.map.cameraPosition;Ee!==void 0&&Ee.setValue(C,Dt.setFromMatrixPosition(I.matrixWorld)),_t.logarithmicDepthBuffer&&ye.setValue(C,"logDepthBufFC",2/(Math.log(I.far+1)/Math.LN2)),(tt.isMeshPhongMaterial||tt.isMeshToonMaterial||tt.isMeshLambertMaterial||tt.isMeshBasicMaterial||tt.isMeshStandardMaterial||tt.isShaderMaterial)&&ye.setValue(C,"isOrthographic",I.isOrthographicCamera===!0),M!==I&&(M=I,tn=!0,si=!0)}if(X.isSkinnedMesh){ye.setOptional(C,X,"bindMatrix"),ye.setOptional(C,X,"bindMatrixInverse");const Fe=X.skeleton;Fe&&(Fe.boneTexture===null&&Fe.computeBoneTexture(),ye.setValue(C,"boneTexture",Fe.boneTexture,Nt))}X.isBatchedMesh&&(ye.setOptional(C,X,"batchingTexture"),ye.setValue(C,"batchingTexture",X._matricesTexture,Nt),ye.setOptional(C,X,"batchingIdTexture"),ye.setValue(C,"batchingIdTexture",X._indirectTexture,Nt),ye.setOptional(C,X,"batchingColorTexture"),X._colorsTexture!==null&&ye.setValue(C,"batchingColorTexture",X._colorsTexture,Nt));const en=et.morphAttributes;if((en.position!==void 0||en.normal!==void 0||en.color!==void 0)&&wt.update(X,et,te),(tn||Qt.receiveShadow!==X.receiveShadow)&&(Qt.receiveShadow=X.receiveShadow,ye.setValue(C,"receiveShadow",X.receiveShadow)),tt.isMeshGouraudMaterial&&tt.envMap!==null&&(_n.envMap.value=Bt,_n.flipEnvMap.value=Bt.isCubeTexture&&Bt.isRenderTargetTexture===!1?-1:1),tt.isMeshStandardMaterial&&tt.envMap===null&&W.environment!==null&&(_n.envMapIntensity.value=W.environmentIntensity),tn&&(ye.setValue(C,"toneMappingExposure",T.toneMappingExposure),Qt.needsLights&&Ji(_n,si),Et&&tt.fog===!0&&gt.refreshFogUniforms(_n,Et),gt.refreshMaterialUniforms(_n,tt,G,ut,g.state.transmissionRenderTarget[I.id]),Ko.upload(C,ro(Qt),_n,Nt)),tt.isShaderMaterial&&tt.uniformsNeedUpdate===!0&&(Ko.upload(C,ro(Qt),_n,Nt),tt.uniformsNeedUpdate=!1),tt.isSpriteMaterial&&ye.setValue(C,"center",X.center),ye.setValue(C,"modelViewMatrix",X.modelViewMatrix),ye.setValue(C,"normalMatrix",X.normalMatrix),ye.setValue(C,"modelMatrix",X.matrixWorld),tt.isShaderMaterial||tt.isRawShaderMaterial){const Fe=tt.uniformsGroups;for(let Ee=0,Yn=Fe.length;Ee<Yn;Ee++){const Cn=Fe[Ee];le.update(Cn,te),le.bind(Cn,te)}}return te}function Ji(I,W){I.ambientLightColor.needsUpdate=W,I.lightProbe.needsUpdate=W,I.directionalLights.needsUpdate=W,I.directionalLightShadows.needsUpdate=W,I.pointLights.needsUpdate=W,I.pointLightShadows.needsUpdate=W,I.spotLights.needsUpdate=W,I.spotLightShadows.needsUpdate=W,I.rectAreaLights.needsUpdate=W,I.hemisphereLights.needsUpdate=W}function za(I){return I.isMeshLambertMaterial||I.isMeshToonMaterial||I.isMeshPhongMaterial||I.isMeshStandardMaterial||I.isShadowMaterial||I.isShaderMaterial&&I.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return z},this.setRenderTargetTextures=function(I,W,et){const tt=yt.get(I);tt.__autoAllocateDepthBuffer=I.resolveDepthBuffer===!1,tt.__autoAllocateDepthBuffer===!1&&(tt.__useRenderToTexture=!1),yt.get(I.texture).__webglTexture=W,yt.get(I.depthTexture).__webglTexture=tt.__autoAllocateDepthBuffer?void 0:et,tt.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(I,W){const et=yt.get(I);et.__webglFramebuffer=W,et.__useDefaultFramebuffer=W===void 0};const ph=C.createFramebuffer();this.setRenderTarget=function(I,W=0,et=0){z=I,B=W,N=et;let tt=!0,X=null,Et=!1,It=!1;if(I){const Bt=yt.get(I);if(Bt.__useDefaultFramebuffer!==void 0)ht.bindFramebuffer(C.FRAMEBUFFER,null),tt=!1;else if(Bt.__webglFramebuffer===void 0)Nt.setupRenderTarget(I);else if(Bt.__hasExternalTextures)Nt.rebindTextures(I,yt.get(I.texture).__webglTexture,yt.get(I.depthTexture).__webglTexture);else if(I.depthBuffer){const Jt=I.depthTexture;if(Bt.__boundDepthTexture!==Jt){if(Jt!==null&&yt.has(Jt)&&(I.width!==Jt.image.width||I.height!==Jt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Nt.setupDepthRenderbuffer(I)}}const ee=I.texture;(ee.isData3DTexture||ee.isDataArrayTexture||ee.isCompressedArrayTexture)&&(It=!0);const ne=yt.get(I).__webglFramebuffer;I.isWebGLCubeRenderTarget?(Array.isArray(ne[W])?X=ne[W][et]:X=ne[W],Et=!0):I.samples>0&&Nt.useMultisampledRTT(I)===!1?X=yt.get(I).__webglMultisampledFramebuffer:Array.isArray(ne)?X=ne[et]:X=ne,k.copy(I.viewport),Z.copy(I.scissor),J=I.scissorTest}else k.copy(Mt).multiplyScalar(G).floor(),Z.copy(Gt).multiplyScalar(G).floor(),J=pt;if(et!==0&&(X=ph),ht.bindFramebuffer(C.FRAMEBUFFER,X)&&tt&&ht.drawBuffers(I,X),ht.viewport(k),ht.scissor(Z),ht.setScissorTest(J),Et){const Bt=yt.get(I.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_CUBE_MAP_POSITIVE_X+W,Bt.__webglTexture,et)}else if(It){const Bt=W;for(let ee=0;ee<I.textures.length;ee++){const ne=yt.get(I.textures[ee]);C.framebufferTextureLayer(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0+ee,ne.__webglTexture,et,Bt)}}else if(I!==null&&et!==0){const Bt=yt.get(I.texture);C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,Bt.__webglTexture,et)}D=-1},this.readRenderTargetPixels=function(I,W,et,tt,X,Et,It,Vt=0){if(!(I&&I.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Bt=yt.get(I).__webglFramebuffer;if(I.isWebGLCubeRenderTarget&&It!==void 0&&(Bt=Bt[It]),Bt){ht.bindFramebuffer(C.FRAMEBUFFER,Bt);try{const ee=I.textures[Vt],ne=ee.format,Jt=ee.type;if(!_t.textureFormatReadable(ne)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!_t.textureTypeReadable(Jt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=I.width-tt&&et>=0&&et<=I.height-X&&(I.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Vt),C.readPixels(W,et,tt,X,Yt.convert(ne),Yt.convert(Jt),Et))}finally{const ee=z!==null?yt.get(z).__webglFramebuffer:null;ht.bindFramebuffer(C.FRAMEBUFFER,ee)}}},this.readRenderTargetPixelsAsync=async function(I,W,et,tt,X,Et,It,Vt=0){if(!(I&&I.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Bt=yt.get(I).__webglFramebuffer;if(I.isWebGLCubeRenderTarget&&It!==void 0&&(Bt=Bt[It]),Bt)if(W>=0&&W<=I.width-tt&&et>=0&&et<=I.height-X){ht.bindFramebuffer(C.FRAMEBUFFER,Bt);const ee=I.textures[Vt],ne=ee.format,Jt=ee.type;if(!_t.textureFormatReadable(ne))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!_t.textureTypeReadable(Jt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=C.createBuffer();C.bindBuffer(C.PIXEL_PACK_BUFFER,fe),C.bufferData(C.PIXEL_PACK_BUFFER,Et.byteLength,C.STREAM_READ),I.textures.length>1&&C.readBuffer(C.COLOR_ATTACHMENT0+Vt),C.readPixels(W,et,tt,X,Yt.convert(ne),Yt.convert(Jt),0);const xe=z!==null?yt.get(z).__webglFramebuffer:null;ht.bindFramebuffer(C.FRAMEBUFFER,xe);const Kt=C.fenceSync(C.SYNC_GPU_COMMANDS_COMPLETE,0);return C.flush(),await o0(C,Kt,4),C.bindBuffer(C.PIXEL_PACK_BUFFER,fe),C.getBufferSubData(C.PIXEL_PACK_BUFFER,0,Et),C.deleteBuffer(fe),C.deleteSync(Kt),Et}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(I,W=null,et=0){const tt=Math.pow(2,-et),X=Math.floor(I.image.width*tt),Et=Math.floor(I.image.height*tt),It=W!==null?W.x:0,Vt=W!==null?W.y:0;Nt.setTexture2D(I,0),C.copyTexSubImage2D(C.TEXTURE_2D,et,0,0,It,Vt,X,Et),ht.unbindTexture()};const mh=C.createFramebuffer(),gh=C.createFramebuffer();this.copyTextureToTexture=function(I,W,et=null,tt=null,X=0,Et=null){Et===null&&(X!==0?(Ls("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Et=X,X=0):Et=0);let It,Vt,Bt,ee,ne,Jt,fe,xe,Kt;const se=I.isCompressedTexture?I.mipmaps[Et]:I.image;if(et!==null)It=et.max.x-et.min.x,Vt=et.max.y-et.min.y,Bt=et.isBox3?et.max.z-et.min.z:1,ee=et.min.x,ne=et.min.y,Jt=et.isBox3?et.min.z:0;else{const en=Math.pow(2,-X);It=Math.floor(se.width*en),Vt=Math.floor(se.height*en),I.isDataArrayTexture?Bt=se.depth:I.isData3DTexture?Bt=Math.floor(se.depth*en):Bt=1,ee=0,ne=0,Jt=0}tt!==null?(fe=tt.x,xe=tt.y,Kt=tt.z):(fe=0,xe=0,Kt=0);const be=Yt.convert(W.format),Qt=Yt.convert(W.type);let Le;W.isData3DTexture?(Nt.setTexture3D(W,0),Le=C.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(Nt.setTexture2DArray(W,0),Le=C.TEXTURE_2D_ARRAY):(Nt.setTexture2D(W,0),Le=C.TEXTURE_2D),C.pixelStorei(C.UNPACK_FLIP_Y_WEBGL,W.flipY),C.pixelStorei(C.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),C.pixelStorei(C.UNPACK_ALIGNMENT,W.unpackAlignment);const ve=C.getParameter(C.UNPACK_ROW_LENGTH),te=C.getParameter(C.UNPACK_IMAGE_HEIGHT),ke=C.getParameter(C.UNPACK_SKIP_PIXELS),tn=C.getParameter(C.UNPACK_SKIP_ROWS),si=C.getParameter(C.UNPACK_SKIP_IMAGES);C.pixelStorei(C.UNPACK_ROW_LENGTH,se.width),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,se.height),C.pixelStorei(C.UNPACK_SKIP_PIXELS,ee),C.pixelStorei(C.UNPACK_SKIP_ROWS,ne),C.pixelStorei(C.UNPACK_SKIP_IMAGES,Jt);const ye=I.isDataArrayTexture||I.isData3DTexture,_n=W.isDataArrayTexture||W.isData3DTexture;if(I.isDepthTexture){const en=yt.get(I),Fe=yt.get(W),Ee=yt.get(en.__renderTarget),Yn=yt.get(Fe.__renderTarget);ht.bindFramebuffer(C.READ_FRAMEBUFFER,Ee.__webglFramebuffer),ht.bindFramebuffer(C.DRAW_FRAMEBUFFER,Yn.__webglFramebuffer);for(let Cn=0;Cn<Bt;Cn++)ye&&(C.framebufferTextureLayer(C.READ_FRAMEBUFFER,C.COLOR_ATTACHMENT0,yt.get(I).__webglTexture,X,Jt+Cn),C.framebufferTextureLayer(C.DRAW_FRAMEBUFFER,C.COLOR_ATTACHMENT0,yt.get(W).__webglTexture,Et,Kt+Cn)),C.blitFramebuffer(ee,ne,It,Vt,fe,xe,It,Vt,C.DEPTH_BUFFER_BIT,C.NEAREST);ht.bindFramebuffer(C.READ_FRAMEBUFFER,null),ht.bindFramebuffer(C.DRAW_FRAMEBUFFER,null)}else if(X!==0||I.isRenderTargetTexture||yt.has(I)){const en=yt.get(I),Fe=yt.get(W);ht.bindFramebuffer(C.READ_FRAMEBUFFER,mh),ht.bindFramebuffer(C.DRAW_FRAMEBUFFER,gh);for(let Ee=0;Ee<Bt;Ee++)ye?C.framebufferTextureLayer(C.READ_FRAMEBUFFER,C.COLOR_ATTACHMENT0,en.__webglTexture,X,Jt+Ee):C.framebufferTexture2D(C.READ_FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,en.__webglTexture,X),_n?C.framebufferTextureLayer(C.DRAW_FRAMEBUFFER,C.COLOR_ATTACHMENT0,Fe.__webglTexture,Et,Kt+Ee):C.framebufferTexture2D(C.DRAW_FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,Fe.__webglTexture,Et),X!==0?C.blitFramebuffer(ee,ne,It,Vt,fe,xe,It,Vt,C.COLOR_BUFFER_BIT,C.NEAREST):_n?C.copyTexSubImage3D(Le,Et,fe,xe,Kt+Ee,ee,ne,It,Vt):C.copyTexSubImage2D(Le,Et,fe,xe,ee,ne,It,Vt);ht.bindFramebuffer(C.READ_FRAMEBUFFER,null),ht.bindFramebuffer(C.DRAW_FRAMEBUFFER,null)}else _n?I.isDataTexture||I.isData3DTexture?C.texSubImage3D(Le,Et,fe,xe,Kt,It,Vt,Bt,be,Qt,se.data):W.isCompressedArrayTexture?C.compressedTexSubImage3D(Le,Et,fe,xe,Kt,It,Vt,Bt,be,se.data):C.texSubImage3D(Le,Et,fe,xe,Kt,It,Vt,Bt,be,Qt,se):I.isDataTexture?C.texSubImage2D(C.TEXTURE_2D,Et,fe,xe,It,Vt,be,Qt,se.data):I.isCompressedTexture?C.compressedTexSubImage2D(C.TEXTURE_2D,Et,fe,xe,se.width,se.height,be,se.data):C.texSubImage2D(C.TEXTURE_2D,Et,fe,xe,It,Vt,be,Qt,se);C.pixelStorei(C.UNPACK_ROW_LENGTH,ve),C.pixelStorei(C.UNPACK_IMAGE_HEIGHT,te),C.pixelStorei(C.UNPACK_SKIP_PIXELS,ke),C.pixelStorei(C.UNPACK_SKIP_ROWS,tn),C.pixelStorei(C.UNPACK_SKIP_IMAGES,si),Et===0&&W.generateMipmaps&&C.generateMipmap(Le),ht.unbindTexture()},this.copyTextureToTexture3D=function(I,W,et=null,tt=null,X=0){return Ls('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(I,W,et,tt,X)},this.initRenderTarget=function(I){yt.get(I).__webglFramebuffer===void 0&&Nt.setupRenderTarget(I)},this.initTexture=function(I){I.isCubeTexture?Nt.setTextureCube(I,0):I.isData3DTexture?Nt.setTexture3D(I,0):I.isDataArrayTexture||I.isCompressedArrayTexture?Nt.setTexture2DArray(I,0):Nt.setTexture2D(I,0),ht.unbindTexture()},this.resetState=function(){B=0,N=0,z=null,ht.reset(),Ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return jn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=Me._getDrawingBufferColorSpace(t),e.unpackColorSpace=Me._getUnpackColorSpace()}}/*!
3850
3850
  * Photo Sphere Viewer 5.14.0
3851
3851
  * @copyright 2014-2015 Jérémy Heleine
3852
3852
  * @copyright 2015-2025 Damien "Mistic" Sorel
@@ -3859,7 +3859,7 @@ void main() {
3859
3859
  `,rS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 80 80"><g fill="currentColor"><circle r="10" cx="20" cy="20"/><circle r="10" cx="50" cy="20"/><circle r="10" cx="80" cy="20"/><circle r="10" cx="20" cy="50"/><circle r="10" cx="50" cy="50"/><circle r="10" cx="80" cy="50"/><circle r="10" cx="20" cy="80"/><circle r="10" cx="50" cy="80"/><circle r="10" cx="80" cy="80"/></g><!-- Created by Richard Kunák from the Noun Project--></svg>
3860
3860
  `,oS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M8.728 4.009H6.744v2.737H4.006V8.73h2.738v2.736h1.984V8.73h2.737V6.746H8.728z"/><!--Created by Ryan Canning from the Noun Project--></svg>
3861
3861
  `,aS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M14.043 12.22a7.738 7.738 0 1 0-1.823 1.822l4.985 4.985c.503.504 1.32.504 1.822 0a1.285 1.285 0 0 0 0-1.822l-4.984-4.985zm-6.305 1.043a5.527 5.527 0 1 1 0-11.053 5.527 5.527 0 0 1 0 11.053z"/><path fill="currentColor" d="M4.006 6.746h7.459V8.73H4.006z"/><!--Created by Ryan Canning from the Noun Project--></svg>
3862
- `,Oc=500,Ad=4,Cd=300,Pd=500,Rd=100,Ld=2e3,ps=10,Vi="photoSphereViewer",kr="psv--capture-event",Id=(n=>(n.ROTATE_UP="ROTATE_UP",n.ROTATE_DOWN="ROTATE_DOWN",n.ROTATE_RIGHT="ROTATE_RIGHT",n.ROTATE_LEFT="ROTATE_LEFT",n.ZOOM_IN="ZOOM_IN",n.ZOOM_OUT="ZOOM_OUT",n))(Id||{}),Ke={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},qe={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},Zn={arrow:$w,close:tS,download:eS,fullscreenIn:nS,fullscreenOut:iS,info:sS,menu:rS,zoomIn:oS,zoomOut:aS},ta={linear:n=>n,inQuad:n=>n*n,outQuad:n=>n*(2-n),inOutQuad:n=>n<.5?2*n*n:-1+(4-2*n)*n,inCubic:n=>n*n*n,outCubic:n=>--n*n*n+1,inOutCubic:n=>n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1,inQuart:n=>n*n*n*n,outQuart:n=>1- --n*n*n*n,inOutQuart:n=>n<.5?8*n*n*n*n:1-8*--n*n*n*n,inQuint:n=>n*n*n*n*n,outQuint:n=>1+--n*n*n*n*n,inOutQuint:n=>n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n,inSine:n=>1-Math.cos(n*(Math.PI/2)),outSine:n=>Math.sin(n*(Math.PI/2)),inOutSine:n=>.5-.5*Math.cos(Math.PI*n),inExpo:n=>Math.pow(2,10*(n-1)),outExpo:n=>1-Math.pow(2,-10*n),inOutExpo:n=>(n=n*2-1)<0?.5*Math.pow(2,10*n):1-.5*Math.pow(2,-10*n),inCirc:n=>1-Math.sqrt(1-n*n),outCirc:n=>Math.sqrt(1-(n-1)*(n-1)),inOutCirc:n=>(n*=2)<1?.5-.5*Math.sqrt(1-n*n):.5+.5*Math.sqrt(1-(n-=2)*n)},ae={};Uc(ae,{Animation:()=>ca,Dynamic:()=>Or,MultiDynamic:()=>rf,PressHandler:()=>ha,Slider:()=>af,SliderDirection:()=>of,addClasses:()=>Nc,angle:()=>kd,applyEulerInverse:()=>Yc,checkClosedShadowDom:()=>nf,checkStylesheet:()=>ef,checkVersion:()=>qc,cleanCssPosition:()=>Kd,clone:()=>sa,createTexture:()=>Xc,cssPositionIsOrdered:()=>Wc,dasherize:()=>dS,deepEqual:()=>Yd,deepmerge:()=>Zd,distance:()=>Dd,exitFullscreen:()=>Gd,firstNonNull:()=>Gi,getAbortError:()=>Vc,getAngle:()=>Od,getClosest:()=>Bd,getConfigParser:()=>la,getElement:()=>Nd,getEventTarget:()=>na,getMatchingTarget:()=>Fd,getPosition:()=>zd,getShortestArc:()=>Ud,getStyleProperty:()=>ei,getTouchData:()=>Bc,getXMPValue:()=>Mn,greatArcDistance:()=>cS,hasParent:()=>uS,invertResolvableBoolean:()=>ra,isAbortError:()=>Qd,isEmpty:()=>Xd,isExtendedPosition:()=>Gc,isFullscreenEnabled:()=>Hd,isNil:()=>Qe,isPlainObject:()=>zc,keyPressMatch:()=>Fc,logWarn:()=>$e,mergePanoData:()=>sf,parseAngle:()=>ni,parsePoint:()=>fS,parseSpeed:()=>$d,removeClasses:()=>hS,requestFullscreen:()=>Vd,resolveBoolean:()=>Hc,speedToDuration:()=>Zc,sum:()=>lS,throttle:()=>Wd,toggleClass:()=>ea,wrap:()=>Ur});function Ur(n,t){let e=n%t;return e<0&&(e+=t),e}function lS(n){return n.reduce((t,e)=>t+e,0)}function Dd(n,t){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function kd(n,t){return Math.atan2(t.y-n.y,t.x-n.x)}function Ud(n,t){return[0,Math.PI*2,-Math.PI*2].reduce((s,r)=>{const a=t-n+r;return Math.abs(a)<Math.abs(s)?a:s},1/0)}function Od(n,t){return Math.acos(Math.cos(n.pitch)*Math.cos(t.pitch)*Math.cos(n.yaw-t.yaw)+Math.sin(n.pitch)*Math.sin(t.pitch))}function cS([n,t],[e,s]){n-e>Math.PI?n-=2*Math.PI:n-e<-Math.PI&&(n+=2*Math.PI);const r=(e-n)*Math.cos((t+s)/2),a=s-t;return Math.sqrt(r*r+a*a)}function Nd(n){return typeof n=="string"?n.match(/^[a-z]/i)?document.getElementById(n):document.querySelector(n):n}function ea(n,t,e){e===void 0?n.classList.toggle(t):e?n.classList.add(t):e||n.classList.remove(t)}function Nc(n,t){n.classList.add(...t.split(" ").filter(e=>!!e))}function hS(n,t){n.classList.remove(...t.split(" ").filter(e=>!!e))}function uS(n,t){let e=n;do{if(e===t)return!0;e=e.parentElement}while(e);return!1}function Bd(n,t){if(!n?.matches)return null;let e=n;do{if(e.matches(t))return e;e=e.parentElement}while(e);return null}function na(n){return n?.composedPath()[0]||null}function Fd(n,t){return n?n.composedPath().find(e=>!(e instanceof HTMLElement)&&!(e instanceof SVGElement)?!1:e.matches(t)):null}function zd(n){let t=0,e=0,s=n;for(;s;)t+=s.offsetLeft-s.scrollLeft+s.clientLeft,e+=s.offsetTop-s.scrollTop+s.clientTop,s=s.offsetParent;return t-=window.scrollX,e-=window.scrollY,{x:t,y:e}}function ei(n,t){return window.getComputedStyle(n).getPropertyValue(t)}function Bc(n){if(n.touches.length<2)return null;const t={x:n.touches[0].clientX,y:n.touches[0].clientY},e={x:n.touches[1].clientX,y:n.touches[1].clientY};return{distance:Dd(t,e),angle:kd(t,e),center:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}var ia;function Hd(n,t=!1){return t?n===ia:document.fullscreenElement===n}function Vd(n,t=!1){t?(ia=n,n.classList.add("psv-fullscreen-emulation"),document.dispatchEvent(new Event("fullscreenchange"))):n.requestFullscreen()}function Gd(n=!1){n?(ia.classList.remove("psv-fullscreen-emulation"),ia=null,document.dispatchEvent(new Event("fullscreenchange"))):document.exitFullscreen()}function Fc(n,t){let e,s=!1,r=!1,a=!1,l=!1;return t==="+"?e=t:t.split("+").forEach(h=>{switch(h){case"Shift":s=!0;break;case"Ctrl":r=!0;break;case"Alt":a=!0;break;case"Meta":l=!0;break;case"Plus":e="+";break;case"Minus":e="-";break;default:e=h;break}}),s===n.shiftKey&&r===n.ctrlKey&&a===n.altKey&&l===n.metaKey&&e===n.key}function dS(n){return n.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function Wd(n,t){let e=!1;return function(...s){e||(e=!0,setTimeout(()=>{n.apply(this,s),e=!1},t))}}function zc(n){if(typeof n!="object"||n===null||Object.prototype.toString.call(n)!=="[object Object]")return!1;if(Object.getPrototypeOf(n)===null)return!0;let t=n;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t}function Zd(n,t){const e=t;return(function s(r,a){return Array.isArray(a)?(!r||!Array.isArray(r)?r=[]:r.length=0,a.forEach((l,h)=>{r[h]=s(null,l)})):typeof a=="object"?((!r||Array.isArray(r))&&(r={}),Object.keys(a).forEach(l=>{l!=="__proto__"&&(typeof a[l]!="object"||!a[l]||!zc(a[l])?r[l]=a[l]:a[l]!==e&&(r[l]?s(r[l],a[l]):r[l]=s(null,a[l])))})):r=a,r})(n,t)}function sa(n){return Zd(null,n)}function Xd(n){return!n||Object.keys(n).length===0&&n.constructor===Object}function Qe(n){return n==null}function Gi(...n){for(const t of n)if(!Qe(t))return t;return null}function Yd(n,t){if(n===t)return!0;if(qd(n)&&qd(t)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e of Object.keys(n))if(!Yd(n[e],t[e]))return!1;return!0}else return!1}function qd(n){return typeof n=="object"&&n!==null}var te=class sg extends Error{constructor(t,e){super(e&&e instanceof Error?`${t}: ${e.message}`:t),this.name="PSVError",Error.captureStackTrace?.(this,sg)}};function Hc(n,t){zc(n)?(t(n.initial,!0),n.promise.then(e=>t(e,!1))):t(n,!0)}function ra(n){return{initial:!n.initial,promise:n.promise.then(t=>!t)}}function Vc(){const n=new Error("Loading was aborted.");return n.name="AbortError",n}function Qd(n){return n?.name==="AbortError"}function $e(n){console.warn(`PhotoSphereViewer: ${n}`)}function Gc(n){return!n||Array.isArray(n)?!1:[["textureX","textureY"],["yaw","pitch"]].some(([t,e])=>n[t]!==void 0&&n[e]!==void 0)}function Mn(n,t,e=!0){let s=n.match("<GPano:"+t+">(.*)</GPano:"+t+">");if(s!==null){const r=e?parseInt(s[1],10):parseFloat(s[1]);return isNaN(r)?null:r}if(s=n.match("GPano:"+t+'="(.*?)"'),s!==null){const r=e?parseInt(s[1],10):parseFloat(s[1]);return isNaN(r)?null:r}return null}var jd={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},oa=["left","center","right"],aa=["top","center","bottom"],Jd=[...oa,...aa],Dn="center";function fS(n){if(!n)return{x:.5,y:.5};if(typeof n=="object")return n;let t=n.toLocaleLowerCase().split(" ").slice(0,2);t.length===1&&(jd[t[0]]?t=[t[0],Dn]:t=[t[0],t[0]]);const e=t[1]!=="left"&&t[1]!=="right"&&t[0]!=="top"&&t[0]!=="bottom";t=t.map(r=>jd[r]||r),e||t.reverse();const s=t.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return s?{x:parseFloat(s[1])/100,y:parseFloat(s[2])/100}:{x:.5,y:.5}}function Kd(n,{allowCenter:t,cssOrder:e}={allowCenter:!0,cssOrder:!0}){return n?(typeof n=="string"&&(n=n.split(" ")),n.length===1&&(n[0]===Dn?n=[Dn,Dn]:oa.indexOf(n[0])!==-1?n=[Dn,n[0]]:aa.indexOf(n[0])!==-1&&(n=[n[0],Dn])),n.length!==2||Jd.indexOf(n[0])===-1||Jd.indexOf(n[1])===-1?($e(`Unparsable position ${n}`),null):!t&&n[0]===Dn&&n[1]===Dn?($e("Invalid position center center"),null):(e&&!Wc(n)&&(n=[n[1],n[0]]),n[1]===Dn&&oa.indexOf(n[0])!==-1&&(n=[Dn,n[0]]),n[0]===Dn&&aa.indexOf(n[1])!==-1&&(n=[n[1],Dn]),n)):null}function Wc(n){return aa.indexOf(n[0])!==-1&&oa.indexOf(n[1])!==-1}function $d(n){let t;if(typeof n=="string"){const e=n.toString().trim();let s=parseFloat(e.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1"));const r=e.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(r.match(/(pm|per minute)$/)&&(s/=60),r){case"dpm":case"degrees per minute":case"dps":case"degrees per second":t=we.degToRad(s);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":t=s;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":t=s*Math.PI*2;break;default:throw new te(`Unknown speed unit "${r}"`)}}else t=n;return t}function Zc(n,t){if(typeof n!="number"){const e=$d(n);return t/Math.abs(e)*1e3}else return Math.abs(n)}function ni(n,t=!1,e=t){let s;if(typeof n=="string"){const r=n.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!r)throw new te(`Unknown angle "${n}"`);const a=parseFloat(r[1]),l=r[2];if(l)switch(l){case"deg":case"degs":s=we.degToRad(a);break;case"rad":case"rads":s=a;break;default:throw new te(`Unknown angle unit "${l}"`)}else s=a}else if(typeof n=="number"&&!isNaN(n))s=n;else throw new te(`Unknown angle "${n}"`);return s=Ur(t?s+Math.PI:s,Math.PI*2),t?we.clamp(s-Math.PI,-Math.PI/(e?2:1),Math.PI/(e?2:1)):s}function Xc(n,t=!1){const e=new Je(n);return e.needsUpdate=!0,e.minFilter=t?Ri:En,e.generateMipmaps=t,e.anisotropy=t?2:1,e}var tf=new ss;function Yc(n,t){tf.setFromEuler(t).invert(),n.applyQuaternion(tf)}function la(n,t){const e=function(s){const r=sa({...n,...s}),a={};for(let[l,h]of Object.entries(r)){if(t&&l in t)h=t[l](h,{rawConfig:r,defValue:n[l]});else if(!(l in n)){$e(`Unknown option ${l}`);continue}a[l]=h}return a};return e.defaults=n,e.parsers=t||{},e}function ef(n,t){ei(n,`--psv-${t}-loaded`)!=="true"&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${t}/index.css" is not loaded`)}function qc(n,t,e){t&&t!==e&&console.error(`PhotoSphereViewer: @photo-sphere-viewer/${n} is in version ${t} but @photo-sphere-viewer/core is in version ${e}`)}function nf(n){do{if(n instanceof ShadowRoot&&n.mode==="closed"){console.error("PhotoSphereViewer: closed shadow DOM detected, the viewer might not work as expected");return}n=n.parentNode}while(n)}function sf(n,t,e,s){const r={isEquirectangular:!0,fullWidth:Gi(e?.fullWidth,s?.fullWidth),fullHeight:Gi(e?.fullHeight,s?.fullHeight),croppedWidth:n,croppedHeight:t,croppedX:Gi(e?.croppedX,s?.croppedX),croppedY:Gi(e?.croppedY,s?.croppedY),poseHeading:Gi(e?.poseHeading,s?.poseHeading,0),posePitch:Gi(e?.posePitch,s?.posePitch,0),poseRoll:Gi(e?.poseRoll,s?.poseRoll,0),initialHeading:s?.initialHeading,initialPitch:s?.initialPitch,initialFov:s?.initialFov};return!r.fullWidth&&!r.fullHeight&&(r.fullWidth=Math.max(n,t*2),r.fullHeight=Math.round(r.fullWidth/2)),r.fullWidth||(r.fullWidth=r.fullHeight*2),r.fullHeight||(r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX===null&&(r.croppedX=Math.round((r.fullWidth-n)/2)),r.croppedY===null&&(r.croppedY=Math.round((r.fullHeight-t)/2)),Math.abs(r.fullWidth-r.fullHeight*2)>1&&($e("Invalid panoData, fullWidth should be twice fullHeight"),r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX+r.croppedWidth>r.fullWidth&&($e("Invalid panoData, croppedX + croppedWidth > fullWidth"),r.croppedX=r.fullWidth-r.croppedWidth),r.croppedY+r.croppedHeight>r.fullHeight&&($e("Invalid panoData, croppedY + croppedHeight > fullHeight"),r.croppedY=r.fullHeight-r.croppedHeight),r.croppedX<0&&($e("Invalid panoData, croppedX < 0"),r.croppedX=0),r.croppedY<0&&($e("Invalid panoData, croppedY < 0"),r.croppedY=0),r}var ca=class{constructor(n){this.easing=ta.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=n,n?(n.easing&&(this.easing=typeof n.easing=="function"?n.easing:ta[n.easing]||ta.linear),this.delayTimeout=setTimeout(()=>{this.delayTimeout=void 0,this.animationFrame=window.requestAnimationFrame(t=>this.__run(t))},n.delay||0)):this.resolved=!0}__run(n){if(this.cancelled)return;this.start||(this.start=n);const t=(n-this.start)/this.options.duration,e={};if(t<1){for(const[s,r]of Object.entries(this.options.properties))if(r){const a=r.start+(r.end-r.start)*this.easing(t);e[s]=a}this.options.onTick(e,t),this.animationFrame=window.requestAnimationFrame(s=>this.__run(s))}else{for(const[s,r]of Object.entries(this.options.properties))r&&(e[s]=r.end);this.options.onTick(e,1),this.__resolve(!0),this.animationFrame=void 0}}__resolve(n){n?this.resolved=!0:this.cancelled=!0,this.callbacks.forEach(t=>t(n)),this.callbacks.length=0}then(n){return this.resolved||this.cancelled?Promise.resolve(this.resolved).then(n):new Promise(t=>{this.callbacks.push(t)}).then(n)}cancel(){!this.cancelled&&!this.resolved&&(this.__resolve(!1),this.delayTimeout&&(window.clearTimeout(this.delayTimeout),this.delayTimeout=void 0),this.animationFrame&&(window.cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0))}},Or=class{constructor(n,t){if(this.fn=n,this.mode=0,this.speed=0,this.speedMult=0,this.currentSpeed=0,this.target=0,this.__current=0,this.min=t.min,this.max=t.max,this.wrap=t.wrap,this.current=t.defaultValue,this.wrap&&this.min!==0)throw new te("invalid config");this.fn&&this.fn(this.current)}get current(){return this.__current}set current(n){this.__current=n}setSpeed(n){this.speed=n}goto(n,t=1){this.mode=2,this.target=this.wrap?Ur(n,this.max):we.clamp(n,this.min,this.max),this.speedMult=t}step(n,t=1){t===0?this.setValue(this.current+n):(this.mode!==2&&(this.target=this.current),this.goto(this.target+n,t))}roll(n=!1,t=1){this.mode=1,this.target=n?-1/0:1/0,this.speedMult=t}stop(){this.mode=0}setValue(n){return this.target=this.wrap?Ur(n,this.max):we.clamp(n,this.min,this.max),this.mode=0,this.currentSpeed=0,this.target!==this.current?(this.current=this.target,this.fn&&this.fn(this.current),!0):!1}update(n){if(this.mode===2){this.wrap&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.current<this.target?this.current+this.max:this.current-this.max);const s=this.currentSpeed*this.currentSpeed/(this.speed*this.speedMult*4);Math.abs(this.target-this.current)<=s&&(this.mode=0)}let t=this.mode===0?0:this.speed*this.speedMult;this.target<this.current&&(t=-t),this.currentSpeed<t?this.currentSpeed=Math.min(t,this.currentSpeed+n/1e3*this.speed*this.speedMult*2):this.currentSpeed>t&&(this.currentSpeed=Math.max(t,this.currentSpeed-n/1e3*this.speed*this.speedMult*2));let e=null;return this.current>this.target&&this.currentSpeed?e=Math.max(this.target,this.current+this.currentSpeed*n/1e3):this.current<this.target&&this.currentSpeed&&(e=Math.min(this.target,this.current+this.currentSpeed*n/1e3)),e!==null&&(e=this.wrap?Ur(e,this.max):we.clamp(e,this.min,this.max),e!==this.current)?(this.current=e,this.fn&&this.fn(this.current),!0):!1}},rf=class{constructor(n,t){this.fn=n,this.dynamics=t,this.fn&&this.fn(this.current)}get current(){return Object.entries(this.dynamics).reduce((n,[t,e])=>(n[t]=e.current,n),{})}setSpeed(n){for(const t of Object.values(this.dynamics))t.setSpeed(n)}goto(n,t=1){for(const[e,s]of Object.entries(n))this.dynamics[e].goto(s,t)}step(n,t=1){if(t===0)this.setValue(Object.keys(n).reduce((e,s)=>(e[s]=n[s]+this.dynamics[s].current,e),{}));else for(const[e,s]of Object.entries(n))this.dynamics[e].step(s,t)}roll(n,t=1){for(const[e,s]of Object.entries(n))this.dynamics[e].roll(s,t)}stop(){for(const n of Object.values(this.dynamics))n.stop()}setValue(n){let t=!1;for(const[e,s]of Object.entries(n))t=this.dynamics[e].setValue(s)||t;return t&&this.fn&&this.fn(this.current),t}update(n){let t=!1;for(const e of Object.values(this.dynamics))t=e.update(n)||t;return t&&this.fn&&this.fn(this.current),t}},ha=class{constructor(n=200){this.delay=n,this.time=0,this.delay=n}get pending(){return this.time!==0}down(n){this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0),this.time=new Date().getTime(),this.data=n}up(n){if(!this.time)return;Date.now()-this.time<this.delay?this.timeout=setTimeout(()=>{n(this.data),this.timeout=void 0,this.time=0,this.data=void 0},this.delay):(n(this.data),this.time=0,this.data=void 0)}},of=(n=>(n.VERTICAL="VERTICAL",n.HORIZONTAL="HORIZONTAL",n))(of||{}),af=class{constructor(n,t,e){this.container=n,this.direction=t,this.listener=e,this.mousedown=!1,this.mouseover=!1,this.container.addEventListener("click",this),this.container.addEventListener("mousedown",this),this.container.addEventListener("mouseenter",this),this.container.addEventListener("mouseleave",this),this.container.addEventListener("touchstart",this),this.container.addEventListener("mousemove",this,!0),this.container.addEventListener("touchmove",this,!0),window.addEventListener("mouseup",this),window.addEventListener("touchend",this)}get isVertical(){return this.direction==="VERTICAL"}get isHorizontal(){return this.direction==="HORIZONTAL"}destroy(){window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this)}handleEvent(n){switch(n.type){case"click":n.stopPropagation();break;case"mousedown":this.__onMouseDown(n);break;case"mouseenter":this.__onMouseEnter(n);break;case"mouseleave":this.__onMouseLeave(n);break;case"touchstart":this.__onTouchStart(n);break;case"mousemove":this.__onMouseMove(n);break;case"touchmove":this.__onTouchMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchend":this.__onTouchEnd(n);break}}__onMouseDown(n){this.mousedown=!0,this.__update(n.clientX,n.clientY,!0)}__onMouseEnter(n){this.mouseover=!0,this.__update(n.clientX,n.clientY,!0)}__onTouchStart(n){this.mouseover=!0,this.mousedown=!0;const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}__onMouseMove(n){(this.mousedown||this.mouseover)&&(n.stopPropagation(),this.__update(n.clientX,n.clientY,!0))}__onTouchMove(n){if(this.mousedown||this.mouseover){n.stopPropagation();const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}}__onMouseUp(n){this.mousedown&&(this.mousedown=!1,this.__update(n.clientX,n.clientY,!1))}__onMouseLeave(n){this.mouseover&&(this.mouseover=!1,this.__update(n.clientX,n.clientY,!0))}__onTouchEnd(n){if(this.mousedown){this.mouseover=!1,this.mousedown=!1;const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!1)}}__update(n,t,e){const s=this.container.getBoundingClientRect();let r;this.isVertical?r=we.clamp((s.bottom-t)/s.height,0,1):r=we.clamp((n-s.left)/s.width,0,1),this.listener({value:r,click:!e,mousedown:this.mousedown,mouseover:this.mouseover,cursor:{clientX:n,clientY:t}})}},Jt={};Uc(Jt,{BeforeAnimateEvent:()=>Qc,BeforeRenderEvent:()=>Nr,BeforeRotateEvent:()=>ff,ClickEvent:()=>mf,ConfigChangedEvent:()=>mn,DoubleClickEvent:()=>vf,FullscreenEvent:()=>Br,HideNotificationEvent:()=>Fr,HideOverlayEvent:()=>wf,HidePanelEvent:()=>Wi,HideTooltipEvent:()=>Tf,KeypressEvent:()=>Zi,LoadProgressEvent:()=>Cf,ObjectEnterEvent:()=>Jf,ObjectEvent:()=>ua,ObjectHoverEvent:()=>tp,ObjectLeaveEvent:()=>jc,PanoramaErrorEvent:()=>Df,PanoramaLoadEvent:()=>Rf,PanoramaLoadedEvent:()=>$s,PositionUpdatedEvent:()=>zr,ReadyEvent:()=>Vr,RenderEvent:()=>zf,RollUpdatedEvent:()=>Hr,ShowNotificationEvent:()=>Gr,ShowOverlayEvent:()=>Gf,ShowPanelEvent:()=>Xi,ShowTooltipEvent:()=>Xf,SizeUpdatedEvent:()=>Wr,StopAllEvent:()=>Zr,TransitionDoneEvent:()=>Uf,ViewerEvent:()=>Re,ZoomUpdatedEvent:()=>Ei});var lf=class extends Event{constructor(n,t=!1){super(n,{cancelable:t})}},cf=class extends EventTarget{dispatchEvent(n){return super.dispatchEvent(n)}addEventListener(n,t,e){super.addEventListener(n,t,e)}removeEventListener(n,t,e){super.removeEventListener(n,t,e)}},Re=class extends lf{},hf=class rg extends Re{constructor(t,e){super(rg.type,!0),this.position=t,this.zoomLevel=e}};hf.type="before-animate";var Qc=hf,uf=class og extends Re{constructor(t,e){super(og.type),this.timestamp=t,this.elapsed=e}};uf.type="before-render";var Nr=uf,df=class ag extends Re{constructor(t){super(ag.type,!0),this.position=t}};df.type="before-rotate";var ff=df,pf=class lg extends Re{constructor(t){super(lg.type),this.data=t}};pf.type="click";var mf=pf,gf=class cg extends Re{constructor(t){super(cg.type),this.options=t}containsOptions(...t){return t.some(e=>this.options.includes(e))}};gf.type="config-changed";var mn=gf,_f=class hg extends Re{constructor(t){super(hg.type),this.data=t}};_f.type="dblclick";var vf=_f,yf=class ug extends Re{constructor(t){super(ug.type),this.fullscreenEnabled=t}};yf.type="fullscreen";var Br=yf,Ef=class dg extends Re{constructor(t){super(dg.type),this.notificationId=t}};Ef.type="hide-notification";var Fr=Ef,xf=class fg extends Re{constructor(t){super(fg.type),this.overlayId=t}};xf.type="hide-overlay";var wf=xf,Sf=class pg extends Re{constructor(t){super(pg.type),this.panelId=t}};Sf.type="hide-panel";var Wi=Sf,Mf=class mg extends Re{constructor(t){super(mg.type),this.tooltipData=t}};Mf.type="hide-tooltip";var Tf=Mf,bf=class gg extends Re{constructor(t,e){super(gg.type,!0),this.key=t,this.originalEvent=e}matches(t){return Fc(this.originalEvent,t)}};bf.type="key-press";var Zi=bf,Af=class _g extends Re{constructor(t){super(_g.type),this.progress=t}};Af.type="load-progress";var Cf=Af,Pf=class vg extends Re{constructor(t){super(vg.type),this.panorama=t}};Pf.type="panorama-load";var Rf=Pf,Lf=class yg extends Re{constructor(t){super(yg.type),this.data=t}};Lf.type="panorama-loaded";var $s=Lf,If=class Eg extends Re{constructor(t,e){super(Eg.type),this.panorama=t,this.error=e}};If.type="panorama-error";var Df=If,kf=class xg extends Re{constructor(t){super(xg.type),this.completed=t}};kf.type="transition-done";var Uf=kf,Of=class wg extends Re{constructor(t){super(wg.type),this.position=t}};Of.type="position-updated";var zr=Of,Nf=class Sg extends Re{constructor(t){super(Sg.type),this.roll=t}};Nf.type="roll-updated";var Hr=Nf,Bf=class Mg extends Re{constructor(){super(Mg.type)}};Bf.type="ready";var Vr=Bf,Ff=class Tg extends Re{constructor(){super(Tg.type)}};Ff.type="render";var zf=Ff,Hf=class bg extends Re{constructor(t){super(bg.type),this.notificationId=t}};Hf.type="show-notification";var Gr=Hf,Vf=class Ag extends Re{constructor(t){super(Ag.type),this.overlayId=t}};Vf.type="show-overlay";var Gf=Vf,Wf=class Cg extends Re{constructor(t){super(Cg.type),this.panelId=t}};Wf.type="show-panel";var Xi=Wf,Zf=class Pg extends Re{constructor(t,e){super(Pg.type),this.tooltip=t,this.tooltipData=e}};Zf.type="show-tooltip";var Xf=Zf,Yf=class Rg extends Re{constructor(t){super(Rg.type),this.size=t}};Yf.type="size-updated";var Wr=Yf,qf=class Lg extends Re{constructor(){super(Lg.type)}};qf.type="stop-all";var Zr=qf,Qf=class Ig extends Re{constructor(t){super(Ig.type),this.zoomLevel=t}};Qf.type="zoom-updated";var Ei=Qf,ua=class extends Re{constructor(n,t,e,s,r){super(n),this.originalEvent=t,this.object=e,this.viewerPoint=s,this.userDataKey=r}},jf=class Dg extends ua{constructor(t,e,s,r){super(Dg.type,t,e,s,r)}};jf.type="enter-object";var Jf=jf,Kf=class kg extends ua{constructor(t,e,s,r){super(kg.type,t,e,s,r)}};Kf.type="leave-object";var jc=Kf,$f=class Ug extends ua{constructor(t,e,s,r){super(Ug.type,t,e,s,r)}};$f.type="hover-object";var tp=$f,da=class{constructor(n){this.viewer=n}init(){}destroy(){}supportsTransition(n){return!1}supportsPreload(n){return!1}textureCoordsToSphericalCoords(n,t){throw new te("Current adapter does not support texture coordinates.")}sphericalCoordsToTextureCoords(n,t){throw new te("Current adapter does not support texture coordinates.")}};da.supportsDownload=!1;function ep(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof da)return qc(t.id,t.VERSION,"5.14.0"),t}return null}var Xr=`${Vi}_touchSupport`,cn={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,__maxCanvasWidth:null,isIphone:!1,get maxCanvasWidth(){return this.__maxCanvasWidth===null&&(this.__maxCanvasWidth=gS(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const n=pS();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=!!n,this.maxTextureWidth=n?n.getParameter(n.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=mS(),this.isIphone=/iPhone/i.test(navigator.userAgent),this.loaded=!0}if(!cn.isWebGLSupported)throw new te("WebGL 2 is not supported.");if(cn.maxTextureWidth===0)throw new te("Unable to detect system capabilities")}};function pS(){try{return document.createElement("canvas").getContext("webgl2")}catch{return null}}function mS(){let n="ontouchstart"in window||navigator.maxTouchPoints>0;Xr in localStorage&&(n=localStorage[Xr]==="true");const t=new Promise(e=>{const s=()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",a),clearTimeout(h)},r=()=>{s(),localStorage[Xr]=!1,e(!1)},a=()=>{s(),localStorage[Xr]=!0,e(!0)},l=()=>{s(),localStorage[Xr]=n,e(n)};window.addEventListener("mousedown",r,!1),window.addEventListener("touchstart",a,!1);const h=setTimeout(l,1e4)});return{initial:n,promise:t}}function gS(n){let t=n,e=!1;const s=document.createElement("canvas"),r=s.getContext("2d");for(s.width=1,s.height=1;t>1024&&!e;){const a=document.createElement("canvas"),l=a.getContext("2d");a.width=t,a.height=t/2;try{l.fillStyle="white",l.fillRect(t-1,t/2-1,1,1),r.drawImage(a,t-1,t/2-1,1,1,0,0,1,1),r.getImageData(0,0,1,1).data[0]>0&&(e=!0)}catch{}a.width=0,a.height=0,e||(t/=2)}if(e)return t;throw new te("Unable to detect system capabilities")}var _S=la({resolution:64,useXmpData:!0,blur:!1},{resolution:n=>{if(!n||!we.isPowerOfTwo(n))throw new te("EquirectangularAdapter resolution must be power of two.");return n}}),fa=class Og extends da{static withConfig(t){return[Og,t]}constructor(t,e){super(t),this.config=_S(e),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2}supportsTransition(){return!0}supportsPreload(){return!0}textureCoordsToSphericalCoords(t,e){if(Qe(t.textureX)||Qe(t.textureY))throw new te("Texture position is missing 'textureX' or 'textureY'");const s=(t.textureX+e.croppedX)/e.fullWidth*Math.PI*2,r=(t.textureY+e.croppedY)/e.fullHeight*Math.PI;return{yaw:s>=Math.PI?s-Math.PI:s+Math.PI,pitch:Math.PI/2-r}}sphericalCoordsToTextureCoords(t,e){const s=t.yaw/Math.PI/2*e.fullWidth,r=t.pitch/Math.PI*e.fullHeight;let a=Math.round(t.yaw<Math.PI?s+e.fullWidth/2:s-e.fullWidth/2)-e.croppedX,l=Math.round(e.fullHeight/2-r)-e.croppedY;return(a<0||a>e.croppedWidth||l<0||l>e.croppedHeight)&&(a=l=void 0),{textureX:a,textureY:l}}async loadTexture(t,e=!0,s,r=this.config.useXmpData){if(typeof t!="string"&&(typeof t!="object"||!t.path))return Promise.reject(new te("Invalid panorama url, are you using the right adapter?"));let a;typeof t=="string"?a={path:t,data:s}:a={data:s,...t};const l=await this.viewer.textureLoader.loadFile(a.path,e?m=>this.viewer.textureLoader.dispatchProgress(m):null,a.path),h=r?await this.loadXMP(l):null,u=await this.viewer.textureLoader.blobToImage(l);typeof a.data=="function"&&(a.data=a.data(u,h));const d=sf(u.width,u.height,a.data,h),p=this.createEquirectangularTexture(u);return{panorama:t,texture:p,panoData:d,cacheKey:a.path}}async loadXMP(t){const e=await this.loadBlobAsString(t),s=e.indexOf("<x:xmpmeta");if(s===-1)return null;const r=e.indexOf("</x:xmpmeta>",s);if(r===-1)return null;const a=e.substring(s,r);return a.includes("GPano:")?{fullWidth:Mn(a,"FullPanoWidthPixels"),fullHeight:Mn(a,"FullPanoHeightPixels"),croppedWidth:Mn(a,"CroppedAreaImageWidthPixels"),croppedHeight:Mn(a,"CroppedAreaImageHeightPixels"),croppedX:Mn(a,"CroppedAreaLeftPixels"),croppedY:Mn(a,"CroppedAreaTopPixels"),poseHeading:Mn(a,"PoseHeadingDegrees",!1),posePitch:Mn(a,"PosePitchDegrees",!1),poseRoll:Mn(a,"PoseRollDegrees",!1),initialHeading:Mn(a,"InitialViewHeadingDegrees",!1),initialPitch:Mn(a,"InitialViewPitchDegrees",!1),initialFov:Mn(a,"InitialHorizontalFOVDegrees",!1)}:null}loadBlobAsString(t){return new Promise((e,s)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=s,r.readAsText(t)})}createEquirectangularTexture(t){if(this.config.blur||t.width>cn.maxTextureWidth){const e=Math.min(1,cn.maxCanvasWidth/t.width),s=new OffscreenCanvas(Math.floor(t.width*e),Math.floor(t.height*e)),r=s.getContext("2d");return this.config.blur&&(r.filter=`blur(${s.width/2048}px)`),r.drawImage(t,0,0,s.width,s.height),Xc(s)}return Xc(t)}createMesh(t){const e=t.croppedX/t.fullWidth*2*Math.PI,s=t.croppedWidth/t.fullWidth*2*Math.PI,r=t.croppedY/t.fullHeight*Math.PI,a=t.croppedHeight/t.fullHeight*Math.PI,l=new Ys(ps,Math.round(this.SPHERE_SEGMENTS/(2*Math.PI)*s),Math.round(this.SPHERE_HORIZONTAL_SEGMENTS/Math.PI*a),-Math.PI/2+e,s,r,a).scale(-1,1,1),h=new Bi({depthTest:!1,depthWrite:!1});return new pn(l,h)}setTexture(t,e){t.material.map=e.texture}setTextureOpacity(t,e){t.material.opacity=e,t.material.transparent=e<1}disposeTexture({texture:t}){t.dispose()}disposeMesh(t){t.geometry.dispose(),t.material.dispose()}};fa.id="equirectangular",fa.VERSION="5.14.0",fa.supportsDownload=!0;var Jc=fa,np=class Ng extends Jc{static withConfig(t){return[Ng,t]}constructor(t,e){super(t,{resolution:e?.resolution??64,useXmpData:!1})}async loadTexture(t,e){const s=await super.loadTexture(t,e,null,!1);return s.panoData=null,s}createMesh(){const t=new Ys(ps,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS).scale(-1,1,1).toNonIndexed(),e=t.getAttribute("uv"),s=t.getAttribute("normal");for(let a=0;a<e.count;a++)for(let l=0;l<3;l++){const h=a*3+l,u=s.getX(h),d=s.getY(h),p=s.getZ(h),m=.947;if(a<e.count/6){const _=u===0&&p===0?1:Math.acos(d)/Math.sqrt(u*u+p*p)*(2/Math.PI);e.setXY(h,u*(m/4)*_+1/4,p*(m/2)*_+1/2)}else{const _=u===0&&p===0?1:Math.acos(-d)/Math.sqrt(u*u+p*p)*(2/Math.PI);e.setXY(h,-u*(m/4)*_+3/4,p*(m/2)*_+1/2)}}t.rotateX(-Math.PI/2),t.rotateY(Math.PI);const r=new Bi({depthTest:!1,depthWrite:!1});return new pn(t,r)}};np.id="dual-fisheye",np.VERSION="5.14.0";var ms=class Bg{constructor(t,e){this.parent=t,this.children=[],this.state={visible:!0},this.viewer=t instanceof Bg?t.viewer:t,this.container=document.createElement(e.tagName??"div"),this.container.className=e.className||"",this.parent.children.push(this),this.parent.container.appendChild(this.container)}destroy(){this.parent.container.removeChild(this.container);const t=this.parent.children.indexOf(this);t!==-1&&this.parent.children.splice(t,1),this.children.slice().forEach(e=>e.destroy()),this.children.length=0}toggle(t=!this.isVisible()){t?this.show():this.hide()}hide(t){this.container.style.display="none",this.state.visible=!1}show(t){this.container.style.display="",this.state.visible=!0}isVisible(){return this.state.visible}},vS=la({id:null,tagName:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),hn=class extends ms{constructor(n,t){super(n,{tagName:t.tagName,className:`psv-button ${t.hoverScale?"psv-button--hover-scale":""} ${t.className||""}`}),this.state={visible:!0,enabled:!0,supported:!0,collapsed:!1,active:!1,width:0},this.config=vS(t),t.id||(this.config.id=this.constructor.id),t.icon&&this.__setIcon(t.icon),this.state.width=this.container.offsetWidth,this.config.title?this.container.title=this.viewer.config.lang[this.config.title]??this.config.title:this.id&&this.id in this.viewer.config.lang&&(this.container.title=this.viewer.config.lang[this.id]),t.tabbable&&(this.container.tabIndex=0),this.container.addEventListener("click",e=>{this.state.enabled&&this.onClick(),e.stopPropagation()}),this.container.addEventListener("keydown",e=>{e.key===qe.Enter&&this.state.enabled&&(this.onClick(),e.stopPropagation())})}get id(){return this.config.id}get title(){return this.container.title}get content(){return this.container.innerHTML}get width(){return this.state.width}get collapsable(){return this.config.collapsable}show(n=!0){this.isVisible()||(this.state.visible=!0,this.state.collapsed||(this.container.style.display=""),n&&this.viewer.navbar.autoSize())}hide(n=!0){this.isVisible()&&(this.state.visible=!1,this.container.style.display="none",n&&this.viewer.navbar.autoSize())}checkSupported(){Hc(this.isSupported(),(n,t)=>{this.state&&(this.state.supported=n,t?n||this.hide():this.toggle(n))})}autoSize(){}isSupported(){return!0}toggleActive(n=!this.state.active){n!==this.state.active&&(this.state.active=n,ea(this.container,"psv-button--active",this.state.active),this.config.iconActive&&this.__setIcon(this.state.active?this.config.iconActive:this.config.icon))}disable(){this.container.classList.add("psv-button--disabled"),this.state.enabled=!1}enable(){this.container.classList.remove("psv-button--disabled"),this.state.enabled=!0}collapse(){this.state.collapsed=!0,this.container.style.display="none"}uncollapse(){this.state.collapsed=!1,this.state.visible&&(this.container.style.display="")}__setIcon(n){this.container.innerHTML=n,Nc(this.container.querySelector("svg"),"psv-button-svg")}},yS=class extends hn{constructor(n,t){super(n,{id:t.id??`psvButton-${Math.random().toString(36).substring(2)}`,className:`psv-custom-button ${t.className||""}`,hoverScale:!1,collapsable:t.collapsable!==!1,tabbable:t.tabbable!==!1,title:t.title}),this.customOnClick=t.onClick,t.content&&(typeof t.content=="string"?this.container.innerHTML=t.content:(this.container.classList.add("psv-custom-button--no-padding"),t.content.style.height="100%",t.content.attachViewer?.(this.viewer),this.container.appendChild(t.content))),this.state.width=this.container.offsetWidth,t.disabled&&this.disable(),t.visible===!1&&this.hide()}onClick(){this.customOnClick?.(this.viewer)}},Yr=class extends hn{constructor(n){super(n,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.info}),this.mode=0,this.viewer.addEventListener(Fr.type,this),this.viewer.addEventListener(Gr.type,this),this.viewer.addEventListener(Wi.type,this),this.viewer.addEventListener(Xi.type,this),this.viewer.addEventListener(mn.type,this)}destroy(){this.viewer.removeEventListener(Fr.type,this),this.viewer.removeEventListener(Gr.type,this),this.viewer.removeEventListener(Wi.type,this),this.viewer.removeEventListener(Xi.type,this),this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){if(n instanceof mn){n.containsOptions("description")&&this.autoSize(!0);return}if(!this.mode)return;let t=!1;n instanceof Fr?t=this.mode===1:n instanceof Gr?t=this.mode===1&&n.notificationId!==Ke.DESCRIPTION:n instanceof Wi?t=this.mode===2:n instanceof Xi&&(t=this.mode===2&&n.panelId!==Ke.DESCRIPTION),t&&(this.toggleActive(!1),this.mode=0)}onClick(){this.mode?this.__close():this.__open()}hide(n){super.hide(n),this.mode&&this.__close()}autoSize(n=!1){if(n){const t=this.viewer.navbar.getButton("caption",!1),e=t&&!t.isVisible(),s=!!this.viewer.config.description;e||s?this.show(!1):this.hide(!1)}}__close(){switch(this.mode){case 1:this.viewer.notification.hide(Ke.DESCRIPTION);break;case 2:this.viewer.panel.hide(Ke.DESCRIPTION);break}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:Ke.DESCRIPTION,content:`${this.viewer.config.caption?`<p>${this.viewer.config.caption}</p>`:""}${this.viewer.config.description}`})):(this.mode=1,this.viewer.notification.show({id:Ke.DESCRIPTION,content:this.viewer.config.caption}))}};Yr.id="description";var ip=class extends hn{constructor(n){super(n,{tagName:"a",className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:Zn.download}),this.viewer.addEventListener(mn.type,this),this.viewer.addEventListener($s.type,this)}destroy(){this.viewer.removeEventListener(mn.type,this),this.viewer.removeEventListener($s.type,this),super.destroy()}handleEvent(n){n instanceof mn?(n.containsOptions("downloadUrl")&&this.checkSupported(),n.containsOptions("downloadUrl","downloadName")&&this.__update()):n instanceof $s&&this.__update()}onClick(){}checkSupported(){this.viewer.adapter.constructor.supportsDownload||this.viewer.config.downloadUrl?this.show():this.hide()}__update(){const n=this.container;n.href=this.viewer.config.downloadUrl||this.viewer.config.panorama,n.target="_blank",n.href.startsWith("data:")&&!this.viewer.config.downloadName?n.download="panorama."+n.href.substring(0,n.href.indexOf(";")).split("/").pop():n.download=this.viewer.config.downloadName||n.href.split("/").pop()}};ip.id="download";var sp=class extends hn{constructor(n){super(n,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.fullscreenIn,iconActive:Zn.fullscreenOut}),this.viewer.addEventListener(Br.type,this)}destroy(){this.viewer.removeEventListener(Br.type,this),super.destroy()}handleEvent(n){n instanceof Br&&this.toggleActive(n.fullscreenEnabled)}onClick(){this.viewer.toggleFullscreen()}};sp.id="fullscreen";var ES="psvButton",xS=(n,t)=>`
3862
+ `,Oc=500,Ad=4,Cd=300,Pd=500,Rd=100,Ld=2e3,ps=10,Vi="photoSphereViewer",kr="psv--capture-event",Id=(n=>(n.ROTATE_UP="ROTATE_UP",n.ROTATE_DOWN="ROTATE_DOWN",n.ROTATE_RIGHT="ROTATE_RIGHT",n.ROTATE_LEFT="ROTATE_LEFT",n.ZOOM_IN="ZOOM_IN",n.ZOOM_OUT="ZOOM_OUT",n))(Id||{}),Ke={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},qe={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},Zn={arrow:$w,close:tS,download:eS,fullscreenIn:nS,fullscreenOut:iS,info:sS,menu:rS,zoomIn:oS,zoomOut:aS},ta={linear:n=>n,inQuad:n=>n*n,outQuad:n=>n*(2-n),inOutQuad:n=>n<.5?2*n*n:-1+(4-2*n)*n,inCubic:n=>n*n*n,outCubic:n=>--n*n*n+1,inOutCubic:n=>n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1,inQuart:n=>n*n*n*n,outQuart:n=>1- --n*n*n*n,inOutQuart:n=>n<.5?8*n*n*n*n:1-8*--n*n*n*n,inQuint:n=>n*n*n*n*n,outQuint:n=>1+--n*n*n*n*n,inOutQuint:n=>n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n,inSine:n=>1-Math.cos(n*(Math.PI/2)),outSine:n=>Math.sin(n*(Math.PI/2)),inOutSine:n=>.5-.5*Math.cos(Math.PI*n),inExpo:n=>Math.pow(2,10*(n-1)),outExpo:n=>1-Math.pow(2,-10*n),inOutExpo:n=>(n=n*2-1)<0?.5*Math.pow(2,10*n):1-.5*Math.pow(2,-10*n),inCirc:n=>1-Math.sqrt(1-n*n),outCirc:n=>Math.sqrt(1-(n-1)*(n-1)),inOutCirc:n=>(n*=2)<1?.5-.5*Math.sqrt(1-n*n):.5+.5*Math.sqrt(1-(n-=2)*n)},oe={};Uc(oe,{Animation:()=>ca,Dynamic:()=>Or,MultiDynamic:()=>rf,PressHandler:()=>ha,Slider:()=>af,SliderDirection:()=>of,addClasses:()=>Nc,angle:()=>kd,applyEulerInverse:()=>Yc,checkClosedShadowDom:()=>nf,checkStylesheet:()=>ef,checkVersion:()=>qc,cleanCssPosition:()=>Kd,clone:()=>sa,createTexture:()=>Xc,cssPositionIsOrdered:()=>Wc,dasherize:()=>dS,deepEqual:()=>Yd,deepmerge:()=>Zd,distance:()=>Dd,exitFullscreen:()=>Gd,firstNonNull:()=>Gi,getAbortError:()=>Vc,getAngle:()=>Od,getClosest:()=>Bd,getConfigParser:()=>la,getElement:()=>Nd,getEventTarget:()=>na,getMatchingTarget:()=>Fd,getPosition:()=>zd,getShortestArc:()=>Ud,getStyleProperty:()=>ei,getTouchData:()=>Bc,getXMPValue:()=>Mn,greatArcDistance:()=>cS,hasParent:()=>uS,invertResolvableBoolean:()=>ra,isAbortError:()=>Qd,isEmpty:()=>Xd,isExtendedPosition:()=>Gc,isFullscreenEnabled:()=>Hd,isNil:()=>Qe,isPlainObject:()=>zc,keyPressMatch:()=>Fc,logWarn:()=>$e,mergePanoData:()=>sf,parseAngle:()=>ni,parsePoint:()=>fS,parseSpeed:()=>$d,removeClasses:()=>hS,requestFullscreen:()=>Vd,resolveBoolean:()=>Hc,speedToDuration:()=>Zc,sum:()=>lS,throttle:()=>Wd,toggleClass:()=>ea,wrap:()=>Ur});function Ur(n,t){let e=n%t;return e<0&&(e+=t),e}function lS(n){return n.reduce((t,e)=>t+e,0)}function Dd(n,t){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function kd(n,t){return Math.atan2(t.y-n.y,t.x-n.x)}function Ud(n,t){return[0,Math.PI*2,-Math.PI*2].reduce((s,r)=>{const a=t-n+r;return Math.abs(a)<Math.abs(s)?a:s},1/0)}function Od(n,t){return Math.acos(Math.cos(n.pitch)*Math.cos(t.pitch)*Math.cos(n.yaw-t.yaw)+Math.sin(n.pitch)*Math.sin(t.pitch))}function cS([n,t],[e,s]){n-e>Math.PI?n-=2*Math.PI:n-e<-Math.PI&&(n+=2*Math.PI);const r=(e-n)*Math.cos((t+s)/2),a=s-t;return Math.sqrt(r*r+a*a)}function Nd(n){return typeof n=="string"?n.match(/^[a-z]/i)?document.getElementById(n):document.querySelector(n):n}function ea(n,t,e){e===void 0?n.classList.toggle(t):e?n.classList.add(t):e||n.classList.remove(t)}function Nc(n,t){n.classList.add(...t.split(" ").filter(e=>!!e))}function hS(n,t){n.classList.remove(...t.split(" ").filter(e=>!!e))}function uS(n,t){let e=n;do{if(e===t)return!0;e=e.parentElement}while(e);return!1}function Bd(n,t){if(!n?.matches)return null;let e=n;do{if(e.matches(t))return e;e=e.parentElement}while(e);return null}function na(n){return n?.composedPath()[0]||null}function Fd(n,t){return n?n.composedPath().find(e=>!(e instanceof HTMLElement)&&!(e instanceof SVGElement)?!1:e.matches(t)):null}function zd(n){let t=0,e=0,s=n;for(;s;)t+=s.offsetLeft-s.scrollLeft+s.clientLeft,e+=s.offsetTop-s.scrollTop+s.clientTop,s=s.offsetParent;return t-=window.scrollX,e-=window.scrollY,{x:t,y:e}}function ei(n,t){return window.getComputedStyle(n).getPropertyValue(t)}function Bc(n){if(n.touches.length<2)return null;const t={x:n.touches[0].clientX,y:n.touches[0].clientY},e={x:n.touches[1].clientX,y:n.touches[1].clientY};return{distance:Dd(t,e),angle:kd(t,e),center:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}var ia;function Hd(n,t=!1){return t?n===ia:document.fullscreenElement===n}function Vd(n,t=!1){t?(ia=n,n.classList.add("psv-fullscreen-emulation"),document.dispatchEvent(new Event("fullscreenchange"))):n.requestFullscreen()}function Gd(n=!1){n?(ia.classList.remove("psv-fullscreen-emulation"),ia=null,document.dispatchEvent(new Event("fullscreenchange"))):document.exitFullscreen()}function Fc(n,t){let e,s=!1,r=!1,a=!1,l=!1;return t==="+"?e=t:t.split("+").forEach(h=>{switch(h){case"Shift":s=!0;break;case"Ctrl":r=!0;break;case"Alt":a=!0;break;case"Meta":l=!0;break;case"Plus":e="+";break;case"Minus":e="-";break;default:e=h;break}}),s===n.shiftKey&&r===n.ctrlKey&&a===n.altKey&&l===n.metaKey&&e===n.key}function dS(n){return n.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function Wd(n,t){let e=!1;return function(...s){e||(e=!0,setTimeout(()=>{n.apply(this,s),e=!1},t))}}function zc(n){if(typeof n!="object"||n===null||Object.prototype.toString.call(n)!=="[object Object]")return!1;if(Object.getPrototypeOf(n)===null)return!0;let t=n;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t}function Zd(n,t){const e=t;return(function s(r,a){return Array.isArray(a)?(!r||!Array.isArray(r)?r=[]:r.length=0,a.forEach((l,h)=>{r[h]=s(null,l)})):typeof a=="object"?((!r||Array.isArray(r))&&(r={}),Object.keys(a).forEach(l=>{l!=="__proto__"&&(typeof a[l]!="object"||!a[l]||!zc(a[l])?r[l]=a[l]:a[l]!==e&&(r[l]?s(r[l],a[l]):r[l]=s(null,a[l])))})):r=a,r})(n,t)}function sa(n){return Zd(null,n)}function Xd(n){return!n||Object.keys(n).length===0&&n.constructor===Object}function Qe(n){return n==null}function Gi(...n){for(const t of n)if(!Qe(t))return t;return null}function Yd(n,t){if(n===t)return!0;if(qd(n)&&qd(t)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e of Object.keys(n))if(!Yd(n[e],t[e]))return!1;return!0}else return!1}function qd(n){return typeof n=="object"&&n!==null}var $t=class sg extends Error{constructor(t,e){super(e&&e instanceof Error?`${t}: ${e.message}`:t),this.name="PSVError",Error.captureStackTrace?.(this,sg)}};function Hc(n,t){zc(n)?(t(n.initial,!0),n.promise.then(e=>t(e,!1))):t(n,!0)}function ra(n){return{initial:!n.initial,promise:n.promise.then(t=>!t)}}function Vc(){const n=new Error("Loading was aborted.");return n.name="AbortError",n}function Qd(n){return n?.name==="AbortError"}function $e(n){console.warn(`PhotoSphereViewer: ${n}`)}function Gc(n){return!n||Array.isArray(n)?!1:[["textureX","textureY"],["yaw","pitch"]].some(([t,e])=>n[t]!==void 0&&n[e]!==void 0)}function Mn(n,t,e=!0){let s=n.match("<GPano:"+t+">(.*)</GPano:"+t+">");if(s!==null){const r=e?parseInt(s[1],10):parseFloat(s[1]);return isNaN(r)?null:r}if(s=n.match("GPano:"+t+'="(.*?)"'),s!==null){const r=e?parseInt(s[1],10):parseFloat(s[1]);return isNaN(r)?null:r}return null}var jd={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},oa=["left","center","right"],aa=["top","center","bottom"],Jd=[...oa,...aa],Dn="center";function fS(n){if(!n)return{x:.5,y:.5};if(typeof n=="object")return n;let t=n.toLocaleLowerCase().split(" ").slice(0,2);t.length===1&&(jd[t[0]]?t=[t[0],Dn]:t=[t[0],t[0]]);const e=t[1]!=="left"&&t[1]!=="right"&&t[0]!=="top"&&t[0]!=="bottom";t=t.map(r=>jd[r]||r),e||t.reverse();const s=t.join(" ").match(/^([0-9.]+)% ([0-9.]+)%$/);return s?{x:parseFloat(s[1])/100,y:parseFloat(s[2])/100}:{x:.5,y:.5}}function Kd(n,{allowCenter:t,cssOrder:e}={allowCenter:!0,cssOrder:!0}){return n?(typeof n=="string"&&(n=n.split(" ")),n.length===1&&(n[0]===Dn?n=[Dn,Dn]:oa.indexOf(n[0])!==-1?n=[Dn,n[0]]:aa.indexOf(n[0])!==-1&&(n=[n[0],Dn])),n.length!==2||Jd.indexOf(n[0])===-1||Jd.indexOf(n[1])===-1?($e(`Unparsable position ${n}`),null):!t&&n[0]===Dn&&n[1]===Dn?($e("Invalid position center center"),null):(e&&!Wc(n)&&(n=[n[1],n[0]]),n[1]===Dn&&oa.indexOf(n[0])!==-1&&(n=[Dn,n[0]]),n[0]===Dn&&aa.indexOf(n[1])!==-1&&(n=[n[1],Dn]),n)):null}function Wc(n){return aa.indexOf(n[0])!==-1&&oa.indexOf(n[1])!==-1}function $d(n){let t;if(typeof n=="string"){const e=n.toString().trim();let s=parseFloat(e.replace(/^(-?[0-9]+(?:\.[0-9]*)?).*$/,"$1"));const r=e.replace(/^-?[0-9]+(?:\.[0-9]*)?(.*)$/,"$1").trim();switch(r.match(/(pm|per minute)$/)&&(s/=60),r){case"dpm":case"degrees per minute":case"dps":case"degrees per second":t=Se.degToRad(s);break;case"rdpm":case"radians per minute":case"rdps":case"radians per second":t=s;break;case"rpm":case"revolutions per minute":case"rps":case"revolutions per second":t=s*Math.PI*2;break;default:throw new $t(`Unknown speed unit "${r}"`)}}else t=n;return t}function Zc(n,t){if(typeof n!="number"){const e=$d(n);return t/Math.abs(e)*1e3}else return Math.abs(n)}function ni(n,t=!1,e=t){let s;if(typeof n=="string"){const r=n.toLowerCase().trim().match(/^(-?[0-9]+(?:\.[0-9]*)?)(.*)$/);if(!r)throw new $t(`Unknown angle "${n}"`);const a=parseFloat(r[1]),l=r[2];if(l)switch(l){case"deg":case"degs":s=Se.degToRad(a);break;case"rad":case"rads":s=a;break;default:throw new $t(`Unknown angle unit "${l}"`)}else s=a}else if(typeof n=="number"&&!isNaN(n))s=n;else throw new $t(`Unknown angle "${n}"`);return s=Ur(t?s+Math.PI:s,Math.PI*2),t?Se.clamp(s-Math.PI,-Math.PI/(e?2:1),Math.PI/(e?2:1)):s}function Xc(n,t=!1){const e=new Je(n);return e.needsUpdate=!0,e.minFilter=t?Ri:En,e.generateMipmaps=t,e.anisotropy=t?2:1,e}var tf=new ss;function Yc(n,t){tf.setFromEuler(t).invert(),n.applyQuaternion(tf)}function la(n,t){const e=function(s){const r=sa({...n,...s}),a={};for(let[l,h]of Object.entries(r)){if(t&&l in t)h=t[l](h,{rawConfig:r,defValue:n[l]});else if(!(l in n)){$e(`Unknown option ${l}`);continue}a[l]=h}return a};return e.defaults=n,e.parsers=t||{},e}function ef(n,t){ei(n,`--psv-${t}-loaded`)!=="true"&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${t}/index.css" is not loaded`)}function qc(n,t,e){t&&t!==e&&console.error(`PhotoSphereViewer: @photo-sphere-viewer/${n} is in version ${t} but @photo-sphere-viewer/core is in version ${e}`)}function nf(n){do{if(n instanceof ShadowRoot&&n.mode==="closed"){console.error("PhotoSphereViewer: closed shadow DOM detected, the viewer might not work as expected");return}n=n.parentNode}while(n)}function sf(n,t,e,s){const r={isEquirectangular:!0,fullWidth:Gi(e?.fullWidth,s?.fullWidth),fullHeight:Gi(e?.fullHeight,s?.fullHeight),croppedWidth:n,croppedHeight:t,croppedX:Gi(e?.croppedX,s?.croppedX),croppedY:Gi(e?.croppedY,s?.croppedY),poseHeading:Gi(e?.poseHeading,s?.poseHeading,0),posePitch:Gi(e?.posePitch,s?.posePitch,0),poseRoll:Gi(e?.poseRoll,s?.poseRoll,0),initialHeading:s?.initialHeading,initialPitch:s?.initialPitch,initialFov:s?.initialFov};return!r.fullWidth&&!r.fullHeight&&(r.fullWidth=Math.max(n,t*2),r.fullHeight=Math.round(r.fullWidth/2)),r.fullWidth||(r.fullWidth=r.fullHeight*2),r.fullHeight||(r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX===null&&(r.croppedX=Math.round((r.fullWidth-n)/2)),r.croppedY===null&&(r.croppedY=Math.round((r.fullHeight-t)/2)),Math.abs(r.fullWidth-r.fullHeight*2)>1&&($e("Invalid panoData, fullWidth should be twice fullHeight"),r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX+r.croppedWidth>r.fullWidth&&($e("Invalid panoData, croppedX + croppedWidth > fullWidth"),r.croppedX=r.fullWidth-r.croppedWidth),r.croppedY+r.croppedHeight>r.fullHeight&&($e("Invalid panoData, croppedY + croppedHeight > fullHeight"),r.croppedY=r.fullHeight-r.croppedHeight),r.croppedX<0&&($e("Invalid panoData, croppedX < 0"),r.croppedX=0),r.croppedY<0&&($e("Invalid panoData, croppedY < 0"),r.croppedY=0),r}var ca=class{constructor(n){this.easing=ta.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=n,n?(n.easing&&(this.easing=typeof n.easing=="function"?n.easing:ta[n.easing]||ta.linear),this.delayTimeout=setTimeout(()=>{this.delayTimeout=void 0,this.animationFrame=window.requestAnimationFrame(t=>this.__run(t))},n.delay||0)):this.resolved=!0}__run(n){if(this.cancelled)return;this.start||(this.start=n);const t=(n-this.start)/this.options.duration,e={};if(t<1){for(const[s,r]of Object.entries(this.options.properties))if(r){const a=r.start+(r.end-r.start)*this.easing(t);e[s]=a}this.options.onTick(e,t),this.animationFrame=window.requestAnimationFrame(s=>this.__run(s))}else{for(const[s,r]of Object.entries(this.options.properties))r&&(e[s]=r.end);this.options.onTick(e,1),this.__resolve(!0),this.animationFrame=void 0}}__resolve(n){n?this.resolved=!0:this.cancelled=!0,this.callbacks.forEach(t=>t(n)),this.callbacks.length=0}then(n){return this.resolved||this.cancelled?Promise.resolve(this.resolved).then(n):new Promise(t=>{this.callbacks.push(t)}).then(n)}cancel(){!this.cancelled&&!this.resolved&&(this.__resolve(!1),this.delayTimeout&&(window.clearTimeout(this.delayTimeout),this.delayTimeout=void 0),this.animationFrame&&(window.cancelAnimationFrame(this.animationFrame),this.animationFrame=void 0))}},Or=class{constructor(n,t){if(this.fn=n,this.mode=0,this.speed=0,this.speedMult=0,this.currentSpeed=0,this.target=0,this.__current=0,this.min=t.min,this.max=t.max,this.wrap=t.wrap,this.current=t.defaultValue,this.wrap&&this.min!==0)throw new $t("invalid config");this.fn&&this.fn(this.current)}get current(){return this.__current}set current(n){this.__current=n}setSpeed(n){this.speed=n}goto(n,t=1){this.mode=2,this.target=this.wrap?Ur(n,this.max):Se.clamp(n,this.min,this.max),this.speedMult=t}step(n,t=1){t===0?this.setValue(this.current+n):(this.mode!==2&&(this.target=this.current),this.goto(this.target+n,t))}roll(n=!1,t=1){this.mode=1,this.target=n?-1/0:1/0,this.speedMult=t}stop(){this.mode=0}setValue(n){return this.target=this.wrap?Ur(n,this.max):Se.clamp(n,this.min,this.max),this.mode=0,this.currentSpeed=0,this.target!==this.current?(this.current=this.target,this.fn&&this.fn(this.current),!0):!1}update(n){if(this.mode===2){this.wrap&&Math.abs(this.target-this.current)>this.max/2&&(this.current=this.current<this.target?this.current+this.max:this.current-this.max);const s=this.currentSpeed*this.currentSpeed/(this.speed*this.speedMult*4);Math.abs(this.target-this.current)<=s&&(this.mode=0)}let t=this.mode===0?0:this.speed*this.speedMult;this.target<this.current&&(t=-t),this.currentSpeed<t?this.currentSpeed=Math.min(t,this.currentSpeed+n/1e3*this.speed*this.speedMult*2):this.currentSpeed>t&&(this.currentSpeed=Math.max(t,this.currentSpeed-n/1e3*this.speed*this.speedMult*2));let e=null;return this.current>this.target&&this.currentSpeed?e=Math.max(this.target,this.current+this.currentSpeed*n/1e3):this.current<this.target&&this.currentSpeed&&(e=Math.min(this.target,this.current+this.currentSpeed*n/1e3)),e!==null&&(e=this.wrap?Ur(e,this.max):Se.clamp(e,this.min,this.max),e!==this.current)?(this.current=e,this.fn&&this.fn(this.current),!0):!1}},rf=class{constructor(n,t){this.fn=n,this.dynamics=t,this.fn&&this.fn(this.current)}get current(){return Object.entries(this.dynamics).reduce((n,[t,e])=>(n[t]=e.current,n),{})}setSpeed(n){for(const t of Object.values(this.dynamics))t.setSpeed(n)}goto(n,t=1){for(const[e,s]of Object.entries(n))this.dynamics[e].goto(s,t)}step(n,t=1){if(t===0)this.setValue(Object.keys(n).reduce((e,s)=>(e[s]=n[s]+this.dynamics[s].current,e),{}));else for(const[e,s]of Object.entries(n))this.dynamics[e].step(s,t)}roll(n,t=1){for(const[e,s]of Object.entries(n))this.dynamics[e].roll(s,t)}stop(){for(const n of Object.values(this.dynamics))n.stop()}setValue(n){let t=!1;for(const[e,s]of Object.entries(n))t=this.dynamics[e].setValue(s)||t;return t&&this.fn&&this.fn(this.current),t}update(n){let t=!1;for(const e of Object.values(this.dynamics))t=e.update(n)||t;return t&&this.fn&&this.fn(this.current),t}},ha=class{constructor(n=200){this.delay=n,this.time=0,this.delay=n}get pending(){return this.time!==0}down(n){this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0),this.time=new Date().getTime(),this.data=n}up(n){if(!this.time)return;Date.now()-this.time<this.delay?this.timeout=setTimeout(()=>{n(this.data),this.timeout=void 0,this.time=0,this.data=void 0},this.delay):(n(this.data),this.time=0,this.data=void 0)}},of=(n=>(n.VERTICAL="VERTICAL",n.HORIZONTAL="HORIZONTAL",n))(of||{}),af=class{constructor(n,t,e){this.container=n,this.direction=t,this.listener=e,this.mousedown=!1,this.mouseover=!1,this.container.addEventListener("click",this),this.container.addEventListener("mousedown",this),this.container.addEventListener("mouseenter",this),this.container.addEventListener("mouseleave",this),this.container.addEventListener("touchstart",this),this.container.addEventListener("mousemove",this,!0),this.container.addEventListener("touchmove",this,!0),window.addEventListener("mouseup",this),window.addEventListener("touchend",this)}get isVertical(){return this.direction==="VERTICAL"}get isHorizontal(){return this.direction==="HORIZONTAL"}destroy(){window.removeEventListener("mouseup",this),window.removeEventListener("touchend",this)}handleEvent(n){switch(n.type){case"click":n.stopPropagation();break;case"mousedown":this.__onMouseDown(n);break;case"mouseenter":this.__onMouseEnter(n);break;case"mouseleave":this.__onMouseLeave(n);break;case"touchstart":this.__onTouchStart(n);break;case"mousemove":this.__onMouseMove(n);break;case"touchmove":this.__onTouchMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchend":this.__onTouchEnd(n);break}}__onMouseDown(n){this.mousedown=!0,this.__update(n.clientX,n.clientY,!0)}__onMouseEnter(n){this.mouseover=!0,this.__update(n.clientX,n.clientY,!0)}__onTouchStart(n){this.mouseover=!0,this.mousedown=!0;const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}__onMouseMove(n){(this.mousedown||this.mouseover)&&(n.stopPropagation(),this.__update(n.clientX,n.clientY,!0))}__onTouchMove(n){if(this.mousedown||this.mouseover){n.stopPropagation();const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!0)}}__onMouseUp(n){this.mousedown&&(this.mousedown=!1,this.__update(n.clientX,n.clientY,!1))}__onMouseLeave(n){this.mouseover&&(this.mouseover=!1,this.__update(n.clientX,n.clientY,!0))}__onTouchEnd(n){if(this.mousedown){this.mouseover=!1,this.mousedown=!1;const t=n.changedTouches[0];this.__update(t.clientX,t.clientY,!1)}}__update(n,t,e){const s=this.container.getBoundingClientRect();let r;this.isVertical?r=Se.clamp((s.bottom-t)/s.height,0,1):r=Se.clamp((n-s.left)/s.width,0,1),this.listener({value:r,click:!e,mousedown:this.mousedown,mouseover:this.mouseover,cursor:{clientX:n,clientY:t}})}},jt={};Uc(jt,{BeforeAnimateEvent:()=>Qc,BeforeRenderEvent:()=>Nr,BeforeRotateEvent:()=>ff,ClickEvent:()=>mf,ConfigChangedEvent:()=>mn,DoubleClickEvent:()=>vf,FullscreenEvent:()=>Br,HideNotificationEvent:()=>Fr,HideOverlayEvent:()=>wf,HidePanelEvent:()=>Wi,HideTooltipEvent:()=>Tf,KeypressEvent:()=>Zi,LoadProgressEvent:()=>Cf,ObjectEnterEvent:()=>Jf,ObjectEvent:()=>ua,ObjectHoverEvent:()=>tp,ObjectLeaveEvent:()=>jc,PanoramaErrorEvent:()=>Df,PanoramaLoadEvent:()=>Rf,PanoramaLoadedEvent:()=>$s,PositionUpdatedEvent:()=>zr,ReadyEvent:()=>Vr,RenderEvent:()=>zf,RollUpdatedEvent:()=>Hr,ShowNotificationEvent:()=>Gr,ShowOverlayEvent:()=>Gf,ShowPanelEvent:()=>Xi,ShowTooltipEvent:()=>Xf,SizeUpdatedEvent:()=>Wr,StopAllEvent:()=>Zr,TransitionDoneEvent:()=>Uf,ViewerEvent:()=>Re,ZoomUpdatedEvent:()=>Ei});var lf=class extends Event{constructor(n,t=!1){super(n,{cancelable:t})}},cf=class extends EventTarget{dispatchEvent(n){return super.dispatchEvent(n)}addEventListener(n,t,e){super.addEventListener(n,t,e)}removeEventListener(n,t,e){super.removeEventListener(n,t,e)}},Re=class extends lf{},hf=class rg extends Re{constructor(t,e){super(rg.type,!0),this.position=t,this.zoomLevel=e}};hf.type="before-animate";var Qc=hf,uf=class og extends Re{constructor(t,e){super(og.type),this.timestamp=t,this.elapsed=e}};uf.type="before-render";var Nr=uf,df=class ag extends Re{constructor(t){super(ag.type,!0),this.position=t}};df.type="before-rotate";var ff=df,pf=class lg extends Re{constructor(t){super(lg.type),this.data=t}};pf.type="click";var mf=pf,gf=class cg extends Re{constructor(t){super(cg.type),this.options=t}containsOptions(...t){return t.some(e=>this.options.includes(e))}};gf.type="config-changed";var mn=gf,_f=class hg extends Re{constructor(t){super(hg.type),this.data=t}};_f.type="dblclick";var vf=_f,yf=class ug extends Re{constructor(t){super(ug.type),this.fullscreenEnabled=t}};yf.type="fullscreen";var Br=yf,Ef=class dg extends Re{constructor(t){super(dg.type),this.notificationId=t}};Ef.type="hide-notification";var Fr=Ef,xf=class fg extends Re{constructor(t){super(fg.type),this.overlayId=t}};xf.type="hide-overlay";var wf=xf,Sf=class pg extends Re{constructor(t){super(pg.type),this.panelId=t}};Sf.type="hide-panel";var Wi=Sf,Mf=class mg extends Re{constructor(t){super(mg.type),this.tooltipData=t}};Mf.type="hide-tooltip";var Tf=Mf,bf=class gg extends Re{constructor(t,e){super(gg.type,!0),this.key=t,this.originalEvent=e}matches(t){return Fc(this.originalEvent,t)}};bf.type="key-press";var Zi=bf,Af=class _g extends Re{constructor(t){super(_g.type),this.progress=t}};Af.type="load-progress";var Cf=Af,Pf=class vg extends Re{constructor(t){super(vg.type),this.panorama=t}};Pf.type="panorama-load";var Rf=Pf,Lf=class yg extends Re{constructor(t){super(yg.type),this.data=t}};Lf.type="panorama-loaded";var $s=Lf,If=class Eg extends Re{constructor(t,e){super(Eg.type),this.panorama=t,this.error=e}};If.type="panorama-error";var Df=If,kf=class xg extends Re{constructor(t){super(xg.type),this.completed=t}};kf.type="transition-done";var Uf=kf,Of=class wg extends Re{constructor(t){super(wg.type),this.position=t}};Of.type="position-updated";var zr=Of,Nf=class Sg extends Re{constructor(t){super(Sg.type),this.roll=t}};Nf.type="roll-updated";var Hr=Nf,Bf=class Mg extends Re{constructor(){super(Mg.type)}};Bf.type="ready";var Vr=Bf,Ff=class Tg extends Re{constructor(){super(Tg.type)}};Ff.type="render";var zf=Ff,Hf=class bg extends Re{constructor(t){super(bg.type),this.notificationId=t}};Hf.type="show-notification";var Gr=Hf,Vf=class Ag extends Re{constructor(t){super(Ag.type),this.overlayId=t}};Vf.type="show-overlay";var Gf=Vf,Wf=class Cg extends Re{constructor(t){super(Cg.type),this.panelId=t}};Wf.type="show-panel";var Xi=Wf,Zf=class Pg extends Re{constructor(t,e){super(Pg.type),this.tooltip=t,this.tooltipData=e}};Zf.type="show-tooltip";var Xf=Zf,Yf=class Rg extends Re{constructor(t){super(Rg.type),this.size=t}};Yf.type="size-updated";var Wr=Yf,qf=class Lg extends Re{constructor(){super(Lg.type)}};qf.type="stop-all";var Zr=qf,Qf=class Ig extends Re{constructor(t){super(Ig.type),this.zoomLevel=t}};Qf.type="zoom-updated";var Ei=Qf,ua=class extends Re{constructor(n,t,e,s,r){super(n),this.originalEvent=t,this.object=e,this.viewerPoint=s,this.userDataKey=r}},jf=class Dg extends ua{constructor(t,e,s,r){super(Dg.type,t,e,s,r)}};jf.type="enter-object";var Jf=jf,Kf=class kg extends ua{constructor(t,e,s,r){super(kg.type,t,e,s,r)}};Kf.type="leave-object";var jc=Kf,$f=class Ug extends ua{constructor(t,e,s,r){super(Ug.type,t,e,s,r)}};$f.type="hover-object";var tp=$f,da=class{constructor(n){this.viewer=n}init(){}destroy(){}supportsTransition(n){return!1}supportsPreload(n){return!1}textureCoordsToSphericalCoords(n,t){throw new $t("Current adapter does not support texture coordinates.")}sphericalCoordsToTextureCoords(n,t){throw new $t("Current adapter does not support texture coordinates.")}};da.supportsDownload=!1;function ep(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof da)return qc(t.id,t.VERSION,"5.14.0"),t}return null}var Xr=`${Vi}_touchSupport`,cn={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,__maxCanvasWidth:null,isIphone:!1,get maxCanvasWidth(){return this.__maxCanvasWidth===null&&(this.__maxCanvasWidth=gS(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const n=pS();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=!!n,this.maxTextureWidth=n?n.getParameter(n.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=mS(),this.isIphone=/iPhone/i.test(navigator.userAgent),this.loaded=!0}if(!cn.isWebGLSupported)throw new $t("WebGL 2 is not supported.");if(cn.maxTextureWidth===0)throw new $t("Unable to detect system capabilities")}};function pS(){try{return document.createElement("canvas").getContext("webgl2")}catch{return null}}function mS(){let n="ontouchstart"in window||navigator.maxTouchPoints>0;Xr in localStorage&&(n=localStorage[Xr]==="true");const t=new Promise(e=>{const s=()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",a),clearTimeout(h)},r=()=>{s(),localStorage[Xr]=!1,e(!1)},a=()=>{s(),localStorage[Xr]=!0,e(!0)},l=()=>{s(),localStorage[Xr]=n,e(n)};window.addEventListener("mousedown",r,!1),window.addEventListener("touchstart",a,!1);const h=setTimeout(l,1e4)});return{initial:n,promise:t}}function gS(n){let t=n,e=!1;const s=document.createElement("canvas"),r=s.getContext("2d");for(s.width=1,s.height=1;t>1024&&!e;){const a=document.createElement("canvas"),l=a.getContext("2d");a.width=t,a.height=t/2;try{l.fillStyle="white",l.fillRect(t-1,t/2-1,1,1),r.drawImage(a,t-1,t/2-1,1,1,0,0,1,1),r.getImageData(0,0,1,1).data[0]>0&&(e=!0)}catch{}a.width=0,a.height=0,e||(t/=2)}if(e)return t;throw new $t("Unable to detect system capabilities")}var _S=la({resolution:64,useXmpData:!0,blur:!1},{resolution:n=>{if(!n||!Se.isPowerOfTwo(n))throw new $t("EquirectangularAdapter resolution must be power of two.");return n}}),fa=class Og extends da{static withConfig(t){return[Og,t]}constructor(t,e){super(t),this.config=_S(e),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2}supportsTransition(){return!0}supportsPreload(){return!0}textureCoordsToSphericalCoords(t,e){if(Qe(t.textureX)||Qe(t.textureY))throw new $t("Texture position is missing 'textureX' or 'textureY'");const s=(t.textureX+e.croppedX)/e.fullWidth*Math.PI*2,r=(t.textureY+e.croppedY)/e.fullHeight*Math.PI;return{yaw:s>=Math.PI?s-Math.PI:s+Math.PI,pitch:Math.PI/2-r}}sphericalCoordsToTextureCoords(t,e){const s=t.yaw/Math.PI/2*e.fullWidth,r=t.pitch/Math.PI*e.fullHeight;let a=Math.round(t.yaw<Math.PI?s+e.fullWidth/2:s-e.fullWidth/2)-e.croppedX,l=Math.round(e.fullHeight/2-r)-e.croppedY;return(a<0||a>e.croppedWidth||l<0||l>e.croppedHeight)&&(a=l=void 0),{textureX:a,textureY:l}}async loadTexture(t,e=!0,s,r=this.config.useXmpData){if(typeof t!="string"&&(typeof t!="object"||!t.path))return Promise.reject(new $t("Invalid panorama url, are you using the right adapter?"));let a;typeof t=="string"?a={path:t,data:s}:a={data:s,...t};const l=await this.viewer.textureLoader.loadFile(a.path,e?m=>this.viewer.textureLoader.dispatchProgress(m):null,a.path),h=r?await this.loadXMP(l):null,u=await this.viewer.textureLoader.blobToImage(l);typeof a.data=="function"&&(a.data=a.data(u,h));const d=sf(u.width,u.height,a.data,h),p=this.createEquirectangularTexture(u);return{panorama:t,texture:p,panoData:d,cacheKey:a.path}}async loadXMP(t){const e=await this.loadBlobAsString(t),s=e.indexOf("<x:xmpmeta");if(s===-1)return null;const r=e.indexOf("</x:xmpmeta>",s);if(r===-1)return null;const a=e.substring(s,r);return a.includes("GPano:")?{fullWidth:Mn(a,"FullPanoWidthPixels"),fullHeight:Mn(a,"FullPanoHeightPixels"),croppedWidth:Mn(a,"CroppedAreaImageWidthPixels"),croppedHeight:Mn(a,"CroppedAreaImageHeightPixels"),croppedX:Mn(a,"CroppedAreaLeftPixels"),croppedY:Mn(a,"CroppedAreaTopPixels"),poseHeading:Mn(a,"PoseHeadingDegrees",!1),posePitch:Mn(a,"PosePitchDegrees",!1),poseRoll:Mn(a,"PoseRollDegrees",!1),initialHeading:Mn(a,"InitialViewHeadingDegrees",!1),initialPitch:Mn(a,"InitialViewPitchDegrees",!1),initialFov:Mn(a,"InitialHorizontalFOVDegrees",!1)}:null}loadBlobAsString(t){return new Promise((e,s)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=s,r.readAsText(t)})}createEquirectangularTexture(t){if(this.config.blur||t.width>cn.maxTextureWidth){const e=Math.min(1,cn.maxCanvasWidth/t.width),s=new OffscreenCanvas(Math.floor(t.width*e),Math.floor(t.height*e)),r=s.getContext("2d");return this.config.blur&&(r.filter=`blur(${s.width/2048}px)`),r.drawImage(t,0,0,s.width,s.height),Xc(s)}return Xc(t)}createMesh(t){const e=t.croppedX/t.fullWidth*2*Math.PI,s=t.croppedWidth/t.fullWidth*2*Math.PI,r=t.croppedY/t.fullHeight*Math.PI,a=t.croppedHeight/t.fullHeight*Math.PI,l=new Ys(ps,Math.round(this.SPHERE_SEGMENTS/(2*Math.PI)*s),Math.round(this.SPHERE_HORIZONTAL_SEGMENTS/Math.PI*a),-Math.PI/2+e,s,r,a).scale(-1,1,1),h=new Bi({depthTest:!1,depthWrite:!1});return new pn(l,h)}setTexture(t,e){t.material.map=e.texture}setTextureOpacity(t,e){t.material.opacity=e,t.material.transparent=e<1}disposeTexture({texture:t}){t.dispose()}disposeMesh(t){t.geometry.dispose(),t.material.dispose()}};fa.id="equirectangular",fa.VERSION="5.14.0",fa.supportsDownload=!0;var Jc=fa,np=class Ng extends Jc{static withConfig(t){return[Ng,t]}constructor(t,e){super(t,{resolution:e?.resolution??64,useXmpData:!1})}async loadTexture(t,e){const s=await super.loadTexture(t,e,null,!1);return s.panoData=null,s}createMesh(){const t=new Ys(ps,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS).scale(-1,1,1).toNonIndexed(),e=t.getAttribute("uv"),s=t.getAttribute("normal");for(let a=0;a<e.count;a++)for(let l=0;l<3;l++){const h=a*3+l,u=s.getX(h),d=s.getY(h),p=s.getZ(h),m=.947;if(a<e.count/6){const _=u===0&&p===0?1:Math.acos(d)/Math.sqrt(u*u+p*p)*(2/Math.PI);e.setXY(h,u*(m/4)*_+1/4,p*(m/2)*_+1/2)}else{const _=u===0&&p===0?1:Math.acos(-d)/Math.sqrt(u*u+p*p)*(2/Math.PI);e.setXY(h,-u*(m/4)*_+3/4,p*(m/2)*_+1/2)}}t.rotateX(-Math.PI/2),t.rotateY(Math.PI);const r=new Bi({depthTest:!1,depthWrite:!1});return new pn(t,r)}};np.id="dual-fisheye",np.VERSION="5.14.0";var ms=class Bg{constructor(t,e){this.parent=t,this.children=[],this.state={visible:!0},this.viewer=t instanceof Bg?t.viewer:t,this.container=document.createElement(e.tagName??"div"),this.container.className=e.className||"",this.parent.children.push(this),this.parent.container.appendChild(this.container)}destroy(){this.parent.container.removeChild(this.container);const t=this.parent.children.indexOf(this);t!==-1&&this.parent.children.splice(t,1),this.children.slice().forEach(e=>e.destroy()),this.children.length=0}toggle(t=!this.isVisible()){t?this.show():this.hide()}hide(t){this.container.style.display="none",this.state.visible=!1}show(t){this.container.style.display="",this.state.visible=!0}isVisible(){return this.state.visible}},vS=la({id:null,tagName:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),hn=class extends ms{constructor(n,t){super(n,{tagName:t.tagName,className:`psv-button ${t.hoverScale?"psv-button--hover-scale":""} ${t.className||""}`}),this.state={visible:!0,enabled:!0,supported:!0,collapsed:!1,active:!1,width:0},this.config=vS(t),t.id||(this.config.id=this.constructor.id),t.icon&&this.__setIcon(t.icon),this.state.width=this.container.offsetWidth,this.config.title?this.container.title=this.viewer.config.lang[this.config.title]??this.config.title:this.id&&this.id in this.viewer.config.lang&&(this.container.title=this.viewer.config.lang[this.id]),t.tabbable&&(this.container.tabIndex=0),this.container.addEventListener("click",e=>{this.state.enabled&&this.onClick(),e.stopPropagation()}),this.container.addEventListener("keydown",e=>{e.key===qe.Enter&&this.state.enabled&&(this.onClick(),e.stopPropagation())})}get id(){return this.config.id}get title(){return this.container.title}get content(){return this.container.innerHTML}get width(){return this.state.width}get collapsable(){return this.config.collapsable}show(n=!0){this.isVisible()||(this.state.visible=!0,this.state.collapsed||(this.container.style.display=""),n&&this.viewer.navbar.autoSize())}hide(n=!0){this.isVisible()&&(this.state.visible=!1,this.container.style.display="none",n&&this.viewer.navbar.autoSize())}checkSupported(){Hc(this.isSupported(),(n,t)=>{this.state&&(this.state.supported=n,t?n||this.hide():this.toggle(n))})}autoSize(){}isSupported(){return!0}toggleActive(n=!this.state.active){n!==this.state.active&&(this.state.active=n,ea(this.container,"psv-button--active",this.state.active),this.config.iconActive&&this.__setIcon(this.state.active?this.config.iconActive:this.config.icon))}disable(){this.container.classList.add("psv-button--disabled"),this.state.enabled=!1}enable(){this.container.classList.remove("psv-button--disabled"),this.state.enabled=!0}collapse(){this.state.collapsed=!0,this.container.style.display="none"}uncollapse(){this.state.collapsed=!1,this.state.visible&&(this.container.style.display="")}__setIcon(n){this.container.innerHTML=n,Nc(this.container.querySelector("svg"),"psv-button-svg")}},yS=class extends hn{constructor(n,t){super(n,{id:t.id??`psvButton-${Math.random().toString(36).substring(2)}`,className:`psv-custom-button ${t.className||""}`,hoverScale:!1,collapsable:t.collapsable!==!1,tabbable:t.tabbable!==!1,title:t.title}),this.customOnClick=t.onClick,t.content&&(typeof t.content=="string"?this.container.innerHTML=t.content:(this.container.classList.add("psv-custom-button--no-padding"),t.content.style.height="100%",t.content.attachViewer?.(this.viewer),this.container.appendChild(t.content))),this.state.width=this.container.offsetWidth,t.disabled&&this.disable(),t.visible===!1&&this.hide()}onClick(){this.customOnClick?.(this.viewer)}},Yr=class extends hn{constructor(n){super(n,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.info}),this.mode=0,this.viewer.addEventListener(Fr.type,this),this.viewer.addEventListener(Gr.type,this),this.viewer.addEventListener(Wi.type,this),this.viewer.addEventListener(Xi.type,this),this.viewer.addEventListener(mn.type,this)}destroy(){this.viewer.removeEventListener(Fr.type,this),this.viewer.removeEventListener(Gr.type,this),this.viewer.removeEventListener(Wi.type,this),this.viewer.removeEventListener(Xi.type,this),this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){if(n instanceof mn){n.containsOptions("description")&&this.autoSize(!0);return}if(!this.mode)return;let t=!1;n instanceof Fr?t=this.mode===1:n instanceof Gr?t=this.mode===1&&n.notificationId!==Ke.DESCRIPTION:n instanceof Wi?t=this.mode===2:n instanceof Xi&&(t=this.mode===2&&n.panelId!==Ke.DESCRIPTION),t&&(this.toggleActive(!1),this.mode=0)}onClick(){this.mode?this.__close():this.__open()}hide(n){super.hide(n),this.mode&&this.__close()}autoSize(n=!1){if(n){const t=this.viewer.navbar.getButton("caption",!1),e=t&&!t.isVisible(),s=!!this.viewer.config.description;e||s?this.show(!1):this.hide(!1)}}__close(){switch(this.mode){case 1:this.viewer.notification.hide(Ke.DESCRIPTION);break;case 2:this.viewer.panel.hide(Ke.DESCRIPTION);break}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:Ke.DESCRIPTION,content:`${this.viewer.config.caption?`<p>${this.viewer.config.caption}</p>`:""}${this.viewer.config.description}`})):(this.mode=1,this.viewer.notification.show({id:Ke.DESCRIPTION,content:this.viewer.config.caption}))}};Yr.id="description";var ip=class extends hn{constructor(n){super(n,{tagName:"a",className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:Zn.download}),this.viewer.addEventListener(mn.type,this),this.viewer.addEventListener($s.type,this)}destroy(){this.viewer.removeEventListener(mn.type,this),this.viewer.removeEventListener($s.type,this),super.destroy()}handleEvent(n){n instanceof mn?(n.containsOptions("downloadUrl")&&this.checkSupported(),n.containsOptions("downloadUrl","downloadName")&&this.__update()):n instanceof $s&&this.__update()}onClick(){}checkSupported(){this.viewer.adapter.constructor.supportsDownload||this.viewer.config.downloadUrl?this.show():this.hide()}__update(){const n=this.container;n.href=this.viewer.config.downloadUrl||this.viewer.config.panorama,n.target="_blank",n.href.startsWith("data:")&&!this.viewer.config.downloadName?n.download="panorama."+n.href.substring(0,n.href.indexOf(";")).split("/").pop():n.download=this.viewer.config.downloadName||n.href.split("/").pop()}};ip.id="download";var sp=class extends hn{constructor(n){super(n,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.fullscreenIn,iconActive:Zn.fullscreenOut}),this.viewer.addEventListener(Br.type,this)}destroy(){this.viewer.removeEventListener(Br.type,this),super.destroy()}handleEvent(n){n instanceof Br&&this.toggleActive(n.fullscreenEnabled)}onClick(){this.viewer.toggleFullscreen()}};sp.id="fullscreen";var ES="psvButton",xS=(n,t)=>`
3863
3863
  <div class="psv-panel-menu psv-panel-menu--stripped">
3864
3864
  <h1 class="psv-panel-menu-title">${Zn.menu} ${t}</h1>
3865
3865
  <ul class="psv-panel-menu-list">
@@ -3871,24 +3871,24 @@ void main() {
3871
3871
  `).join("")}
3872
3872
  </ul>
3873
3873
  </div>
3874
- `,pa=class extends hn{constructor(n){super(n,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.menu}),this.viewer.addEventListener(Xi.type,this),this.viewer.addEventListener(Wi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Xi.type,this),this.viewer.removeEventListener(Wi.type,this),super.destroy()}handleEvent(n){n instanceof Xi?this.toggleActive(n.panelId===Ke.MENU):n instanceof Wi&&this.toggleActive(!1)}onClick(){this.state.active?this.__hideMenu():this.__showMenu()}hide(n){super.hide(n),this.__hideMenu()}show(n){super.show(n),this.state.active&&this.__showMenu()}__showMenu(){this.viewer.panel.show({id:Ke.MENU,content:xS(this.viewer.navbar.collapsed,this.viewer.config.lang.menu),noMargin:!0,clickHandler:n=>{const t=n?Bd(n,".psv-panel-menu-item"):void 0,e=t?t.dataset[ES]:void 0;e&&(this.viewer.navbar.getButton(e).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(Ke.MENU)}};pa.id="menu";function wS(n){let t=0;switch(n){case 0:t=90;break;case 1:t=-90;break;case 3:t=180;break;default:t=0;break}return Zn.arrow.replace("rotate(0",`rotate(${t}`)}var qr=class extends hn{constructor(n,t){super(n,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:wS(t)}),this.direction=t,this.handler=new ha,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown();break;case"mouseup":this.__onMouseUp();break;case"touchend":this.__onMouseUp();break;case"keydown":n.key===qe.Enter&&this.__onMouseDown();break;case"keyup":n.key===qe.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}__onMouseDown(){if(!this.state.enabled)return;const n={};switch(this.direction){case 0:n.pitch=!1;break;case 1:n.pitch=!0;break;case 3:n.yaw=!1;break;default:n.yaw=!0;break}this.viewer.stopAll(),this.viewer.dynamics.position.roll(n),this.handler.down()}__onMouseUp(){this.state.enabled&&this.handler.up(()=>{this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer()})}};qr.groupId="move";var rp=class extends qr{constructor(n){super(n,1)}};rp.id="moveDown";var op=class extends qr{constructor(n){super(n,2)}};op.id="moveLeft";var ap=class extends qr{constructor(n){super(n,3)}};ap.id="moveRight";var lp=class extends qr{constructor(n){super(n,0)}};lp.id="moveUp";var Kc=class extends hn{constructor(n,t,e){super(n,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:t}),this.direction=e,this.handler=new ha,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown();break;case"mouseup":this.__onMouseUp();break;case"touchend":this.__onMouseUp();break;case"keydown":n.key===qe.Enter&&this.__onMouseDown();break;case"keyup":n.key===qe.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}__onMouseDown(){this.state.enabled&&(this.viewer.dynamics.zoom.roll(this.direction===1),this.handler.down())}__onMouseUp(){this.state.enabled&&this.handler.up(()=>this.viewer.dynamics.zoom.stop())}};Kc.groupId="zoom";var cp=class extends Kc{constructor(n){super(n,Zn.zoomIn,0)}};cp.id="zoomIn";var hp=class extends Kc{constructor(n){super(n,Zn.zoomOut,1)}};hp.id="zoomOut";var $c=class extends hn{constructor(n){super(n,{className:"psv-zoom-range",hoverScale:!1,collapsable:!1,tabbable:!1}),this.zoomRange=document.createElement("div"),this.zoomRange.className="psv-zoom-range-line",this.container.appendChild(this.zoomRange),this.zoomValue=document.createElement("div"),this.zoomValue.className="psv-zoom-range-handle",this.zoomRange.appendChild(this.zoomValue),this.slider=new af(this.container,"HORIZONTAL",t=>this.__onSliderUpdate(t)),this.mediaMinWidth=parseInt(ei(this.container,"max-width"),10),this.viewer.addEventListener(Ei.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(Vr.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(Ei.type,this),this.viewer.removeEventListener(Vr.type,this),super.destroy()}handleEvent(n){n instanceof Ei?this.__moveZoomValue(n.zoomLevel):n instanceof Vr&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}autoSize(){this.state.supported&&(this.viewer.state.size.width<=this.mediaMinWidth&&this.state.visible?this.hide(!1):this.viewer.state.size.width>this.mediaMinWidth&&!this.state.visible&&this.show(!1))}__moveZoomValue(n){this.zoomValue.style.left=n/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"}__onSliderUpdate(n){n.mousedown&&this.viewer.zoom(n.value*100)}};$c.id="zoomRange",$c.groupId="zoom";var up=class extends cf{constructor(n){super(),this.viewer=n}init(){}destroy(){}},dp=class extends up{constructor(n,t){super(n),this.config=this.constructor.configParser(t)}setOption(n,t){this.setOptions({[n]:t})}setOptions(n){const t={...this.config,...n},e=this.constructor,s=e.configParser,r=e.readonlyOptions,a=e.id;for(let[l,h]of Object.entries(n)){if(!(l in s.defaults)){$e(`${a}: Unknown option "${l}"`);continue}if(r.includes(l)){$e(`${a}: Option "${l}" cannot be updated`);continue}l in s.parsers&&(h=s.parsers[l](h,{rawConfig:t,defValue:s.defaults[l]})),this.config[l]=h}}};dp.readonlyOptions=[];function th(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof up)return qc(t.id,t.VERSION,"5.14.0"),t}return null}var xi={panorama:null,container:null,adapter:[Jc,null],plugins:[],caption:null,description:null,downloadUrl:null,downloadName:null,loadingImg:null,loadingTxt:"",size:null,fisheye:0,minFov:30,maxFov:90,defaultZoomLvl:50,defaultYaw:0,defaultPitch:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,moveInertia:.8,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,panoData:null,requestHeaders:null,canvasBackground:"#000",defaultTransition:{speed:1500,rotation:!0,effect:"fade"},rendererParameters:{alpha:!0,antialias:!0},withCredentials:()=>!1,navbar:["zoom","move","download","description","caption","fullscreen"],lang:{zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right",description:"Description",download:"Download",fullscreen:"Fullscreen",loading:"Loading...",menu:"Menu",close:"Close",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama cannot be loaded",webglError:"Your browser does not seem to support WebGL"},keyboard:"fullscreen",keyboardActions:{[qe.ArrowUp]:"ROTATE_UP",[qe.ArrowDown]:"ROTATE_DOWN",[qe.ArrowRight]:"ROTATE_RIGHT",[qe.ArrowLeft]:"ROTATE_LEFT",[qe.PageUp]:"ZOOM_IN",[qe.PageDown]:"ZOOM_OUT",[qe.Plus]:"ZOOM_IN",[qe.Minus]:"ZOOM_OUT"}},fp={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},eh={container:n=>{if(!n)throw new te("No value given for container.");return n},adapter:(n,{defValue:t})=>{if(n?Array.isArray(n)?n=[ep(n[0]),n[1]]:n=[ep(n),null]:n=t,!n[0])throw new te("An undefined value was given for adapter.");if(!n[0].id)throw new te("Adapter has no id.");return n},defaultYaw:n=>ni(n),defaultPitch:n=>ni(n,!0),defaultZoomLvl:n=>we.clamp(n,0,100),minFov:(n,{rawConfig:t})=>(t.maxFov<n&&($e("maxFov cannot be lower than minFov"),n=t.maxFov),we.clamp(n,1,179)),maxFov:(n,{rawConfig:t})=>(n<t.minFov&&(n=t.minFov),we.clamp(n,1,179)),moveInertia:(n,{defValue:t})=>n===!0?t:n===!1?0:n,lang:n=>({...xi.lang,...n}),fisheye:n=>n===!0?1:n===!1?0:n,requestHeaders:n=>n&&typeof n=="object"?()=>n:typeof n=="function"?n:null,withCredentials:n=>typeof n=="boolean"?()=>n:typeof n=="function"?n:()=>!1,defaultTransition:(n,{defValue:t})=>n===null||n.speed===0?null:{...t,...n},rendererParameters:(n,{defValue:t})=>({...n,...t}),plugins:n=>n.map((t,e)=>{if(Array.isArray(t)?t=[th(t[0]),t[1]]:t=[th(t),null],!t[0])throw new te(`An undefined value was given for plugin ${e}.`);if(!t[0].id)throw new te(`Plugin ${e} has no id.`);return t}),navbar:n=>n===!1?null:n===!0?sa(xi.navbar):typeof n=="string"?n.split(/[ ,]/):n},SS=la(xi,eh),tr=class extends hn{constructor(n){super(n,{className:"psv-caption",hoverScale:!1,collapsable:!1,tabbable:!0}),this.contentWidth=0,this.state.width=0,this.contentElt=document.createElement("div"),this.contentElt.className="psv-caption-content",this.container.appendChild(this.contentElt),this.setCaption(this.viewer.config.caption)}hide(){this.contentElt.style.display="none",this.state.visible=!1}show(){this.contentElt.style.display="",this.state.visible=!0}onClick(){}setCaption(n){this.show(),this.contentElt.innerHTML=n??"",this.contentElt.innerHTML?this.contentWidth=this.contentElt.offsetWidth:this.contentWidth=0,this.autoSize()}autoSize(){this.toggle(this.container.offsetWidth>=this.contentWidth),this.__refreshButton()}__refreshButton(){this.viewer.navbar.getButton(Yr.id,!1)?.autoSize(!0)}};tr.id="caption";var nh={},ma={};function ih(n,t){if(!n.id)throw new te("Button id is required");if(nh[n.id]=n,n.groupId&&(ma[n.groupId]=ma[n.groupId]||[]).push(n),t){const e=xi.navbar;switch(t){case"start":e.unshift(n.id);break;case"end":e.push(n.id);break;default:{const[s,r]=t.split(":"),a=e.indexOf(s);if(!s||!r||a===-1)throw new te(`Invalid defaultPosition ${t}`);e.splice(a+(r==="right"?1:0),0,n.id)}}}}[hp,$c,cp,Yr,tr,ip,sp,op,ap,lp,rp].forEach(n=>ih(n));var MS=class extends ms{constructor(n){super(n,{className:`psv-navbar ${kr}`}),this.collapsed=[],this.state.visible=!1}show(){this.viewer.container.classList.add("psv--has-navbar"),this.container.classList.add("psv-navbar--open"),this.state.visible=!0}hide(){this.viewer.container.classList.remove("psv--has-navbar"),this.container.classList.remove("psv-navbar--open"),this.state.visible=!1}setButtons(n){this.children.slice().forEach(t=>t.destroy()),this.children.length=0,n.indexOf(tr.id)!==-1&&n.indexOf(Yr.id)===-1&&n.splice(n.indexOf(tr.id),0,Yr.id),n.forEach(t=>{typeof t=="object"?new yS(this,t):nh[t]?new nh[t](this):ma[t]?ma[t].forEach(e=>{new e(this)}):$e(`Unknown button ${t}`)}),new pa(this),this.children.forEach(t=>{t instanceof hn&&t.checkSupported()}),this.autoSize()}setCaption(n){this.children.some(t=>t instanceof tr?(t.setCaption(n),!0):!1)}getButton(n,t=!0){const e=this.children.find(s=>s instanceof hn&&s.id===n);return!e&&t&&$e(`button "${n}" not found in the navbar`),e}focusButton(n){this.isVisible()&&(this.getButton(n,!1)?.container||this.container.firstElementChild)?.focus()}autoSize(){this.children.forEach(s=>{s instanceof hn&&s.autoSize()});const n=this.container.offsetWidth;let t=0;const e=[];this.children.forEach(s=>{s.isVisible()&&s instanceof hn&&(t+=s.width,s.collapsable&&e.push(s))}),t!==0&&(n<t&&e.length>0?(e.forEach(s=>s.collapse()),this.collapsed=e,this.getButton(pa.id).show(!1)):n>=t&&this.collapsed.length>0&&(this.collapsed.forEach(s=>s.uncollapse()),this.collapsed=[],this.getButton(pa.id).hide(!1)),this.getButton(tr.id,!1)?.autoSize())}};Hi.enabled=!1;var er={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){Hi.enabled&&($e("ThreeJS cache should be disabled"),Hi.enabled=!1),!this.purgeInterval&&this.enabled&&(this.purgeInterval=setInterval(()=>this.purge(),60*1e3))},add(n,t,e){this.enabled&&t&&(this.items[t]=this.items[t]??{files:{},lastAccess:null},this.items[t].files[n]=e,this.items[t].lastAccess=Date.now())},get(n,t){if(this.enabled&&t&&this.items[t])return this.items[t].lastAccess=Date.now(),this.items[t].files[n]},remove(n,t){this.enabled&&t&&this.items[t]&&(delete this.items[t].files[n],Object.keys(this.items[t].files).length===0&&delete this.items[t])},purge(){Object.entries(this.items).sort(([,n],[,t])=>t.lastAccess-n.lastAccess).forEach(([n,{lastAccess:t}],e)=>{e>0&&(Date.now()-t>=this.ttl*1e3||e>=this.maxItems)&&delete this.items[n]})}},TS=class extends ms{constructor(n){super(n,{className:"psv-loader-container"}),this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.size=this.loader.offsetWidth,this.canvas=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.canvas.setAttribute("class","psv-loader-canvas"),this.canvas.setAttribute("viewBox",`0 0 ${this.size} ${this.size}`),this.loader.appendChild(this.canvas),this.textColor=ei(this.loader,"color"),this.color=ei(this.canvas,"color"),this.border=parseInt(ei(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(ei(this.loader,"--psv-loader-tickness"),10);const t=this.size/2;this.canvas.innerHTML=`
3874
+ `,pa=class extends hn{constructor(n){super(n,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Zn.menu}),this.viewer.addEventListener(Xi.type,this),this.viewer.addEventListener(Wi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Xi.type,this),this.viewer.removeEventListener(Wi.type,this),super.destroy()}handleEvent(n){n instanceof Xi?this.toggleActive(n.panelId===Ke.MENU):n instanceof Wi&&this.toggleActive(!1)}onClick(){this.state.active?this.__hideMenu():this.__showMenu()}hide(n){super.hide(n),this.__hideMenu()}show(n){super.show(n),this.state.active&&this.__showMenu()}__showMenu(){this.viewer.panel.show({id:Ke.MENU,content:xS(this.viewer.navbar.collapsed,this.viewer.config.lang.menu),noMargin:!0,clickHandler:n=>{const t=n?Bd(n,".psv-panel-menu-item"):void 0,e=t?t.dataset[ES]:void 0;e&&(this.viewer.navbar.getButton(e).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(Ke.MENU)}};pa.id="menu";function wS(n){let t=0;switch(n){case 0:t=90;break;case 1:t=-90;break;case 3:t=180;break;default:t=0;break}return Zn.arrow.replace("rotate(0",`rotate(${t}`)}var qr=class extends hn{constructor(n,t){super(n,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:wS(t)}),this.direction=t,this.handler=new ha,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown();break;case"mouseup":this.__onMouseUp();break;case"touchend":this.__onMouseUp();break;case"keydown":n.key===qe.Enter&&this.__onMouseDown();break;case"keyup":n.key===qe.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}__onMouseDown(){if(!this.state.enabled)return;const n={};switch(this.direction){case 0:n.pitch=!1;break;case 1:n.pitch=!0;break;case 3:n.yaw=!1;break;default:n.yaw=!0;break}this.viewer.stopAll(),this.viewer.dynamics.position.roll(n),this.handler.down()}__onMouseUp(){this.state.enabled&&this.handler.up(()=>{this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer()})}};qr.groupId="move";var rp=class extends qr{constructor(n){super(n,1)}};rp.id="moveDown";var op=class extends qr{constructor(n){super(n,2)}};op.id="moveLeft";var ap=class extends qr{constructor(n){super(n,3)}};ap.id="moveRight";var lp=class extends qr{constructor(n){super(n,0)}};lp.id="moveUp";var Kc=class extends hn{constructor(n,t,e){super(n,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:t}),this.direction=e,this.handler=new ha,this.container.addEventListener("mousedown",this),this.container.addEventListener("keydown",this),this.container.addEventListener("keyup",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this)}destroy(){this.__onMouseUp(),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown();break;case"mouseup":this.__onMouseUp();break;case"touchend":this.__onMouseUp();break;case"keydown":n.key===qe.Enter&&this.__onMouseDown();break;case"keyup":n.key===qe.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}__onMouseDown(){this.state.enabled&&(this.viewer.dynamics.zoom.roll(this.direction===1),this.handler.down())}__onMouseUp(){this.state.enabled&&this.handler.up(()=>this.viewer.dynamics.zoom.stop())}};Kc.groupId="zoom";var cp=class extends Kc{constructor(n){super(n,Zn.zoomIn,0)}};cp.id="zoomIn";var hp=class extends Kc{constructor(n){super(n,Zn.zoomOut,1)}};hp.id="zoomOut";var $c=class extends hn{constructor(n){super(n,{className:"psv-zoom-range",hoverScale:!1,collapsable:!1,tabbable:!1}),this.zoomRange=document.createElement("div"),this.zoomRange.className="psv-zoom-range-line",this.container.appendChild(this.zoomRange),this.zoomValue=document.createElement("div"),this.zoomValue.className="psv-zoom-range-handle",this.zoomRange.appendChild(this.zoomValue),this.slider=new af(this.container,"HORIZONTAL",t=>this.__onSliderUpdate(t)),this.mediaMinWidth=parseInt(ei(this.container,"max-width"),10),this.viewer.addEventListener(Ei.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(Vr.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(Ei.type,this),this.viewer.removeEventListener(Vr.type,this),super.destroy()}handleEvent(n){n instanceof Ei?this.__moveZoomValue(n.zoomLevel):n instanceof Vr&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return ra(cn.isTouchEnabled)}autoSize(){this.state.supported&&(this.viewer.state.size.width<=this.mediaMinWidth&&this.state.visible?this.hide(!1):this.viewer.state.size.width>this.mediaMinWidth&&!this.state.visible&&this.show(!1))}__moveZoomValue(n){this.zoomValue.style.left=n/100*this.zoomRange.offsetWidth-this.zoomValue.offsetWidth/2+"px"}__onSliderUpdate(n){n.mousedown&&this.viewer.zoom(n.value*100)}};$c.id="zoomRange",$c.groupId="zoom";var up=class extends cf{constructor(n){super(),this.viewer=n}init(){}destroy(){}},dp=class extends up{constructor(n,t){super(n),this.config=this.constructor.configParser(t)}setOption(n,t){this.setOptions({[n]:t})}setOptions(n){const t={...this.config,...n},e=this.constructor,s=e.configParser,r=e.readonlyOptions,a=e.id;for(let[l,h]of Object.entries(n)){if(!(l in s.defaults)){$e(`${a}: Unknown option "${l}"`);continue}if(r.includes(l)){$e(`${a}: Option "${l}" cannot be updated`);continue}l in s.parsers&&(h=s.parsers[l](h,{rawConfig:t,defValue:s.defaults[l]})),this.config[l]=h}}};dp.readonlyOptions=[];function th(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof up)return qc(t.id,t.VERSION,"5.14.0"),t}return null}var xi={panorama:null,container:null,adapter:[Jc,null],plugins:[],caption:null,description:null,downloadUrl:null,downloadName:null,loadingImg:null,loadingTxt:"",size:null,fisheye:0,minFov:30,maxFov:90,defaultZoomLvl:50,defaultYaw:0,defaultPitch:0,sphereCorrection:null,moveSpeed:1,zoomSpeed:1,moveInertia:.8,mousewheel:!0,mousemove:!0,mousewheelCtrlKey:!1,touchmoveTwoFingers:!1,panoData:null,requestHeaders:null,canvasBackground:"#000",defaultTransition:{speed:1500,rotation:!0,effect:"fade"},rendererParameters:{alpha:!0,antialias:!0},withCredentials:()=>!1,navbar:["zoom","move","download","description","caption","fullscreen"],lang:{zoom:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in",moveUp:"Move up",moveDown:"Move down",moveLeft:"Move left",moveRight:"Move right",description:"Description",download:"Download",fullscreen:"Fullscreen",loading:"Loading...",menu:"Menu",close:"Close",twoFingers:"Use two fingers to navigate",ctrlZoom:"Use ctrl + scroll to zoom the image",loadError:"The panorama cannot be loaded",webglError:"Your browser does not seem to support WebGL"},keyboard:"fullscreen",keyboardActions:{[qe.ArrowUp]:"ROTATE_UP",[qe.ArrowDown]:"ROTATE_DOWN",[qe.ArrowRight]:"ROTATE_RIGHT",[qe.ArrowLeft]:"ROTATE_LEFT",[qe.PageUp]:"ZOOM_IN",[qe.PageDown]:"ZOOM_OUT",[qe.Plus]:"ZOOM_IN",[qe.Minus]:"ZOOM_OUT"}},fp={panorama:"Use setPanorama method to change the panorama",panoData:"Use setPanorama method to change the panorama",container:"Cannot change viewer container",adapter:"Cannot change adapter",plugins:"Cannot change plugins"},eh={container:n=>{if(!n)throw new $t("No value given for container.");return n},adapter:(n,{defValue:t})=>{if(n?Array.isArray(n)?n=[ep(n[0]),n[1]]:n=[ep(n),null]:n=t,!n[0])throw new $t("An undefined value was given for adapter.");if(!n[0].id)throw new $t("Adapter has no id.");return n},defaultYaw:n=>ni(n),defaultPitch:n=>ni(n,!0),defaultZoomLvl:n=>Se.clamp(n,0,100),minFov:(n,{rawConfig:t})=>(t.maxFov<n&&($e("maxFov cannot be lower than minFov"),n=t.maxFov),Se.clamp(n,1,179)),maxFov:(n,{rawConfig:t})=>(n<t.minFov&&(n=t.minFov),Se.clamp(n,1,179)),moveInertia:(n,{defValue:t})=>n===!0?t:n===!1?0:n,lang:n=>({...xi.lang,...n}),fisheye:n=>n===!0?1:n===!1?0:n,requestHeaders:n=>n&&typeof n=="object"?()=>n:typeof n=="function"?n:null,withCredentials:n=>typeof n=="boolean"?()=>n:typeof n=="function"?n:()=>!1,defaultTransition:(n,{defValue:t})=>n===null||n.speed===0?null:{...t,...n},rendererParameters:(n,{defValue:t})=>({...n,...t}),plugins:n=>n.map((t,e)=>{if(Array.isArray(t)?t=[th(t[0]),t[1]]:t=[th(t),null],!t[0])throw new $t(`An undefined value was given for plugin ${e}.`);if(!t[0].id)throw new $t(`Plugin ${e} has no id.`);return t}),navbar:n=>n===!1?null:n===!0?sa(xi.navbar):typeof n=="string"?n.split(/[ ,]/):n},SS=la(xi,eh),tr=class extends hn{constructor(n){super(n,{className:"psv-caption",hoverScale:!1,collapsable:!1,tabbable:!0}),this.contentWidth=0,this.state.width=0,this.contentElt=document.createElement("div"),this.contentElt.className="psv-caption-content",this.container.appendChild(this.contentElt),this.setCaption(this.viewer.config.caption)}hide(){this.contentElt.style.display="none",this.state.visible=!1}show(){this.contentElt.style.display="",this.state.visible=!0}onClick(){}setCaption(n){this.show(),this.contentElt.innerHTML=n??"",this.contentElt.innerHTML?this.contentWidth=this.contentElt.offsetWidth:this.contentWidth=0,this.autoSize()}autoSize(){this.toggle(this.container.offsetWidth>=this.contentWidth),this.__refreshButton()}__refreshButton(){this.viewer.navbar.getButton(Yr.id,!1)?.autoSize(!0)}};tr.id="caption";var nh={},ma={};function ih(n,t){if(!n.id)throw new $t("Button id is required");if(nh[n.id]=n,n.groupId&&(ma[n.groupId]=ma[n.groupId]||[]).push(n),t){const e=xi.navbar;switch(t){case"start":e.unshift(n.id);break;case"end":e.push(n.id);break;default:{const[s,r]=t.split(":"),a=e.indexOf(s);if(!s||!r||a===-1)throw new $t(`Invalid defaultPosition ${t}`);e.splice(a+(r==="right"?1:0),0,n.id)}}}}[hp,$c,cp,Yr,tr,ip,sp,op,ap,lp,rp].forEach(n=>ih(n));var MS=class extends ms{constructor(n){super(n,{className:`psv-navbar ${kr}`}),this.collapsed=[],this.state.visible=!1}show(){this.viewer.container.classList.add("psv--has-navbar"),this.container.classList.add("psv-navbar--open"),this.state.visible=!0}hide(){this.viewer.container.classList.remove("psv--has-navbar"),this.container.classList.remove("psv-navbar--open"),this.state.visible=!1}setButtons(n){this.children.slice().forEach(t=>t.destroy()),this.children.length=0,n.indexOf(tr.id)!==-1&&n.indexOf(Yr.id)===-1&&n.splice(n.indexOf(tr.id),0,Yr.id),n.forEach(t=>{typeof t=="object"?new yS(this,t):nh[t]?new nh[t](this):ma[t]?ma[t].forEach(e=>{new e(this)}):$e(`Unknown button ${t}`)}),new pa(this),this.children.forEach(t=>{t instanceof hn&&t.checkSupported()}),this.autoSize()}setCaption(n){this.children.some(t=>t instanceof tr?(t.setCaption(n),!0):!1)}getButton(n,t=!0){const e=this.children.find(s=>s instanceof hn&&s.id===n);return!e&&t&&$e(`button "${n}" not found in the navbar`),e}focusButton(n){this.isVisible()&&(this.getButton(n,!1)?.container||this.container.firstElementChild)?.focus()}autoSize(){this.children.forEach(s=>{s instanceof hn&&s.autoSize()});const n=this.container.offsetWidth;let t=0;const e=[];this.children.forEach(s=>{s.isVisible()&&s instanceof hn&&(t+=s.width,s.collapsable&&e.push(s))}),t!==0&&(n<t&&e.length>0?(e.forEach(s=>s.collapse()),this.collapsed=e,this.getButton(pa.id).show(!1)):n>=t&&this.collapsed.length>0&&(this.collapsed.forEach(s=>s.uncollapse()),this.collapsed=[],this.getButton(pa.id).hide(!1)),this.getButton(tr.id,!1)?.autoSize())}};Hi.enabled=!1;var er={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){Hi.enabled&&($e("ThreeJS cache should be disabled"),Hi.enabled=!1),!this.purgeInterval&&this.enabled&&(this.purgeInterval=setInterval(()=>this.purge(),60*1e3))},add(n,t,e){this.enabled&&t&&(this.items[t]=this.items[t]??{files:{},lastAccess:null},this.items[t].files[n]=e,this.items[t].lastAccess=Date.now())},get(n,t){if(this.enabled&&t&&this.items[t])return this.items[t].lastAccess=Date.now(),this.items[t].files[n]},remove(n,t){this.enabled&&t&&this.items[t]&&(delete this.items[t].files[n],Object.keys(this.items[t].files).length===0&&delete this.items[t])},purge(){Object.entries(this.items).sort(([,n],[,t])=>t.lastAccess-n.lastAccess).forEach(([n,{lastAccess:t}],e)=>{e>0&&(Date.now()-t>=this.ttl*1e3||e>=this.maxItems)&&delete this.items[n]})}},TS=class extends ms{constructor(n){super(n,{className:"psv-loader-container"}),this.loader=document.createElement("div"),this.loader.className="psv-loader",this.container.appendChild(this.loader),this.size=this.loader.offsetWidth,this.canvas=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.canvas.setAttribute("class","psv-loader-canvas"),this.canvas.setAttribute("viewBox",`0 0 ${this.size} ${this.size}`),this.loader.appendChild(this.canvas),this.textColor=ei(this.loader,"color"),this.color=ei(this.canvas,"color"),this.border=parseInt(ei(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(ei(this.loader,"--psv-loader-tickness"),10);const t=this.size/2;this.canvas.innerHTML=`
3875
3875
  <circle cx="${t}" cy="${t}" r="${t}" fill="${this.color}"/>
3876
3876
  <path d="" fill="none" stroke="${this.textColor}" stroke-width="${this.thickness}" stroke-linecap="round"/>
3877
- `,this.viewer.addEventListener(mn.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){n instanceof mn&&n.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(n){this.container.classList.remove("psv-loader--undefined");const t=we.clamp(n,0,99.999)/100*Math.PI*2,e=this.size/2,s=e,r=this.thickness/2+this.border,a=(this.size-this.thickness)/2-this.border,l=Math.sin(t)*a+e,h=-Math.cos(t)*a+e,u=n>50?"1":"0";this.canvas.querySelector("path").setAttributeNS(null,"d",`M ${s} ${r} A ${a} ${a} 0 ${u} 1 ${l} ${h}`)}showUndefined(){this.show(),this.setProgress(25),this.container.classList.add("psv-loader--undefined")}__updateContent(){const n=this.loader.querySelector(".psv-loader-image, .psv-loader-text");n&&this.loader.removeChild(n);let t;if(this.viewer.config.loadingImg?(t=document.createElement("img"),t.className="psv-loader-image",t.src=this.viewer.config.loadingImg):this.viewer.config.loadingTxt!==null&&(t=document.createElement("div"),t.className="psv-loader-text",t.innerHTML=this.viewer.config.loadingTxt||this.viewer.config.lang.loading),t){const e=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}}},bS=class extends ms{constructor(n){super(n,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",()=>this.hide())}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new te("Notification cannot be toggled")}show(n){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),typeof n=="string"&&(n={content:n}),this.state.contentId=n.id||null,this.content.innerHTML=n.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new Gr(this.state.contentId)),n.timeout&&(this.state.timeout=setTimeout(()=>this.hide(this.state.contentId),n.timeout))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new Fr(t))}}},AS=class extends ms{constructor(n){super(n,{className:`psv-overlay ${kr}`}),this.state={visible:!1,contentId:null,dismissible:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(Zi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Zi.type,this),super.destroy()}handleEvent(n){n.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),n.stopPropagation()):n instanceof Zi&&this.isVisible()&&this.state.dismissible&&n.matches(qe.Escape)&&(this.hide(),n.preventDefault())}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new te("Overlay cannot be toggled")}show(n){typeof n=="string"&&(n={title:n}),this.state.contentId=n.id||null,this.state.dismissible=n.dismissible!==!1,this.image.innerHTML=n.image||"",this.title.innerHTML=n.title||"",this.text.innerHTML=n.text||"",super.show(),this.viewer.dispatchEvent(new Gf(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new wf(t))}}},CS=200,sh="psv-panel-content--no-interaction",PS=class extends ms{constructor(n){super(n,{className:`psv-panel ${kr}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const t=document.createElement("div");t.className="psv-panel-resizer",this.container.appendChild(t);const e=document.createElement("div");e.className="psv-panel-close-button",e.innerHTML=Zn.close,e.title=n.config.lang.close,this.container.appendChild(e),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),e.addEventListener("click",()=>this.hide()),t.addEventListener("mousedown",this),t.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(Zi.type,this)}destroy(){this.viewer.removeEventListener(Zi.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown(n);break;case"touchstart":this.__onTouchStart(n);break;case"mousemove":this.__onMouseMove(n);break;case"touchmove":this.__onTouchMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchend":this.__onTouchEnd(n);break;case Zi.type:this.__onKeyPress(n);break}}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new te("Panel cannot be toggled")}show(n){typeof n=="string"&&(n={content:n});const t=this.isVisible(n.id);this.state.contentId=n.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),n.id&&this.state.width[n.id]?this.container.style.width=this.state.width[n.id]:n.width?this.container.style.width=n.width:this.container.style.width=null,this.content.innerHTML=n.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),ea(this.content,"psv-panel-content--no-margin",n.noMargin===!0),n.clickHandler&&(this.state.clickHandler=e=>{n.clickHandler(na(e))},this.state.keyHandler=e=>{e.key===qe.Enter&&n.clickHandler(na(e))},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),t||setTimeout(()=>{this.content.querySelector("a,button,[tabindex]")?.focus()},300)),this.viewer.dispatchEvent(new Xi(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.viewer.dispatchEvent(new Wi(t))}}__onMouseDown(n){n.stopPropagation(),this.__startResize(n.clientX,n.clientY)}__onTouchStart(n){if(n.stopPropagation(),n.touches.length===1){const t=n.touches[0];this.__startResize(t.clientX,t.clientY)}}__onMouseUp(n){this.state.mousedown&&(n.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(sh))}__onTouchEnd(n){this.state.mousedown&&(n.stopPropagation(),n.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(sh)))}__onMouseMove(n){this.state.mousedown&&(n.stopPropagation(),this.__resize(n.clientX,n.clientY))}__onTouchMove(n){if(this.state.mousedown){const t=n.touches[0];this.__resize(t.clientX,t.clientY)}}__onKeyPress(n){this.isVisible()&&n.matches(qe.Escape)&&(this.hide(),n.preventDefault())}__startResize(n,t){this.state.mouseX=n,this.state.mouseY=t,this.state.mousedown=!0,this.content.classList.add(sh)}__resize(n,t){const e=n,s=t,r=Math.max(CS,this.container.offsetWidth-(e-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=r),this.container.style.width=r,this.state.mouseX=e,this.state.mouseY=s}},RS=class extends ms{constructor(n,t){super(n,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null,hideTimeout:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",e=>e.stopPropagation()),this.container.addEventListener("mousedown",e=>e.stopPropagation()),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(t)}handleEvent(n){n.type==="transitionend"&&this.__onTransitionEnd(n)}destroy(){clearTimeout(this.state.hideTimeout),delete this.state.data,super.destroy()}toggle(){throw new te("Tooltip cannot be toggled")}show(n){if(this.state.state!==0)throw new te("Initialized tooltip cannot be re-initialized");n.className&&Nc(this.container,n.className),n.style&&Object.assign(this.container.style,n.style),this.state.state=3,this.update(n.content,n),this.state.data=n.data,this.state.state=1,this.viewer.dispatchEvent(new Xf(this,this.state.data)),this.__waitImages()}update(n,t){this.content.innerHTML=n;const e=this.container.getBoundingClientRect();this.state.width=e.right-e.left,this.state.height=e.bottom-e.top,this.state.arrow=parseInt(ei(this.arrow,"border-top-width"),10),this.state.border=parseInt(ei(this.container,"border-top-left-radius"),10),this.move(t??this.state.config),this.__waitImages()}move(n){if(this.state.state!==1&&this.state.state!==3)throw new te("Uninitialized tooltip cannot be moved");n.box=n.box??this.state.config?.box??{width:0,height:0},this.state.config=n;const t=this.container,e=this.arrow,s={posClass:Kd(n.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(s,n);let r=null,a=null;if(s.top<0?r="bottom":s.top+s.height>this.viewer.state.size.height&&(r="top"),s.left<0?a="right":s.left+s.width>this.viewer.state.size.width&&(a="left"),a||r){const h=Wc(s.posClass);r&&(s.posClass[h?0:1]=r),a&&(s.posClass[h?1:0]=a),this.__computeTooltipPosition(s,n)}t.style.top=s.top+"px",t.style.left=s.left+"px",e.style.top=s.arrowTop+"px",e.style.left=s.arrowLeft+"px";const l=s.posClass.join("-");l!==this.state.pos&&(t.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=l,t.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new Tf(this.state.data));const n=parseFloat(ei(this.container,"transition-duration"));this.state.hideTimeout=setTimeout(()=>{this.destroy()},n*2)}__onTransitionEnd(n){if(n.propertyName==="transform")switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy();break}}__computeTooltipPosition(n,t){const e=this.state.arrow,s=t.top,r=n.height,a=t.left,l=n.width,h=e+this.state.border,u=t.box.width/2+e*2,d=t.box.height/2+e*2;switch(n.posClass.join("-")){case"top-left":n.top=s-d-r,n.left=a+h-l,n.arrowTop=r,n.arrowLeft=l-h-e;break;case"top-center":n.top=s-d-r,n.left=a-l/2,n.arrowTop=r,n.arrowLeft=l/2-e;break;case"top-right":n.top=s-d-r,n.left=a-h,n.arrowTop=r,n.arrowLeft=e;break;case"bottom-left":n.top=s+d,n.left=a+h-l,n.arrowTop=-e*2,n.arrowLeft=l-h-e;break;case"bottom-center":n.top=s+d,n.left=a-l/2,n.arrowTop=-e*2,n.arrowLeft=l/2-e;break;case"bottom-right":n.top=s+d,n.left=a-h,n.arrowTop=-e*2,n.arrowLeft=e;break;case"left-top":n.top=s+h-r,n.left=a-u-l,n.arrowTop=r-h-e,n.arrowLeft=l;break;case"center-left":n.top=s-r/2,n.left=a-u-l,n.arrowTop=r/2-e,n.arrowLeft=l;break;case"left-bottom":n.top=s-h,n.left=a-u-l,n.arrowTop=e,n.arrowLeft=l;break;case"right-top":n.top=s+h-r,n.left=a+u,n.arrowTop=r-h-e,n.arrowLeft=-e*2;break;case"center-right":n.top=s-r/2,n.left=a+u,n.arrowTop=r/2-e,n.arrowLeft=-e*2;break;case"right-bottom":n.top=s-h,n.left=a+u,n.arrowTop=e,n.arrowLeft=-e*2;break}}__waitImages(){const n=this.content.querySelectorAll("img");if(n.length>0){const t=[];n.forEach(e=>{e.complete||t.push(new Promise(s=>{e.onload=s,e.onerror=s}))}),t.length&&Promise.all(t).then(()=>{if(this.state.state===1||this.state.state===3){const e=this.container.getBoundingClientRect();this.state.width=e.right-e.left,this.state.height=e.bottom-e.top,this.move(this.state.config)}})}}},LS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/><!--Created by Shastry from the Noun Project--></svg>
3878
- `,Qr=class{constructor(n){this.viewer=n,this.config=n.config,this.state=n.state}destroy(){}},Xn=new q,ga=new Jn(0,0,0,"ZXY"),IS=class extends Qr{constructor(n){super(n)}fovToZoomLevel(n){const t=Math.round((n-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return we.clamp(t-2*(t-50),0,100)}zoomLevelToFov(n){return this.config.maxFov+n/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(n){return we.radToDeg(2*Math.atan(Math.tan(we.degToRad(n)/2)*this.state.aspect))}hFovToVFov(n){return we.radToDeg(2*Math.atan(Math.tan(we.degToRad(n)/2)/this.state.aspect))}getAnimationProperties(n,t,e){const s=!Qe(t),r=!Qe(e),a={};let l=null;if(s){const h=this.viewer.getPosition(),u=Ud(h.yaw,t.yaw);a.yaw={start:h.yaw,end:h.yaw+u},a.pitch={start:h.pitch,end:t.pitch},l=Zc(n,Od(h,t))}if(r){const h=this.viewer.getZoomLevel(),u=Math.abs(e-h);a.zoom={start:h,end:e},l===null&&(l=Zc(n,Math.PI/4*u/100))}return l===null?typeof n=="number"?l=n:l=Oc:l=Math.max(Oc,l),{duration:l,properties:a}}getTransitionOptions(n){let t;const e=this.config.defaultTransition??xi.defaultTransition;return n.transition===!1||n.transition===null?t=null:n.transition===!0?t={...e}:typeof n.transition=="object"?t={...e,...n.transition}:t=this.config.defaultTransition,t}textureCoordsToSphericalCoords(n){if(!this.state.textureData?.panoData)throw new te("Current adapter does not support texture coordinates or no texture has been loaded");const t=this.viewer.adapter.textureCoordsToSphericalCoords(n,this.state.textureData.panoData);return!ga.equals(this.viewer.renderer.panoramaPose)||!ga.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(t,Xn),Xn.applyEuler(this.viewer.renderer.panoramaPose),Xn.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(Xn)):t}sphericalCoordsToTextureCoords(n){if(!this.state.textureData?.panoData)throw new te("Current adapter does not support texture coordinates or no texture has been loaded");return(!ga.equals(this.viewer.renderer.panoramaPose)||!ga.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(n,Xn),Yc(Xn,this.viewer.renderer.sphereCorrection),Yc(Xn,this.viewer.renderer.panoramaPose),n=this.vector3ToSphericalCoords(Xn)),this.viewer.adapter.sphericalCoordsToTextureCoords(n,this.state.textureData.panoData)}sphericalCoordsToVector3(n,t,e=ps){return t||(t=new q),t.x=e*-Math.cos(n.pitch)*Math.sin(n.yaw),t.y=e*Math.sin(n.pitch),t.z=e*Math.cos(n.pitch)*Math.cos(n.yaw),t}vector3ToSphericalCoords(n){const t=Math.acos(n.y/Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)),e=Math.atan2(n.x,n.z);return{yaw:e<0?-e:Math.PI*2-e,pitch:Math.PI/2-t}}viewerCoordsToVector3(n){const t=this.viewer.renderer.getIntersections(n).filter(e=>e.object.userData[Vi]);return t.length?t[0].point:null}viewerCoordsToSphericalCoords(n){const t=this.viewerCoordsToVector3(n);return t?this.vector3ToSphericalCoords(t):null}vector3ToViewerCoords(n){const t=n.clone();return t.project(this.viewer.renderer.camera),{x:Math.round((t.x+1)/2*this.state.size.width),y:Math.round((1-t.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(n){return this.sphericalCoordsToVector3(n,Xn),this.vector3ToViewerCoords(Xn)}isPointVisible(n){let t,e;if(n instanceof q)t=n,e=this.vector3ToViewerCoords(n);else if(Gc(n))t=this.sphericalCoordsToVector3(n,Xn),e=this.vector3ToViewerCoords(t);else return!1;return t.dot(this.viewer.state.direction)>0&&e.x>=0&&e.x<=this.viewer.state.size.width&&e.y>=0&&e.y<=this.viewer.state.size.height}cleanPosition(n){if("yaw"in n||"pitch"in n){if(!("yaw"in n)||!("pitch"in n))throw new te("Position is missing 'yaw' or 'pitch'");return{yaw:ni(n.yaw),pitch:ni(n.pitch,!0)}}else return this.textureCoordsToSphericalCoords(n)}cleanSphereCorrection(n){return{pan:ni(n?.pan||0),tilt:ni(n?.tilt||0,!0),roll:ni(n?.roll||0,!0,!1)}}cleanPanoramaPose(n){return{pan:we.degToRad(n?.poseHeading||0),tilt:we.degToRad(n?.posePitch||0),roll:we.degToRad(n?.poseRoll||0)}}cleanPanoramaOptions(n,t){return t?.isEquirectangular&&(Qe(n.zoom)&&!Qe(t.initialFov)&&(n={...n,zoom:this.fovToZoomLevel(this.hFovToVFov(t.initialFov))}),Qe(n.position)&&!Qe(t.initialHeading)&&!Qe(t.initialPitch)&&(n={...n,position:{yaw:ni(t.initialHeading),pitch:ni(t.initialPitch,!0)}})),n}},DS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/><!--Created by AomAm from the Noun Project--></svg>
3877
+ `,this.viewer.addEventListener(mn.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){n instanceof mn&&n.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(n){this.container.classList.remove("psv-loader--undefined");const t=Se.clamp(n,0,99.999)/100*Math.PI*2,e=this.size/2,s=e,r=this.thickness/2+this.border,a=(this.size-this.thickness)/2-this.border,l=Math.sin(t)*a+e,h=-Math.cos(t)*a+e,u=n>50?"1":"0";this.canvas.querySelector("path").setAttributeNS(null,"d",`M ${s} ${r} A ${a} ${a} 0 ${u} 1 ${l} ${h}`)}showUndefined(){this.show(),this.setProgress(25),this.container.classList.add("psv-loader--undefined")}__updateContent(){const n=this.loader.querySelector(".psv-loader-image, .psv-loader-text");n&&this.loader.removeChild(n);let t;if(this.viewer.config.loadingImg?(t=document.createElement("img"),t.className="psv-loader-image",t.src=this.viewer.config.loadingImg):this.viewer.config.loadingTxt!==null&&(t=document.createElement("div"),t.className="psv-loader-text",t.innerHTML=this.viewer.config.loadingTxt||this.viewer.config.lang.loading),t){const e=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));t.style.maxWidth=e+"px",t.style.maxHeight=e+"px",this.loader.appendChild(t)}}},bS=class extends ms{constructor(n){super(n,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",()=>this.hide())}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new $t("Notification cannot be toggled")}show(n){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),typeof n=="string"&&(n={content:n}),this.state.contentId=n.id||null,this.content.innerHTML=n.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new Gr(this.state.contentId)),n.timeout&&(this.state.timeout=setTimeout(()=>this.hide(this.state.contentId),n.timeout))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new Fr(t))}}},AS=class extends ms{constructor(n){super(n,{className:`psv-overlay ${kr}`}),this.state={visible:!1,contentId:null,dismissible:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(Zi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Zi.type,this),super.destroy()}handleEvent(n){n.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),n.stopPropagation()):n instanceof Zi&&this.isVisible()&&this.state.dismissible&&n.matches(qe.Escape)&&(this.hide(),n.preventDefault())}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new $t("Overlay cannot be toggled")}show(n){typeof n=="string"&&(n={title:n}),this.state.contentId=n.id||null,this.state.dismissible=n.dismissible!==!1,this.image.innerHTML=n.image||"",this.title.innerHTML=n.title||"",this.text.innerHTML=n.text||"",super.show(),this.viewer.dispatchEvent(new Gf(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new wf(t))}}},CS=200,sh="psv-panel-content--no-interaction",PS=class extends ms{constructor(n){super(n,{className:`psv-panel ${kr}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const t=document.createElement("div");t.className="psv-panel-resizer",this.container.appendChild(t);const e=document.createElement("div");e.className="psv-panel-close-button",e.innerHTML=Zn.close,e.title=n.config.lang.close,this.container.appendChild(e),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),e.addEventListener("click",()=>this.hide()),t.addEventListener("mousedown",this),t.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(Zi.type,this)}destroy(){this.viewer.removeEventListener(Zi.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(n){switch(n.type){case"mousedown":this.__onMouseDown(n);break;case"touchstart":this.__onTouchStart(n);break;case"mousemove":this.__onMouseMove(n);break;case"touchmove":this.__onTouchMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchend":this.__onTouchEnd(n);break;case Zi.type:this.__onKeyPress(n);break}}isVisible(n){return this.state.visible&&(!n||!this.state.contentId||this.state.contentId===n)}toggle(){throw new $t("Panel cannot be toggled")}show(n){typeof n=="string"&&(n={content:n});const t=this.isVisible(n.id);this.state.contentId=n.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),n.id&&this.state.width[n.id]?this.container.style.width=this.state.width[n.id]:n.width?this.container.style.width=n.width:this.container.style.width=null,this.content.innerHTML=n.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),ea(this.content,"psv-panel-content--no-margin",n.noMargin===!0),n.clickHandler&&(this.state.clickHandler=e=>{n.clickHandler(na(e))},this.state.keyHandler=e=>{e.key===qe.Enter&&n.clickHandler(na(e))},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),t||setTimeout(()=>{this.content.querySelector("a,button,[tabindex]")?.focus()},300)),this.viewer.dispatchEvent(new Xi(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.viewer.dispatchEvent(new Wi(t))}}__onMouseDown(n){n.stopPropagation(),this.__startResize(n.clientX,n.clientY)}__onTouchStart(n){if(n.stopPropagation(),n.touches.length===1){const t=n.touches[0];this.__startResize(t.clientX,t.clientY)}}__onMouseUp(n){this.state.mousedown&&(n.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(sh))}__onTouchEnd(n){this.state.mousedown&&(n.stopPropagation(),n.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(sh)))}__onMouseMove(n){this.state.mousedown&&(n.stopPropagation(),this.__resize(n.clientX,n.clientY))}__onTouchMove(n){if(this.state.mousedown){const t=n.touches[0];this.__resize(t.clientX,t.clientY)}}__onKeyPress(n){this.isVisible()&&n.matches(qe.Escape)&&(this.hide(),n.preventDefault())}__startResize(n,t){this.state.mouseX=n,this.state.mouseY=t,this.state.mousedown=!0,this.content.classList.add(sh)}__resize(n,t){const e=n,s=t,r=Math.max(CS,this.container.offsetWidth-(e-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=r),this.container.style.width=r,this.state.mouseX=e,this.state.mouseY=s}},RS=class extends ms{constructor(n,t){super(n,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null,hideTimeout:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",e=>e.stopPropagation()),this.container.addEventListener("mousedown",e=>e.stopPropagation()),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(t)}handleEvent(n){n.type==="transitionend"&&this.__onTransitionEnd(n)}destroy(){clearTimeout(this.state.hideTimeout),delete this.state.data,super.destroy()}toggle(){throw new $t("Tooltip cannot be toggled")}show(n){if(this.state.state!==0)throw new $t("Initialized tooltip cannot be re-initialized");n.className&&Nc(this.container,n.className),n.style&&Object.assign(this.container.style,n.style),this.state.state=3,this.update(n.content,n),this.state.data=n.data,this.state.state=1,this.viewer.dispatchEvent(new Xf(this,this.state.data)),this.__waitImages()}update(n,t){this.content.innerHTML=n;const e=this.container.getBoundingClientRect();this.state.width=e.right-e.left,this.state.height=e.bottom-e.top,this.state.arrow=parseInt(ei(this.arrow,"border-top-width"),10),this.state.border=parseInt(ei(this.container,"border-top-left-radius"),10),this.move(t??this.state.config),this.__waitImages()}move(n){if(this.state.state!==1&&this.state.state!==3)throw new $t("Uninitialized tooltip cannot be moved");n.box=n.box??this.state.config?.box??{width:0,height:0},this.state.config=n;const t=this.container,e=this.arrow,s={posClass:Kd(n.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(s,n);let r=null,a=null;if(s.top<0?r="bottom":s.top+s.height>this.viewer.state.size.height&&(r="top"),s.left<0?a="right":s.left+s.width>this.viewer.state.size.width&&(a="left"),a||r){const h=Wc(s.posClass);r&&(s.posClass[h?0:1]=r),a&&(s.posClass[h?1:0]=a),this.__computeTooltipPosition(s,n)}t.style.top=s.top+"px",t.style.left=s.left+"px",e.style.top=s.arrowTop+"px",e.style.left=s.arrowLeft+"px";const l=s.posClass.join("-");l!==this.state.pos&&(t.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=l,t.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new Tf(this.state.data));const n=parseFloat(ei(this.container,"transition-duration"));this.state.hideTimeout=setTimeout(()=>{this.destroy()},n*2)}__onTransitionEnd(n){if(n.propertyName==="transform")switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy();break}}__computeTooltipPosition(n,t){const e=this.state.arrow,s=t.top,r=n.height,a=t.left,l=n.width,h=e+this.state.border,u=t.box.width/2+e*2,d=t.box.height/2+e*2;switch(n.posClass.join("-")){case"top-left":n.top=s-d-r,n.left=a+h-l,n.arrowTop=r,n.arrowLeft=l-h-e;break;case"top-center":n.top=s-d-r,n.left=a-l/2,n.arrowTop=r,n.arrowLeft=l/2-e;break;case"top-right":n.top=s-d-r,n.left=a-h,n.arrowTop=r,n.arrowLeft=e;break;case"bottom-left":n.top=s+d,n.left=a+h-l,n.arrowTop=-e*2,n.arrowLeft=l-h-e;break;case"bottom-center":n.top=s+d,n.left=a-l/2,n.arrowTop=-e*2,n.arrowLeft=l/2-e;break;case"bottom-right":n.top=s+d,n.left=a-h,n.arrowTop=-e*2,n.arrowLeft=e;break;case"left-top":n.top=s+h-r,n.left=a-u-l,n.arrowTop=r-h-e,n.arrowLeft=l;break;case"center-left":n.top=s-r/2,n.left=a-u-l,n.arrowTop=r/2-e,n.arrowLeft=l;break;case"left-bottom":n.top=s-h,n.left=a-u-l,n.arrowTop=e,n.arrowLeft=l;break;case"right-top":n.top=s+h-r,n.left=a+u,n.arrowTop=r-h-e,n.arrowLeft=-e*2;break;case"center-right":n.top=s-r/2,n.left=a+u,n.arrowTop=r/2-e,n.arrowLeft=-e*2;break;case"right-bottom":n.top=s-h,n.left=a+u,n.arrowTop=e,n.arrowLeft=-e*2;break}}__waitImages(){const n=this.content.querySelectorAll("img");if(n.length>0){const t=[];n.forEach(e=>{e.complete||t.push(new Promise(s=>{e.onload=s,e.onerror=s}))}),t.length&&Promise.all(t).then(()=>{if(this.state.state===1||this.state.state===3){const e=this.container.getBoundingClientRect();this.state.width=e.right-e.left,this.state.height=e.bottom-e.top,this.move(this.state.config)}})}}},LS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/><!--Created by Shastry from the Noun Project--></svg>
3878
+ `,Qr=class{constructor(n){this.viewer=n,this.config=n.config,this.state=n.state}destroy(){}},Xn=new q,ga=new Jn(0,0,0,"ZXY"),IS=class extends Qr{constructor(n){super(n)}fovToZoomLevel(n){const t=Math.round((n-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return Se.clamp(t-2*(t-50),0,100)}zoomLevelToFov(n){return this.config.maxFov+n/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(n){return Se.radToDeg(2*Math.atan(Math.tan(Se.degToRad(n)/2)*this.state.aspect))}hFovToVFov(n){return Se.radToDeg(2*Math.atan(Math.tan(Se.degToRad(n)/2)/this.state.aspect))}getAnimationProperties(n,t,e){const s=!Qe(t),r=!Qe(e),a={};let l=null;if(s){const h=this.viewer.getPosition(),u=Ud(h.yaw,t.yaw);a.yaw={start:h.yaw,end:h.yaw+u},a.pitch={start:h.pitch,end:t.pitch},l=Zc(n,Od(h,t))}if(r){const h=this.viewer.getZoomLevel(),u=Math.abs(e-h);a.zoom={start:h,end:e},l===null&&(l=Zc(n,Math.PI/4*u/100))}return l===null?typeof n=="number"?l=n:l=Oc:l=Math.max(Oc,l),{duration:l,properties:a}}getTransitionOptions(n){let t;const e=this.config.defaultTransition??xi.defaultTransition;return n.transition===!1||n.transition===null?t=null:n.transition===!0?t={...e}:typeof n.transition=="object"?t={...e,...n.transition}:t=this.config.defaultTransition,t}textureCoordsToSphericalCoords(n){if(!this.state.textureData?.panoData)throw new $t("Current adapter does not support texture coordinates or no texture has been loaded");const t=this.viewer.adapter.textureCoordsToSphericalCoords(n,this.state.textureData.panoData);return!ga.equals(this.viewer.renderer.panoramaPose)||!ga.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(t,Xn),Xn.applyEuler(this.viewer.renderer.panoramaPose),Xn.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(Xn)):t}sphericalCoordsToTextureCoords(n){if(!this.state.textureData?.panoData)throw new $t("Current adapter does not support texture coordinates or no texture has been loaded");return(!ga.equals(this.viewer.renderer.panoramaPose)||!ga.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(n,Xn),Yc(Xn,this.viewer.renderer.sphereCorrection),Yc(Xn,this.viewer.renderer.panoramaPose),n=this.vector3ToSphericalCoords(Xn)),this.viewer.adapter.sphericalCoordsToTextureCoords(n,this.state.textureData.panoData)}sphericalCoordsToVector3(n,t,e=ps){return t||(t=new q),t.x=e*-Math.cos(n.pitch)*Math.sin(n.yaw),t.y=e*Math.sin(n.pitch),t.z=e*Math.cos(n.pitch)*Math.cos(n.yaw),t}vector3ToSphericalCoords(n){const t=Math.acos(n.y/Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z)),e=Math.atan2(n.x,n.z);return{yaw:e<0?-e:Math.PI*2-e,pitch:Math.PI/2-t}}viewerCoordsToVector3(n){const t=this.viewer.renderer.getIntersections(n).filter(e=>e.object.userData[Vi]);return t.length?t[0].point:null}viewerCoordsToSphericalCoords(n){const t=this.viewerCoordsToVector3(n);return t?this.vector3ToSphericalCoords(t):null}vector3ToViewerCoords(n){const t=n.clone();return t.project(this.viewer.renderer.camera),{x:Math.round((t.x+1)/2*this.state.size.width),y:Math.round((1-t.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(n){return this.sphericalCoordsToVector3(n,Xn),this.vector3ToViewerCoords(Xn)}isPointVisible(n){let t,e;if(n instanceof q)t=n,e=this.vector3ToViewerCoords(n);else if(Gc(n))t=this.sphericalCoordsToVector3(n,Xn),e=this.vector3ToViewerCoords(t);else return!1;return t.dot(this.viewer.state.direction)>0&&e.x>=0&&e.x<=this.viewer.state.size.width&&e.y>=0&&e.y<=this.viewer.state.size.height}cleanPosition(n){if("yaw"in n||"pitch"in n){if(!("yaw"in n)||!("pitch"in n))throw new $t("Position is missing 'yaw' or 'pitch'");return{yaw:ni(n.yaw),pitch:ni(n.pitch,!0)}}else return this.textureCoordsToSphericalCoords(n)}cleanSphereCorrection(n){return{pan:ni(n?.pan||0),tilt:ni(n?.tilt||0,!0),roll:ni(n?.roll||0,!0,!1)}}cleanPanoramaPose(n){return{pan:Se.degToRad(n?.poseHeading||0),tilt:Se.degToRad(n?.posePitch||0),roll:Se.degToRad(n?.poseRoll||0)}}cleanPanoramaOptions(n,t){return t?.isEquirectangular&&(Qe(n.zoom)&&!Qe(t.initialFov)&&(n={...n,zoom:this.fovToZoomLevel(this.hFovToVFov(t.initialFov))}),Qe(n.position)&&!Qe(t.initialHeading)&&!Qe(t.initialPitch)&&(n={...n,position:{yaw:ni(t.initialHeading),pitch:ni(t.initialPitch,!0)}})),n}},DS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/><!--Created by AomAm from the Noun Project--></svg>
3879
3879
  `,kS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/><!-- Created by Icon Island from the Noun Project --></svg>
3880
- `,_a=class Fg{constructor(){this.$=Fg.IDLE}is(...t){return t.some(e=>this.$&e)}set(t){this.$=t}add(t){this.$|=t}remove(t){this.$&=~t}};_a.IDLE=0,_a.CLICK=1,_a.MOVING=2;var Ge=_a,US=class extends Qr{constructor(n){super(n),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new Ge,this.keyHandler=new ha,this.resizeObserver=new ResizeObserver(Wd(()=>this.viewer.autoSize(),50)),this.moveThreshold=Ad*cn.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(Nr.type,this),this.viewer.addEventListener(Zr.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(Nr.type,this),this.viewer.removeEventListener(Zr.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(n){switch(n.type){case"keydown":this.__onKeyDown(n);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchmove":this.__onTouchMove(n);break;case"touchend":this.__onTouchEnd(n);break;case"fullscreenchange":this.__onFullscreenChange();break;case Nr.type:this.__applyMoveDelta();break;case Zr.type:this.__clearMoveDelta();break}if(!Fd(n,"."+kr))switch(n.type){case"mousedown":this.__onMouseDown(n);break;case"touchstart":this.__onTouchStart(n);break;case"wheel":this.__onMouseWheel(n);break}}__onKeyDown(n){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=n.key===qe.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Ke.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new Zi(n.key,n))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[t,e]of Object.entries(this.config.keyboardActions))if(Fc(n,t)){if(typeof e=="function")e(this.viewer,n);else{switch(e!=="ZOOM_IN"&&e!=="ZOOM_OUT"&&this.viewer.stopAll(),e){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(e)}n.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(n=>{n==="ZOOM_IN"||n==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(n){this.step.add(Ge.CLICK),this.data.startMouseX=n.clientX,this.data.startMouseY=n.clientY,this.config.mousemove&&n.preventDefault()}__onMouseUp(n){this.step.is(Ge.CLICK,Ge.MOVING)&&this.__stopMove(n.clientX,n.clientY,n,n.button===2)}__onMouseMove(n){this.config.mousemove&&this.step.is(Ge.CLICK,Ge.MOVING)&&(n.preventDefault(),this.__doMove(n.clientX,n.clientY)),this.__handleObjectsEvents(n)}__onTouchStart(n){n.touches.length===1?(this.step.add(Ge.CLICK),this.data.startMouseX=n.touches[0].clientX,this.data.startMouseY=n.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const t=n.touches[0];this.__stopMove(t.clientX,t.clientY,n,!0),this.data.longtouchTimeout=null},Pd))):n.touches.length===2&&(this.step.set(Ge.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(n),n.preventDefault()))}__onTouchEnd(n){if(this.__cancelLongTouch(),this.step.is(Ge.CLICK,Ge.MOVING)){if(n.preventDefault(),this.__cancelTwoFingersOverlay(),n.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(n.touches.length===0){const t=n.changedTouches[0];this.__stopMove(t.clientX,t.clientY,n)}}}__onTouchMove(n){if(this.__cancelLongTouch(),!!this.config.mousemove)if(n.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(Ge.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Ke.TWO_FINGERS,image:DS,title:this.config.lang.twoFingers})},Rd));else if(this.step.is(Ge.CLICK,Ge.MOVING)){n.preventDefault();const t=n.touches[0];this.__doMove(t.clientX,t.clientY)}}else this.__doMoveZoom(n),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Ke.TWO_FINGERS))}__onMouseWheel(n){if(!this.config.mousewheel||!n.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Ke.CTRL_ZOOM,image:kS,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Ke.CTRL_ZOOM),Ld);return}n.preventDefault(),n.stopPropagation();const t=n.deltaY/Math.abs(n.deltaY)*5*this.config.zoomSpeed;t!==0&&this.viewer.dynamics.zoom.step(-t,5)}__onFullscreenChange(){const n=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(n?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new Br(n))}__resetMove(){this.step.set(Ge.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(n){this.viewer.stopAll(),this.__resetMove();const t=Bc(n);this.step.set(Ge.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=t}__stopMove(n,t,e,s=!1){this.step.is(Ge.CLICK)&&!this.__moveThresholdReached(n,t)&&this.__doClick(n,t,e,s),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(n,t,e,s=!1){const r=this.viewer.container.getBoundingClientRect(),a=n-r.left,l=t-r.top,h=this.viewer.renderer.getIntersections({x:a,y:l}),u=h.find(d=>d.object.userData[Vi]);if(u){const d=this.viewer.dataHelper.vector3ToSphericalCoords(u.point),p={rightclick:s,originalEvent:e,target:na(e),clientX:n,clientY:t,viewerX:a,viewerY:l,yaw:d.yaw,pitch:d.pitch,objects:h.map(m=>m.object).filter(m=>!m.userData[Vi])};try{const m=this.viewer.dataHelper.sphericalCoordsToTextureCoords(p);Object.assign(p,m)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-p.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-p.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new vf(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new mf(p)),this.data.dblclickData=sa(p),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},Cd))}}__handleObjectsEvents(n){if(!Xd(this.state.objectsObservers)&&n.composedPath().includes(this.viewer.container)){const t=zd(this.viewer.container),e={x:n.clientX-t.x,y:n.clientY-t.y},s=this.viewer.renderer.getIntersections(e),r=(a,l,h)=>{this.viewer.dispatchEvent(new h(n,a,e,l))};for(const[a,l]of Object.entries(this.state.objectsObservers)){const h=s.find(u=>u.object.userData[a]);h?(l&&h.object!==l&&(r(l,a,jc),this.state.objectsObservers[a]=null),l?r(h.object,a,tp):(this.state.objectsObservers[a]=h.object,r(h.object,a,Jf))):l&&(r(l,a,jc),this.state.objectsObservers[a]=null)}}}__doMove(n,t){if(this.step.is(Ge.CLICK)&&this.__moveThresholdReached(n,t))this.viewer.stopAll(),this.__resetMove(),this.step.set(Ge.MOVING),this.data.mouseX=n,this.data.mouseY=t,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(Ge.MOVING)){const e=(n-this.data.mouseX)*Math.cos(this.state.roll)-(t-this.data.mouseY)*Math.sin(this.state.roll),s=(t-this.data.mouseY)*Math.cos(this.state.roll)+(n-this.data.mouseX)*Math.sin(this.state.roll),r={yaw:this.config.moveSpeed*(e/this.state.size.width)*we.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(s/this.state.size.height)*we.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=r.yaw,this.data.moveDelta.pitch+=r.pitch,this.data.mouseX=n,this.data.mouseY=t}}__moveThresholdReached(n,t){return Math.abs(n-this.data.startMouseX)>=this.moveThreshold||Math.abs(t-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(n){if(this.step.is(Ge.MOVING)){n.preventDefault();const t=Bc(n);this.__doMove(t.center.x,t.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((t.distance-this.data.pinchDist)/cn.pixelRatio),this.data.pinchDist=t.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const t=this.viewer.getPosition();this.viewer.rotate({yaw:t.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:t.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const t=this.viewer.getZoomLevel();this.viewer.zoom(t+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Se.enabled=!1;var va=new be,pp=new Oe,mp=new ks,OS=class extends Qr{constructor(n){super(n),this.frustumNeedsUpdate=!0,this.renderer=new Jw(this.config.rendererParameters),this.renderer.setPixelRatio(cn.pixelRatio),this.renderer.outputColorSpace=is,this.renderer.toneMapping=nu,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new xc,this.camera=new In(50,16/9,.1,2*ps),this.camera.matrixAutoUpdate=!1;const t=new pn(new Ys(ps).scale(-1,1,1),new Bi({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));t.userData={[Vi]:!0},this.scene.add(t),this.raycaster=new q0,this.frustum=new Sc,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",e=>e.preventDefault()),this.viewer.addEventListener(Wr.type,this),this.viewer.addEventListener(Ei.type,this),this.viewer.addEventListener(zr.type,this),this.viewer.addEventListener(Hr.type,this),this.viewer.addEventListener(mn.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(n=>this.__renderLoop(n))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(Wr.type,this),this.viewer.removeEventListener(Ei.type,this),this.viewer.removeEventListener(zr.type,this),this.viewer.removeEventListener(Hr.type,this),this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){switch(n.type){case Wr.type:this.__onSizeUpdated();break;case Ei.type:this.__onZoomUpdated();break;case zr.type:this.__onPositionUpdated();break;case Hr.type:this.__onPositionUpdated();break;case mn.type:n.containsOptions("fisheye")&&this.__onPositionUpdated(),n.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(n){n?this.customRenderer=n(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(n){const t=this.timestamp?n-this.timestamp:0;this.timestamp=n,this.viewer.dispatchEvent(new Nr(n,t)),this.viewer.dynamics.update(t),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new zf))}setTexture(n){this.meshContainer||(this.meshContainer=new zi,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(n.panoData),this.viewer.adapter.setTexture(this.mesh,n,!1),this.meshContainer.add(this.mesh),this.state.textureData=n,this.viewer.needsUpdate()}setPanoramaPose(n,t=this.mesh){const e=this.viewer.dataHelper.cleanPanoramaPose(n);t.rotation.set(e.tilt,e.pan,e.roll,"YXZ")}setSphereCorrection(n,t=this.meshContainer){const e=this.viewer.dataHelper.cleanSphereCorrection(n);t.rotation.set(e.tilt,e.pan,e.roll,"YXZ")}transition(n,t,e){const s=e.effect==="fade"||e.rotation,r=!Qe(t.position),a=!Qe(t.zoom),l=new Qc(r?this.viewer.dataHelper.cleanPosition(t.position):void 0,t.zoom);this.viewer.dispatchEvent(l);const h=new zi,u=this.viewer.adapter.createMesh(n.panoData);if(this.viewer.adapter.setTexture(u,n,!0),this.viewer.adapter.setTextureOpacity(u,0),this.setPanoramaPose(n.panoData,u),this.setSphereCorrection(t.sphereCorrection,h),r&&!e.rotation){const _=this.viewer.getPosition(),E=new q(0,1,0);h.rotateOnWorldAxis(E,l.position.yaw-_.yaw);const S=new q(0,1,0).cross(this.camera.getWorldDirection(new q)).normalize();h.rotateOnWorldAxis(S,l.position.pitch-_.pitch)}h.add(u),this.scene.add(h),this.renderer.setRenderTarget(new Ii),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:d,properties:p}=this.viewer.dataHelper.getAnimationProperties(e.speed,e.rotation?l.position:null,s?l.zoomLevel:null),m=new ca({properties:{...p,opacity:{start:0,end:1}},duration:d,easing:"inOutCubic",onTick:_=>{switch(e.effect){case"fade":this.viewer.adapter.setTextureOpacity(u,_.opacity);break;case"black":case"white":_.opacity<.5?this.renderer.toneMappingExposure=e.effect==="black"?we.mapLinear(_.opacity,0,.5,1,0):we.mapLinear(_.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=e.effect==="black"?we.mapLinear(_.opacity,.5,1,0,1):we.mapLinear(_.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(u,1),a&&!s&&this.viewer.dynamics.zoom.setValue(l.zoomLevel));break}r&&e.rotation&&this.viewer.dynamics.position.setValue({yaw:_.yaw,pitch:_.pitch}),a&&s&&this.viewer.dynamics.zoom.setValue(_.zoom),this.viewer.needsUpdate()}});return m.then(_=>{h.remove(u),this.scene.remove(h),_?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=u,this.meshContainer.add(u),this.state.textureData=n,this.setPanoramaPose(n.panoData),this.setSphereCorrection(t.sphereCorrection),r&&!e.rotation&&this.viewer.rotate(t.position)):(this.viewer.adapter.disposeTexture(n),this.viewer.adapter.disposeMesh(u))}),m}getIntersections(n){va.x=2*n.x/this.state.size.width-1,va.y=-2*n.y/this.state.size.height+1,this.raycaster.setFromCamera(va,this.camera);const t=this.raycaster.intersectObjects(this.scene.children,!0).filter(e=>e.object.visible).filter(e=>e.object.isMesh&&!!e.object.userData);return this.customRenderer?.getIntersections&&t.push(...this.customRenderer.getIntersections(this.raycaster,va)),t}isObjectVisible(n){if(!n)return!1;if(this.frustumNeedsUpdate&&(pp.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(pp),this.frustumNeedsUpdate=!1),n.isVector3)return this.frustum.containsPoint(n);if(n.isMesh&&n.geometry){const t=n;return t.geometry.boundingBox||t.geometry.computeBoundingBox(),mp.copy(t.geometry.boundingBox).applyMatrix4(t.matrixWorld),this.frustum.intersectsBox(mp)}else return n.isObject3D?this.frustum.intersectsObject(n):!1}addObject(n){this.scene.add(n)}removeObject(n){this.scene.remove(n)}cleanScene(n){const t=e=>{e.map?.dispose(),e.uniforms&&Object.values(e.uniforms).forEach(s=>{s.value?.dispose?.()}),e.dispose()};n.traverse(e=>{e.geometry?.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(s=>{t(s)}):t(e.material)),e instanceof xc||e.dispose?.(),e!==n&&this.cleanScene(e)})}},NS=class extends Z0{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(n,t,e,s){const r=this._abortController.signal,a=super.load(n,u=>{h(),t(u)},e,u=>{if(h(),r.aborted){const d=new Error;d.name="AbortError",d.message="The operation was aborted.",s(d)}else s(u)});function l(){a.src=""}function h(){r.removeEventListener("abort",l,!1)}return r.addEventListener("abort",l,!1),a}},BS=class extends Qr{constructor(n){super(n),this.fileLoader=new W0,this.fileLoader.setResponseType("blob"),this.imageLoader=new NS}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(n,t,e){const s=er.get(n,e);if(s){if(s instanceof Blob)return t?.(100),Promise.resolve(s);er.remove(n,e)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(n)),this.fileLoader.setWithCredentials(this.config.withCredentials(n));let r=0;return t?.(r),this.fileLoader.loadAsync(n,a=>{if(a.lengthComputable){const l=a.loaded/a.total*100;l>r&&(r=l,t?.(r))}}).then(a=>(r=100,t?.(r),er.add(n,e,a),a))}loadImage(n,t,e){const s=er.get(n,e);return s?(t?.(100),s instanceof Blob?this.blobToImage(s):Promise.resolve(s)):!t&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(n)),this.imageLoader.loadAsync(n).then(r=>(er.add(n,e,r),r))):this.loadFile(n,t,e).then(r=>this.blobToImage(r))}blobToImage(n){return new Promise((t,e)=>{const s=document.createElement("img");s.onload=()=>{URL.revokeObjectURL(s.src),t(s)},s.onerror=e,s.src=URL.createObjectURL(n)})}preloadPanorama(n){return this.viewer.adapter.supportsPreload(n)?this.viewer.adapter.loadTexture(n,!1):Promise.reject(new te("Current adapter does not support preload"))}dispatchProgress(n){this.viewer.loader.setProgress(n),this.viewer.dispatchEvent(new Cf(Math.round(n)))}},FS=class extends Qr{constructor(n){super(n),this.zoom=new Or(t=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(t),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Ei(t))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new rf(t=>{this.viewer.dataHelper.sphericalCoordsToVector3(t,this.viewer.state.direction),this.viewer.dispatchEvent(new zr(t))},{yaw:new Or(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new Or(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new Or(t=>{this.viewer.state.roll=t,this.viewer.dispatchEvent(new Hr(t))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(we.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(we.degToRad(this.config.moveSpeed*50))}update(n){this.zoom.update(n),this.position.update(n),this.roll.update(n)}},zS=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new q(0,0,ps),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},HS=class extends cf{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=Nd(t.container),!this.parent)throw new te('"container" element not found.');this.parent[Vi]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),nf(this.parent),ef(this.container,"core"),this.state=new zS,this.config=SS(t),this.__setSize(this.config.size),this.overlay=new AS(this);try{cn.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}er.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new OS(this),this.textureLoader=new BS(this),this.eventsHandler=new US(this),this.dataHelper=new IS(this),this.dynamics=new FS(this),this.adapter.init?.(),this.loader=new TS(this),this.navbar=new MS(this),this.panel=new PS(this),this.notification=new bS(this),this.autoSize(),this.setCursor(null),Hc(cn.isTouchEnabled,e=>{ea(this.container,"psv--is-touch",e)}),this.config.plugins.forEach(([e,s])=>{this.plugins[e.id]=new e(this,s)});for(const e of Object.values(this.plugins))e.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[t,e]of Object.entries(this.plugins))e.destroy(),delete this.plugins[t];this.children.slice().forEach(t=>t.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[Vi]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new Vr)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=th(t);return e?this.plugins[e.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Hd(this.parent,cn.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(t){t?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new Wr(this.getSize())),this.navbar.autoSize())}setPanorama(t,e={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const s=this.dataHelper.getTransitionOptions(e);e.showLoader===void 0&&(e.showLoader=!0),e.caption===void 0&&(e.caption=this.config.caption),e.description===void 0&&(e.description=this.config.description),!e.panoData&&typeof this.config.panoData=="function"&&(e.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description,this.config.sphereCorrection=e.sphereCorrection,(typeof this.config.panoData!="function"||typeof e.panoData=="function")&&(this.config.panoData=e.panoData);const r=l=>{if(Qd(l))return!1;if(this.loader.hide(),this.state.loadingPromise=null,l)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(l),this.dispatchEvent(new Df(t,l)),l;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(e.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new Rf(t));const a=this.adapter.loadTexture(this.config.panorama,!0,e.panoData).then(l=>{if(l.panorama!==this.config.panorama)throw this.adapter.disposeTexture(l),Vc();const h=this.dataHelper.cleanPanoramaOptions(e,l.panoData);return(!Qe(h.zoom)||!Qe(h.position))&&this.stopAll(),{textureData:l,cleanOptions:h}});return!s||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=a.then(({textureData:l,cleanOptions:h})=>{this.renderer.show(),this.renderer.setTexture(l),this.renderer.setPanoramaPose(l.panoData),this.renderer.setSphereCorrection(e.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new $s(l)),Qe(h.zoom)||this.zoom(h.zoom),Qe(h.position)||this.rotate(h.position)}).then(()=>r(),l=>r(l)):this.state.loadingPromise=a.then(({textureData:l,cleanOptions:h})=>(this.loader.hide(),this.dispatchEvent(new $s(l)),this.state.transitionAnimation=this.renderer.transition(l,h,s),this.state.transitionAnimation)).then(l=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new Uf(l)),!l)throw Vc()}).then(()=>r(),l=>r(l)),this.state.loadingPromise}setOptions(t){const e={...this.config,...t};for(let[s,r]of Object.entries(t)){if(!(s in xi)){$e(`Unknown option ${s}`);continue}if(s in fp){$e(fp[s]);continue}switch(s in eh&&(r=eh[s](r,{rawConfig:e,defValue:xi[s]})),this.config[s]=r,s){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Ei(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new mn(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Ke.ERROR,image:LS,title:t,dismissible:!1})}hideError(){this.overlay.hide(Ke.ERROR)}rotate(t){const e=new ff(this.dataHelper.cleanPosition(t));this.dispatchEvent(e),!e.defaultPrevented&&this.dynamics.position.setValue(e.position)}zoom(t){this.dynamics.zoom.setValue(t)}zoomIn(t=1){this.dynamics.zoom.step(t)}zoomOut(t=1){this.dynamics.zoom.step(-t)}animate(t){const e=Gc(t),s=!Qe(t.zoom),r=new Qc(e?this.dataHelper.cleanPosition(t):void 0,t.zoom);if(this.dispatchEvent(r),r.defaultPrevented)return;this.stopAll();const{duration:a,properties:l}=this.dataHelper.getAnimationProperties(t.speed,r.position,r.zoomLevel);return a?(this.state.animation=new ca({properties:l,duration:a,easing:t.easing||"inOutSine",onTick:h=>{e&&this.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),s&&this.dynamics.zoom.setValue(h.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(e&&this.rotate(r.position),s&&this.zoom(r.zoomLevel),new ca(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(t){this.__setSize(t),this.autoSize()}__setSize(t){["width","height"].forEach(e=>{t?.[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])})}enterFullscreen(){this.isFullscreenEnabled()||Vd(this.parent,cn.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Gd(cn.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new RS(this,t)}setCursor(t){this.state.cursorOverride=t,t?this.container.style.cursor=t:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(t){this.state.objectsObservers[t]||(this.state.objectsObservers[t]=null)}unobserveObjects(t){delete this.state.objectsObservers[t]}stopAll(){return this.dispatchEvent(new Zr),this.disableIdleTimer(),this.stopAnimation()}};/*!
3880
+ `,_a=class Fg{constructor(){this.$=Fg.IDLE}is(...t){return t.some(e=>this.$&e)}set(t){this.$=t}add(t){this.$|=t}remove(t){this.$&=~t}};_a.IDLE=0,_a.CLICK=1,_a.MOVING=2;var Ge=_a,US=class extends Qr{constructor(n){super(n),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new Ge,this.keyHandler=new ha,this.resizeObserver=new ResizeObserver(Wd(()=>this.viewer.autoSize(),50)),this.moveThreshold=Ad*cn.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(Nr.type,this),this.viewer.addEventListener(Zr.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(Nr.type,this),this.viewer.removeEventListener(Zr.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(n){switch(n.type){case"keydown":this.__onKeyDown(n);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(n);break;case"mouseup":this.__onMouseUp(n);break;case"touchmove":this.__onTouchMove(n);break;case"touchend":this.__onTouchEnd(n);break;case"fullscreenchange":this.__onFullscreenChange();break;case Nr.type:this.__applyMoveDelta();break;case Zr.type:this.__clearMoveDelta();break}if(!Fd(n,"."+kr))switch(n.type){case"mousedown":this.__onMouseDown(n);break;case"touchstart":this.__onTouchStart(n);break;case"wheel":this.__onMouseWheel(n);break}}__onKeyDown(n){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=n.key===qe.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Ke.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new Zi(n.key,n))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[t,e]of Object.entries(this.config.keyboardActions))if(Fc(n,t)){if(typeof e=="function")e(this.viewer,n);else{switch(e!=="ZOOM_IN"&&e!=="ZOOM_OUT"&&this.viewer.stopAll(),e){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(e)}n.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(n=>{n==="ZOOM_IN"||n==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(n){this.step.add(Ge.CLICK),this.data.startMouseX=n.clientX,this.data.startMouseY=n.clientY,this.config.mousemove&&n.preventDefault()}__onMouseUp(n){this.step.is(Ge.CLICK,Ge.MOVING)&&this.__stopMove(n.clientX,n.clientY,n,n.button===2)}__onMouseMove(n){this.config.mousemove&&this.step.is(Ge.CLICK,Ge.MOVING)&&(n.preventDefault(),this.__doMove(n.clientX,n.clientY)),this.__handleObjectsEvents(n)}__onTouchStart(n){n.touches.length===1?(this.step.add(Ge.CLICK),this.data.startMouseX=n.touches[0].clientX,this.data.startMouseY=n.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const t=n.touches[0];this.__stopMove(t.clientX,t.clientY,n,!0),this.data.longtouchTimeout=null},Pd))):n.touches.length===2&&(this.step.set(Ge.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(n),n.preventDefault()))}__onTouchEnd(n){if(this.__cancelLongTouch(),this.step.is(Ge.CLICK,Ge.MOVING)){if(n.preventDefault(),this.__cancelTwoFingersOverlay(),n.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(n.touches.length===0){const t=n.changedTouches[0];this.__stopMove(t.clientX,t.clientY,n)}}}__onTouchMove(n){if(this.__cancelLongTouch(),!!this.config.mousemove)if(n.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(Ge.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Ke.TWO_FINGERS,image:DS,title:this.config.lang.twoFingers})},Rd));else if(this.step.is(Ge.CLICK,Ge.MOVING)){n.preventDefault();const t=n.touches[0];this.__doMove(t.clientX,t.clientY)}}else this.__doMoveZoom(n),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Ke.TWO_FINGERS))}__onMouseWheel(n){if(!this.config.mousewheel||!n.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Ke.CTRL_ZOOM,image:kS,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Ke.CTRL_ZOOM),Ld);return}n.preventDefault(),n.stopPropagation();const t=n.deltaY/Math.abs(n.deltaY)*5*this.config.zoomSpeed;t!==0&&this.viewer.dynamics.zoom.step(-t,5)}__onFullscreenChange(){const n=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(n?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new Br(n))}__resetMove(){this.step.set(Ge.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(n){this.viewer.stopAll(),this.__resetMove();const t=Bc(n);this.step.set(Ge.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=t}__stopMove(n,t,e,s=!1){this.step.is(Ge.CLICK)&&!this.__moveThresholdReached(n,t)&&this.__doClick(n,t,e,s),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(n,t,e,s=!1){const r=this.viewer.container.getBoundingClientRect(),a=n-r.left,l=t-r.top,h=this.viewer.renderer.getIntersections({x:a,y:l}),u=h.find(d=>d.object.userData[Vi]);if(u){const d=this.viewer.dataHelper.vector3ToSphericalCoords(u.point),p={rightclick:s,originalEvent:e,target:na(e),clientX:n,clientY:t,viewerX:a,viewerY:l,yaw:d.yaw,pitch:d.pitch,objects:h.map(m=>m.object).filter(m=>!m.userData[Vi])};try{const m=this.viewer.dataHelper.sphericalCoordsToTextureCoords(p);Object.assign(p,m)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-p.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-p.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new vf(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new mf(p)),this.data.dblclickData=sa(p),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},Cd))}}__handleObjectsEvents(n){if(!Xd(this.state.objectsObservers)&&n.composedPath().includes(this.viewer.container)){const t=zd(this.viewer.container),e={x:n.clientX-t.x,y:n.clientY-t.y},s=this.viewer.renderer.getIntersections(e),r=(a,l,h)=>{this.viewer.dispatchEvent(new h(n,a,e,l))};for(const[a,l]of Object.entries(this.state.objectsObservers)){const h=s.find(u=>u.object.userData[a]);h?(l&&h.object!==l&&(r(l,a,jc),this.state.objectsObservers[a]=null),l?r(h.object,a,tp):(this.state.objectsObservers[a]=h.object,r(h.object,a,Jf))):l&&(r(l,a,jc),this.state.objectsObservers[a]=null)}}}__doMove(n,t){if(this.step.is(Ge.CLICK)&&this.__moveThresholdReached(n,t))this.viewer.stopAll(),this.__resetMove(),this.step.set(Ge.MOVING),this.data.mouseX=n,this.data.mouseY=t,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(Ge.MOVING)){const e=(n-this.data.mouseX)*Math.cos(this.state.roll)-(t-this.data.mouseY)*Math.sin(this.state.roll),s=(t-this.data.mouseY)*Math.cos(this.state.roll)+(n-this.data.mouseX)*Math.sin(this.state.roll),r={yaw:this.config.moveSpeed*(e/this.state.size.width)*Se.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(s/this.state.size.height)*Se.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=r.yaw,this.data.moveDelta.pitch+=r.pitch,this.data.mouseX=n,this.data.mouseY=t}}__moveThresholdReached(n,t){return Math.abs(n-this.data.startMouseX)>=this.moveThreshold||Math.abs(t-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(n){if(this.step.is(Ge.MOVING)){n.preventDefault();const t=Bc(n);this.__doMove(t.center.x,t.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((t.distance-this.data.pinchDist)/cn.pixelRatio),this.data.pinchDist=t.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const t=this.viewer.getPosition();this.viewer.rotate({yaw:t.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:t.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const t=this.viewer.getZoomLevel();this.viewer.zoom(t+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Me.enabled=!1;var va=new Ae,pp=new Oe,mp=new ks,OS=class extends Qr{constructor(n){super(n),this.frustumNeedsUpdate=!0,this.renderer=new Jw(this.config.rendererParameters),this.renderer.setPixelRatio(cn.pixelRatio),this.renderer.outputColorSpace=is,this.renderer.toneMapping=nu,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new xc,this.camera=new In(50,16/9,.1,2*ps),this.camera.matrixAutoUpdate=!1;const t=new pn(new Ys(ps).scale(-1,1,1),new Bi({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));t.userData={[Vi]:!0},this.scene.add(t),this.raycaster=new q0,this.frustum=new Sc,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",e=>e.preventDefault()),this.viewer.addEventListener(Wr.type,this),this.viewer.addEventListener(Ei.type,this),this.viewer.addEventListener(zr.type,this),this.viewer.addEventListener(Hr.type,this),this.viewer.addEventListener(mn.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(n=>this.__renderLoop(n))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(Wr.type,this),this.viewer.removeEventListener(Ei.type,this),this.viewer.removeEventListener(zr.type,this),this.viewer.removeEventListener(Hr.type,this),this.viewer.removeEventListener(mn.type,this),super.destroy()}handleEvent(n){switch(n.type){case Wr.type:this.__onSizeUpdated();break;case Ei.type:this.__onZoomUpdated();break;case zr.type:this.__onPositionUpdated();break;case Hr.type:this.__onPositionUpdated();break;case mn.type:n.containsOptions("fisheye")&&this.__onPositionUpdated(),n.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(n){n?this.customRenderer=n(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(n){const t=this.timestamp?n-this.timestamp:0;this.timestamp=n,this.viewer.dispatchEvent(new Nr(n,t)),this.viewer.dynamics.update(t),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new zf))}setTexture(n){this.meshContainer||(this.meshContainer=new zi,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(n.panoData),this.viewer.adapter.setTexture(this.mesh,n,!1),this.meshContainer.add(this.mesh),this.state.textureData=n,this.viewer.needsUpdate()}setPanoramaPose(n,t=this.mesh){const e=this.viewer.dataHelper.cleanPanoramaPose(n);t.rotation.set(e.tilt,e.pan,e.roll,"YXZ")}setSphereCorrection(n,t=this.meshContainer){const e=this.viewer.dataHelper.cleanSphereCorrection(n);t.rotation.set(e.tilt,e.pan,e.roll,"YXZ")}transition(n,t,e){const s=e.effect==="fade"||e.rotation,r=!Qe(t.position),a=!Qe(t.zoom),l=new Qc(r?this.viewer.dataHelper.cleanPosition(t.position):void 0,t.zoom);this.viewer.dispatchEvent(l);const h=new zi,u=this.viewer.adapter.createMesh(n.panoData);if(this.viewer.adapter.setTexture(u,n,!0),this.viewer.adapter.setTextureOpacity(u,0),this.setPanoramaPose(n.panoData,u),this.setSphereCorrection(t.sphereCorrection,h),r&&!e.rotation){const _=this.viewer.getPosition(),E=new q(0,1,0);h.rotateOnWorldAxis(E,l.position.yaw-_.yaw);const w=new q(0,1,0).cross(this.camera.getWorldDirection(new q)).normalize();h.rotateOnWorldAxis(w,l.position.pitch-_.pitch)}h.add(u),this.scene.add(h),this.renderer.setRenderTarget(new Ii),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:d,properties:p}=this.viewer.dataHelper.getAnimationProperties(e.speed,e.rotation?l.position:null,s?l.zoomLevel:null),m=new ca({properties:{...p,opacity:{start:0,end:1}},duration:d,easing:"inOutCubic",onTick:_=>{switch(e.effect){case"fade":this.viewer.adapter.setTextureOpacity(u,_.opacity);break;case"black":case"white":_.opacity<.5?this.renderer.toneMappingExposure=e.effect==="black"?Se.mapLinear(_.opacity,0,.5,1,0):Se.mapLinear(_.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=e.effect==="black"?Se.mapLinear(_.opacity,.5,1,0,1):Se.mapLinear(_.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(u,1),a&&!s&&this.viewer.dynamics.zoom.setValue(l.zoomLevel));break}r&&e.rotation&&this.viewer.dynamics.position.setValue({yaw:_.yaw,pitch:_.pitch}),a&&s&&this.viewer.dynamics.zoom.setValue(_.zoom),this.viewer.needsUpdate()}});return m.then(_=>{h.remove(u),this.scene.remove(h),_?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=u,this.meshContainer.add(u),this.state.textureData=n,this.setPanoramaPose(n.panoData),this.setSphereCorrection(t.sphereCorrection),r&&!e.rotation&&this.viewer.rotate(t.position)):(this.viewer.adapter.disposeTexture(n),this.viewer.adapter.disposeMesh(u))}),m}getIntersections(n){va.x=2*n.x/this.state.size.width-1,va.y=-2*n.y/this.state.size.height+1,this.raycaster.setFromCamera(va,this.camera);const t=this.raycaster.intersectObjects(this.scene.children,!0).filter(e=>e.object.visible).filter(e=>e.object.isMesh&&!!e.object.userData);return this.customRenderer?.getIntersections&&t.push(...this.customRenderer.getIntersections(this.raycaster,va)),t}isObjectVisible(n){if(!n)return!1;if(this.frustumNeedsUpdate&&(pp.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(pp),this.frustumNeedsUpdate=!1),n.isVector3)return this.frustum.containsPoint(n);if(n.isMesh&&n.geometry){const t=n;return t.geometry.boundingBox||t.geometry.computeBoundingBox(),mp.copy(t.geometry.boundingBox).applyMatrix4(t.matrixWorld),this.frustum.intersectsBox(mp)}else return n.isObject3D?this.frustum.intersectsObject(n):!1}addObject(n){this.scene.add(n)}removeObject(n){this.scene.remove(n)}cleanScene(n){const t=e=>{e.map?.dispose(),e.uniforms&&Object.values(e.uniforms).forEach(s=>{s.value?.dispose?.()}),e.dispose()};n.traverse(e=>{e.geometry?.dispose(),e.material&&(Array.isArray(e.material)?e.material.forEach(s=>{t(s)}):t(e.material)),e instanceof xc||e.dispose?.(),e!==n&&this.cleanScene(e)})}},NS=class extends Z0{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(n,t,e,s){const r=this._abortController.signal,a=super.load(n,u=>{h(),t(u)},e,u=>{if(h(),r.aborted){const d=new Error;d.name="AbortError",d.message="The operation was aborted.",s(d)}else s(u)});function l(){a.src=""}function h(){r.removeEventListener("abort",l,!1)}return r.addEventListener("abort",l,!1),a}},BS=class extends Qr{constructor(n){super(n),this.fileLoader=new W0,this.fileLoader.setResponseType("blob"),this.imageLoader=new NS}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(n,t,e){const s=er.get(n,e);if(s){if(s instanceof Blob)return t?.(100),Promise.resolve(s);er.remove(n,e)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(n)),this.fileLoader.setWithCredentials(this.config.withCredentials(n));let r=0;return t?.(r),this.fileLoader.loadAsync(n,a=>{if(a.lengthComputable){const l=a.loaded/a.total*100;l>r&&(r=l,t?.(r))}}).then(a=>(r=100,t?.(r),er.add(n,e,a),a))}loadImage(n,t,e){const s=er.get(n,e);return s?(t?.(100),s instanceof Blob?this.blobToImage(s):Promise.resolve(s)):!t&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(n)),this.imageLoader.loadAsync(n).then(r=>(er.add(n,e,r),r))):this.loadFile(n,t,e).then(r=>this.blobToImage(r))}blobToImage(n){return new Promise((t,e)=>{const s=document.createElement("img");s.onload=()=>{URL.revokeObjectURL(s.src),t(s)},s.onerror=e,s.src=URL.createObjectURL(n)})}preloadPanorama(n){return this.viewer.adapter.supportsPreload(n)?this.viewer.adapter.loadTexture(n,!1):Promise.reject(new $t("Current adapter does not support preload"))}dispatchProgress(n){this.viewer.loader.setProgress(n),this.viewer.dispatchEvent(new Cf(Math.round(n)))}},FS=class extends Qr{constructor(n){super(n),this.zoom=new Or(t=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(t),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Ei(t))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new rf(t=>{this.viewer.dataHelper.sphericalCoordsToVector3(t,this.viewer.state.direction),this.viewer.dispatchEvent(new zr(t))},{yaw:new Or(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new Or(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new Or(t=>{this.viewer.state.roll=t,this.viewer.dispatchEvent(new Hr(t))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(Se.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(Se.degToRad(this.config.moveSpeed*50))}update(n){this.zoom.update(n),this.position.update(n),this.roll.update(n)}},zS=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new q(0,0,ps),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},HS=class extends cf{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=Nd(t.container),!this.parent)throw new $t('"container" element not found.');this.parent[Vi]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),nf(this.parent),ef(this.container,"core"),this.state=new zS,this.config=SS(t),this.__setSize(this.config.size),this.overlay=new AS(this);try{cn.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}er.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new OS(this),this.textureLoader=new BS(this),this.eventsHandler=new US(this),this.dataHelper=new IS(this),this.dynamics=new FS(this),this.adapter.init?.(),this.loader=new TS(this),this.navbar=new MS(this),this.panel=new PS(this),this.notification=new bS(this),this.autoSize(),this.setCursor(null),Hc(cn.isTouchEnabled,e=>{ea(this.container,"psv--is-touch",e)}),this.config.plugins.forEach(([e,s])=>{this.plugins[e.id]=new e(this,s)});for(const e of Object.values(this.plugins))e.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[t,e]of Object.entries(this.plugins))e.destroy(),delete this.plugins[t];this.children.slice().forEach(t=>t.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[Vi]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new Vr)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=th(t);return e?this.plugins[e.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Hd(this.parent,cn.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(t){t?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new Wr(this.getSize())),this.navbar.autoSize())}setPanorama(t,e={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const s=this.dataHelper.getTransitionOptions(e);e.showLoader===void 0&&(e.showLoader=!0),e.caption===void 0&&(e.caption=this.config.caption),e.description===void 0&&(e.description=this.config.description),!e.panoData&&typeof this.config.panoData=="function"&&(e.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description,this.config.sphereCorrection=e.sphereCorrection,(typeof this.config.panoData!="function"||typeof e.panoData=="function")&&(this.config.panoData=e.panoData);const r=l=>{if(Qd(l))return!1;if(this.loader.hide(),this.state.loadingPromise=null,l)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(l),this.dispatchEvent(new Df(t,l)),l;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(e.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new Rf(t));const a=this.adapter.loadTexture(this.config.panorama,!0,e.panoData).then(l=>{if(l.panorama!==this.config.panorama)throw this.adapter.disposeTexture(l),Vc();const h=this.dataHelper.cleanPanoramaOptions(e,l.panoData);return(!Qe(h.zoom)||!Qe(h.position))&&this.stopAll(),{textureData:l,cleanOptions:h}});return!s||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=a.then(({textureData:l,cleanOptions:h})=>{this.renderer.show(),this.renderer.setTexture(l),this.renderer.setPanoramaPose(l.panoData),this.renderer.setSphereCorrection(e.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new $s(l)),Qe(h.zoom)||this.zoom(h.zoom),Qe(h.position)||this.rotate(h.position)}).then(()=>r(),l=>r(l)):this.state.loadingPromise=a.then(({textureData:l,cleanOptions:h})=>(this.loader.hide(),this.dispatchEvent(new $s(l)),this.state.transitionAnimation=this.renderer.transition(l,h,s),this.state.transitionAnimation)).then(l=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new Uf(l)),!l)throw Vc()}).then(()=>r(),l=>r(l)),this.state.loadingPromise}setOptions(t){const e={...this.config,...t};for(let[s,r]of Object.entries(t)){if(!(s in xi)){$e(`Unknown option ${s}`);continue}if(s in fp){$e(fp[s]);continue}switch(s in eh&&(r=eh[s](r,{rawConfig:e,defValue:xi[s]})),this.config[s]=r,s){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Ei(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new mn(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Ke.ERROR,image:LS,title:t,dismissible:!1})}hideError(){this.overlay.hide(Ke.ERROR)}rotate(t){const e=new ff(this.dataHelper.cleanPosition(t));this.dispatchEvent(e),!e.defaultPrevented&&this.dynamics.position.setValue(e.position)}zoom(t){this.dynamics.zoom.setValue(t)}zoomIn(t=1){this.dynamics.zoom.step(t)}zoomOut(t=1){this.dynamics.zoom.step(-t)}animate(t){const e=Gc(t),s=!Qe(t.zoom),r=new Qc(e?this.dataHelper.cleanPosition(t):void 0,t.zoom);if(this.dispatchEvent(r),r.defaultPrevented)return;this.stopAll();const{duration:a,properties:l}=this.dataHelper.getAnimationProperties(t.speed,r.position,r.zoomLevel);return a?(this.state.animation=new ca({properties:l,duration:a,easing:t.easing||"inOutSine",onTick:h=>{e&&this.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),s&&this.dynamics.zoom.setValue(h.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(e&&this.rotate(r.position),s&&this.zoom(r.zoomLevel),new ca(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(t){this.__setSize(t),this.autoSize()}__setSize(t){["width","height"].forEach(e=>{t?.[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])})}enterFullscreen(){this.isFullscreenEnabled()||Vd(this.parent,cn.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Gd(cn.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new RS(this,t)}setCursor(t){this.state.cursorOverride=t,t?this.container.style.cursor=t:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(t){this.state.objectsObservers[t]||(this.state.objectsObservers[t]=null)}unobserveObjects(t){delete this.state.objectsObservers[t]}stopAll(){return this.dispatchEvent(new Zr),this.disableIdleTimer(),this.stopAnimation()}};/*!
3881
3881
  * Photo Sphere Viewer / Equirectangular Tiles Adapter 5.14.0
3882
3882
  * @copyright 2015-2025 Damien "Mistic" Sorel
3883
3883
  * @licence MIT (https://opensource.org/licenses/MIT)
3884
- */var VS=class{constructor(n,t,e){this.id=n,this.priority=t,this.fn=e,this.status=1}start(){return this.status=2,this.fn(this).then(()=>{this.status=4},()=>{this.status=5})}cancel(){this.status=3}isCancelled(){return this.status===3}},GS=class{constructor(n=8){this.concurency=n,this.runningTasks={},this.tasks={}}enqueue(n){this.tasks[n.id]=n}clear(){Object.values(this.tasks).forEach(n=>n.cancel()),this.tasks={},this.runningTasks={}}setPriority(n,t){const e=this.tasks[n];e&&(e.priority=t,e.status===0&&(e.status=1))}disableAllTasks(){Object.values(this.tasks).forEach(n=>{n.status=0})}start(){if(Object.keys(this.runningTasks).length>=this.concurency)return;const n=Object.values(this.tasks).filter(t=>t.status===1).sort((t,e)=>e.priority-t.priority).pop();n&&(this.runningTasks[n.id]=!0,n.start().then(()=>{n.isCancelled()||(delete this.tasks[n.id],delete this.runningTasks[n.id],this.start())}),this.start())}};function WS(){const n=new OffscreenCanvas(512,512),t=n.getContext("2d");return t.fillStyle="#333",t.fillRect(0,0,n.width,n.height),t.font=`${n.width/5}px serif`,t.fillStyle="#a22",t.textAlign="center",t.textBaseline="middle",t.fillText("⚠",n.width/2,n.height/2),new Bi({map:ae.createTexture(n)})}function ZS(n){const t=new B0(n),e=new O0(t);return e.material.depthTest=!1,e.material.depthWrite=!1,e.material.opacity=.25,e.material.transparent=!0,e}var gp=["dodgerblue","limegreen","indianred"];function XS(n,t,e){const s=document.createElement("canvas");s.width=n.width,s.height=n.height;const r=s.getContext("2d");r.fillStyle=gp[t%gp.length],r.fillRect(0,0,s.width,s.height),r.globalCompositeOperation="multiply",r.drawImage(n,0,0);const a=n.width/7;return r.globalCompositeOperation="source-over",r.fillStyle="white",r.font=`${a}px monospace`,r.textAlign="center",e.split(`
3885
- `).forEach((l,h)=>{r.fillText(l,n.width/2,n.height/2+a*(.3+h))}),s}function rh(n){return!!n.levels}function _p(n,t,e){return{...n,level:t,colSize:n.width/n.cols,rowSize:n.width/2/n.rows,facesByCol:e.SPHERE_SEGMENTS/n.cols,facesByRow:e.SPHERE_HORIZONTAL_SEGMENTS/n.rows}}function vp(n,t,e,s,r){let a,l;return rh(n)?(s?(l=n.levels.findIndex(h=>{const u=h.width/360*t,d=h.width/2/180*e;return u>=s.width&&d>=s.height}),l===-1&&(l=n.levels.length-1)):l=0,a=n.levels[l]):(l=0,a={...n}),_p(a,l,r)}function YS(n,t,e){return!rh(n)||!n.levels[t]?null:_p(n.levels[t],t,e)}function qS(n,t){if(typeof n!="object"||!n.tileUrl)throw new te("Invalid panorama configuration, are you using the right adapter?");rh(n)?(n.levels.forEach(e=>{yp(e,t),"zoomRange"in e&&ae.logWarn('EquirectangularTilesAdapter: "zoomRange" property is deprecated and must be removed')}),n.levels.sort((e,s)=>e.width-s.width)):yp(n,t)}function yp(n,t){if(!n.width||!n.cols||!n.rows)throw new te("Invalid panorama configuration, are you using the right adapter?");if(n.cols>t.SPHERE_SEGMENTS)throw new te(`Panorama cols must not be greater than ${t.SPHERE_SEGMENTS}.`);if(n.rows>t.SPHERE_HORIZONTAL_SEGMENTS)throw new te(`Panorama rows must not be greater than ${t.SPHERE_HORIZONTAL_SEGMENTS}.`);if(!we.isPowerOfTwo(n.cols)||!we.isPowerOfTwo(n.rows))throw new te("Panorama cols and rows must be powers of 2.")}function QS(n,t){for(let e=0;e<t.cols;e++){const s=n.tileUrl(e,t.rows/2,t.level);if(s)return s}return n.tileUrl.toString()}var jr=6,gn=3,jS="uv",JS="position",Ep=-1;function oh(n){return`${n.col}x${n.row}/${n.config.level}`}function ya(n){return n.children}var KS=ae.getConfigParser({resolution:64,showErrorTile:!0,baseBlur:!0,antialias:!0,debug:!1,useXmpData:!1}),Ea=new q,xa=class zg extends da{constructor(t,e){super(t),this.state={tileConfig:null,tiles:{},faces:{},geom:null,materials:[],errorMaterial:null,inTransition:!1},this.queue=new GS,this.config=KS(e),this.adapter=new Jc(this.viewer,{resolution:this.config.resolution,blur:this.config.baseBlur}),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2,this.NB_VERTICES=2*this.SPHERE_SEGMENTS*gn+(this.SPHERE_HORIZONTAL_SEGMENTS-2)*this.SPHERE_SEGMENTS*jr,this.NB_GROUPS=this.SPHERE_SEGMENTS*this.SPHERE_HORIZONTAL_SEGMENTS,this.viewer.config.requestHeaders&&ae.logWarn('EquirectangularTilesAdapter fallbacks to file loader because "requestHeaders" where provided. Consider removing "requestHeaders" if you experience performances issues.')}static withConfig(t){return[zg,t]}init(){super.init(),this.viewer.addEventListener(Jt.TransitionDoneEvent.type,this),this.viewer.addEventListener(Jt.PositionUpdatedEvent.type,this),this.viewer.addEventListener(Jt.ZoomUpdatedEvent.type,this)}destroy(){this.viewer.removeEventListener(Jt.TransitionDoneEvent.type,this),this.viewer.removeEventListener(Jt.PositionUpdatedEvent.type,this),this.viewer.removeEventListener(Jt.ZoomUpdatedEvent.type,this),this.__cleanup(),this.state.errorMaterial?.map?.dispose(),this.state.errorMaterial?.dispose(),this.adapter.destroy(),delete this.adapter,delete this.state.geom,delete this.state.errorMaterial,super.destroy()}handleEvent(t){switch(t.type){case Jt.PositionUpdatedEvent.type:case Jt.ZoomUpdatedEvent.type:this.__refresh();break;case Jt.TransitionDoneEvent.type:this.state.inTransition=!1,t.completed&&this.__switchMesh(this.viewer.renderer.mesh);break}}supportsTransition(t){return!!t.baseUrl}supportsPreload(t){return!!t.baseUrl}textureCoordsToSphericalCoords(t,e){return this.adapter.textureCoordsToSphericalCoords(t,e)}sphericalCoordsToTextureCoords(t,e){return this.adapter.sphericalCoordsToTextureCoords(t,e)}async loadTexture(t,e=!0){qS(t,this);const s=vp(t,0,0,null,this),r={isEquirectangular:!0,fullWidth:s.width,fullHeight:s.width/2,croppedWidth:s.width,croppedHeight:s.width/2,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0};if(t.baseUrl){const a=await this.adapter.loadTexture(t.baseUrl,e,t.basePanoData,!0);return{panorama:t,panoData:{...r,baseData:a.panoData},cacheKey:a.cacheKey,texture:a.texture}}else return{panorama:t,panoData:{...r,baseData:null},cacheKey:QS(t,s),texture:null}}createMesh(t){const e=this.adapter.createMesh(t.baseData??t),s=new Ys(Ks.SPHERE_RADIUS,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1).toNonIndexed();s.clearGroups();let r=0,a=0;for(;r<this.SPHERE_SEGMENTS*gn;r+=gn)s.addGroup(r,gn,a++);for(;r<this.NB_VERTICES-this.SPHERE_SEGMENTS*gn;r+=jr)s.addGroup(r,jr,a++);for(;r<this.NB_VERTICES;r+=gn)s.addGroup(r,gn,a++);const l=[],h=new Bi({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1});for(let p=0;p<this.NB_GROUPS;p++)l.push(h);const u=new pn(s,l);u.renderOrder=1;const d=new zi;return d.add(e),d.add(u),d}setTexture(t,e,s){const[r]=ya(t);e.texture?this.adapter.setTexture(r,{panorama:e.panorama.baseUrl,texture:e.texture,panoData:e.panoData.baseData}):r.visible=!1,s?this.state.inTransition=!0:this.__switchMesh(t)}setTextureOpacity(t,e){const[s]=ya(t);this.adapter.setTextureOpacity(s,e)}disposeTexture({texture:t}){t?.dispose()}disposeMesh(t){const[e,s]=ya(t);e.geometry.dispose(),e.material.dispose(),s.geometry.dispose(),s.material.forEach(r=>{r.map?.dispose(),r.dispose()})}__refresh(){if(!this.state.geom||this.state.inTransition)return;const t=this.viewer.config.panorama,e=vp(t,this.viewer.state.hFov,this.viewer.state.vFov,this.viewer.state.size,this),s=this.state.geom.getAttribute(JS),r={};for(let a=0;a<this.NB_VERTICES;a+=1)if(Ea.fromBufferAttribute(s,a),Ea.applyEuler(this.viewer.renderer.sphereCorrection),this.viewer.renderer.isObjectVisible(Ea)){let l;a<this.SPHERE_SEGMENTS*gn?l=Math.floor(a/3):a<this.NB_VERTICES-this.SPHERE_SEGMENTS*gn?l=Math.floor((a/3-this.SPHERE_SEGMENTS)/2)+this.SPHERE_SEGMENTS:l=Math.floor((a-this.NB_VERTICES-this.SPHERE_SEGMENTS*gn)/3)+this.SPHERE_HORIZONTAL_SEGMENTS*(this.SPHERE_SEGMENTS-1);const h=Math.floor(l/this.SPHERE_SEGMENTS),u=l-h*this.SPHERE_SEGMENTS;let d=e;for(;d;){const p=Math.floor(h/d.facesByRow),m=Math.floor(u/d.facesByCol);let _=Ea.angleTo(this.viewer.state.direction);(p===0||p===d.rows-1)&&(_*=2);const E={row:p,col:m,angle:_,config:d,url:null},S=oh(E);if(r[S]){r[S].angle=Math.min(r[S].angle,_);break}else if(E.url=t.tileUrl(m,p,d.level),E.url){r[S]=E;break}else d=YS(t,d.level-1,this)}}this.state.tileConfig=e,this.__loadTiles(Object.values(r))}__loadTiles(t){this.queue.disableAllTasks(),t.forEach(e=>{const s=oh(e);this.state.tiles[s]?this.queue.setPriority(s,e.angle):(this.state.tiles[s]=!0,this.queue.enqueue(new VS(s,e.angle,r=>this.__loadTile(e,r))))}),this.queue.start()}__loadTile(t,e){return this.viewer.textureLoader.loadImage(t.url,null,this.viewer.state.textureData.cacheKey).then(s=>{if(!e.isCancelled()){this.config.debug&&(s=XS(s,t.config.level,oh(t)));const r=this.config.antialias&&t.config.level>0,a=new Bi({map:ae.createTexture(s,r)});this.__swapMaterial(t,a,!1),this.viewer.needsUpdate()}}).catch(s=>{!ae.isAbortError(s)&&!e.isCancelled()&&this.config.showErrorTile&&(this.state.errorMaterial||(this.state.errorMaterial=WS()),this.__swapMaterial(t,this.state.errorMaterial,!0),this.viewer.needsUpdate())})}__swapMaterial(t,e,s){const r=this.state.geom.getAttribute(jS);for(let a=0;a<t.config.facesByCol;a++)for(let l=0;l<t.config.facesByRow;l++){const h=t.col*t.config.facesByCol+a,u=t.row*t.config.facesByRow+l,d=u===0,p=u===this.SPHERE_HORIZONTAL_SEGMENTS-1;let m;if(d?m=h*gn:p?m=this.NB_VERTICES-this.SPHERE_SEGMENTS*gn+h*gn:m=this.SPHERE_SEGMENTS*gn+(u-1)*this.SPHERE_SEGMENTS*jr+h*jr,s&&this.state.faces[m]>Ep||this.state.faces[m]>t.config.level)continue;this.state.faces[m]=s?Ep:t.config.level;const _=this.state.geom.groups.find(g=>g.start===m).materialIndex;this.state.materials[_]=e;const E=1-l/t.config.facesByRow,S=1-(l+1)/t.config.facesByRow,w=a/t.config.facesByCol,v=(a+1)/t.config.facesByCol;d?(r.setXY(m,(w+v)/2,E),r.setXY(m+1,w,S),r.setXY(m+2,v,S)):p?(r.setXY(m,v,E),r.setXY(m+1,w,E),r.setXY(m+2,(w+v)/2,S)):(r.setXY(m,v,E),r.setXY(m+1,w,E),r.setXY(m+2,v,S),r.setXY(m+3,w,E),r.setXY(m+4,w,S),r.setXY(m+5,v,S))}r.needsUpdate=!0}__switchMesh(t){const[,e]=ya(t);if(this.__cleanup(),this.state.materials=e.material,this.state.geom=e.geometry,this.config.debug){const s=ZS(this.state.geom);this.viewer.renderer.addObject(s),this.viewer.renderer.setSphereCorrection(this.viewer.config.sphereCorrection,s)}setTimeout(()=>this.__refresh())}__cleanup(){this.queue.clear(),this.state.tiles={},this.state.faces={},this.state.materials=[],this.state.inTransition=!1}};xa.id="equirectangular-tiles",xa.VERSION="5.14.0",xa.supportsDownload=!1;var $S=xa;/*!
3884
+ */var VS=class{constructor(n,t,e){this.id=n,this.priority=t,this.fn=e,this.status=1}start(){return this.status=2,this.fn(this).then(()=>{this.status=4},()=>{this.status=5})}cancel(){this.status=3}isCancelled(){return this.status===3}},GS=class{constructor(n=8){this.concurency=n,this.runningTasks={},this.tasks={}}enqueue(n){this.tasks[n.id]=n}clear(){Object.values(this.tasks).forEach(n=>n.cancel()),this.tasks={},this.runningTasks={}}setPriority(n,t){const e=this.tasks[n];e&&(e.priority=t,e.status===0&&(e.status=1))}disableAllTasks(){Object.values(this.tasks).forEach(n=>{n.status=0})}start(){if(Object.keys(this.runningTasks).length>=this.concurency)return;const n=Object.values(this.tasks).filter(t=>t.status===1).sort((t,e)=>e.priority-t.priority).pop();n&&(this.runningTasks[n.id]=!0,n.start().then(()=>{n.isCancelled()||(delete this.tasks[n.id],delete this.runningTasks[n.id],this.start())}),this.start())}};function WS(){const n=new OffscreenCanvas(512,512),t=n.getContext("2d");return t.fillStyle="#333",t.fillRect(0,0,n.width,n.height),t.font=`${n.width/5}px serif`,t.fillStyle="#a22",t.textAlign="center",t.textBaseline="middle",t.fillText("⚠",n.width/2,n.height/2),new Bi({map:oe.createTexture(n)})}function ZS(n){const t=new B0(n),e=new O0(t);return e.material.depthTest=!1,e.material.depthWrite=!1,e.material.opacity=.25,e.material.transparent=!0,e}var gp=["dodgerblue","limegreen","indianred"];function XS(n,t,e){const s=document.createElement("canvas");s.width=n.width,s.height=n.height;const r=s.getContext("2d");r.fillStyle=gp[t%gp.length],r.fillRect(0,0,s.width,s.height),r.globalCompositeOperation="multiply",r.drawImage(n,0,0);const a=n.width/7;return r.globalCompositeOperation="source-over",r.fillStyle="white",r.font=`${a}px monospace`,r.textAlign="center",e.split(`
3885
+ `).forEach((l,h)=>{r.fillText(l,n.width/2,n.height/2+a*(.3+h))}),s}function rh(n){return!!n.levels}function _p(n,t,e){return{...n,level:t,colSize:n.width/n.cols,rowSize:n.width/2/n.rows,facesByCol:e.SPHERE_SEGMENTS/n.cols,facesByRow:e.SPHERE_HORIZONTAL_SEGMENTS/n.rows}}function vp(n,t,e,s,r){let a,l;return rh(n)?(s?(l=n.levels.findIndex(h=>{const u=h.width/360*t,d=h.width/2/180*e;return u>=s.width&&d>=s.height}),l===-1&&(l=n.levels.length-1)):l=0,a=n.levels[l]):(l=0,a={...n}),_p(a,l,r)}function YS(n,t,e){return!rh(n)||!n.levels[t]?null:_p(n.levels[t],t,e)}function qS(n,t){if(typeof n!="object"||!n.tileUrl)throw new $t("Invalid panorama configuration, are you using the right adapter?");rh(n)?(n.levels.forEach(e=>{yp(e,t),"zoomRange"in e&&oe.logWarn('EquirectangularTilesAdapter: "zoomRange" property is deprecated and must be removed')}),n.levels.sort((e,s)=>e.width-s.width)):yp(n,t)}function yp(n,t){if(!n.width||!n.cols||!n.rows)throw new $t("Invalid panorama configuration, are you using the right adapter?");if(n.cols>t.SPHERE_SEGMENTS)throw new $t(`Panorama cols must not be greater than ${t.SPHERE_SEGMENTS}.`);if(n.rows>t.SPHERE_HORIZONTAL_SEGMENTS)throw new $t(`Panorama rows must not be greater than ${t.SPHERE_HORIZONTAL_SEGMENTS}.`);if(!Se.isPowerOfTwo(n.cols)||!Se.isPowerOfTwo(n.rows))throw new $t("Panorama cols and rows must be powers of 2.")}function QS(n,t){for(let e=0;e<t.cols;e++){const s=n.tileUrl(e,t.rows/2,t.level);if(s)return s}return n.tileUrl.toString()}var jr=6,gn=3,jS="uv",JS="position",Ep=-1;function oh(n){return`${n.col}x${n.row}/${n.config.level}`}function ya(n){return n.children}var KS=oe.getConfigParser({resolution:64,showErrorTile:!0,baseBlur:!0,antialias:!0,debug:!1,useXmpData:!1}),Ea=new q,xa=class zg extends da{constructor(t,e){super(t),this.state={tileConfig:null,tiles:{},faces:{},geom:null,materials:[],errorMaterial:null,inTransition:!1},this.queue=new GS,this.config=KS(e),this.adapter=new Jc(this.viewer,{resolution:this.config.resolution,blur:this.config.baseBlur}),this.SPHERE_SEGMENTS=this.config.resolution,this.SPHERE_HORIZONTAL_SEGMENTS=this.SPHERE_SEGMENTS/2,this.NB_VERTICES=2*this.SPHERE_SEGMENTS*gn+(this.SPHERE_HORIZONTAL_SEGMENTS-2)*this.SPHERE_SEGMENTS*jr,this.NB_GROUPS=this.SPHERE_SEGMENTS*this.SPHERE_HORIZONTAL_SEGMENTS,this.viewer.config.requestHeaders&&oe.logWarn('EquirectangularTilesAdapter fallbacks to file loader because "requestHeaders" where provided. Consider removing "requestHeaders" if you experience performances issues.')}static withConfig(t){return[zg,t]}init(){super.init(),this.viewer.addEventListener(jt.TransitionDoneEvent.type,this),this.viewer.addEventListener(jt.PositionUpdatedEvent.type,this),this.viewer.addEventListener(jt.ZoomUpdatedEvent.type,this)}destroy(){this.viewer.removeEventListener(jt.TransitionDoneEvent.type,this),this.viewer.removeEventListener(jt.PositionUpdatedEvent.type,this),this.viewer.removeEventListener(jt.ZoomUpdatedEvent.type,this),this.__cleanup(),this.state.errorMaterial?.map?.dispose(),this.state.errorMaterial?.dispose(),this.adapter.destroy(),delete this.adapter,delete this.state.geom,delete this.state.errorMaterial,super.destroy()}handleEvent(t){switch(t.type){case jt.PositionUpdatedEvent.type:case jt.ZoomUpdatedEvent.type:this.__refresh();break;case jt.TransitionDoneEvent.type:this.state.inTransition=!1,t.completed&&this.__switchMesh(this.viewer.renderer.mesh);break}}supportsTransition(t){return!!t.baseUrl}supportsPreload(t){return!!t.baseUrl}textureCoordsToSphericalCoords(t,e){return this.adapter.textureCoordsToSphericalCoords(t,e)}sphericalCoordsToTextureCoords(t,e){return this.adapter.sphericalCoordsToTextureCoords(t,e)}async loadTexture(t,e=!0){qS(t,this);const s=vp(t,0,0,null,this),r={isEquirectangular:!0,fullWidth:s.width,fullHeight:s.width/2,croppedWidth:s.width,croppedHeight:s.width/2,croppedX:0,croppedY:0,poseHeading:0,posePitch:0,poseRoll:0};if(t.baseUrl){const a=await this.adapter.loadTexture(t.baseUrl,e,t.basePanoData,!0);return{panorama:t,panoData:{...r,baseData:a.panoData},cacheKey:a.cacheKey,texture:a.texture}}else return{panorama:t,panoData:{...r,baseData:null},cacheKey:QS(t,s),texture:null}}createMesh(t){const e=this.adapter.createMesh(t.baseData??t),s=new Ys(Ks.SPHERE_RADIUS,this.SPHERE_SEGMENTS,this.SPHERE_HORIZONTAL_SEGMENTS,-Math.PI/2).scale(-1,1,1).toNonIndexed();s.clearGroups();let r=0,a=0;for(;r<this.SPHERE_SEGMENTS*gn;r+=gn)s.addGroup(r,gn,a++);for(;r<this.NB_VERTICES-this.SPHERE_SEGMENTS*gn;r+=jr)s.addGroup(r,jr,a++);for(;r<this.NB_VERTICES;r+=gn)s.addGroup(r,gn,a++);const l=[],h=new Bi({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1});for(let p=0;p<this.NB_GROUPS;p++)l.push(h);const u=new pn(s,l);u.renderOrder=1;const d=new zi;return d.add(e),d.add(u),d}setTexture(t,e,s){const[r]=ya(t);e.texture?this.adapter.setTexture(r,{panorama:e.panorama.baseUrl,texture:e.texture,panoData:e.panoData.baseData}):r.visible=!1,s?this.state.inTransition=!0:this.__switchMesh(t)}setTextureOpacity(t,e){const[s]=ya(t);this.adapter.setTextureOpacity(s,e)}disposeTexture({texture:t}){t?.dispose()}disposeMesh(t){const[e,s]=ya(t);e.geometry.dispose(),e.material.dispose(),s.geometry.dispose(),s.material.forEach(r=>{r.map?.dispose(),r.dispose()})}__refresh(){if(!this.state.geom||this.state.inTransition)return;const t=this.viewer.config.panorama,e=vp(t,this.viewer.state.hFov,this.viewer.state.vFov,this.viewer.state.size,this),s=this.state.geom.getAttribute(JS),r={};for(let a=0;a<this.NB_VERTICES;a+=1)if(Ea.fromBufferAttribute(s,a),Ea.applyEuler(this.viewer.renderer.sphereCorrection),this.viewer.renderer.isObjectVisible(Ea)){let l;a<this.SPHERE_SEGMENTS*gn?l=Math.floor(a/3):a<this.NB_VERTICES-this.SPHERE_SEGMENTS*gn?l=Math.floor((a/3-this.SPHERE_SEGMENTS)/2)+this.SPHERE_SEGMENTS:l=Math.floor((a-this.NB_VERTICES-this.SPHERE_SEGMENTS*gn)/3)+this.SPHERE_HORIZONTAL_SEGMENTS*(this.SPHERE_SEGMENTS-1);const h=Math.floor(l/this.SPHERE_SEGMENTS),u=l-h*this.SPHERE_SEGMENTS;let d=e;for(;d;){const p=Math.floor(h/d.facesByRow),m=Math.floor(u/d.facesByCol);let _=Ea.angleTo(this.viewer.state.direction);(p===0||p===d.rows-1)&&(_*=2);const E={row:p,col:m,angle:_,config:d,url:null},w=oh(E);if(r[w]){r[w].angle=Math.min(r[w].angle,_);break}else if(E.url=t.tileUrl(m,p,d.level),E.url){r[w]=E;break}else d=YS(t,d.level-1,this)}}this.state.tileConfig=e,this.__loadTiles(Object.values(r))}__loadTiles(t){this.queue.disableAllTasks(),t.forEach(e=>{const s=oh(e);this.state.tiles[s]?this.queue.setPriority(s,e.angle):(this.state.tiles[s]=!0,this.queue.enqueue(new VS(s,e.angle,r=>this.__loadTile(e,r))))}),this.queue.start()}__loadTile(t,e){return this.viewer.textureLoader.loadImage(t.url,null,this.viewer.state.textureData.cacheKey).then(s=>{if(!e.isCancelled()){this.config.debug&&(s=XS(s,t.config.level,oh(t)));const r=this.config.antialias&&t.config.level>0,a=new Bi({map:oe.createTexture(s,r)});this.__swapMaterial(t,a,!1),this.viewer.needsUpdate()}}).catch(s=>{!oe.isAbortError(s)&&!e.isCancelled()&&this.config.showErrorTile&&(this.state.errorMaterial||(this.state.errorMaterial=WS()),this.__swapMaterial(t,this.state.errorMaterial,!0),this.viewer.needsUpdate())})}__swapMaterial(t,e,s){const r=this.state.geom.getAttribute(jS);for(let a=0;a<t.config.facesByCol;a++)for(let l=0;l<t.config.facesByRow;l++){const h=t.col*t.config.facesByCol+a,u=t.row*t.config.facesByRow+l,d=u===0,p=u===this.SPHERE_HORIZONTAL_SEGMENTS-1;let m;if(d?m=h*gn:p?m=this.NB_VERTICES-this.SPHERE_SEGMENTS*gn+h*gn:m=this.SPHERE_SEGMENTS*gn+(u-1)*this.SPHERE_SEGMENTS*jr+h*jr,s&&this.state.faces[m]>Ep||this.state.faces[m]>t.config.level)continue;this.state.faces[m]=s?Ep:t.config.level;const _=this.state.geom.groups.find(g=>g.start===m).materialIndex;this.state.materials[_]=e;const E=1-l/t.config.facesByRow,w=1-(l+1)/t.config.facesByRow,S=a/t.config.facesByCol,v=(a+1)/t.config.facesByCol;d?(r.setXY(m,(S+v)/2,E),r.setXY(m+1,S,w),r.setXY(m+2,v,w)):p?(r.setXY(m,v,E),r.setXY(m+1,S,E),r.setXY(m+2,(S+v)/2,w)):(r.setXY(m,v,E),r.setXY(m+1,S,E),r.setXY(m+2,v,w),r.setXY(m+3,S,E),r.setXY(m+4,S,w),r.setXY(m+5,v,w))}r.needsUpdate=!0}__switchMesh(t){const[,e]=ya(t);if(this.__cleanup(),this.state.materials=e.material,this.state.geom=e.geometry,this.config.debug){const s=ZS(this.state.geom);this.viewer.renderer.addObject(s),this.viewer.renderer.setSphereCorrection(this.viewer.config.sphereCorrection,s)}setTimeout(()=>this.__refresh())}__cleanup(){this.queue.clear(),this.state.tiles={},this.state.faces={},this.state.materials=[],this.state.inTransition=!1}};xa.id="equirectangular-tiles",xa.VERSION="5.14.0",xa.supportsDownload=!1;var $S=xa;/*!
3886
3886
  * Photo Sphere Viewer / Markers Plugin 5.14.0
3887
3887
  * @copyright 2015-2025 Damien "Mistic" Sorel
3888
3888
  * @licence MIT (https://opensource.org/licenses/MIT)
3889
3889
  */var tM=Object.defineProperty,eM=(n,t)=>{for(var e in t)tM(n,e,{get:t[e],enumerable:!0})},xp={};eM(xp,{EnterMarkerEvent:()=>Cp,GotoMarkerDoneEvent:()=>ah,HideMarkersEvent:()=>Jr,LeaveMarkerEvent:()=>bp,MarkerVisibilityEvent:()=>Sp,MarkersPluginEvent:()=>kn,RenderMarkersListEvent:()=>zp,SelectMarkerEvent:()=>Rp,SelectMarkerListEvent:()=>Ip,SetMarkersEvent:()=>Np,ShowMarkersEvent:()=>Kr,UnselectMarkerEvent:()=>kp});var kn=class extends lf{},wp=class Hg extends kn{constructor(t,e){super(Hg.type),this.marker=t,this.visible=e}};wp.type="marker-visibility";var Sp=wp,Mp=class Vg extends kn{constructor(t){super(Vg.type),this.marker=t}};Mp.type="goto-marker-done";var ah=Mp,Tp=class Gg extends kn{constructor(t){super(Gg.type),this.marker=t}};Tp.type="leave-marker";var bp=Tp,Ap=class Wg extends kn{constructor(t){super(Wg.type),this.marker=t}};Ap.type="enter-marker";var Cp=Ap,Pp=class Zg extends kn{constructor(t,e,s){super(Zg.type),this.marker=t,this.doubleClick=e,this.rightClick=s}};Pp.type="select-marker";var Rp=Pp,Lp=class Xg extends kn{constructor(t){super(Xg.type),this.marker=t}};Lp.type="select-marker-list";var Ip=Lp,Dp=class Yg extends kn{constructor(t){super(Yg.type),this.marker=t}};Dp.type="unselect-marker";var kp=Dp,Up=class qg extends kn{constructor(){super(qg.type)}};Up.type="hide-markers";var Jr=Up,Op=class Qg extends kn{constructor(t){super(Qg.type),this.markers=t}};Op.type="set-markers";var Np=Op,Bp=class jg extends kn{constructor(){super(jg.type)}};Bp.type="show-markers";var Kr=Bp,Fp=class Jg extends kn{constructor(t){super(Jg.type),this.markers=t}};Fp.type="render-markers-list";var zp=Fp,nM=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 9 81 81"><path fill="currentColor" d="M50.5 90S22.9 51.9 22.9 36.6 35.2 9 50.5 9s27.6 12.4 27.6 27.6S50.5 90 50.5 90zm0-66.3c-6.1 0-11 4.9-11 11s4.9 11 11 11 11-4.9 11-11-4.9-11-11-11z"/><!--Created by Rohith M S from the Noun Project--></svg>
3890
3890
  `,$r=class extends hn{constructor(n){super(n,{className:"psv-markers-button",icon:nM,hoverScale:!0,collapsable:!0,tabbable:!0}),this.plugin=this.viewer.getPlugin("markers"),this.plugin&&(this.plugin.addEventListener(Kr.type,this),this.plugin.addEventListener(Jr.type,this),this.toggleActive(!0))}destroy(){this.plugin&&(this.plugin.removeEventListener(Kr.type,this),this.plugin.removeEventListener(Jr.type,this)),super.destroy()}isSupported(){return!!this.plugin}handleEvent(n){n instanceof Kr?this.toggleActive(!0):n instanceof Jr&&this.toggleActive(!1)}onClick(){this.plugin.toggleAllMarkers()}};$r.id="markers";var Hp=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="9 9 81 81"><path fill="currentColor" d="M37.5 90S9.9 51.9 9.9 36.6 22.2 9 37.5 9s27.6 12.4 27.6 27.6S37.5 90 37.5 90zm0-66.3c-6.1 0-11 4.9-11 11s4.9 11 11 11 11-4.9 11-11-4.9-11-11-11zM86.7 55H70c-1.8 0-3.3-1.5-3.3-3.3s1.5-3.3 3.3-3.3h16.7c1.8 0 3.3 1.5 3.3 3.3S88.5 55 86.7 55zm0-25h-15a3.3 3.3 0 0 1-3.3-3.3c0-1.8 1.5-3.3 3.3-3.3h15c1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3zM56.5 73h30c1.8 0 3.3 1.5 3.3 3.3 0 1.8-1.5 3.3-3.3 3.3h-30a3.3 3.3 0 0 1-3.3-3.3 3.2 3.2 0 0 1 3.3-3.3z"/><!--Created by Rohith M S from the Noun Project--></svg>
3891
- `,wa="http://www.w3.org/2000/svg",Ne="psvMarker",iM=ae.dasherize(Ne),to="marker",nr="markersList",lh={amount:2,duration:100,easing:"linear"},sM=(n,t)=>`
3891
+ `,wa="http://www.w3.org/2000/svg",Ne="psvMarker",iM=oe.dasherize(Ne),to="marker",nr="markersList",lh={amount:2,duration:100,easing:"linear"},sM=(n,t)=>`
3892
3892
  <div class="psv-panel-menu psv-panel-menu--stripped">
3893
3893
  <h1 class="psv-panel-menu-title">${Hp} ${t}</h1>
3894
3894
  <ul class="psv-panel-menu-list">
@@ -3900,7 +3900,7 @@ void main() {
3900
3900
  `).join("")}
3901
3901
  </ul>
3902
3902
  </div>
3903
- `,Sa=class extends hn{constructor(n){super(n,{className:" psv-markers-list-button",icon:Hp,hoverScale:!0,collapsable:!0,tabbable:!0}),this.plugin=this.viewer.getPlugin("markers"),this.plugin&&(this.viewer.addEventListener(Jt.ShowPanelEvent.type,this),this.viewer.addEventListener(Jt.HidePanelEvent.type,this))}destroy(){this.viewer.removeEventListener(Jt.ShowPanelEvent.type,this),this.viewer.removeEventListener(Jt.HidePanelEvent.type,this),super.destroy()}isSupported(){return!!this.plugin}handleEvent(n){n instanceof Jt.ShowPanelEvent?this.toggleActive(n.panelId===nr):n instanceof Jt.HidePanelEvent&&this.toggleActive(!1)}onClick(){this.plugin.toggleMarkersList()}};Sa.id="markersList";var Vp=new q,rM=new ss,Gp=new q,oM=class extends an{constructor(n=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=n,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(n,t){return super.copy(n,t),this.element=n.element.cloneNode(!0),this}},ii=new Oe,aM=new Oe,lM=class{constructor(n={}){const t=this;let e,s,r,a;const l={camera:{style:""},objects:new WeakMap},h=n.element!==void 0?n.element:document.createElement("div");h.style.overflow="hidden",this.domElement=h;const u=document.createElement("div");u.style.transformOrigin="0 0",u.style.pointerEvents="none",h.appendChild(u);const d=document.createElement("div");d.style.transformStyle="preserve-3d",u.appendChild(d),this.getSize=function(){return{width:e,height:s}},this.render=function(w,v){const g=v.projectionMatrix.elements[5]*a;v.view&&v.view.enabled?(u.style.transform=`translate( ${-v.view.offsetX*(e/v.view.width)}px, ${-v.view.offsetY*(s/v.view.height)}px )`,u.style.transform+=`scale( ${v.view.fullWidth/v.view.width}, ${v.view.fullHeight/v.view.height} )`):u.style.transform="",w.matrixWorldAutoUpdate===!0&&w.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld();let I,C;v.isOrthographicCamera&&(I=-(v.right+v.left)/2,C=(v.top+v.bottom)/2);const T=v.view&&v.view.enabled?v.view.height/v.view.fullHeight:1,U=v.isOrthographicCamera?`scale( ${T} )scale(`+g+")translate("+p(I)+"px,"+p(C)+"px)"+m(v.matrixWorldInverse):`scale( ${T} )translateZ(`+g+"px)"+m(v.matrixWorldInverse),B=(v.isPerspectiveCamera?"perspective("+g+"px) ":"")+U+"translate("+r+"px,"+a+"px)";l.camera.style!==B&&(d.style.transform=B,l.camera.style=B),S(w,w,v)},this.setSize=function(w,v){e=w,s=v,r=e/2,a=s/2,h.style.width=w+"px",h.style.height=v+"px",u.style.width=w+"px",u.style.height=v+"px",d.style.width=w+"px",d.style.height=v+"px"};function p(w){return Math.abs(w)<1e-10?0:w}function m(w){const v=w.elements;return"matrix3d("+p(v[0])+","+p(-v[1])+","+p(v[2])+","+p(v[3])+","+p(v[4])+","+p(-v[5])+","+p(v[6])+","+p(v[7])+","+p(v[8])+","+p(-v[9])+","+p(v[10])+","+p(v[11])+","+p(v[12])+","+p(-v[13])+","+p(v[14])+","+p(v[15])+")"}function _(w){const v=w.elements;return"translate(-50%,-50%)"+("matrix3d("+p(v[0])+","+p(v[1])+","+p(v[2])+","+p(v[3])+","+p(-v[4])+","+p(-v[5])+","+p(-v[6])+","+p(-v[7])+","+p(v[8])+","+p(v[9])+","+p(v[10])+","+p(v[11])+","+p(v[12])+","+p(v[13])+","+p(v[14])+","+p(v[15])+")")}function E(w){w.isCSS3DObject&&(w.element.style.display="none");for(let v=0,g=w.children.length;v<g;v++)E(w.children[v])}function S(w,v,g,I){if(w.visible===!1){E(w);return}if(w.isCSS3DObject){const C=w.layers.test(g.layers)===!0,T=w.element;if(T.style.display=C===!0?"":"none",C===!0){w.onBeforeRender(t,v,g);let U;w.isCSS3DSprite?(ii.copy(g.matrixWorldInverse),ii.transpose(),w.rotation2D!==0&&ii.multiply(aM.makeRotationZ(w.rotation2D)),w.matrixWorld.decompose(Vp,rM,Gp),ii.setPosition(Vp),ii.scale(Gp),ii.elements[3]=0,ii.elements[7]=0,ii.elements[11]=0,ii.elements[15]=1,U=_(ii)):U=_(w.matrixWorld);const N=l.objects.get(w);if(N===void 0||N.style!==U){T.style.transform=U;const B={style:U};l.objects.set(w,B)}T.parentNode!==d&&d.appendChild(T),w.onAfterRender(t,v,g)}}for(let C=0,T=w.children.length;C<T;C++)S(w.children[C],v,g)}}},cM=class{constructor(n){this.viewer=n,this.element=document.createElement("div"),this.element.className="psv-markers-css3d-container",this.renderer=new lM({element:this.element}),this.scene=new xc,this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(e=>{const s=e.target[Ne];s.config.visible&&(s.viewportIntersection=e.isIntersecting)})},{root:this.element}),n.addEventListener(Jt.ReadyEvent.type,this,{once:!0}),n.addEventListener(Jt.SizeUpdatedEvent.type,this),n.addEventListener(Jt.RenderEvent.type,this)}handleEvent(n){switch(n.type){case Jt.ReadyEvent.type:case Jt.SizeUpdatedEvent.type:this.updateSize();break;case Jt.RenderEvent.type:this.render();break}}destroy(){this.viewer.removeEventListener(Jt.ReadyEvent.type,this),this.viewer.removeEventListener(Jt.SizeUpdatedEvent.type,this),this.viewer.removeEventListener(Jt.RenderEvent.type,this),this.intersectionObserver.disconnect()}updateSize(){const n=this.viewer.getSize();this.renderer.setSize(n.width,n.height)}render(){this.renderer.render(this.scene,this.viewer.renderer.camera)}addObject(n){this.scene.add(n.threeElement),this.intersectionObserver.observe(n.domElement)}removeObject(n){this.scene.remove(n.threeElement),this.intersectionObserver.unobserve(n.domElement)}},Ma=(n=>(n.image="image",n.html="html",n.element="element",n.imageLayer="imageLayer",n.videoLayer="videoLayer",n.elementLayer="elementLayer",n.polygon="polygon",n.polygonPixels="polygonPixels",n.polyline="polyline",n.polylinePixels="polylinePixels",n.square="square",n.rect="rect",n.circle="circle",n.ellipse="ellipse",n.path="path",n))(Ma||{});function ch(n,t=!1){const e=[];if(Object.keys(Ma).forEach(s=>{n[s]&&e.push(s)}),e.length===0&&!t)throw new te(`missing marker content, either ${Object.keys(Ma).join(", ")}`);if(e.length>1)throw new te(`multiple marker content, either ${Object.keys(Ma).join(", ")}`);return e[0]}var Wp=class{constructor(n,t,e){if(this.viewer=n,this.plugin=t,this.state={anchor:null,visible:!1,staticTooltip:!1,position:null,position2D:null,positions3D:null,size:null},!e.id)throw new te("missing marker id");this.type=ch(e),this.createElement(),this.update(e)}get id(){return this.config.id}get data(){return this.config.data}get domElement(){return null}get threeElement(){return null}get video(){return null}destroy(){delete this.viewer,delete this.plugin,delete this.element,this.hideTooltip()}is3d(){return!1}isNormal(){return!1}isPoly(){return!1}isSvg(){return!1}isCss3d(){return!1}update(n){const t=ch(n,!0);if(t!==void 0&&t!==this.type)throw new te(`cannot change marker ${n.id} type`);if(this.config=ae.deepmerge(this.config,n),typeof this.config.tooltip=="string"&&(this.config.tooltip={content:this.config.tooltip}),this.config.tooltip&&!this.config.tooltip.trigger&&(this.config.tooltip.trigger="hover"),ae.isNil(this.config.visible)&&(this.config.visible=!0),ae.isNil(this.config.zIndex)&&(this.config.zIndex=1),ae.isNil(this.config.opacity)&&(this.config.opacity=1),this.config.rotation){const e=this.config.rotation;typeof e=="object"?this.config.rotation={yaw:e.yaw?ae.parseAngle(e.yaw,!0,!1):0,pitch:e.pitch?ae.parseAngle(e.pitch,!0,!1):0,roll:e.roll?ae.parseAngle(e.roll,!0,!1):0}:this.config.rotation={yaw:0,pitch:0,roll:ae.parseAngle(e,!0,!1)}}else this.config.rotation={yaw:0,pitch:0,roll:0};this.state.anchor=ae.parsePoint(this.config.anchor)}getListContent(){return this.config.listContent?this.config.listContent:this.config.tooltip?.content?this.config.tooltip.content:this.config.html?this.config.html:this.id}showTooltip(n,t,e=!1){if(this.state.visible&&this.config.tooltip?.content&&this.state.position2D){const s={...this.config.tooltip,style:{pointerEvents:this.state.staticTooltip?"auto":"none"},data:this,top:0,left:0};if(this.isPoly()||this.is3d()||this.isCss3d())if(n||t){const r=ae.getPosition(this.viewer.container);s.top=t-r.y+10,s.left=n-r.x,s.box={width:20,height:20}}else s.top=this.state.position2D.y,s.left=this.state.position2D.x;else{const r=this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);let a=this.state.size.width,l=this.state.size.height;this.config.hoverScale&&!this.state.staticTooltip&&(a*=this.config.hoverScale.amount,l*=this.config.hoverScale.amount),s.top=r.y-l*this.state.anchor.y+l/2,s.left=r.x-a*this.state.anchor.x+a/2,s.box={width:a,height:l}}this.tooltip?e?this.tooltip.update(this.config.tooltip.content,s):this.tooltip.move(s):this.tooltip=this.viewer.createTooltip(s)}}hideTooltip(){this.tooltip&&(this.tooltip.hide(),this.tooltip=null)}},hh=class extends Wp{get domElement(){return this.element}constructor(n,t,e){super(n,t,e)}afterCreateElement(){this.element[Ne]=this}destroy(){delete this.element[Ne],super.destroy()}update(n){super.update(n);const t=this.domElement;t.id=`psv-marker-${this.config.id}`,t.setAttribute("class","psv-marker"),this.state.visible&&t.classList.add("psv-marker--visible"),this.config.tooltip&&t.classList.add("psv-marker--has-tooltip"),this.config.content&&t.classList.add("psv-marker--has-content"),this.config.className&&ae.addClasses(t,this.config.className),t.style.opacity=`${this.config.opacity}`,t.style.zIndex=`${30+this.config.zIndex}`,this.config.style&&Object.assign(t.style,this.config.style)}},Ta=class extends hh{constructor(n,t,e){super(n,t,e)}afterCreateElement(){super.afterCreateElement(),this.domElement.addEventListener("transitionend",()=>{this.domElement.style.transition=""})}render({viewerPosition:n,zoomLevel:t,hoveringMarker:e}){this.__updateSize();const s=this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);return s.x-=this.state.size.width*this.state.anchor.x,s.y-=this.state.size.height*this.state.anchor.y,this.state.positions3D[0].dot(this.viewer.state.direction)>0&&s.x+this.state.size.width>=0&&s.x-this.state.size.width<=this.viewer.state.size.width&&s.y+this.state.size.height>=0&&s.y-this.state.size.height<=this.viewer.state.size.height?(this.domElement.style.translate=`${s.x}px ${s.y}px 0px`,this.applyScale({zoomLevel:t,viewerPosition:n,mouseover:this===e}),s):null}update(n){if(super.update(n),!ae.isExtendedPosition(this.config.position))throw new te(`missing marker ${this.id} position`);try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(e){throw new te(`invalid marker ${this.id} position`,e)}this.state.positions3D=[this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];const t=this.domElement;t.classList.add("psv-marker--normal"),this.config.scale&&Array.isArray(this.config.scale)&&(this.config.scale={zoom:this.config.scale}),typeof this.config.hoverScale=="boolean"?this.config.hoverScale=this.config.hoverScale?this.plugin.config.defaultHoverScale||lh:null:typeof this.config.hoverScale=="number"?this.config.hoverScale={amount:this.config.hoverScale}:this.config.hoverScale||(this.config.hoverScale=this.plugin.config.defaultHoverScale),this.config.hoverScale&&(this.config.hoverScale={...this.plugin.config.defaultHoverScale,...this.config.hoverScale}),t.style.rotate=this.config.rotation.roll!==0?we.radToDeg(this.config.rotation.roll)+"deg":null,t.style.transformOrigin=`${this.state.anchor.x*100}% ${this.state.anchor.y*100}%`}__updateSize(){if(!this.needsUpdateSize)return;const n=this.domElement,t=!this.state.visible||!this.state.size;if(t&&n.classList.add("psv-marker--transparent"),this.isSvg()){const e=n.firstElementChild.getBoundingClientRect();this.state.size={width:e.width,height:e.height}}else this.state.size={width:n.offsetWidth,height:n.offsetHeight};t&&n.classList.remove("psv-marker--transparent"),this.isSvg()&&(n.style.width=this.state.size.width+"px",n.style.height=this.state.size.height+"px"),this.type!=="element"&&(this.needsUpdateSize=!1)}applyScale({zoomLevel:n,viewerPosition:t,mouseover:e}){e!==null&&this.config.hoverScale&&(this.domElement.style.transition=`scale ${this.config.hoverScale.duration}ms ${this.config.hoverScale.easing}`);let s=1;if(typeof this.config.scale=="function")s=this.config.scale(n,t);else if(this.config.scale){if(Array.isArray(this.config.scale.zoom)){const[r,a]=this.config.scale.zoom;s*=r+(a-r)*Ks.EASINGS.inQuad(n/100)}if(Array.isArray(this.config.scale.yaw)){const[r,a]=this.config.scale.yaw,l=we.degToRad(this.viewer.state.hFov)/2,h=Math.abs(ae.getShortestArc(this.state.position.yaw,t.yaw));s*=a+(r-a)*Ks.EASINGS.outQuad(Math.max(0,(l-h)/l))}}e&&this.config.hoverScale&&(s*=this.config.hoverScale.amount),this.domElement.style.scale=`${s}`}},hM=`// https://www.8thwall.com/playground/chromakey-threejs
3903
+ `,Sa=class extends hn{constructor(n){super(n,{className:" psv-markers-list-button",icon:Hp,hoverScale:!0,collapsable:!0,tabbable:!0}),this.plugin=this.viewer.getPlugin("markers"),this.plugin&&(this.viewer.addEventListener(jt.ShowPanelEvent.type,this),this.viewer.addEventListener(jt.HidePanelEvent.type,this))}destroy(){this.viewer.removeEventListener(jt.ShowPanelEvent.type,this),this.viewer.removeEventListener(jt.HidePanelEvent.type,this),super.destroy()}isSupported(){return!!this.plugin}handleEvent(n){n instanceof jt.ShowPanelEvent?this.toggleActive(n.panelId===nr):n instanceof jt.HidePanelEvent&&this.toggleActive(!1)}onClick(){this.plugin.toggleMarkersList()}};Sa.id="markersList";var Vp=new q,rM=new ss,Gp=new q,oM=class extends an{constructor(n=document.createElement("div")){super(),this.isCSS3DObject=!0,this.element=n,this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof t.element.ownerDocument.defaultView.Element&&t.element.parentNode!==null&&t.element.remove()})})}copy(n,t){return super.copy(n,t),this.element=n.element.cloneNode(!0),this}},ii=new Oe,aM=new Oe,lM=class{constructor(n={}){const t=this;let e,s,r,a;const l={camera:{style:""},objects:new WeakMap},h=n.element!==void 0?n.element:document.createElement("div");h.style.overflow="hidden",this.domElement=h;const u=document.createElement("div");u.style.transformOrigin="0 0",u.style.pointerEvents="none",h.appendChild(u);const d=document.createElement("div");d.style.transformStyle="preserve-3d",u.appendChild(d),this.getSize=function(){return{width:e,height:s}},this.render=function(S,v){const g=v.projectionMatrix.elements[5]*a;v.view&&v.view.enabled?(u.style.transform=`translate( ${-v.view.offsetX*(e/v.view.width)}px, ${-v.view.offsetY*(s/v.view.height)}px )`,u.style.transform+=`scale( ${v.view.fullWidth/v.view.width}, ${v.view.fullHeight/v.view.height} )`):u.style.transform="",S.matrixWorldAutoUpdate===!0&&S.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld();let R,P;v.isOrthographicCamera&&(R=-(v.right+v.left)/2,P=(v.top+v.bottom)/2);const T=v.view&&v.view.enabled?v.view.height/v.view.fullHeight:1,U=v.isOrthographicCamera?`scale( ${T} )scale(`+g+")translate("+p(R)+"px,"+p(P)+"px)"+m(v.matrixWorldInverse):`scale( ${T} )translateZ(`+g+"px)"+m(v.matrixWorldInverse),N=(v.isPerspectiveCamera?"perspective("+g+"px) ":"")+U+"translate("+r+"px,"+a+"px)";l.camera.style!==N&&(d.style.transform=N,l.camera.style=N),w(S,S,v)},this.setSize=function(S,v){e=S,s=v,r=e/2,a=s/2,h.style.width=S+"px",h.style.height=v+"px",u.style.width=S+"px",u.style.height=v+"px",d.style.width=S+"px",d.style.height=v+"px"};function p(S){return Math.abs(S)<1e-10?0:S}function m(S){const v=S.elements;return"matrix3d("+p(v[0])+","+p(-v[1])+","+p(v[2])+","+p(v[3])+","+p(v[4])+","+p(-v[5])+","+p(v[6])+","+p(v[7])+","+p(v[8])+","+p(-v[9])+","+p(v[10])+","+p(v[11])+","+p(v[12])+","+p(-v[13])+","+p(v[14])+","+p(v[15])+")"}function _(S){const v=S.elements;return"translate(-50%,-50%)"+("matrix3d("+p(v[0])+","+p(v[1])+","+p(v[2])+","+p(v[3])+","+p(-v[4])+","+p(-v[5])+","+p(-v[6])+","+p(-v[7])+","+p(v[8])+","+p(v[9])+","+p(v[10])+","+p(v[11])+","+p(v[12])+","+p(v[13])+","+p(v[14])+","+p(v[15])+")")}function E(S){S.isCSS3DObject&&(S.element.style.display="none");for(let v=0,g=S.children.length;v<g;v++)E(S.children[v])}function w(S,v,g,R){if(S.visible===!1){E(S);return}if(S.isCSS3DObject){const P=S.layers.test(g.layers)===!0,T=S.element;if(T.style.display=P===!0?"":"none",P===!0){S.onBeforeRender(t,v,g);let U;S.isCSS3DSprite?(ii.copy(g.matrixWorldInverse),ii.transpose(),S.rotation2D!==0&&ii.multiply(aM.makeRotationZ(S.rotation2D)),S.matrixWorld.decompose(Vp,rM,Gp),ii.setPosition(Vp),ii.scale(Gp),ii.elements[3]=0,ii.elements[7]=0,ii.elements[11]=0,ii.elements[15]=1,U=_(ii)):U=_(S.matrixWorld);const B=l.objects.get(S);if(B===void 0||B.style!==U){T.style.transform=U;const N={style:U};l.objects.set(S,N)}T.parentNode!==d&&d.appendChild(T),S.onAfterRender(t,v,g)}}for(let P=0,T=S.children.length;P<T;P++)w(S.children[P],v,g)}}},cM=class{constructor(n){this.viewer=n,this.element=document.createElement("div"),this.element.className="psv-markers-css3d-container",this.renderer=new lM({element:this.element}),this.scene=new xc,this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(e=>{const s=e.target[Ne];s.config.visible&&(s.viewportIntersection=e.isIntersecting)})},{root:this.element}),n.addEventListener(jt.ReadyEvent.type,this,{once:!0}),n.addEventListener(jt.SizeUpdatedEvent.type,this),n.addEventListener(jt.RenderEvent.type,this)}handleEvent(n){switch(n.type){case jt.ReadyEvent.type:case jt.SizeUpdatedEvent.type:this.updateSize();break;case jt.RenderEvent.type:this.render();break}}destroy(){this.viewer.removeEventListener(jt.ReadyEvent.type,this),this.viewer.removeEventListener(jt.SizeUpdatedEvent.type,this),this.viewer.removeEventListener(jt.RenderEvent.type,this),this.intersectionObserver.disconnect()}updateSize(){const n=this.viewer.getSize();this.renderer.setSize(n.width,n.height)}render(){this.renderer.render(this.scene,this.viewer.renderer.camera)}addObject(n){this.scene.add(n.threeElement),this.intersectionObserver.observe(n.domElement)}removeObject(n){this.scene.remove(n.threeElement),this.intersectionObserver.unobserve(n.domElement)}},Ma=(n=>(n.image="image",n.html="html",n.element="element",n.imageLayer="imageLayer",n.videoLayer="videoLayer",n.elementLayer="elementLayer",n.polygon="polygon",n.polygonPixels="polygonPixels",n.polyline="polyline",n.polylinePixels="polylinePixels",n.square="square",n.rect="rect",n.circle="circle",n.ellipse="ellipse",n.path="path",n))(Ma||{});function ch(n,t=!1){const e=[];if(Object.keys(Ma).forEach(s=>{n[s]&&e.push(s)}),e.length===0&&!t)throw new $t(`missing marker content, either ${Object.keys(Ma).join(", ")}`);if(e.length>1)throw new $t(`multiple marker content, either ${Object.keys(Ma).join(", ")}`);return e[0]}var Wp=class{constructor(n,t,e){if(this.viewer=n,this.plugin=t,this.state={anchor:null,visible:!1,staticTooltip:!1,position:null,position2D:null,positions3D:null,size:null},!e.id)throw new $t("missing marker id");this.type=ch(e),this.createElement(),this.update(e)}get id(){return this.config.id}get data(){return this.config.data}get domElement(){return null}get threeElement(){return null}get video(){return null}destroy(){delete this.viewer,delete this.plugin,delete this.element,this.hideTooltip()}is3d(){return!1}isNormal(){return!1}isPoly(){return!1}isSvg(){return!1}isCss3d(){return!1}update(n){const t=ch(n,!0);if(t!==void 0&&t!==this.type)throw new $t(`cannot change marker ${n.id} type`);if(this.config=oe.deepmerge(this.config,n),typeof this.config.tooltip=="string"&&(this.config.tooltip={content:this.config.tooltip}),this.config.tooltip&&!this.config.tooltip.trigger&&(this.config.tooltip.trigger="hover"),oe.isNil(this.config.visible)&&(this.config.visible=!0),oe.isNil(this.config.zIndex)&&(this.config.zIndex=1),oe.isNil(this.config.opacity)&&(this.config.opacity=1),this.config.rotation){const e=this.config.rotation;typeof e=="object"?this.config.rotation={yaw:e.yaw?oe.parseAngle(e.yaw,!0,!1):0,pitch:e.pitch?oe.parseAngle(e.pitch,!0,!1):0,roll:e.roll?oe.parseAngle(e.roll,!0,!1):0}:this.config.rotation={yaw:0,pitch:0,roll:oe.parseAngle(e,!0,!1)}}else this.config.rotation={yaw:0,pitch:0,roll:0};this.state.anchor=oe.parsePoint(this.config.anchor)}getListContent(){return this.config.listContent?this.config.listContent:this.config.tooltip?.content?this.config.tooltip.content:this.config.html?this.config.html:this.id}showTooltip(n,t,e=!1){if(this.state.visible&&this.config.tooltip?.content&&this.state.position2D){const s={...this.config.tooltip,style:{pointerEvents:this.state.staticTooltip?"auto":"none"},data:this,top:0,left:0};if(this.isPoly()||this.is3d()||this.isCss3d())if(n||t){const r=oe.getPosition(this.viewer.container);s.top=t-r.y+10,s.left=n-r.x,s.box={width:20,height:20}}else s.top=this.state.position2D.y,s.left=this.state.position2D.x;else{const r=this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);let a=this.state.size.width,l=this.state.size.height;this.config.hoverScale&&!this.state.staticTooltip&&(a*=this.config.hoverScale.amount,l*=this.config.hoverScale.amount),s.top=r.y-l*this.state.anchor.y+l/2,s.left=r.x-a*this.state.anchor.x+a/2,s.box={width:a,height:l}}this.tooltip?e?this.tooltip.update(this.config.tooltip.content,s):this.tooltip.move(s):this.tooltip=this.viewer.createTooltip(s)}}hideTooltip(){this.tooltip&&(this.tooltip.hide(),this.tooltip=null)}},hh=class extends Wp{get domElement(){return this.element}constructor(n,t,e){super(n,t,e)}afterCreateElement(){this.element[Ne]=this}destroy(){delete this.element[Ne],super.destroy()}update(n){super.update(n);const t=this.domElement;t.id=`psv-marker-${this.config.id}`,t.setAttribute("class","psv-marker"),this.state.visible&&t.classList.add("psv-marker--visible"),this.config.tooltip&&t.classList.add("psv-marker--has-tooltip"),this.config.content&&t.classList.add("psv-marker--has-content"),this.config.className&&oe.addClasses(t,this.config.className),t.style.opacity=`${this.config.opacity}`,t.style.zIndex=`${30+this.config.zIndex}`,this.config.style&&Object.assign(t.style,this.config.style)}},Ta=class extends hh{constructor(n,t,e){super(n,t,e)}afterCreateElement(){super.afterCreateElement(),this.domElement.addEventListener("transitionend",()=>{this.domElement.style.transition=""})}render({viewerPosition:n,zoomLevel:t,hoveringMarker:e}){this.__updateSize();const s=this.viewer.dataHelper.vector3ToViewerCoords(this.state.positions3D[0]);return s.x-=this.state.size.width*this.state.anchor.x,s.y-=this.state.size.height*this.state.anchor.y,this.state.positions3D[0].dot(this.viewer.state.direction)>0&&s.x+this.state.size.width>=0&&s.x-this.state.size.width<=this.viewer.state.size.width&&s.y+this.state.size.height>=0&&s.y-this.state.size.height<=this.viewer.state.size.height?(this.domElement.style.translate=`${s.x}px ${s.y}px 0px`,this.applyScale({zoomLevel:t,viewerPosition:n,mouseover:this===e}),s):null}update(n){if(super.update(n),!oe.isExtendedPosition(this.config.position))throw new $t(`missing marker ${this.id} position`);try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(e){throw new $t(`invalid marker ${this.id} position`,e)}this.state.positions3D=[this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];const t=this.domElement;t.classList.add("psv-marker--normal"),this.config.scale&&Array.isArray(this.config.scale)&&(this.config.scale={zoom:this.config.scale}),typeof this.config.hoverScale=="boolean"?this.config.hoverScale=this.config.hoverScale?this.plugin.config.defaultHoverScale||lh:null:typeof this.config.hoverScale=="number"?this.config.hoverScale={amount:this.config.hoverScale}:this.config.hoverScale||(this.config.hoverScale=this.plugin.config.defaultHoverScale),this.config.hoverScale&&(this.config.hoverScale={...this.plugin.config.defaultHoverScale,...this.config.hoverScale}),t.style.rotate=this.config.rotation.roll!==0?Se.radToDeg(this.config.rotation.roll)+"deg":null,t.style.transformOrigin=`${this.state.anchor.x*100}% ${this.state.anchor.y*100}%`}__updateSize(){if(!this.needsUpdateSize)return;const n=this.domElement,t=!this.state.visible||!this.state.size;if(t&&n.classList.add("psv-marker--transparent"),this.isSvg()){const e=n.firstElementChild.getBoundingClientRect();this.state.size={width:e.width,height:e.height}}else this.state.size={width:n.offsetWidth,height:n.offsetHeight};t&&n.classList.remove("psv-marker--transparent"),this.isSvg()&&(n.style.width=this.state.size.width+"px",n.style.height=this.state.size.height+"px"),this.type!=="element"&&(this.needsUpdateSize=!1)}applyScale({zoomLevel:n,viewerPosition:t,mouseover:e}){e!==null&&this.config.hoverScale&&(this.domElement.style.transition=`scale ${this.config.hoverScale.duration}ms ${this.config.hoverScale.easing}`);let s=1;if(typeof this.config.scale=="function")s=this.config.scale(n,t);else if(this.config.scale){if(Array.isArray(this.config.scale.zoom)){const[r,a]=this.config.scale.zoom;s*=r+(a-r)*Ks.EASINGS.inQuad(n/100)}if(Array.isArray(this.config.scale.yaw)){const[r,a]=this.config.scale.yaw,l=Se.degToRad(this.viewer.state.hFov)/2,h=Math.abs(oe.getShortestArc(this.state.position.yaw,t.yaw));s*=a+(r-a)*Ks.EASINGS.outQuad(Math.max(0,(l-h)/l))}}e&&this.config.hoverScale&&(s*=this.config.hoverScale.amount),this.domElement.style.scale=`${s}`}},hM=`// https://www.8thwall.com/playground/chromakey-threejs
3904
3904
 
3905
3905
  uniform sampler2D map;
3906
3906
  uniform float alpha;
@@ -3944,8 +3944,8 @@ void main() {
3944
3944
  vUv = uv * repeat + offset;
3945
3945
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
3946
3946
  }
3947
- `,dM=class extends vi{get map(){return this.uniforms.map.value}set map(n){this.uniforms.map.value=n}set alpha(n){this.uniforms.alpha.value=n}get offset(){return this.uniforms.offset.value}get repeat(){return this.uniforms.repeat.value}set chromaKey(n){this.uniforms.keying.value=n?.enabled===!0,n?.enabled&&(typeof n.color=="object"&&"r"in n.color?this.uniforms.color.value.set(n.color.r/255,n.color.g/255,n.color.b/255):this.uniforms.color.value.set(n.color??65280),this.uniforms.similarity.value=n.similarity??.2,this.uniforms.smoothness.value=n.smoothness??.2)}constructor(n){super({transparent:!0,depthTest:!1,depthWrite:!1,uniforms:{map:{value:n?.map},repeat:{value:new be(1,1)},offset:{value:new be(0,0)},alpha:{value:n?.alpha??1},keying:{value:!1},color:{value:new Pe(65280)},similarity:{value:.2},smoothness:{value:.2},spill:{value:.1}},vertexShader:uM,fragmentShader:hM}),this.chromaKey=n?.chromaKey}};function fM({src:n,withCredentials:t,muted:e,autoplay:s}){const r=document.createElement("video");return r.crossOrigin=t?"use-credentials":"anonymous",r.loop=!0,r.playsInline=!0,r.autoplay=s,r.muted=e,r.preload="metadata",n instanceof MediaStream?r.srcObject=n:r.src=n,r}function pM(n,t,e){const[s,r]=n,[a,l]=t,h=ae.greatArcDistance(n,t),u=Math.sin((1-e)*h)/Math.sin(h),d=Math.sin(e*h)/Math.sin(h),p=u*Math.cos(r)*Math.cos(s)+d*Math.cos(l)*Math.cos(a),m=u*Math.cos(r)*Math.sin(s)+d*Math.cos(l)*Math.sin(a),_=u*Math.sin(r)+d*Math.sin(l);return[Math.atan2(m,p),Math.atan2(_,Math.sqrt(p*p+m*m))]}function mM(n){const t=[n[0]];let e=0;for(let s=1;s<n.length;s++){const r=n[s-1][0]-n[s][0];r>Math.PI?e+=1:r<-Math.PI&&(e-=1),t.push([n[s][0]+e*2*Math.PI,n[s][1]])}return t}function Zp(n){return n.reduce((t,e)=>t.add(e),new q).normalize()}function gM(n){const t=mM(n);let e=0;const s=[];for(let a=0;a<t.length-1;a++){const l=ae.greatArcDistance(t[a],t[a+1])*Ks.SPHERE_RADIUS;s.push(l),e+=l}let r=0;for(let a=0;a<t.length-1;a++){if(r+s[a]>e/2){const l=(e/2-r)/s[a];return pM(t[a],t[a+1],l)}r+=s[a]}return t[Math.round(t.length/2)]}var ba=new q,Xp=new q,uh=new q,Yp=new q,qp=new q,Qp=new q;function _M(n,t,e){ba.copy(e).normalize(),Xp.crossVectors(n,t).normalize(),uh.crossVectors(Xp,n).normalize(),Yp.copy(n).multiplyScalar(-ba.dot(uh)),qp.copy(uh).multiplyScalar(ba.dot(n));const s=new q().addVectors(Yp,qp).normalize();return Qp.crossVectors(s,ba),s.applyAxisAngle(Qp,.01).multiplyScalar(Ks.SPHERE_RADIUS)}var vM=class extends Wp{get threeElement(){return this.element}get threeMesh(){return this.threeElement.children[0]}get video(){return this.type==="videoLayer"?this.threeMesh.material.map.image:null}constructor(n,t,e){super(n,t,e)}is3d(){return!0}createElement(){const n=new dM({alpha:0}),t=new Ir(1,1),e=new pn(t,n);e.userData={[Ne]:this},Object.defineProperty(e,"visible",{enumerable:!0,get:function(){return this.userData[Ne].config.visible},set:function(s){this.userData[Ne].config.visible=s}}),this.element=new zi().add(e),this.type==="videoLayer"&&this.viewer.needsContinuousUpdate(!0)}destroy(){delete this.threeMesh.userData[Ne],this.type==="videoLayer"&&(this.video.pause(),this.viewer.needsContinuousUpdate(!1)),super.destroy()}render(){return this.viewer.renderer.isObjectVisible(this.threeMesh)?this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position):null}update(n){super.update(n);const t=this.threeMesh,e=t.parent,s=t.material;if(ae.isExtendedPosition(this.config.position)){try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(a){throw new te(`invalid marker ${this.id} position`,a)}if(!this.config.size)throw new te(`missing marker ${this.id} size`);this.state.size=this.config.size,t.scale.set(this.config.size.width/100,this.config.size.height/100,1),t.position.set(t.scale.x*(.5-this.state.anchor.x),t.scale.y*(this.state.anchor.y-.5),0),t.rotation.set(0,0,0),this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position,e.position),e.lookAt(0,e.position.y,0),t.rotateY(-this.config.rotation.yaw),t.rotateX(-this.config.rotation.pitch),t.rotateZ(-this.config.rotation.roll);const r=t.geometry.getAttribute("position");this.state.positions3D=[0,1,3,2].map(a=>{const l=new q;return l.fromBufferAttribute(r,a),t.localToWorld(l)})}else{if(this.config.position?.length!==4)throw new te(`missing marker ${this.id} position`);let r;try{r=this.config.position.map(u=>this.viewer.dataHelper.cleanPosition(u))}catch(u){throw new te(`invalid marker ${this.id} position`,u)}const a=r.map(u=>this.viewer.dataHelper.sphericalCoordsToVector3(u)),l=Zp(a);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(l),this.state.positions3D=a;const h=t.geometry.getAttribute("position");[a[0],a[1],a[3],a[2]].forEach((u,d)=>{h.setX(d,u.x),h.setY(d,u.y),h.setZ(d,u.z)}),h.needsUpdate=!0,this.__setTextureWrap(s)}switch(this.type){case"videoLayer":if(this.definition!==this.config.videoLayer){s.map?.dispose();const r=fM({src:this.config.videoLayer,withCredentials:this.viewer.config.withCredentials(this.config.videoLayer),muted:!0,autoplay:this.config.autoplay??!0}),a=new N0(r);s.map=a,s.alpha=0,r.addEventListener("loadedmetadata",()=>{this.viewer&&(s.alpha=this.config.opacity,ae.isExtendedPosition(this.config.position)||(t.material.userData[Ne]={width:r.videoWidth,height:r.videoHeight},this.__setTextureWrap(s)))},{once:!0}),r.autoplay&&r.play(),this.definition=this.config.videoLayer}else s.alpha=this.config.opacity;break;case"imageLayer":if(this.definition!==this.config.imageLayer){s.map?.dispose();const r=new Je;s.map=r,s.alpha=0,this.viewer.textureLoader.loadImage(this.config.imageLayer).then(a=>{this.viewer&&(ae.isExtendedPosition(this.config.position)||(t.material.userData[Ne]={width:a.width,height:a.height},this.__setTextureWrap(s)),r.image=a,r.anisotropy=4,r.needsUpdate=!0,s.alpha=this.config.opacity,this.viewer.needsUpdate())}),this.definition=this.config.imageLayer}else s.alpha=this.config.opacity;break}s.chromaKey=this.config.chromaKey,t.renderOrder=1e3+this.config.zIndex,t.geometry.boundingBox=null}__setTextureWrap(n){const t=n.userData[Ne];if(!t||!t.height||!t.width){n.repeat.set(1,1),n.offset.set(0,0);return}const e=this.config.position.map(m=>this.viewer.dataHelper.cleanPosition(m)),s=ae.greatArcDistance([e[0].yaw,e[0].pitch],[e[1].yaw,e[1].pitch]),r=ae.greatArcDistance([e[3].yaw,e[3].pitch],[e[2].yaw,e[2].pitch]),a=ae.greatArcDistance([e[1].yaw,e[1].pitch],[e[2].yaw,e[2].pitch]),l=ae.greatArcDistance([e[0].yaw,e[0].pitch],[e[3].yaw,e[3].pitch]),h=(s+r)/(a+l),u=t.width/t.height;let d=0,p=0;h<u?d=u-h:p=1/u-1/h,n.repeat.set(1-d,1-p),n.offset.set(d/2,p/2)}},yM=class extends hh{constructor(n,t,e){super(n,t,e),this.viewportIntersection=!1}get threeElement(){return this.object}isCss3d(){return!0}createElement(){this.element=document.createElement("div"),this.object=new oM(this.element),this.object.userData={[Ne]:this},Object.defineProperty(this.object,"visible",{enumerable:!0,get:function(){return this.userData[Ne].config.visible},set:function(n){this.userData[Ne].config.visible=n}}),this.afterCreateElement()}destroy(){delete this.object.userData[Ne],delete this.object,super.destroy()}render({viewerPosition:n,zoomLevel:t}){const e=this.domElement;if(this.state.size={width:e.offsetWidth,height:e.offsetHeight},this.state.positions3D[0].dot(this.viewer.state.direction)>0&&this.viewportIntersection){const r=this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position);return this.config.elementLayer.updateMarker?.({marker:this,position:r,viewerPosition:n,zoomLevel:t,viewerSize:this.viewer.state.size}),r}else return null}update(n){if(super.update(n),!ae.isExtendedPosition(this.config.position))throw new te(`missing marker ${this.id} position`);try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(s){throw new te(`invalid marker ${this.id} position`,s)}this.state.positions3D=[this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];const t=this.threeElement,e=this.domElement;e.classList.add("psv-marker--css3d"),e.childNodes.forEach(s=>s.remove()),e.appendChild(this.config.elementLayer),this.config.elementLayer.style.display="block",t.position.copy(this.state.positions3D[0]).multiplyScalar(100),t.lookAt(0,this.state.positions3D[0].y*100,0),t.rotateY(-this.config.rotation.yaw),t.rotateX(-this.config.rotation.pitch),t.rotateZ(-this.config.rotation.roll)}},EM=class extends Ta{constructor(n,t,e){super(n,t,e)}isNormal(){return!0}createElement(){this.element=document.createElement("div"),this.afterCreateElement()}render(n){const t=super.render(n);return t&&this.type==="element"&&this.config.element.updateMarker?.({marker:this,position:t,viewerPosition:n.viewerPosition,zoomLevel:n.zoomLevel,viewerSize:this.viewer.state.size}),t}update(n){super.update(n);const t=this.domElement;if(this.config.image&&!this.config.size)throw new te(`missing marker ${this.id} size`);switch(this.config.size?(this.needsUpdateSize=!1,this.state.size=this.config.size,t.style.width=this.config.size.width+"px",t.style.height=this.config.size.height+"px"):this.needsUpdateSize=!0,this.type){case"image":this.definition=this.config.image,t.style.backgroundImage=`url("${this.config.image}")`;break;case"html":this.definition=this.config.html,t.innerHTML=this.config.html;break;case"element":this.definition!==this.config.element&&(this.definition=this.config.element,t.childNodes.forEach(e=>e.remove()),t.appendChild(this.config.element),this.config.element.style.display="block");break}}},xM=class extends hh{constructor(n,t,e){super(n,t,e)}createElement(){this.element=document.createElementNS(wa,"path"),this.element[Ne]=this}isPoly(){return!0}get isPixels(){return this.type==="polygonPixels"||this.type==="polylinePixels"}get isPolygon(){return this.type==="polygon"||this.type==="polygonPixels"}get isPolyline(){return this.type==="polyline"||this.type==="polylinePixels"}get coords(){return this.definition}render(){const n=this.__getAllPolyPositions();if(n[0].length>(this.isPolygon?2:1)){const e=this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position),s=n.filter(r=>r.length>0).map(r=>{let a="M";return a+=r.map(l=>`${l.x-e.x},${l.y-e.y}`).join("L"),this.isPolygon&&(a+="Z"),a}).join(" ");return this.domElement.setAttributeNS(null,"d",s),this.domElement.setAttributeNS(null,"transform",`translate(${e.x} ${e.y})`),e}else return null}update(n){super.update(n);const t=this.domElement;t.classList.add("psv-marker--poly"),this.config.svgStyle?(Object.entries(this.config.svgStyle).forEach(([e,s])=>{t.setAttributeNS(null,ae.dasherize(e),s)}),this.isPolyline&&!this.config.svgStyle.fill&&t.setAttributeNS(null,"fill","none")):this.isPolygon?t.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"):this.isPolyline&&(t.setAttributeNS(null,"fill","none"),t.setAttributeNS(null,"stroke","rgb(0,0,0)"));try{let e=this.config[this.type];if(!Array.isArray(e[0])&&typeof e[0]!="object")for(let s=0;s<e.length;s++)e.splice(s,2,[e[s],e[s+1]]);if(!Array.isArray(e[0][0])&&typeof e[0][0]!="object"&&(e=[e]),this.isPolyline&&e.length>1)throw new te("polylines cannot have holes");this.isPixels?this.definition=e.map(s=>s.map(r=>{let a;return ae.isExtendedPosition(r)?a=this.viewer.dataHelper.cleanPosition(r):a=this.viewer.dataHelper.textureCoordsToSphericalCoords({textureX:r[0],textureY:r[1]}),[a.yaw,a.pitch]})):this.definition=e.map(s=>s.map(r=>{let a;return ae.isExtendedPosition(r)?a=this.viewer.dataHelper.cleanPosition(r):a=this.viewer.dataHelper.cleanPosition({yaw:r[0],pitch:r[1]}),[a.yaw,a.pitch]}))}catch(e){throw new te(`invalid marker ${this.id} position`,e)}if(this.positions3D=this.coords.map(e=>e.map(s=>this.viewer.dataHelper.sphericalCoordsToVector3({yaw:s[0],pitch:s[1]}))),this.isPolygon){const e=Zp(this.positions3D[0]);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(e)}else{const e=gM(this.coords[0]);this.state.position={yaw:e[0],pitch:e[1]}}this.state.positions3D=this.positions3D[0]}__getAllPolyPositions(){return this.positions3D.map(n=>this.__getPolyPositions(n))}__getPolyPositions(n){const t=n.length,e=n.map(r=>({vector:r,visible:r.dot(this.viewer.state.direction)>0})),s=[];return e.forEach((r,a)=>{r.visible||[a===0?e[t-1]:e[a-1],a===t-1?e[0]:e[a+1]].forEach(h=>{h.visible&&s.push({visible:h.vector,invisible:r.vector,index:a})})}),s.reverse().forEach(r=>{e.splice(r.index,0,{vector:_M(r.visible,r.invisible,this.viewer.state.direction),visible:!0})}),e.filter(r=>r.visible).map(r=>this.viewer.dataHelper.vector3ToViewerCoords(r.vector))}},wM=class extends Ta{get svgElement(){return this.domElement.firstElementChild}constructor(n,t,e){super(n,t,e)}isSvg(){return!0}createElement(){const n=this.type==="square"?"rect":this.type,t=document.createElementNS(wa,n);this.element=document.createElementNS(wa,"svg"),this.element.appendChild(t),this.afterCreateElement()}update(n){super.update(n);const t=this.svgElement;switch(this.needsUpdateSize=!0,this.type){case"square":this.definition={x:0,y:0,width:this.config.square,height:this.config.square};break;case"rect":Array.isArray(this.config.rect)?this.definition={x:0,y:0,width:this.config.rect[0],height:this.config.rect[1]}:this.definition={x:0,y:0,width:this.config.rect.width,height:this.config.rect.height};break;case"circle":this.definition={cx:this.config.circle,cy:this.config.circle,r:this.config.circle};break;case"ellipse":Array.isArray(this.config.ellipse)?this.definition={cx:this.config.ellipse[0],cy:this.config.ellipse[1],rx:this.config.ellipse[0],ry:this.config.ellipse[1]}:this.definition={cx:this.config.ellipse.rx,cy:this.config.ellipse.ry,rx:this.config.ellipse.rx,ry:this.config.ellipse.ry};break;case"path":this.definition={d:this.config.path};break}Object.entries(this.definition).forEach(([e,s])=>{t.setAttributeNS(null,e,s)}),this.config.svgStyle?Object.entries(this.config.svgStyle).forEach(([e,s])=>{t.setAttributeNS(null,ae.dasherize(e),s)}):t.setAttributeNS(null,"fill","rgba(0,0,0,0.5)")}},SM=ae.getConfigParser({clickEventOnMarker:!1,gotoMarkerSpeed:"8rpm",markers:null,defaultHoverScale:null},{defaultHoverScale(n){return n?(n===!0&&(n=lh),typeof n=="number"&&(n={amount:n}),{...lh,...n}):null}});function MM(n){switch(ch(n,!1)){case"image":case"html":case"element":return EM;case"imageLayer":case"videoLayer":return vM;case"elementLayer":return yM;case"polygon":case"polyline":case"polygonPixels":case"polylinePixels":return xM;case"square":case"rect":case"circle":case"ellipse":case"path":return wM;default:throw new te("invalid marker type")}}var eo=class Kg extends dp{constructor(t,e){super(t,e),this.markers={},this.state={allVisible:!0,showAllTooltips:!1,currentMarker:null,hoveringMarker:null,needsReRender:!1,lastClientX:null,lastClientY:null},this.container=document.createElement("div"),this.container.className="psv-markers",this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",s=>s.preventDefault()),this.svgContainer=document.createElementNS(wa,"svg"),this.svgContainer.setAttribute("class","psv-markers-svg-container"),this.container.appendChild(this.svgContainer),this.css3DContainer=new cM(t),this.container.appendChild(this.css3DContainer.element),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0)}static withConfig(t){return[Kg,t]}init(){super.init(),ae.checkStylesheet(this.viewer.container,"markers-plugin"),this.viewer.addEventListener(Jt.ClickEvent.type,this),this.viewer.addEventListener(Jt.DoubleClickEvent.type,this),this.viewer.addEventListener(Jt.RenderEvent.type,this),this.viewer.addEventListener(Jt.ConfigChangedEvent.type,this),this.viewer.addEventListener(Jt.ObjectEnterEvent.type,this),this.viewer.addEventListener(Jt.ObjectHoverEvent.type,this),this.viewer.addEventListener(Jt.ObjectLeaveEvent.type,this),this.viewer.addEventListener(Jt.ReadyEvent.type,this,{once:!0})}destroy(){this.clearMarkers(!1),this.viewer.unobserveObjects(Ne),this.viewer.removeEventListener(Jt.ClickEvent.type,this),this.viewer.removeEventListener(Jt.DoubleClickEvent.type,this),this.viewer.removeEventListener(Jt.RenderEvent.type,this),this.viewer.removeEventListener(Jt.ObjectEnterEvent.type,this),this.viewer.removeEventListener(Jt.ObjectHoverEvent.type,this),this.viewer.removeEventListener(Jt.ObjectLeaveEvent.type,this),this.viewer.removeEventListener(Jt.ReadyEvent.type,this),this.css3DContainer.destroy(),this.viewer.container.removeChild(this.container),super.destroy()}handleEvent(t){switch(t.type){case Jt.ReadyEvent.type:this.config.markers&&(this.setMarkers(this.config.markers),delete this.config.markers);break;case Jt.RenderEvent.type:this.renderMarkers();break;case Jt.ClickEvent.type:this.__onClick(t,!1);break;case Jt.DoubleClickEvent.type:this.__onClick(t,!0);break;case Jt.ObjectEnterEvent.type:case Jt.ObjectLeaveEvent.type:case Jt.ObjectHoverEvent.type:if(t.userDataKey===Ne){const e=t.originalEvent,s=t.object.userData[Ne];switch(t.type){case Jt.ObjectEnterEvent.type:s.config.style?.cursor?this.viewer.setCursor(s.config.style.cursor):(s.config.tooltip||s.config.content)&&this.viewer.setCursor("pointer"),this.__onEnterMarker(e,s);break;case Jt.ObjectLeaveEvent.type:this.viewer.setCursor(null),this.__onLeaveMarker(s);break;case Jt.ObjectHoverEvent.type:this.__onHoverMarker(e,s);break}}break;case"mouseenter":{const e=this.__getTargetMarker(ae.getEventTarget(t));this.__onEnterMarker(t,e);break}case"mouseleave":{const e=this.__getTargetMarker(ae.getEventTarget(t));this.__onLeaveMarker(e);break}case"mousemove":{const e=this.__getTargetMarker(ae.getEventTarget(t),!0);this.__onHoverMarker(t,e);break}}}toggleAllMarkers(){this.state.allVisible?this.hideAllMarkers():this.showAllMarkers()}showAllMarkers(){this.state.allVisible=!0,Object.values(this.markers).forEach(t=>{t.config.visible=!0}),this.renderMarkers(),this.dispatchEvent(new Kr)}hideAllMarkers(){this.state.allVisible=!1,Object.values(this.markers).forEach(t=>{t.config.visible=!1}),this.renderMarkers(),this.dispatchEvent(new Jr)}toggleAllTooltips(){this.state.showAllTooltips?this.hideAllTooltips():this.showAllTooltips()}showAllTooltips(){this.state.showAllTooltips=!0,Object.values(this.markers).forEach(t=>{t.state.staticTooltip=!0,t.showTooltip()})}hideAllTooltips(){this.state.showAllTooltips=!1,Object.values(this.markers).forEach(t=>{t.state.staticTooltip=!1,t.hideTooltip()})}getNbMarkers(){return Object.keys(this.markers).length}getMarkers(){return Object.values(this.markers)}addMarker(t,e=!0){if(this.markers[t.id])throw new te(`marker "${t.id}" already exists`);const s=new(MM(t))(this.viewer,this,t);s.isPoly()?this.svgContainer.appendChild(s.domElement):s.isCss3d()?this.css3DContainer.addObject(s):s.is3d()?this.viewer.renderer.addObject(s.threeElement):this.container.appendChild(s.domElement),this.markers[s.id]=s,this.state.showAllTooltips&&(s.state.staticTooltip=!0),e&&this.__afterChangeMarkers()}getMarker(t){const e=typeof t=="object"?t.id:t;if(!this.markers[e])throw new te(`cannot find marker "${e}"`);return this.markers[e]}getCurrentMarker(){return this.state.currentMarker}updateMarker(t,e=!0){const s=this.getMarker(t.id);s.update(t),e&&(this.__afterChangeMarkers(),(s===this.state.hoveringMarker&&s.config.tooltip?.trigger==="hover"||s.state.staticTooltip)&&s.showTooltip(this.state.lastClientX,this.state.lastClientY,!0))}removeMarker(t,e=!0){const s=this.getMarker(t);s.isPoly()?this.svgContainer.removeChild(s.domElement):s.isCss3d()?this.css3DContainer.removeObject(s):s.is3d()?this.viewer.renderer.removeObject(s.threeElement):this.container.removeChild(s.domElement),this.state.hoveringMarker===s&&(this.state.hoveringMarker=null),this.state.currentMarker===s&&(this.state.currentMarker=null),s.destroy(),delete this.markers[s.id],e&&this.__afterChangeMarkers()}removeMarkers(t,e=!0){t.forEach(s=>this.removeMarker(s,!1)),e&&this.__afterChangeMarkers()}setMarkers(t,e=!0){this.clearMarkers(!1),t?.forEach(s=>{this.addMarker(s,!1)}),e&&this.__afterChangeMarkers()}clearMarkers(t=!0){Object.keys(this.markers).forEach(e=>{this.removeMarker(e,!1)}),t&&this.__afterChangeMarkers()}gotoMarker(t,e=this.config.gotoMarkerSpeed){const s=this.getMarker(t);return e?this.viewer.animate({...s.state.position,zoom:s.config.zoomLvl,speed:e}).then(()=>{this.dispatchEvent(new ah(s))}):(this.viewer.rotate(s.state.position),ae.isNil(s.config.zoomLvl)||this.viewer.zoom(s.config.zoomLvl),this.dispatchEvent(new ah(s)),Promise.resolve())}hideMarker(t){this.toggleMarker(t,!1)}showMarker(t){this.toggleMarker(t,!0)}showMarkerTooltip(t){const e=this.getMarker(t);e.state.staticTooltip=!0,e.showTooltip()}hideMarkerTooltip(t){const e=this.getMarker(t);e.state.staticTooltip=!1,e.hideTooltip()}toggleMarker(t,e){const s=this.getMarker(t);s.config.visible=ae.isNil(e)?!s.config.visible:e,this.renderMarkers()}showMarkerPanel(t){const e=this.getMarker(t);e.config.content?this.viewer.panel.show({id:to,content:e.config.content}):this.hideMarkerPanel()}hideMarkerPanel(){this.viewer.panel.hide(to)}toggleMarkersList(){this.viewer.panel.isVisible(nr)?this.hideMarkersList():this.showMarkersList()}showMarkersList(){let t=[];Object.values(this.markers).forEach(s=>{s.config.visible&&!s.config.hideList&&t.push(s)});const e=new zp(t);this.dispatchEvent(e),t=e.markers,this.viewer.panel.show({id:nr,content:sM(t,this.viewer.config.lang[$r.id]),noMargin:!0,clickHandler:s=>{const r=ae.getClosest(s,".psv-panel-menu-item"),a=r?r.dataset[Ne]:void 0;if(a){const l=this.getMarker(a);this.dispatchEvent(new Ip(l)),this.gotoMarker(l.id),this.hideMarkersList()}}})}hideMarkersList(){this.viewer.panel.hide(nr)}renderMarkers(){if(this.state.needsReRender){this.state.needsReRender=!1;return}const t=this.viewer.getZoomLevel(),e=this.viewer.getPosition(),s=this.state.hoveringMarker;Object.values(this.markers).forEach(r=>{let a=r.config.visible,l=!1,h=null;a&&(h=r.render({viewerPosition:e,zoomLevel:t,hoveringMarker:s}),a=!!h),l=r.state.visible!==a,r.state.visible=a,r.state.position2D=h,r.domElement&&ae.toggleClass(r.domElement,"psv-marker--visible",a),a?r.state.staticTooltip?r.showTooltip():r!==this.state.hoveringMarker&&r.hideTooltip():r.hideTooltip(),l&&(this.dispatchEvent(new Sp(r,a)),(r.is3d()||r.isCss3d())&&(this.state.needsReRender=!0))}),this.state.needsReRender&&this.viewer.needsUpdate()}__getTargetMarker(t,e=!1){if(t instanceof Node){const s=e?ae.getClosest(t,".psv-marker"):t;return s?s[Ne]:void 0}else return Array.isArray(t)?t.map(s=>s.userData[Ne]).filter(s=>!!s).sort((s,r)=>r.config.zIndex-s.config.zIndex)[0]:null}__onEnterMarker(t,e){e&&(this.state.hoveringMarker=e,this.state.lastClientX=t.clientX,this.state.lastClientY=t.clientY,this.dispatchEvent(new Cp(e)),e instanceof Ta&&e.applyScale({zoomLevel:this.viewer.getZoomLevel(),viewerPosition:this.viewer.getPosition(),mouseover:!0}),!e.state.staticTooltip&&e.config.tooltip?.trigger==="hover"&&e.showTooltip(t.clientX,t.clientY))}__onLeaveMarker(t){t&&(this.dispatchEvent(new bp(t)),t instanceof Ta&&t.applyScale({zoomLevel:this.viewer.getZoomLevel(),viewerPosition:this.viewer.getPosition(),mouseover:!1}),this.state.hoveringMarker=null,!t.state.staticTooltip&&t.config.tooltip?.trigger==="hover"?t.hideTooltip():t.state.staticTooltip&&t.showTooltip())}__onHoverMarker(t,e){e&&(this.state.lastClientX=t.clientX,this.state.lastClientY=t.clientY,(e.isPoly()||e.is3d()||e.isCss3d())&&e.config.tooltip?.trigger==="hover"&&e.showTooltip(t.clientX,t.clientY))}__onClick(t,e){const s=this.__getTargetMarker(t.data.objects),a=this.__getTargetMarker(t.data.target,!0)||s;this.state.currentMarker&&this.state.currentMarker!==a&&(this.dispatchEvent(new kp(this.state.currentMarker)),this.viewer.panel.hide(to),!this.state.showAllTooltips&&this.state.currentMarker.config.tooltip?.trigger==="click"&&this.hideMarkerTooltip(this.state.currentMarker.id),this.state.currentMarker=null),a&&(this.state.currentMarker=a,this.dispatchEvent(new Rp(a,e,t.data.rightclick)),this.config.clickEventOnMarker?t.data.marker=a:t.stopImmediatePropagation(),this.markers[a.id]&&!t.data.rightclick&&(a.config.tooltip?.trigger==="click"?a.tooltip?this.hideMarkerTooltip(a.id):this.showMarkerTooltip(a.id):this.showMarkerPanel(a.id)))}__afterChangeMarkers(){this.__refreshUi(),this.__checkObjectsObserver(),this.viewer.needsUpdate(),this.dispatchEvent(new Np(this.getMarkers()))}__refreshUi(){const t=Object.values(this.markers).filter(e=>!e.config.hideList).length;t===0?(this.viewer.panel.hide(to),this.viewer.panel.hide(nr)):this.viewer.panel.isVisible(nr)?this.showMarkersList():this.viewer.panel.isVisible(to)&&(this.state.currentMarker?this.showMarkerPanel(this.state.currentMarker.id):this.viewer.panel.hide()),this.viewer.navbar.getButton($r.id,!1)?.toggle(t>0),this.viewer.navbar.getButton(Sa.id,!1)?.toggle(t>0)}__checkObjectsObserver(){Object.values(this.markers).some(e=>e.is3d())?this.viewer.observeObjects(Ne):this.viewer.unobserveObjects(Ne)}};eo.id="markers",eo.VERSION="5.14.0",eo.configParser=SM,eo.readonlyOptions=["markers"];var jp=eo;xi.lang[$r.id]="Markers",xi.lang[Sa.id]="Markers list",ih($r,"caption:left"),ih(Sa,"caption:left");var Jp=(n=>(n[n.Manual=0]="Manual",n[n.Intelligent=1]="Intelligent",n[n.RTK=2]="RTK",n[n.RealTimeTrack=3]="RealTimeTrack",n[n.Drone=4]="Drone",n))(Jp||{}),He=(n=>(n[n.StoreMissParams=1e4]="StoreMissParams",n[n.StoreNoCSTree=10001]="StoreNoCSTree",n[n.StoreNoRecord=10002]="StoreNoRecord",n[n.StoreInvRecord=10003]="StoreInvRecord",n[n.StoreRecordOutCSTree=10004]="StoreRecordOutCSTree",n[n.StoreNoCSByID=10005]="StoreNoCSByID",n[n.StoreSelectNoRecord=10006]="StoreSelectNoRecord",n[n.StoreSelectNoPoint=10007]="StoreSelectNoPoint",n[n.StoreSelectNoMarker=10008]="StoreSelectNoMarker",n[n.StoreSelectedMarker=10009]="StoreSelectedMarker",n[n.StroeNoModelValue=10010]="StroeNoModelValue",n[n.StoreNoProjectDetail=10011]="StoreNoProjectDetail",n[n.ViewModeNoAuto=10012]="ViewModeNoAuto",n))(He||{}),Aa=(n=>(n[n.NUMBER=0]="NUMBER",n[n.DISTANCE=1]="DISTANCE",n))(Aa||{}),dh=(n=>(n.pin="pin",n))(dh||{}),Yi=(n=>(n[n.Forward=1]="Forward",n[n.Stationary=0]="Stationary",n[n.Backward=-1]="Backward",n))(Yi||{}),ir=(n=>(n[n.Auto=0]="Auto",n[n.FollowRoad=1]="FollowRoad",n[n.FollowView=2]="FollowView",n))(ir||{});class gs{id="";img="";patrolId="";coordinate=new Mt.Coordinate;point=new Mt.Point;position;placeholderImg;uxTime;panorama;color;index;rawIndex;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static parsedModel(t,e,s,r){const{x:a,y:l,z:h,lon:u,lat:d,alt:p,p:m,img:_,patroIndex:E,...S}=t,w=Number(E)||0,v={...S,rawIndex:w,img:_,coordinate:e},g=Mt.Point.toRadians(Number(m)||0),I=new Mt.Point({x:a,y:l,z:h,lon:u,lat:d,alt:p,yaw:g});return _&&(v.panorama=L_(_,s,r)),(I.hasXYZ||I.hasXYZ)&&(v.point=I),v}static toSphericalCoord(t,e){const s=e.x-t.x,r=e.y-t.y,a=Math.hypot(s,r);if(a<1e-6)return{d:0,yaw:0,pitch:0};const l=(r<0?-Math.acos(s/a):Math.acos(s/a))-t.yaw,h=-Math.atan(1800/a);return{d:a,yaw:l,pitch:h}}projection(t,e){if(!this.point)return;const s=new gs(this),r=s.point?.projection(t.srcToDstRelativeMap,t.srcCoordinate,t.dstCoordinate),a=s.point?.projection(e.srcToDstRelativeMap,e.srcCoordinate,e.dstCoordinate);if(!(!r||!a))return s.coordinate=t.dstCoordinate,s.point=r,s.position=a,s}}class no{id="";pointId="";patrolId="";coordinateId=0;coordinate=new Mt.Coordinate;point=new Mt.Point;relativePosition;perspective;photoTime;panorama;markerIcon;markerType;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static parsedModel(t,e){const{coordinateId:s,relativePosition:r,perspective:a,point:l}=t,h={...t};if(s&&e){let u=e?.findCsById(s);if(Mt.RelativeMap.isValid(r)){const d=Mt.RelativeMap.toParse(r);u=new Mt.Coordinate({parent:u,type:Mt.CoordinateType.Data,relativeMap:d})}h.coordinate=u}return a&&(h.perspective=Mt.Position.toParse(a)),l&&(h.point=Mt.Point.toParse(l)),h}projection(t){if(!this.coordinate||!this.point)return;const e=this.coordinate.getDestRelativeMap(t);if(!e)return;const s=new no(this),r=s.point?.projection(e,s.coordinate,t);if(r)return s.point=r,s.coordinate=t,s}}/**
3947
+ `,dM=class extends vi{get map(){return this.uniforms.map.value}set map(n){this.uniforms.map.value=n}set alpha(n){this.uniforms.alpha.value=n}get offset(){return this.uniforms.offset.value}get repeat(){return this.uniforms.repeat.value}set chromaKey(n){this.uniforms.keying.value=n?.enabled===!0,n?.enabled&&(typeof n.color=="object"&&"r"in n.color?this.uniforms.color.value.set(n.color.r/255,n.color.g/255,n.color.b/255):this.uniforms.color.value.set(n.color??65280),this.uniforms.similarity.value=n.similarity??.2,this.uniforms.smoothness.value=n.smoothness??.2)}constructor(n){super({transparent:!0,depthTest:!1,depthWrite:!1,uniforms:{map:{value:n?.map},repeat:{value:new Ae(1,1)},offset:{value:new Ae(0,0)},alpha:{value:n?.alpha??1},keying:{value:!1},color:{value:new Pe(65280)},similarity:{value:.2},smoothness:{value:.2},spill:{value:.1}},vertexShader:uM,fragmentShader:hM}),this.chromaKey=n?.chromaKey}};function fM({src:n,withCredentials:t,muted:e,autoplay:s}){const r=document.createElement("video");return r.crossOrigin=t?"use-credentials":"anonymous",r.loop=!0,r.playsInline=!0,r.autoplay=s,r.muted=e,r.preload="metadata",n instanceof MediaStream?r.srcObject=n:r.src=n,r}function pM(n,t,e){const[s,r]=n,[a,l]=t,h=oe.greatArcDistance(n,t),u=Math.sin((1-e)*h)/Math.sin(h),d=Math.sin(e*h)/Math.sin(h),p=u*Math.cos(r)*Math.cos(s)+d*Math.cos(l)*Math.cos(a),m=u*Math.cos(r)*Math.sin(s)+d*Math.cos(l)*Math.sin(a),_=u*Math.sin(r)+d*Math.sin(l);return[Math.atan2(m,p),Math.atan2(_,Math.sqrt(p*p+m*m))]}function mM(n){const t=[n[0]];let e=0;for(let s=1;s<n.length;s++){const r=n[s-1][0]-n[s][0];r>Math.PI?e+=1:r<-Math.PI&&(e-=1),t.push([n[s][0]+e*2*Math.PI,n[s][1]])}return t}function Zp(n){return n.reduce((t,e)=>t.add(e),new q).normalize()}function gM(n){const t=mM(n);let e=0;const s=[];for(let a=0;a<t.length-1;a++){const l=oe.greatArcDistance(t[a],t[a+1])*Ks.SPHERE_RADIUS;s.push(l),e+=l}let r=0;for(let a=0;a<t.length-1;a++){if(r+s[a]>e/2){const l=(e/2-r)/s[a];return pM(t[a],t[a+1],l)}r+=s[a]}return t[Math.round(t.length/2)]}var ba=new q,Xp=new q,uh=new q,Yp=new q,qp=new q,Qp=new q;function _M(n,t,e){ba.copy(e).normalize(),Xp.crossVectors(n,t).normalize(),uh.crossVectors(Xp,n).normalize(),Yp.copy(n).multiplyScalar(-ba.dot(uh)),qp.copy(uh).multiplyScalar(ba.dot(n));const s=new q().addVectors(Yp,qp).normalize();return Qp.crossVectors(s,ba),s.applyAxisAngle(Qp,.01).multiplyScalar(Ks.SPHERE_RADIUS)}var vM=class extends Wp{get threeElement(){return this.element}get threeMesh(){return this.threeElement.children[0]}get video(){return this.type==="videoLayer"?this.threeMesh.material.map.image:null}constructor(n,t,e){super(n,t,e)}is3d(){return!0}createElement(){const n=new dM({alpha:0}),t=new Ir(1,1),e=new pn(t,n);e.userData={[Ne]:this},Object.defineProperty(e,"visible",{enumerable:!0,get:function(){return this.userData[Ne].config.visible},set:function(s){this.userData[Ne].config.visible=s}}),this.element=new zi().add(e),this.type==="videoLayer"&&this.viewer.needsContinuousUpdate(!0)}destroy(){delete this.threeMesh.userData[Ne],this.type==="videoLayer"&&(this.video.pause(),this.viewer.needsContinuousUpdate(!1)),super.destroy()}render(){return this.viewer.renderer.isObjectVisible(this.threeMesh)?this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position):null}update(n){super.update(n);const t=this.threeMesh,e=t.parent,s=t.material;if(oe.isExtendedPosition(this.config.position)){try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(a){throw new $t(`invalid marker ${this.id} position`,a)}if(!this.config.size)throw new $t(`missing marker ${this.id} size`);this.state.size=this.config.size,t.scale.set(this.config.size.width/100,this.config.size.height/100,1),t.position.set(t.scale.x*(.5-this.state.anchor.x),t.scale.y*(this.state.anchor.y-.5),0),t.rotation.set(0,0,0),this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position,e.position),e.lookAt(0,e.position.y,0),t.rotateY(-this.config.rotation.yaw),t.rotateX(-this.config.rotation.pitch),t.rotateZ(-this.config.rotation.roll);const r=t.geometry.getAttribute("position");this.state.positions3D=[0,1,3,2].map(a=>{const l=new q;return l.fromBufferAttribute(r,a),t.localToWorld(l)})}else{if(this.config.position?.length!==4)throw new $t(`missing marker ${this.id} position`);let r;try{r=this.config.position.map(u=>this.viewer.dataHelper.cleanPosition(u))}catch(u){throw new $t(`invalid marker ${this.id} position`,u)}const a=r.map(u=>this.viewer.dataHelper.sphericalCoordsToVector3(u)),l=Zp(a);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(l),this.state.positions3D=a;const h=t.geometry.getAttribute("position");[a[0],a[1],a[3],a[2]].forEach((u,d)=>{h.setX(d,u.x),h.setY(d,u.y),h.setZ(d,u.z)}),h.needsUpdate=!0,this.__setTextureWrap(s)}switch(this.type){case"videoLayer":if(this.definition!==this.config.videoLayer){s.map?.dispose();const r=fM({src:this.config.videoLayer,withCredentials:this.viewer.config.withCredentials(this.config.videoLayer),muted:!0,autoplay:this.config.autoplay??!0}),a=new N0(r);s.map=a,s.alpha=0,r.addEventListener("loadedmetadata",()=>{this.viewer&&(s.alpha=this.config.opacity,oe.isExtendedPosition(this.config.position)||(t.material.userData[Ne]={width:r.videoWidth,height:r.videoHeight},this.__setTextureWrap(s)))},{once:!0}),r.autoplay&&r.play(),this.definition=this.config.videoLayer}else s.alpha=this.config.opacity;break;case"imageLayer":if(this.definition!==this.config.imageLayer){s.map?.dispose();const r=new Je;s.map=r,s.alpha=0,this.viewer.textureLoader.loadImage(this.config.imageLayer).then(a=>{this.viewer&&(oe.isExtendedPosition(this.config.position)||(t.material.userData[Ne]={width:a.width,height:a.height},this.__setTextureWrap(s)),r.image=a,r.anisotropy=4,r.needsUpdate=!0,s.alpha=this.config.opacity,this.viewer.needsUpdate())}),this.definition=this.config.imageLayer}else s.alpha=this.config.opacity;break}s.chromaKey=this.config.chromaKey,t.renderOrder=1e3+this.config.zIndex,t.geometry.boundingBox=null}__setTextureWrap(n){const t=n.userData[Ne];if(!t||!t.height||!t.width){n.repeat.set(1,1),n.offset.set(0,0);return}const e=this.config.position.map(m=>this.viewer.dataHelper.cleanPosition(m)),s=oe.greatArcDistance([e[0].yaw,e[0].pitch],[e[1].yaw,e[1].pitch]),r=oe.greatArcDistance([e[3].yaw,e[3].pitch],[e[2].yaw,e[2].pitch]),a=oe.greatArcDistance([e[1].yaw,e[1].pitch],[e[2].yaw,e[2].pitch]),l=oe.greatArcDistance([e[0].yaw,e[0].pitch],[e[3].yaw,e[3].pitch]),h=(s+r)/(a+l),u=t.width/t.height;let d=0,p=0;h<u?d=u-h:p=1/u-1/h,n.repeat.set(1-d,1-p),n.offset.set(d/2,p/2)}},yM=class extends hh{constructor(n,t,e){super(n,t,e),this.viewportIntersection=!1}get threeElement(){return this.object}isCss3d(){return!0}createElement(){this.element=document.createElement("div"),this.object=new oM(this.element),this.object.userData={[Ne]:this},Object.defineProperty(this.object,"visible",{enumerable:!0,get:function(){return this.userData[Ne].config.visible},set:function(n){this.userData[Ne].config.visible=n}}),this.afterCreateElement()}destroy(){delete this.object.userData[Ne],delete this.object,super.destroy()}render({viewerPosition:n,zoomLevel:t}){const e=this.domElement;if(this.state.size={width:e.offsetWidth,height:e.offsetHeight},this.state.positions3D[0].dot(this.viewer.state.direction)>0&&this.viewportIntersection){const r=this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position);return this.config.elementLayer.updateMarker?.({marker:this,position:r,viewerPosition:n,zoomLevel:t,viewerSize:this.viewer.state.size}),r}else return null}update(n){if(super.update(n),!oe.isExtendedPosition(this.config.position))throw new $t(`missing marker ${this.id} position`);try{this.state.position=this.viewer.dataHelper.cleanPosition(this.config.position)}catch(s){throw new $t(`invalid marker ${this.id} position`,s)}this.state.positions3D=[this.viewer.dataHelper.sphericalCoordsToVector3(this.state.position)];const t=this.threeElement,e=this.domElement;e.classList.add("psv-marker--css3d"),e.childNodes.forEach(s=>s.remove()),e.appendChild(this.config.elementLayer),this.config.elementLayer.style.display="block",t.position.copy(this.state.positions3D[0]).multiplyScalar(100),t.lookAt(0,this.state.positions3D[0].y*100,0),t.rotateY(-this.config.rotation.yaw),t.rotateX(-this.config.rotation.pitch),t.rotateZ(-this.config.rotation.roll)}},EM=class extends Ta{constructor(n,t,e){super(n,t,e)}isNormal(){return!0}createElement(){this.element=document.createElement("div"),this.afterCreateElement()}render(n){const t=super.render(n);return t&&this.type==="element"&&this.config.element.updateMarker?.({marker:this,position:t,viewerPosition:n.viewerPosition,zoomLevel:n.zoomLevel,viewerSize:this.viewer.state.size}),t}update(n){super.update(n);const t=this.domElement;if(this.config.image&&!this.config.size)throw new $t(`missing marker ${this.id} size`);switch(this.config.size?(this.needsUpdateSize=!1,this.state.size=this.config.size,t.style.width=this.config.size.width+"px",t.style.height=this.config.size.height+"px"):this.needsUpdateSize=!0,this.type){case"image":this.definition=this.config.image,t.style.backgroundImage=`url("${this.config.image}")`;break;case"html":this.definition=this.config.html,t.innerHTML=this.config.html;break;case"element":this.definition!==this.config.element&&(this.definition=this.config.element,t.childNodes.forEach(e=>e.remove()),t.appendChild(this.config.element),this.config.element.style.display="block");break}}},xM=class extends hh{constructor(n,t,e){super(n,t,e)}createElement(){this.element=document.createElementNS(wa,"path"),this.element[Ne]=this}isPoly(){return!0}get isPixels(){return this.type==="polygonPixels"||this.type==="polylinePixels"}get isPolygon(){return this.type==="polygon"||this.type==="polygonPixels"}get isPolyline(){return this.type==="polyline"||this.type==="polylinePixels"}get coords(){return this.definition}render(){const n=this.__getAllPolyPositions();if(n[0].length>(this.isPolygon?2:1)){const e=this.viewer.dataHelper.sphericalCoordsToViewerCoords(this.state.position),s=n.filter(r=>r.length>0).map(r=>{let a="M";return a+=r.map(l=>`${l.x-e.x},${l.y-e.y}`).join("L"),this.isPolygon&&(a+="Z"),a}).join(" ");return this.domElement.setAttributeNS(null,"d",s),this.domElement.setAttributeNS(null,"transform",`translate(${e.x} ${e.y})`),e}else return null}update(n){super.update(n);const t=this.domElement;t.classList.add("psv-marker--poly"),this.config.svgStyle?(Object.entries(this.config.svgStyle).forEach(([e,s])=>{t.setAttributeNS(null,oe.dasherize(e),s)}),this.isPolyline&&!this.config.svgStyle.fill&&t.setAttributeNS(null,"fill","none")):this.isPolygon?t.setAttributeNS(null,"fill","rgba(0,0,0,0.5)"):this.isPolyline&&(t.setAttributeNS(null,"fill","none"),t.setAttributeNS(null,"stroke","rgb(0,0,0)"));try{let e=this.config[this.type];if(!Array.isArray(e[0])&&typeof e[0]!="object")for(let s=0;s<e.length;s++)e.splice(s,2,[e[s],e[s+1]]);if(!Array.isArray(e[0][0])&&typeof e[0][0]!="object"&&(e=[e]),this.isPolyline&&e.length>1)throw new $t("polylines cannot have holes");this.isPixels?this.definition=e.map(s=>s.map(r=>{let a;return oe.isExtendedPosition(r)?a=this.viewer.dataHelper.cleanPosition(r):a=this.viewer.dataHelper.textureCoordsToSphericalCoords({textureX:r[0],textureY:r[1]}),[a.yaw,a.pitch]})):this.definition=e.map(s=>s.map(r=>{let a;return oe.isExtendedPosition(r)?a=this.viewer.dataHelper.cleanPosition(r):a=this.viewer.dataHelper.cleanPosition({yaw:r[0],pitch:r[1]}),[a.yaw,a.pitch]}))}catch(e){throw new $t(`invalid marker ${this.id} position`,e)}if(this.positions3D=this.coords.map(e=>e.map(s=>this.viewer.dataHelper.sphericalCoordsToVector3({yaw:s[0],pitch:s[1]}))),this.isPolygon){const e=Zp(this.positions3D[0]);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(e)}else{const e=gM(this.coords[0]);this.state.position={yaw:e[0],pitch:e[1]}}this.state.positions3D=this.positions3D[0]}__getAllPolyPositions(){return this.positions3D.map(n=>this.__getPolyPositions(n))}__getPolyPositions(n){const t=n.length,e=n.map(r=>({vector:r,visible:r.dot(this.viewer.state.direction)>0})),s=[];return e.forEach((r,a)=>{r.visible||[a===0?e[t-1]:e[a-1],a===t-1?e[0]:e[a+1]].forEach(h=>{h.visible&&s.push({visible:h.vector,invisible:r.vector,index:a})})}),s.reverse().forEach(r=>{e.splice(r.index,0,{vector:_M(r.visible,r.invisible,this.viewer.state.direction),visible:!0})}),e.filter(r=>r.visible).map(r=>this.viewer.dataHelper.vector3ToViewerCoords(r.vector))}},wM=class extends Ta{get svgElement(){return this.domElement.firstElementChild}constructor(n,t,e){super(n,t,e)}isSvg(){return!0}createElement(){const n=this.type==="square"?"rect":this.type,t=document.createElementNS(wa,n);this.element=document.createElementNS(wa,"svg"),this.element.appendChild(t),this.afterCreateElement()}update(n){super.update(n);const t=this.svgElement;switch(this.needsUpdateSize=!0,this.type){case"square":this.definition={x:0,y:0,width:this.config.square,height:this.config.square};break;case"rect":Array.isArray(this.config.rect)?this.definition={x:0,y:0,width:this.config.rect[0],height:this.config.rect[1]}:this.definition={x:0,y:0,width:this.config.rect.width,height:this.config.rect.height};break;case"circle":this.definition={cx:this.config.circle,cy:this.config.circle,r:this.config.circle};break;case"ellipse":Array.isArray(this.config.ellipse)?this.definition={cx:this.config.ellipse[0],cy:this.config.ellipse[1],rx:this.config.ellipse[0],ry:this.config.ellipse[1]}:this.definition={cx:this.config.ellipse.rx,cy:this.config.ellipse.ry,rx:this.config.ellipse.rx,ry:this.config.ellipse.ry};break;case"path":this.definition={d:this.config.path};break}Object.entries(this.definition).forEach(([e,s])=>{t.setAttributeNS(null,e,s)}),this.config.svgStyle?Object.entries(this.config.svgStyle).forEach(([e,s])=>{t.setAttributeNS(null,oe.dasherize(e),s)}):t.setAttributeNS(null,"fill","rgba(0,0,0,0.5)")}},SM=oe.getConfigParser({clickEventOnMarker:!1,gotoMarkerSpeed:"8rpm",markers:null,defaultHoverScale:null},{defaultHoverScale(n){return n?(n===!0&&(n=lh),typeof n=="number"&&(n={amount:n}),{...lh,...n}):null}});function MM(n){switch(ch(n,!1)){case"image":case"html":case"element":return EM;case"imageLayer":case"videoLayer":return vM;case"elementLayer":return yM;case"polygon":case"polyline":case"polygonPixels":case"polylinePixels":return xM;case"square":case"rect":case"circle":case"ellipse":case"path":return wM;default:throw new $t("invalid marker type")}}var eo=class Kg extends dp{constructor(t,e){super(t,e),this.markers={},this.state={allVisible:!0,showAllTooltips:!1,currentMarker:null,hoveringMarker:null,needsReRender:!1,lastClientX:null,lastClientY:null},this.container=document.createElement("div"),this.container.className="psv-markers",this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",s=>s.preventDefault()),this.svgContainer=document.createElementNS(wa,"svg"),this.svgContainer.setAttribute("class","psv-markers-svg-container"),this.container.appendChild(this.svgContainer),this.css3DContainer=new cM(t),this.container.appendChild(this.css3DContainer.element),this.container.addEventListener("mouseenter",this,!0),this.container.addEventListener("mouseleave",this,!0),this.container.addEventListener("mousemove",this,!0)}static withConfig(t){return[Kg,t]}init(){super.init(),oe.checkStylesheet(this.viewer.container,"markers-plugin"),this.viewer.addEventListener(jt.ClickEvent.type,this),this.viewer.addEventListener(jt.DoubleClickEvent.type,this),this.viewer.addEventListener(jt.RenderEvent.type,this),this.viewer.addEventListener(jt.ConfigChangedEvent.type,this),this.viewer.addEventListener(jt.ObjectEnterEvent.type,this),this.viewer.addEventListener(jt.ObjectHoverEvent.type,this),this.viewer.addEventListener(jt.ObjectLeaveEvent.type,this),this.viewer.addEventListener(jt.ReadyEvent.type,this,{once:!0})}destroy(){this.clearMarkers(!1),this.viewer.unobserveObjects(Ne),this.viewer.removeEventListener(jt.ClickEvent.type,this),this.viewer.removeEventListener(jt.DoubleClickEvent.type,this),this.viewer.removeEventListener(jt.RenderEvent.type,this),this.viewer.removeEventListener(jt.ObjectEnterEvent.type,this),this.viewer.removeEventListener(jt.ObjectHoverEvent.type,this),this.viewer.removeEventListener(jt.ObjectLeaveEvent.type,this),this.viewer.removeEventListener(jt.ReadyEvent.type,this),this.css3DContainer.destroy(),this.viewer.container.removeChild(this.container),super.destroy()}handleEvent(t){switch(t.type){case jt.ReadyEvent.type:this.config.markers&&(this.setMarkers(this.config.markers),delete this.config.markers);break;case jt.RenderEvent.type:this.renderMarkers();break;case jt.ClickEvent.type:this.__onClick(t,!1);break;case jt.DoubleClickEvent.type:this.__onClick(t,!0);break;case jt.ObjectEnterEvent.type:case jt.ObjectLeaveEvent.type:case jt.ObjectHoverEvent.type:if(t.userDataKey===Ne){const e=t.originalEvent,s=t.object.userData[Ne];switch(t.type){case jt.ObjectEnterEvent.type:s.config.style?.cursor?this.viewer.setCursor(s.config.style.cursor):(s.config.tooltip||s.config.content)&&this.viewer.setCursor("pointer"),this.__onEnterMarker(e,s);break;case jt.ObjectLeaveEvent.type:this.viewer.setCursor(null),this.__onLeaveMarker(s);break;case jt.ObjectHoverEvent.type:this.__onHoverMarker(e,s);break}}break;case"mouseenter":{const e=this.__getTargetMarker(oe.getEventTarget(t));this.__onEnterMarker(t,e);break}case"mouseleave":{const e=this.__getTargetMarker(oe.getEventTarget(t));this.__onLeaveMarker(e);break}case"mousemove":{const e=this.__getTargetMarker(oe.getEventTarget(t),!0);this.__onHoverMarker(t,e);break}}}toggleAllMarkers(){this.state.allVisible?this.hideAllMarkers():this.showAllMarkers()}showAllMarkers(){this.state.allVisible=!0,Object.values(this.markers).forEach(t=>{t.config.visible=!0}),this.renderMarkers(),this.dispatchEvent(new Kr)}hideAllMarkers(){this.state.allVisible=!1,Object.values(this.markers).forEach(t=>{t.config.visible=!1}),this.renderMarkers(),this.dispatchEvent(new Jr)}toggleAllTooltips(){this.state.showAllTooltips?this.hideAllTooltips():this.showAllTooltips()}showAllTooltips(){this.state.showAllTooltips=!0,Object.values(this.markers).forEach(t=>{t.state.staticTooltip=!0,t.showTooltip()})}hideAllTooltips(){this.state.showAllTooltips=!1,Object.values(this.markers).forEach(t=>{t.state.staticTooltip=!1,t.hideTooltip()})}getNbMarkers(){return Object.keys(this.markers).length}getMarkers(){return Object.values(this.markers)}addMarker(t,e=!0){if(this.markers[t.id])throw new $t(`marker "${t.id}" already exists`);const s=new(MM(t))(this.viewer,this,t);s.isPoly()?this.svgContainer.appendChild(s.domElement):s.isCss3d()?this.css3DContainer.addObject(s):s.is3d()?this.viewer.renderer.addObject(s.threeElement):this.container.appendChild(s.domElement),this.markers[s.id]=s,this.state.showAllTooltips&&(s.state.staticTooltip=!0),e&&this.__afterChangeMarkers()}getMarker(t){const e=typeof t=="object"?t.id:t;if(!this.markers[e])throw new $t(`cannot find marker "${e}"`);return this.markers[e]}getCurrentMarker(){return this.state.currentMarker}updateMarker(t,e=!0){const s=this.getMarker(t.id);s.update(t),e&&(this.__afterChangeMarkers(),(s===this.state.hoveringMarker&&s.config.tooltip?.trigger==="hover"||s.state.staticTooltip)&&s.showTooltip(this.state.lastClientX,this.state.lastClientY,!0))}removeMarker(t,e=!0){const s=this.getMarker(t);s.isPoly()?this.svgContainer.removeChild(s.domElement):s.isCss3d()?this.css3DContainer.removeObject(s):s.is3d()?this.viewer.renderer.removeObject(s.threeElement):this.container.removeChild(s.domElement),this.state.hoveringMarker===s&&(this.state.hoveringMarker=null),this.state.currentMarker===s&&(this.state.currentMarker=null),s.destroy(),delete this.markers[s.id],e&&this.__afterChangeMarkers()}removeMarkers(t,e=!0){t.forEach(s=>this.removeMarker(s,!1)),e&&this.__afterChangeMarkers()}setMarkers(t,e=!0){this.clearMarkers(!1),t?.forEach(s=>{this.addMarker(s,!1)}),e&&this.__afterChangeMarkers()}clearMarkers(t=!0){Object.keys(this.markers).forEach(e=>{this.removeMarker(e,!1)}),t&&this.__afterChangeMarkers()}gotoMarker(t,e=this.config.gotoMarkerSpeed){const s=this.getMarker(t);return e?this.viewer.animate({...s.state.position,zoom:s.config.zoomLvl,speed:e}).then(()=>{this.dispatchEvent(new ah(s))}):(this.viewer.rotate(s.state.position),oe.isNil(s.config.zoomLvl)||this.viewer.zoom(s.config.zoomLvl),this.dispatchEvent(new ah(s)),Promise.resolve())}hideMarker(t){this.toggleMarker(t,!1)}showMarker(t){this.toggleMarker(t,!0)}showMarkerTooltip(t){const e=this.getMarker(t);e.state.staticTooltip=!0,e.showTooltip()}hideMarkerTooltip(t){const e=this.getMarker(t);e.state.staticTooltip=!1,e.hideTooltip()}toggleMarker(t,e){const s=this.getMarker(t);s.config.visible=oe.isNil(e)?!s.config.visible:e,this.renderMarkers()}showMarkerPanel(t){const e=this.getMarker(t);e.config.content?this.viewer.panel.show({id:to,content:e.config.content}):this.hideMarkerPanel()}hideMarkerPanel(){this.viewer.panel.hide(to)}toggleMarkersList(){this.viewer.panel.isVisible(nr)?this.hideMarkersList():this.showMarkersList()}showMarkersList(){let t=[];Object.values(this.markers).forEach(s=>{s.config.visible&&!s.config.hideList&&t.push(s)});const e=new zp(t);this.dispatchEvent(e),t=e.markers,this.viewer.panel.show({id:nr,content:sM(t,this.viewer.config.lang[$r.id]),noMargin:!0,clickHandler:s=>{const r=oe.getClosest(s,".psv-panel-menu-item"),a=r?r.dataset[Ne]:void 0;if(a){const l=this.getMarker(a);this.dispatchEvent(new Ip(l)),this.gotoMarker(l.id),this.hideMarkersList()}}})}hideMarkersList(){this.viewer.panel.hide(nr)}renderMarkers(){if(this.state.needsReRender){this.state.needsReRender=!1;return}const t=this.viewer.getZoomLevel(),e=this.viewer.getPosition(),s=this.state.hoveringMarker;Object.values(this.markers).forEach(r=>{let a=r.config.visible,l=!1,h=null;a&&(h=r.render({viewerPosition:e,zoomLevel:t,hoveringMarker:s}),a=!!h),l=r.state.visible!==a,r.state.visible=a,r.state.position2D=h,r.domElement&&oe.toggleClass(r.domElement,"psv-marker--visible",a),a?r.state.staticTooltip?r.showTooltip():r!==this.state.hoveringMarker&&r.hideTooltip():r.hideTooltip(),l&&(this.dispatchEvent(new Sp(r,a)),(r.is3d()||r.isCss3d())&&(this.state.needsReRender=!0))}),this.state.needsReRender&&this.viewer.needsUpdate()}__getTargetMarker(t,e=!1){if(t instanceof Node){const s=e?oe.getClosest(t,".psv-marker"):t;return s?s[Ne]:void 0}else return Array.isArray(t)?t.map(s=>s.userData[Ne]).filter(s=>!!s).sort((s,r)=>r.config.zIndex-s.config.zIndex)[0]:null}__onEnterMarker(t,e){e&&(this.state.hoveringMarker=e,this.state.lastClientX=t.clientX,this.state.lastClientY=t.clientY,this.dispatchEvent(new Cp(e)),e instanceof Ta&&e.applyScale({zoomLevel:this.viewer.getZoomLevel(),viewerPosition:this.viewer.getPosition(),mouseover:!0}),!e.state.staticTooltip&&e.config.tooltip?.trigger==="hover"&&e.showTooltip(t.clientX,t.clientY))}__onLeaveMarker(t){t&&(this.dispatchEvent(new bp(t)),t instanceof Ta&&t.applyScale({zoomLevel:this.viewer.getZoomLevel(),viewerPosition:this.viewer.getPosition(),mouseover:!1}),this.state.hoveringMarker=null,!t.state.staticTooltip&&t.config.tooltip?.trigger==="hover"?t.hideTooltip():t.state.staticTooltip&&t.showTooltip())}__onHoverMarker(t,e){e&&(this.state.lastClientX=t.clientX,this.state.lastClientY=t.clientY,(e.isPoly()||e.is3d()||e.isCss3d())&&e.config.tooltip?.trigger==="hover"&&e.showTooltip(t.clientX,t.clientY))}__onClick(t,e){const s=this.__getTargetMarker(t.data.objects),a=this.__getTargetMarker(t.data.target,!0)||s;this.state.currentMarker&&this.state.currentMarker!==a&&(this.dispatchEvent(new kp(this.state.currentMarker)),this.viewer.panel.hide(to),!this.state.showAllTooltips&&this.state.currentMarker.config.tooltip?.trigger==="click"&&this.hideMarkerTooltip(this.state.currentMarker.id),this.state.currentMarker=null),a&&(this.state.currentMarker=a,this.dispatchEvent(new Rp(a,e,t.data.rightclick)),this.config.clickEventOnMarker?t.data.marker=a:t.stopImmediatePropagation(),this.markers[a.id]&&!t.data.rightclick&&(a.config.tooltip?.trigger==="click"?a.tooltip?this.hideMarkerTooltip(a.id):this.showMarkerTooltip(a.id):this.showMarkerPanel(a.id)))}__afterChangeMarkers(){this.__refreshUi(),this.__checkObjectsObserver(),this.viewer.needsUpdate(),this.dispatchEvent(new Np(this.getMarkers()))}__refreshUi(){const t=Object.values(this.markers).filter(e=>!e.config.hideList).length;t===0?(this.viewer.panel.hide(to),this.viewer.panel.hide(nr)):this.viewer.panel.isVisible(nr)?this.showMarkersList():this.viewer.panel.isVisible(to)&&(this.state.currentMarker?this.showMarkerPanel(this.state.currentMarker.id):this.viewer.panel.hide()),this.viewer.navbar.getButton($r.id,!1)?.toggle(t>0),this.viewer.navbar.getButton(Sa.id,!1)?.toggle(t>0)}__checkObjectsObserver(){Object.values(this.markers).some(e=>e.is3d())?this.viewer.observeObjects(Ne):this.viewer.unobserveObjects(Ne)}};eo.id="markers",eo.VERSION="5.14.0",eo.configParser=SM,eo.readonlyOptions=["markers"];var jp=eo;xi.lang[$r.id]="Markers",xi.lang[Sa.id]="Markers list",ih($r,"caption:left"),ih(Sa,"caption:left");var Jp=(n=>(n[n.Manual=0]="Manual",n[n.Intelligent=1]="Intelligent",n[n.RTK=2]="RTK",n[n.RealTimeTrack=3]="RealTimeTrack",n[n.Drone=4]="Drone",n))(Jp||{}),ze=(n=>(n[n.StoreMissParams=1e4]="StoreMissParams",n[n.StoreNoCSTree=10001]="StoreNoCSTree",n[n.StoreNoRecord=10002]="StoreNoRecord",n[n.StoreInvRecord=10003]="StoreInvRecord",n[n.StoreRecordOutCSTree=10004]="StoreRecordOutCSTree",n[n.StoreNoCSByID=10005]="StoreNoCSByID",n[n.StoreSelectNoRecord=10006]="StoreSelectNoRecord",n[n.StoreSelectNoPoint=10007]="StoreSelectNoPoint",n[n.StoreSelectNoMarker=10008]="StoreSelectNoMarker",n[n.StoreSelectedMarker=10009]="StoreSelectedMarker",n[n.StroeNoModelValue=10010]="StroeNoModelValue",n[n.StoreNoProjectDetail=10011]="StoreNoProjectDetail",n[n.ViewModeNoAuto=10012]="ViewModeNoAuto",n))(ze||{}),Aa=(n=>(n[n.NUMBER=0]="NUMBER",n[n.DISTANCE=1]="DISTANCE",n))(Aa||{}),dh=(n=>(n.pin="pin",n))(dh||{}),Yi=(n=>(n[n.Forward=1]="Forward",n[n.Stationary=0]="Stationary",n[n.Backward=-1]="Backward",n))(Yi||{}),ir=(n=>(n[n.Auto=0]="Auto",n[n.FollowRoad=1]="FollowRoad",n[n.FollowView=2]="FollowView",n))(ir||{});class gs{id="";img="";patrolId="";coordinate=new xt.Coordinate;point=new xt.Point;position;placeholderImg;uxTime;panorama;color;index;rawIndex;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static parsedModel(t,e,s,r){const{x:a,y:l,z:h,lon:u,lat:d,alt:p,p:m,img:_,patroIndex:E,...w}=t,S=Number(E)||0,v={...w,rawIndex:S,img:_,coordinate:e},g=xt.Point.toRadians(Number(m)||0),R=new xt.Point({x:a,y:l,z:h,lon:u,lat:d,alt:p,yaw:g});return _&&(v.panorama=L_(_,s,r)),(R.hasXYZ||R.hasXYZ)&&(v.point=R),v}static toSphericalCoord(t,e){const s=e.x-t.x,r=e.y-t.y,a=Math.hypot(s,r);if(a<1e-6)return{d:0,yaw:0,pitch:0};const l=(r<0?-Math.acos(s/a):Math.acos(s/a))-t.yaw,h=-Math.atan(1800/a);return{d:a,yaw:l,pitch:h}}projection(t,e){if(!this.point)return;const s=new gs(this),r=s.point?.projection(t.srcToDstRelativeMap,t.srcCoordinate,t.dstCoordinate),a=s.point?.projection(e.srcToDstRelativeMap,e.srcCoordinate,e.dstCoordinate);if(!(!r||!a))return s.coordinate=t.dstCoordinate,s.point=r,s.position=a,s}}class no{id="";pointId="";patrolId="";coordinateId=0;coordinate=new xt.Coordinate;point=new xt.Point;relativePosition;perspective;photoTime;panorama;markerIcon;markerType;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static parsedModel(t,e){const{coordinateId:s,relativePosition:r,perspective:a,point:l}=t,h={...t};if(s&&e){let u=e?.findCsById(s);if(xt.RelativeMap.isValid(r)){const d=xt.RelativeMap.toParse(r);u=new xt.Coordinate({parent:u,type:xt.CoordinateType.Data,relativeMap:d})}h.coordinate=u}return a&&(h.perspective=xt.Position.toParse(a)),l&&(h.point=xt.Point.toParse(l)),h}projection(t){if(!this.coordinate||!this.point)return;const e=this.coordinate.getDestRelativeMap(t);if(!e)return;const s=new no(this),r=s.point?.projection(e,s.coordinate,t);if(r)return s.point=r,s.coordinate=t,s}}/**
3948
3948
  * @preserve
3949
3949
  * gcoord 1.0.7, geographic coordinate library
3950
3950
  * Copyright (c) 2025 Jiulong Hu <me@hujiulong.com>
3951
- */const{sin:Tn,cos:TM,sqrt:fh,abs:Ca,PI:un}=Math,Kp=6378245,$p=.006693421622965823;function tm(n,t){return n>=72.004&&n<=137.8347&&t>=.8293&&t<=55.8271}function bM(n,t){let e=-100+2*n+3*t+.2*t*t+.1*n*t+.2*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(t*un)+40*Tn(t/3*un))*2/3,e+=(160*Tn(t/12*un)+320*Tn(t*un/30))*2/3,e}function AM(n,t){let e=300+n+2*t+.1*n*n+.1*n*t+.1*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(n*un)+40*Tn(n/3*un))*2/3,e+=(150*Tn(n/12*un)+300*Tn(n/30*un))*2/3,e}function CM(n,t){let e=AM(n-105,t-35),s=bM(n-105,t-35);const r=t/180*un;let a=Tn(r);a=1-$p*a*a;const l=fh(a);return e=e*180/(Kp/l*TM(r)*un),s=s*180/(Kp*(1-$p)/(a*l)*un),[e,s]}function qi(n){const[t,e]=n;if(!tm(t,e))return[t,e];const s=CM(t,e);return[t+s[0],e+s[1]]}function sr(n){const[t,e]=n;if(!tm(t,e))return[t,e];let[s,r]=[t,e],a=qi([s,r]),l=a[0]-t,h=a[1]-e;for(;Ca(l)>1e-6||Ca(h)>1e-6;)s-=l,r-=h,a=qi([s,r]),l=a[0]-t,h=a[1]-e;return[s,r]}const{sin:Pa,cos:Ra,atan2:em,sqrt:nm,PI:PM}=Math,La=PM*3e3/180;function rr(n){const[t,e]=n,s=t-.0065,r=e-.006,a=nm(s*s+r*r)-2e-5*Pa(r*La),l=em(r,s)-3e-6*Ra(s*La),h=a*Ra(l),u=a*Pa(l);return[h,u]}function or(n){const[t,e]=n,s=t,r=e,a=nm(s*s+r*r)+2e-5*Pa(r*La),l=em(r,s)+3e-6*Ra(s*La),h=a*Ra(l)+.0065,u=a*Pa(l)+.006;return[h,u]}const im=180/Math.PI,sm=Math.PI/180,Ia=6378137,Qi=20037508342789244e-9;function Da(n){return[n[0]*im/Ia,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/Ia)))*im]}function ka(n){const t=Math.abs(n[0])<=180?n[0]:n[0]-(n[0]<0?-1:1)*360,e=[Ia*t*sm,Ia*Math.log(Math.tan(Math.PI*.25+.5*n[1]*sm))];return e[0]>Qi&&(e[0]=Qi),e[0]<-Qi&&(e[0]=-Qi),e[1]>Qi&&(e[1]=Qi),e[1]<-Qi&&(e[1]=-Qi),e}const{abs:Ua}=Math,rm=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],om=[75,60,45,30,15,0],RM=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],LM=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]];function am(n,t,e){const s=Ua(t)/e[9];let r=e[0]+e[1]*Ua(n),a=e[2]+e[3]*s+e[4]*Math.pow(s,2)+e[5]*Math.pow(s,3)+e[6]*Math.pow(s,4)+e[7]*Math.pow(s,5)+e[8]*Math.pow(s,6);return r*=n<0?-1:1,a*=t<0?-1:1,[r,a]}function Oa(n){const[t,e]=n;let s=[];for(let r=0;r<om.length;r++)if(Ua(e)>om[r]){s=LM[r];break}return am(t,e,s)}function Na(n){const[t,e]=n;let s=[];for(let r=0;r<rm.length;r++)if(Ua(e)>=rm[r]){s=RM[r];break}return am(t,e,s)}function ji(n,t){if(!n)throw new Error(t)}function lm(n){return!!n&&Object.prototype.toString.call(n)==="[object Array]"}function cm(n){return!isNaN(Number(n))&&n!==null&&!lm(n)}function Un(...n){const t=n.length-1;return function(...e){let s=t,r=n[t].apply(null,e);for(;s--;)r=n[s].call(null,r);return r}}function hm(n,t,e=!1){if(n===null)return;let s,r,a,l,h,u,d=0,p=0,m,_;const{type:E}=n,S=E==="FeatureCollection",w=E==="Feature",v=S?n.features.length:1;for(let g=0;g<v;g++){m=S?n.features[g].geometry:w?n.geometry:n,_=m?m.type==="GeometryCollection":!1,u=_?m.geometries.length:1;for(let I=0;I<u;I++){let C=0,T=0;if(l=_?m.geometries[I]:m,l===null)continue;const U=l.type;switch(d=e&&(U==="Polygon"||U==="MultiPolygon")?1:0,U){case null:break;case"Point":if(h=l.coordinates,t(h,p,g,C,T)===!1)return!1;p++,C++;break;case"LineString":case"MultiPoint":for(h=l.coordinates,s=0;s<h.length;s++){if(t(h[s],p,g,C,T)===!1)return!1;p++,U==="MultiPoint"&&C++}U==="LineString"&&C++;break;case"Polygon":case"MultiLineString":for(h=l.coordinates,s=0;s<h.length;s++){for(r=0;r<h[s].length-d;r++){if(t(h[s][r],p,g,C,T)===!1)return!1;p++}U==="MultiLineString"&&C++,U==="Polygon"&&T++}U==="Polygon"&&C++;break;case"MultiPolygon":for(h=l.coordinates,s=0;s<h.length;s++){for(T=0,r=0;r<h[s].length;r++){for(a=0;a<h[s][r].length-d;a++){if(t(h[s][r][a],p,g,C,T)===!1)return!1;p++}T++}C++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)if(hm(l.geometries[s],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}var Be;(function(n){n.WGS84="WGS84",n.WGS1984="WGS84",n.EPSG4326="WGS84",n.GCJ02="GCJ02",n.AMap="GCJ02",n.BD09="BD09",n.BD09LL="BD09",n.Baidu="BD09",n.BMap="BD09",n.BD09MC="BD09MC",n.BD09Meter="BD09MC",n.EPSG3857="EPSG3857",n.EPSG900913="EPSG3857",n.EPSG102100="EPSG3857",n.WebMercator="EPSG3857",n.WM="EPSG3857"})(Be||(Be={}));const IM={to:{[Be.GCJ02]:qi,[Be.BD09]:Un(or,qi),[Be.BD09MC]:Un(Oa,or,qi),[Be.EPSG3857]:ka}},DM={to:{[Be.WGS84]:sr,[Be.BD09]:or,[Be.BD09MC]:Un(Oa,or),[Be.EPSG3857]:Un(ka,sr)}},kM={to:{[Be.WGS84]:Un(sr,rr),[Be.GCJ02]:rr,[Be.EPSG3857]:Un(ka,sr,rr),[Be.BD09MC]:Oa}},UM={to:{[Be.WGS84]:Da,[Be.GCJ02]:Un(qi,Da),[Be.BD09]:Un(or,qi,Da),[Be.BD09MC]:Un(Oa,or,qi,Da)}},OM={to:{[Be.WGS84]:Un(sr,rr,Na),[Be.GCJ02]:Un(rr,Na),[Be.EPSG3857]:Un(ka,sr,rr,Na),[Be.BD09]:Na}};var NM={WGS84:IM,GCJ02:DM,BD09:kM,EPSG3857:UM,BD09MC:OM};function BM(n,t,e){if(ji(!!n,"The args[0] input coordinate is required"),ji(!!t,"The args[1] original coordinate system is required"),ji(!!e,"The args[2] target coordinate system is required"),t===e)return n;const s=NM[t];ji(!!s,`Invalid original coordinate system: ${t}`);const r=s.to[e];ji(!!r,`Invalid target coordinate system: ${e}`);const a=typeof n;if(ji(a==="string"||a==="object",`Invalid input coordinate type: ${a}`),a==="string")try{n=JSON.parse(n)}catch{throw new Error(`Invalid input coordinate: ${n}`)}let l=!1;lm(n)&&(ji(n.length>=2,`Invalid input coordinate: ${n}`),ji(cm(n[0])&&cm(n[1]),`Invalid input coordinate: ${n}`),n=n.map(Number),l=!0);const h=r;return l?h(n):(hm(n,u=>{[u[0],u[1]]=h(u)}),n)}const um=Object.assign(Object.assign({},Be),{CRSTypes:Be,transform:BM});class ar{id="";coordinateId=0;coordinate=new Mt.Coordinate;trackPoints=new Map;trackMarkers=new Map;relativePosition;projectId;createTime;color;type;panoramaSize;realseeSetting;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static async parsedModel(t,e,s){const{coordinateId:r,relativePosition:a,trackList:l,markerList:h,...u}=t,d=Mt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(Mt.RelativeMap.isValid(a)){const S=Mt.RelativeMap.toParse(a);E=new Mt.Coordinate({parent:E,type:Mt.CoordinateType.Data,relativeMap:S})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await I_(l?.[0]?.img,s);d.panoramaSize=E;const S=new Map;for(const w of l){const v=gs.parsedModel({...w,patrolId:p,color:_},m,E,s);v.id&&S.set(v.id,new gs(v))}d.trackPoints=S}if(h?.length&&e){const E=new Map;for(const S of h){const w=no.parsedModel({...S,patrolId:p},e);w.id&&E.set(w.id,new no(w))}d.trackMarkers=E}return d}hasPoint(t){return this?.trackPoints?.has(t)}getPoint(t){return this?.trackPoints?.get(t)}getNearPoint(t){const e=Array.from(this?.trackPoints?.values()),s=e[0],r=e[e.length-1];return t<=(s.rawIndex??0)?s:t>=(r.rawIndex??0)?r:e.find(a=>(a.rawIndex??0)>=t)}hasMarker(t){return this?.trackMarkers?.has(t)}getMarker(t){return this?.trackMarkers?.get(t)}getPointMarkers(t){return Array.from(this?.trackMarkers?.values()).filter(e=>e.pointId===t)}projection(t,e,s){const{coordinate:r,trackPoints:a,trackMarkers:l}=this||{};if(!r||!a?.size)return;const h=r.getDestRelativeMap(t),u=r.getDestRelativeMap(e);if(!h||!u)return;const d=Array.from(l?.values()),p={srcToDstRelativeMap:h,srcCoordinate:r,dstCoordinate:t},m={srcToDstRelativeMap:u,srcCoordinate:r,dstCoordinate:e},{pointLax:_=0,trackCRSType:E}=s||{},S=new Map;let w;for(const g of a.values()){const I=g.projection(p,m);if(!I)continue;if(I.index=S.size,r.modelType===Mt.CoordinateModelType.GeoModel){const{point:T}=I;if(E&&T){const[U,N]=um.transform([T.lon,T.lat],um.WGS84,E);I.point=new Mt.Point({...T,lon:U,lat:N})}}if(_<=0){S.set(I.id,I);continue}if(d.find(T=>T.pointId===I.id)){S.set(I.id,I),w=I;continue}if(!S.size){S.set(I.id,I),w=I;continue}I.position&&w?.position&&Mt.Point.distXY(I.position,w.position)>=_&&(S.set(I.id,I),w=I)}const v=new ar(this);return v.trackPoints=S,v.coordinate=t,v.realseeSetting=s,v}getPathMarkers(t){const{pointType:e=Aa.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===Aa.NUMBER?l=this.getPointsByNumber(a,s):e===Aa.DISTANCE&&(l=this.getPointsByDistance(a,r)),this.createPathMarkers(a,l)}getPointsByDistance(t,e){if(!t.position||e<=0)return[];const{x:s,y:r}=t.position;return Array.from(this.trackPoints.values()).filter(a=>!a.position||!t.position||Math.abs(a.position.x-s)>e||Math.abs(a.position.y-r)>e?!1:Mt.Point.distXY(a.position,t.position)<=e)}getPointsByNumber(t,e){const s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}createPathMarkers(t,e){const{pathPin:s,pathRedPin:r}=this.realseeSetting||{},a=t.position;if(!a)return[];const l=[];for(const h of e){const u=h.position;if(!u)continue;const{d,yaw:p,pitch:m}=gs.toSphericalCoord(a,u);if(d===0)continue;const _=Math.min(120/(d/2e3),120),E=this.getPointMarkers(h.id).length>0;l.push({id:h.id,image:E?r:s,position:new Mt.Position({yaw:p,pitch:m}),data:{...h,markerType:dh.pin},size:{width:_,height:_/2},hoverScale:{amount:1},opacity:.8,anchor:"center center"})}return l}getViolationMarkers(t){if(!t)return[];const e=this.getPointMarkers(t.id);return this.createViolationMarkers(e)}createViolationMarkers(t){return t.map((e,s)=>({id:e.id,image:e.markerIcon,position:e.perspective||new Mt.Position({yaw:Mt.Point.toDegrees(10)*s,pitch:0}),data:{...e,markerType:e.markerType},size:{width:50,height:50},hoverScale:{amount:1},opacity:.8,anchor:"bottom center"}))}getPreloadPoints(t){if(!t)return[];const{preloadStep:e=5}=this.realseeSetting||{},s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}}const{cloneDeep:dm,deepMergeProps:FM,getDiffProps:zM}=Mt.utils;function HM(n,t,e,s,r){const a=y.ref(),l=y.ref(!1),h=y.ref(new Set),u=y.ref(new Set),d=y.ref(dm(Hh)),p=y.computed(()=>d.value),m=y.ref(),_=y.computed(()=>{const{currentRecord:pt}=y.unref(t)||{};return Array.from(pt?.trackPoints?.values()||[])});y.watch(()=>dm(n.value?.viewer),E,{immediate:!0,deep:!0});function E(pt,Lt){const Y=zM(pt,Lt);w(Y)}function S(){return p.value}function w(pt){pt&&FM(d.value,pt)}function v(){y.unref(e)?.container?.addEventListener("mousedown",C),y.unref(e)?.container?.addEventListener("touchstart",C),y.unref(e)?.container?.addEventListener("mouseover",T),y.unref(e)?.container?.addEventListener("mouseout",U),y.unref(e)?.addEventListener(Jt.ReadyEvent.type,pt=>{r("ready",pt)}),y.unref(e)?.addEventListener(Jt.SizeUpdatedEvent.type,pt=>{r("size-updated",pt)}),y.unref(e)?.addEventListener(Jt.PanoramaLoadedEvent.type,pt=>{r("panorama-loaded",pt)}),y.unref(e)?.addEventListener(Jt.PanoramaErrorEvent.type,pt=>{r("panorama-error",pt)}),y.unref(e)?.addEventListener(Jt.ClickEvent.type,pt=>{r("click",pt)}),y.unref(e)?.addEventListener(Jt.PositionUpdatedEvent.type,pt=>{r("position-updated",pt)}),y.unref(e)?.addEventListener(Jt.ZoomUpdatedEvent.type,pt=>{r("zoom-updated",pt)})}function g(){}function I(pt){r("panorama-complete",pt)}function C(pt){r("mousedown",pt)}function T(pt){Z(!0)}function U(pt){Z(!1)}async function N(pt,Lt){if(l.value){a.value={currentPoint:pt,options:Lt};return}try{l.value=!0;const{loadingPh:Y=!1}=p.value,{panorama:it,placeholderImg:ft}=pt;ft&&!Y?(await e.value?.setPanorama(ft,Lt),await e.value?.setPanorama(it,{showLoader:!1})):await e.value?.setPanorama(it,Lt),await B(it)}catch(Y){console.error(Y)}finally{l.value=!1,D(),z(),I(a.value)}}async function B(pt){try{if(Mt.utils.isObject(pt)){const Lt=pt.tileUrl(Math.floor(pt.cols/2),0);if(Lt){const Y=await fetch(Lt);if(Y.ok)return await Y.blob()}}}catch{}}async function z(){if(await y.nextTick(),a.value){const{currentPoint:pt,options:Lt}=a.value;a.value=void 0,N(pt,Lt)}}async function D(){let{currentPoint:pt,currentRecord:Lt}=y.unref(t)||{};if(pt&&Lt){const Y=Lt.getPreloadPoints(pt);for(const it of Y)if(!h.value.has(it.id)&&!u.value.has(it.id)){u.value.add(it.id);const{panorama:ft,placeholderImg:kt}=it||{},Ot=[];if(Mt.utils.isObject(ft)){const zt=ft.tileUrl(Math.floor(ft.cols/2),0);Ot.push(fetch(ft.baseUrl),fetch(zt))}else Ot.push(fetch(ft)),kt&&Ot.push(fetch(kt));Promise.all(Ot).then(()=>{h.value.add(it.id)}).finally(()=>{u.value.delete(it.id)}).catch(zt=>{console.error(zt)})}}}function M(){k()}function k(){const{handleViolationMarkerFn:pt,handlePathMarkerFn:Lt}=y.unref(n)?.marker||{},{currentPoint:Y,currentRecord:it,currentMarker:ft}=y.unref(t)||{};if(Y&&it){const kt=it?.getPathMarkers(Y)?.map(ct=>Lt?.(ct)||ct),Ot=it?.getViolationMarkers(Y)?.map(ct=>pt?.(ct)||ct),zt=[...kt,...Ot];if(y.unref(s)?.setMarkers(zt),ft){const ct=Ot.find(ht=>ht.data.id===ft.id);if(!ct)return;y.unref(s)?.gotoMarker(ct.id,100)}}}function Z(pt){w({mouseover:pt})}function J(pt){w({mousedown:pt})}function V(){return y.unref(d)?.mouseover??!1}function $(){return y.unref(d)?.mousedown??!1}function K(pt){w({moveDirection:pt})}function ut(pt){m.value=pt}async function G(){const{currentPoint:pt}=y.unref(t)||{};if(pt){const Lt=Tt(pt);m.value=void 0,await N(pt,Lt)}}function Tt(pt){const{defaultTransition:Lt}=p.value,Y={showLoader:!1,transition:Lt},it=St(pt);return{...Y,...m.value,...it?{position:it}:{}}}function ot(pt){return Math.max(50,Math.min(1e3,pt-100))}function St(pt,Lt){const{viewMode:Y,moveDirection:it=1,moveThresh:ft=0}=p.value;if(!pt||Y===ir.Auto||it===Yi.Stationary)return;const kt=e.value?.getPosition()?.yaw??0,Ot=Lt??ft;if(Y===ir.FollowView){const zt=pt.point.yaw??0;return Math.abs(zt-kt)>=Ot?{yaw:zt,pitch:0}:void 0}if(Y===ir.FollowRoad){const{index:zt=0,point:ct}=pt,ht=_.value[zt+it]?.point;if(!ct||!ht)return;const P=gs?.toSphericalCoord(ct,ht);if(!P)return;const lt=P.yaw??0;if(Math.abs(lt-kt)>=Ot)return{yaw:lt,pitch:0}}}return{getProps:p,viewerAction:{getState:S,setState:w,isMouseover:V,isMousedown:$,setMousedown:J,setMouseover:Z,setPanoramaPath:N,setViewerStatus:ut,setMoveDirection:K,updateMarkers:k,preloadPanorama:D,loadMarkers:M,updateViewer:G,getPanoramaOptions:Tt,getTransitionSpeed:ot,getMovePosition:St},handleViewerEvents:v,handleUninstallEvents:g}}const{cloneDeep:fm,deepMergeProps:VM,getDiffProps:GM}=Mt.utils;function WM(n,t,e,s,r){const a=y.ref(fm(Gh)),l=y.computed(()=>a.value);y.watch(()=>fm(n.value?.marker),h,{immediate:!0,deep:!0});function h(_,E){const S=GM(_,E);u(S)}function u(_){_&&VM(a.value,_)}function d(){y.unref(s)?.addEventListener(xp.SelectMarkerEvent.type,p)}async function p(_){const{id:E,data:S}=_.marker.config,{onPointChange:w,onMarkerChange:v}=l.value;S.markerType==dh.pin?(await w?.(_),y.unref(t)?.selectPoint(S),r("select-point",S)):(await v?.(_),y.unref(s)?.gotoMarker(E,500),y.unref(t)?.selectMarker(S),r("select-marker",S))}return{getProps:l,markerAction:{},handleMarkerEvents:d}}const ZM={class:"vsleem-viewer"},pm=Pn(y.defineComponent({name:"Viewer",__name:"Viewer",emits:["register","ready","click","mousedown","size-updated","zoom-updated","position-updated","panorama-loaded","panorama-error","panorama-complete","select-point","select-marker"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(""),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(h))),p=y.computed(()=>y.unref(y.unref(u))),{getProps:m,handleViewerEvents:_,viewerAction:E}=HM(d,p,r,a,s),{handleMarkerEvents:S,markerAction:w}=WM(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(U),y.onBeforeUnmount(C);function v(N){N&&(g(),_(),S())}function g(){const{currentPoint:N}=p.value;if(y.unref(r)||!N)return;const B=I(),z=new HS(B),D=z.getPlugin(jp);r.value=Object.assign(z,E),a.value=Object.assign(D,w)}function I(){const{currentPoint:N}=p.value,B=E.getMovePosition(N,0);B&&E.setState({defaultYaw:B.yaw,defaultPitch:B.pitch});let z;Mt.utils.isObject(N?.panorama)&&(z=$S);const{viewMode:D,moveThresh:M,moveDirection:k,mousedown:Z,mouseover:J,loadingPh:V,...$}=m.value;return{...$,container:l.value,panorama:N?.panorama,adapter:z,plugins:[[jp,[]]]}}function C(){r.value?.destroy()}function T(N,B){h.value=N,u.value=B}function U(){s("register",r,a,T)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(N,B)=>(y.openBlock(),y.createElementBlock("div",ZM,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-3371c619"]]);function XM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getMap:a}}function YM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getPlaybar:a}}function qM(n,t){return Mt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:Mt.RequestMethod.GET,params:n},t)}function QM(n,t){const{setReferPoint:e}=t,s=y.ref(),r=y.ref(),a=y.ref(),l=y.reactive(new Map),h=y.ref(!1),u=y.ref(!1),d=y.ref(),p=y.ref(),m=y.ref(),_=y.ref(),E=y.computed(()=>r.value?.findCsById(d.value)),S=y.computed(()=>E.value?.findParentSpace()),w=y.computed(()=>Mt.Coordinate.getCommonCoordinate(Array.from(l.values(),ct=>ct.coordinate))),v=y.computed(()=>l.get(p.value??"")),g=y.computed(()=>N.value.get(p.value??"")),I=y.computed(()=>v.value?.getPoint(m.value??"")),C=y.computed(()=>g.value?.getPoint(m.value??"")),T=y.computed(()=>g.value?.getMarker(_.value??"")),U=y.computed(()=>g.value?.getPointMarkers(C.value?.id??"")||[]),N=y.computed(()=>{const ct=new Map;if(!E.value||!w.value)return ct;for(const ht of l.values()){const P=ht.projection(E.value,w.value,n.value.realseeSetting);P&&ct.set(P.id,P)}return ct}),B=y.computed(()=>{const ct=new Map;if(!N.value.size)return ct;for(const ht of N.value.values()){const{trackMarkers:P}=ht;for(const lt of P.values()){const at=ht.getPoint(lt.pointId);if(at){const vt=ct.get(at)??[];vt.push(lt),vt.length===1&&ct.set(at,vt)}}}return ct});async function z(ct){const{projectId:ht,patrolId:P}=ct||{},lt=P?Array.isArray(P)?P:[P]:[];try{if(!ht||!lt.length)throw new Mt.AppError(He.StoreMissParams,"缺少必要的查询参数");if(h.value=!0,ht!=r.value?.projectId){const[bt]=await Promise.all([Mt.DataSource.getCoordinateTree(ht)]);if(!bt)throw new Mt.AppError(He.StoreNoCSTree,`未查询到项目ID为 ${ht} 的坐标系树`);r.value=bt}const[at,...vt]=lt,gt=await D(at);if(!gt)return;const Bt=gt.coordinate.findChildModel([Mt.CoordinateModelType.CADModel,Mt.CoordinateModelType.GeoModel]);if(Bt?.modelType===Mt.CoordinateModelType.CADModel&&!Bt?.modelValue)throw new Mt.AppError(He.StroeNoModelValue,`没有找到当前坐标系${Bt?.id||""}的modelKey字段值`);a.value=Bt?.getMappedCsTree(),l.clear(),l.set(gt.id,gt),k({modelCsId:Bt?.id,...ct}),Gt(vt)}catch(at){console.error(at),n.value.fetchError?.(at)}finally{h.value=!1}}async function D(ct){try{let ht=await qM({...n.value.fetchParams,id:ct});if(ht=await n.value.handleResponseFn?.(ht)||ht,!ht)throw new Mt.AppError(He.StoreNoRecord,`未查询到ID为 ${ct} 的巡检记录`);const P=Y();ht.color=ht.color||P;const{appSetting:lt}=n.value,at=await ar.parsedModel(ht,r.value,lt);if(!at?.trackPoints?.size||!at.coordinate)throw new Mt.AppError(He.StoreInvRecord,`ID为 ${ct} 是无效的巡检记录`);let vt;if(h.value?vt=r.value?.findCsById(at.coordinateId):a.value&&(vt=a.value.findCsById(at.coordinateId)),!vt)throw new Mt.AppError(He.StoreRecordOutCSTree,`ID为 ${ct} 的巡检记录不在映射坐标系树内`);if(vt?.modelType===Mt.CoordinateModelType.GeoModel){const Bt=r.value?.findClosestModel(Mt.CoordinateModelType.GeoModel);if(Bt&&!Bt.relativeMap?.refPoint){const bt=Array.from(at.trackPoints.values()),Zt=new Mt.GeoPoint(bt[0].point),ve=new Mt.RelativeMap({refPoint:Zt});Bt.setOptions({relativeMap:ve})}}const gt=new ar(at);return n.value.fetchSuccess?.(gt,r.value),gt}catch(ht){console.error(ht),n.value.fetchError?.(ht)}}function M(ct=!1){u.value=ct}function k(ct){const{patrolId:ht,pointId:P,modelCsId:lt}=ct,at=ht?Array.isArray(ht)?ht:[ht]:[],vt=l.get(at[0]);if(vt){const gt=Array.from(vt.trackPoints.values());p.value=vt.id,m.value=P??gt[0]?.id}lt&&(d.value=lt)}function Z(ct){const{id:ht}=ct;if(a.value?.findCsById(ht)?.type===Mt.CoordinateType.Model)d.value=ht;else throw new Mt.AppError(He.StoreNoCSByID,`ID为 ${ht} 的模型坐标系不在映射坐标系树内`)}function J(ct){const ht=ot(ct.id??"");if(!ht)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到ID为 ${ct.id} 的巡检记录`);const P=Array.from(ht.trackPoints.values());p.value=ht.id,m.value=P[0]?.id}function V(ct){const{patrolId:ht,id:P=""}=ct,lt=ot(ht??"");if(!lt)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${ht} 的巡检记录`);if(!lt?.hasPoint(P))throw new Mt.AppError(He.StoreSelectNoPoint,`未找到ID为 ${P} 的轨迹点`);p.value=lt.id,m.value=P}function $(ct){if(ct){const{patrolId:ht,id:P=""}=ct,lt=ot(ht??"");if(!lt)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到问题标记patrolId为 ${ht} 的巡检记录`);if(!lt?.hasMarker(P))throw new Mt.AppError(He.StoreSelectNoMarker,`未找到ID为 ${P} 的问题标记`);_.value=P}else _.value=void 0}function K(ct){const ht=l.get(ct.patrolId);if(!ht)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到问题标记patrolId为 ${ct.patrolId} 的巡检记录`);ht.trackMarkers.set(ct.id,ct)}function ut(ct){const ht=l.get(ct.patrolId??"");if(!ht)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到问题标记patrolId为 ${ct.patrolId} 的巡检记录`);ht.trackMarkers.delete(ct.id??"")}function G(ct){const ht=l.get(ct.patrolId??"");if(!ht)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到问题标记patrolId为 ${ct.patrolId} 的巡检记录`);const P=ht.trackMarkers.get(ct.id??"");if(!P)throw new Mt.AppError(He.StoreSelectNoMarker,`未找到ID为 ${ct.id} 的问题标记`);Object.assign(P,ct)}function Tt(ct){return N.value.has(ct)}function ot(ct){return N.value.get(ct)}async function St(ct){if(!l.has(ct)){const ht=await D(ct);if(ht){const P=new ar(ht);return l.set(P.id,P),P}}}async function Gt(ct){if(ct.length)for(const ht of ct)await St(ht)}function pt(ct){if(g.value?.id===ct)throw new Mt.AppError(He.StoreSelectedMarker,`ID为 ${ct} 的巡检记录正在被使用,无法删除`);return l.delete(ct)}async function Lt(ct){const ht=l.get(ct.id??"");if(!ht)throw new Mt.AppError(He.StoreSelectNoRecord,`未找到ID为 ${ct.id} 的巡检记录`);Object.assign(ht,ct)}function Y(){const ct=h.value?[]:Array.from(l.values()).map(P=>P.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find(P=>!ct.includes(P?.toUpperCase?.()))}function it(){return E.value?.findClosestModel(Mt.CoordinateModelType.BIMModel)}function ft(ct){let ht=1/0,P;if(ct.position){for(const lt of N.value.values())if(lt.trackPoints?.size)for(const at of lt.trackPoints.values()){if(!at.position)continue;const vt=Mt.Point.distXY(ct.position,at.position);if(vt===0){ht=vt,P=at;break}vt<ht&&(ht=vt,P=at)}if(P)return P}}function kt(ct){if(!E.value||!w.value||!ct)return;const ht=r.value?.findCsById(ct.coordinate.id);if(!ht)return;const P=ht?.getDestRelativeMap(E.value),lt=ht?.getDestRelativeMap(w.value);if(!P||!lt)return;const at={srcToDstRelativeMap:P,srcCoordinate:ht,dstCoordinate:E.value},vt={srcToDstRelativeMap:lt,srcCoordinate:ht,dstCoordinate:w.value};return ct.projection(at,vt)}function Ot(){return zt.value}const zt=y.computed(()=>({ready:u.value,rawDataSource:l,currentProject:s.value,coordinateTree:r.value,mappedCoordinateTree:a.value,dataSource:N.value,comCoordinate:w.value,currentModel:E.value,currentSpace:S.value,currentRawRecord:v.value,currentRecord:g.value,currentRawPoint:I.value,currentPoint:C.value,currentMarker:T.value,currentPointMarkers:U.value,groupedMarkers:B.value,reload:z,fetchRecord:D,selectModel:Z,selectRecord:J,selectPoint:V,selectMarker:$,setReferPoint:e,addMarker:K,removeMarker:ut,updateMarker:G,hasRecord:Tt,getRecord:ot,addRecord:St,batchAddRecords:Gt,removeRecord:pt,updateRecord:Lt,findClosestBIMModel:it,findClosestPoint:ft,normalizeToModelPoint:kt}));return{storeRef:zt,getStore:Ot,setReady:M}}function jM(n,t){const e=y.ref(),s=y.ref(),r=y.ref(!1);function a(u,d,p){y.unref(r)||(e.value=u,s.value=d,y.unref(n)&&y.unref(t)&&p(n,t),r.value=!0)}function l(){return y.unref(y.unref(e))}function h(){return y.unref(y.unref(s))}return{register:a,getViewer:l,getMarker:h}}const{cloneDeep:mm,deepMergeProps:JM,getDiffProps:KM}=Mt.utils;function gm(n,t){const e=y.ref(mm(Wh)),s=y.computed(()=>e.value);y.watch(()=>mm(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>T(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=QM(s,{setReferPoint:N}),{register:h,getViewer:u,getMarker:d}=jM(s,r),{register:p,getMap:m}=XM(s,r),{register:_,getPlaybar:E}=YM(s,r);y.onMounted(S),y.onBeforeUnmount(w);async function S(){const{appSetting:B,immediate:z}=y.unref(s);B&&Mt.http.setRequestGlobalConfig(B),z&&(await T(!0),setTimeout(C,0))}function w(){t?.("destroy")}function v(B,z){const D=KM(B,z);I(D)}function g(){return s.value}function I(B){B&&JM(e.value,B)}function C(){l(!0),t?.("ready")}async function T(B){const{searchInfo:z}=s.value;B&&z&&(await r.value?.reload(z),t?.("reload"))}function U(){const B=Mt.utils.cloneDeep(s.value),z=a();if(z){const{currentModel:J,currentRecord:V,currentPoint:$}=z,{projectId:K=0,id:ut=""}=V||{},G=$?.id,Tt=J?.id;B.searchInfo={projectId:K,patrolId:ut,pointId:G,modelCsId:Tt}}const D=u();if(D){const J=Mt.utils.cloneDeep(s.value.viewer),V=D.getPosition(),$=D.getZoomLevel(),{yaw:K,pitch:ut}=V||{};B.viewer={...J,defaultZoomLvl:$,defaultYaw:K,defaultPitch:ut}}d()&&(B.marker=Mt.utils.cloneDeep(s.value.marker));const k=m();if(k){const{size:J,radarAngle:V,...$}=k.getState()||{};B.map={...$}}const Z=E();if(Z){const{showPlay:J,showSpeed:V,...$}=Z.getState()||{};B.playbar={...$,showPlay:!1,showSpeed:!1}}return B}async function N(B,z){const D=a();if(D){const M=u();if(!M)return;const{viewMode:k}=M?.getState()||{};if(k!==ir.Auto)throw new Mt.AppError(He.ViewModeNoAuto,"视图预览不是自由模式");const Z=D.normalizeToModelPoint(B);if(!Z?.point)return;const J=D.findClosestPoint(Z);if(!J?.point)return;const{zoom:V=0}=z,{yaw:$=0,pitch:K=0}=z.position||{},G={yaw:Z.point.yaw-J.point.yaw+$,pitch:K};D?.selectPoint?.(J),M.setViewerStatus({position:G,zoom:V}),D.currentPoint?.id===J.id&&M.updateViewer()}}return{getProps:s,storeRef:r,registerViewer:h,registerMap:p,registerPlaybar:_,getStore:a,getViewer:u,getMarker:d,getPlaybar:E,getMap:m,getOptions:U,getState:g,setState:I}}function $M(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentMarker:T,currentPointMarkers:U}=n.value||{};return{dataSource:E,coordinateTree:S,mappedCoordinateTree:w,currentSpace:v,currentModel:g,currentRecord:I,currentPoint:C,currentPointMarkers:U,currentMarker:T}});y.watch(()=>n.value?.currentModel?.id,h,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,u,{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,d,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m,{immediate:!0});function h(E){E&&r("change-model",n.value?.currentModel)}function u(E){E&&r("change-record",n.value?.currentRecord)}function d(E,S){E&&(p(E,S),r("change-point",n.value?.currentPoint))}function p(E,S){_(S),t()?.updateViewer?.()}function m(E){if(E){const{currentRecord:S,currentRawPoint:w,selectPoint:v}=n.value;if(S?.id===w?.patrolId){const g=S?.getNearPoint(w?.rawIndex||0);g&&v?.(g)}}}function _(E){const S=t(),{moveDirection:w}=S?.getState()||{};if(w!==Yi.Stationary){const v=n.value?.currentPoint,g=n.value.currentRecord?.getPoint(E??""),I=(v?.index??0)-(g?.index??0)>=0?Yi.Forward:Yi.Backward;S?.setMoveDirection(I)}}return{getShow:a,getBindValue:l}}function tT(n,t){const{getMap:e,getViewer:s}=n;function r(){t("map-ready")}function a(){t("map-resize")}function l(_){t("map-collapse",_)}function h(){t("map-dragger")}function u(_){t("map-angle-updated",_)}function d(_,E){p(),t("map-select-point",_,E)}function p(){const{rotation:_}=e()?.getState?.()||{},E=_?void 0:Yi.Stationary;s()?.setMoveDirection(E)}return{mapEvents:{ready:r,resize:a,collapse:l,dragger:h,angleUpdated:u,selectPoint:d}}}function eT(n,t){const{getViewer:e,getPlaybar:s,setState:r}=n;function a(){t("playbar-ready")}function l(T){E(),t("playbar-slider",T)}function h(T){S(),t("playbar-backward",T)}function u(T){v(!1),t("playbar-pause",T)}function d(T){v(!0),t("playbar-play",T)}function p(T){w(),t("playbar-forward",T)}function m(T){g(T),t("playbar-speed",T)}function _(T){t("playbar-select-point",T)}function E(){const{rotation:T}=s()?.getState()||{};I(T?.slider)}function S(){const{rotation:T}=s()?.getState()||{};I(T?.backward)}function w(){const{rotation:T}=s()?.getState()||{};I(T?.forward)}function v(T){const{rotation:U}=s()?.getState()||{};I(U?.play),e()?.setState({loadingPh:T})}function g(T){const N={speed:e()?.getTransitionSpeed(T)};r({playbar:{speed:T}}),e()?.setState({defaultTransition:N})}function I(T){const U=T?void 0:Yi.Stationary;e()?.setMoveDirection(U)}return{playbarEvents:{ready:a,backward:h,pause:u,play:d,forward:p,slider:l,speed:m,selectPoint:_}}}function nT(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(M){g(M),t("viewer-ready")}function h(M){t("viewer-click",M)}function u(M){I(),t("viewer-mousedown",M)}function d(M){C(M),t("viewer-size-updated",M)}function p(M){T(M),t("viewer-zoom-updated",M)}function m(M){U(M),t("viewer-position-updated",M,z(M))}function _(M){N(),t("viewer-panorama-loaded",M)}function E(M){t("viewer-panorama-error",M)}function S(M){B(M),t("viewer-panorama-complete")}function w(M){t("viewer-select-point",M)}function v(M){t("viewer-select-marker",M)}function g(M){const{defaultYaw:k=0,defaultPitch:Z=0}=M?.currentTarget.config;a.value={yaw:k,pitch:Z},e()?.setRadarYaw(k),e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function I(M){e()?.setCollapse(!0)}function C(M){e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function T(M){e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function U(M){e()?.setRadarYaw(M.position.yaw??0)}function N(){r()?.loadMarkers()}function B(M){M||s()?.playNext()}function z(M){const{yaw:k,pitch:Z}=M.position,{yaw:J,pitch:V}=y.unref(a);return a.value=M.position,{yaw:k-J,pitch:Z-V}}return{viewerEvents:{ready:l,click:h,mousedown:u,sizeUpdated:d,zoomUpdated:p,positionUpdated:m,panoramaLoaded:_,panoramaError:E,panoramaComplete:S,selectPoint:w,selectMarker:v}}}const iT={class:"vsleem-realsee"},_m=Pn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>el},viewer:{},marker:{},playbar:{default:()=>_o},map:{default:()=>go},immediate:{type:Boolean,default:!0},fetchParams:{},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-record","change-point","map-ready","map-resize","map-collapse","map-dragger","map-angle-updated","map-select-point","viewer-ready","viewer-click","viewer-mousedown","viewer-size-updated","viewer-zoom-updated","viewer-position-updated","viewer-panorama-loaded","viewer-panorama-error","viewer-panorama-complete","viewer-select-point","viewer-select-marker","playbar-ready","playbar-backward","playbar-pause","playbar-play","playbar-forward","playbar-speed","playbar-slider","playbar-select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,{registerViewer:a,registerMap:l,registerPlaybar:h,getProps:u,...d}=gm(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:S,getBindValue:w}=$M(p,m,_,E,r),{viewerEvents:v}=nT(d,r),{mapEvents:g}=tT(d,r),{playbarEvents:I}=eT(d,r);return t(d),(C,T)=>(y.openBlock(),y.createElementBlock("div",iT,[y.createVNode(pm,y.mergeProps({onRegister:y.unref(a)},y.toHandlers(y.unref(v))),null,16,["onRegister"]),y.unref(u).map&&y.unref(S)?(y.openBlock(),y.createBlock(Yh,y.mergeProps({key:0,onRegister:y.unref(l)},y.toHandlers(y.unref(g))),{extra:y.withCtx(U=>[y.renderSlot(C.$slots,"mapExtra",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),left:y.withCtx(U=>[y.renderSlot(C.$slots,"mapLeft",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),right:y.withCtx(U=>[y.renderSlot(C.$slots,"mapRight",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),default:y.withCtx(U=>[y.renderSlot(C.$slots,"mapDefault",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.unref(u).playbar&&y.unref(S)?(y.openBlock(),y.createBlock(Qh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(I))),{slider:y.withCtx(U=>[y.renderSlot(C.$slots,"playbarSlider",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),box:y.withCtx(U=>[y.renderSlot(C.$slots,"playbarBox",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),caption:y.withCtx(U=>[y.renderSlot(C.$slots,"playbarCaption",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),button:y.withCtx(U=>[y.renderSlot(C.$slots,"playbarButton",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),default:y.withCtx(U=>[y.renderSlot(C.$slots,"playbarDefault",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.renderSlot(C.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(w))),void 0,!0)]))}}),[["__scopeId","data-v-cb8f711d"]]);Ce.APP_SETTING=Fh,Ce.DirectionMoveEnum=Yi,Ce.MAP_CONFIG=go,Ce.MAP_GEO_OPTIONS=Vh,Ce.MARKER_CONFIG=Gh,Ce.Map=Yh,Ce.PLAYBAR_CONFIG=_o,Ce.Playbar=Qh,Ce.REALSEE_CONFIG=Wh,Ce.REALSEE_SETTING=el,Ce.Realsee=_m,Ce.RealseeErrorCode=He,Ce.RealseePlugin=_m,Ce.TILE_LAYERS=nl,Ce.TRACK_COLOR_LIST=zh,Ce.TrackMarker=no,Ce.TrackPoint=gs,Ce.TrackRecord=ar,Ce.TrackRecordTypeEnum=Jp,Ce.VIEWER_CONFIG=Hh,Ce.ViewModeEnum=ir,Ce.Viewer=pm,Ce.useRealsee=gm,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));
3951
+ */const{sin:Tn,cos:TM,sqrt:fh,abs:Ca,PI:un}=Math,Kp=6378245,$p=.006693421622965823;function tm(n,t){return n>=72.004&&n<=137.8347&&t>=.8293&&t<=55.8271}function bM(n,t){let e=-100+2*n+3*t+.2*t*t+.1*n*t+.2*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(t*un)+40*Tn(t/3*un))*2/3,e+=(160*Tn(t/12*un)+320*Tn(t*un/30))*2/3,e}function AM(n,t){let e=300+n+2*t+.1*n*n+.1*n*t+.1*fh(Ca(n));return e+=(20*Tn(6*n*un)+20*Tn(2*n*un))*2/3,e+=(20*Tn(n*un)+40*Tn(n/3*un))*2/3,e+=(150*Tn(n/12*un)+300*Tn(n/30*un))*2/3,e}function CM(n,t){let e=AM(n-105,t-35),s=bM(n-105,t-35);const r=t/180*un;let a=Tn(r);a=1-$p*a*a;const l=fh(a);return e=e*180/(Kp/l*TM(r)*un),s=s*180/(Kp*(1-$p)/(a*l)*un),[e,s]}function qi(n){const[t,e]=n;if(!tm(t,e))return[t,e];const s=CM(t,e);return[t+s[0],e+s[1]]}function sr(n){const[t,e]=n;if(!tm(t,e))return[t,e];let[s,r]=[t,e],a=qi([s,r]),l=a[0]-t,h=a[1]-e;for(;Ca(l)>1e-6||Ca(h)>1e-6;)s-=l,r-=h,a=qi([s,r]),l=a[0]-t,h=a[1]-e;return[s,r]}const{sin:Pa,cos:Ra,atan2:em,sqrt:nm,PI:PM}=Math,La=PM*3e3/180;function rr(n){const[t,e]=n,s=t-.0065,r=e-.006,a=nm(s*s+r*r)-2e-5*Pa(r*La),l=em(r,s)-3e-6*Ra(s*La),h=a*Ra(l),u=a*Pa(l);return[h,u]}function or(n){const[t,e]=n,s=t,r=e,a=nm(s*s+r*r)+2e-5*Pa(r*La),l=em(r,s)+3e-6*Ra(s*La),h=a*Ra(l)+.0065,u=a*Pa(l)+.006;return[h,u]}const im=180/Math.PI,sm=Math.PI/180,Ia=6378137,Qi=20037508342789244e-9;function Da(n){return[n[0]*im/Ia,(Math.PI*.5-2*Math.atan(Math.exp(-n[1]/Ia)))*im]}function ka(n){const t=Math.abs(n[0])<=180?n[0]:n[0]-(n[0]<0?-1:1)*360,e=[Ia*t*sm,Ia*Math.log(Math.tan(Math.PI*.25+.5*n[1]*sm))];return e[0]>Qi&&(e[0]=Qi),e[0]<-Qi&&(e[0]=-Qi),e[1]>Qi&&(e[1]=Qi),e[1]<-Qi&&(e[1]=-Qi),e}const{abs:Ua}=Math,rm=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],om=[75,60,45,30,15,0],RM=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],LM=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]];function am(n,t,e){const s=Ua(t)/e[9];let r=e[0]+e[1]*Ua(n),a=e[2]+e[3]*s+e[4]*Math.pow(s,2)+e[5]*Math.pow(s,3)+e[6]*Math.pow(s,4)+e[7]*Math.pow(s,5)+e[8]*Math.pow(s,6);return r*=n<0?-1:1,a*=t<0?-1:1,[r,a]}function Oa(n){const[t,e]=n;let s=[];for(let r=0;r<om.length;r++)if(Ua(e)>om[r]){s=LM[r];break}return am(t,e,s)}function Na(n){const[t,e]=n;let s=[];for(let r=0;r<rm.length;r++)if(Ua(e)>=rm[r]){s=RM[r];break}return am(t,e,s)}function ji(n,t){if(!n)throw new Error(t)}function lm(n){return!!n&&Object.prototype.toString.call(n)==="[object Array]"}function cm(n){return!isNaN(Number(n))&&n!==null&&!lm(n)}function Un(...n){const t=n.length-1;return function(...e){let s=t,r=n[t].apply(null,e);for(;s--;)r=n[s].call(null,r);return r}}function hm(n,t,e=!1){if(n===null)return;let s,r,a,l,h,u,d=0,p=0,m,_;const{type:E}=n,w=E==="FeatureCollection",S=E==="Feature",v=w?n.features.length:1;for(let g=0;g<v;g++){m=w?n.features[g].geometry:S?n.geometry:n,_=m?m.type==="GeometryCollection":!1,u=_?m.geometries.length:1;for(let R=0;R<u;R++){let P=0,T=0;if(l=_?m.geometries[R]:m,l===null)continue;const U=l.type;switch(d=e&&(U==="Polygon"||U==="MultiPolygon")?1:0,U){case null:break;case"Point":if(h=l.coordinates,t(h,p,g,P,T)===!1)return!1;p++,P++;break;case"LineString":case"MultiPoint":for(h=l.coordinates,s=0;s<h.length;s++){if(t(h[s],p,g,P,T)===!1)return!1;p++,U==="MultiPoint"&&P++}U==="LineString"&&P++;break;case"Polygon":case"MultiLineString":for(h=l.coordinates,s=0;s<h.length;s++){for(r=0;r<h[s].length-d;r++){if(t(h[s][r],p,g,P,T)===!1)return!1;p++}U==="MultiLineString"&&P++,U==="Polygon"&&T++}U==="Polygon"&&P++;break;case"MultiPolygon":for(h=l.coordinates,s=0;s<h.length;s++){for(T=0,r=0;r<h[s].length;r++){for(a=0;a<h[s][r].length-d;a++){if(t(h[s][r][a],p,g,P,T)===!1)return!1;p++}T++}P++}break;case"GeometryCollection":for(s=0;s<l.geometries.length;s++)if(hm(l.geometries[s],t,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}var Be;(function(n){n.WGS84="WGS84",n.WGS1984="WGS84",n.EPSG4326="WGS84",n.GCJ02="GCJ02",n.AMap="GCJ02",n.BD09="BD09",n.BD09LL="BD09",n.Baidu="BD09",n.BMap="BD09",n.BD09MC="BD09MC",n.BD09Meter="BD09MC",n.EPSG3857="EPSG3857",n.EPSG900913="EPSG3857",n.EPSG102100="EPSG3857",n.WebMercator="EPSG3857",n.WM="EPSG3857"})(Be||(Be={}));const IM={to:{[Be.GCJ02]:qi,[Be.BD09]:Un(or,qi),[Be.BD09MC]:Un(Oa,or,qi),[Be.EPSG3857]:ka}},DM={to:{[Be.WGS84]:sr,[Be.BD09]:or,[Be.BD09MC]:Un(Oa,or),[Be.EPSG3857]:Un(ka,sr)}},kM={to:{[Be.WGS84]:Un(sr,rr),[Be.GCJ02]:rr,[Be.EPSG3857]:Un(ka,sr,rr),[Be.BD09MC]:Oa}},UM={to:{[Be.WGS84]:Da,[Be.GCJ02]:Un(qi,Da),[Be.BD09]:Un(or,qi,Da),[Be.BD09MC]:Un(Oa,or,qi,Da)}},OM={to:{[Be.WGS84]:Un(sr,rr,Na),[Be.GCJ02]:Un(rr,Na),[Be.EPSG3857]:Un(ka,sr,rr,Na),[Be.BD09]:Na}};var NM={WGS84:IM,GCJ02:DM,BD09:kM,EPSG3857:UM,BD09MC:OM};function BM(n,t,e){if(ji(!!n,"The args[0] input coordinate is required"),ji(!!t,"The args[1] original coordinate system is required"),ji(!!e,"The args[2] target coordinate system is required"),t===e)return n;const s=NM[t];ji(!!s,`Invalid original coordinate system: ${t}`);const r=s.to[e];ji(!!r,`Invalid target coordinate system: ${e}`);const a=typeof n;if(ji(a==="string"||a==="object",`Invalid input coordinate type: ${a}`),a==="string")try{n=JSON.parse(n)}catch{throw new Error(`Invalid input coordinate: ${n}`)}let l=!1;lm(n)&&(ji(n.length>=2,`Invalid input coordinate: ${n}`),ji(cm(n[0])&&cm(n[1]),`Invalid input coordinate: ${n}`),n=n.map(Number),l=!0);const h=r;return l?h(n):(hm(n,u=>{[u[0],u[1]]=h(u)}),n)}const um=Object.assign(Object.assign({},Be),{CRSTypes:Be,transform:BM});class ar{id="";coordinateId=0;coordinate=new xt.Coordinate;trackPoints=new Map;trackMarkers=new Map;relativePosition;projectId;createTime;color;type;panoramaSize;realseeSetting;data;constructor(t){this.setState(t)}setState(t){Object.assign(this,t)}static async parsedModel(t,e,s){const{coordinateId:r,relativePosition:a,trackList:l,markerList:h,...u}=t,d=xt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(xt.RelativeMap.isValid(a)){const w=xt.RelativeMap.toParse(a);E=new xt.Coordinate({parent:E,type:xt.CoordinateType.Data,relativeMap:w})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await I_(l?.[0]?.img,s);d.panoramaSize=E;const w=new Map;for(const S of l){const v=gs.parsedModel({...S,patrolId:p,color:_},m,E,s);v.id&&w.set(v.id,new gs(v))}d.trackPoints=w}if(h?.length&&e){const E=new Map;for(const w of h){const S=no.parsedModel({...w,patrolId:p},e);S.id&&E.set(S.id,new no(S))}d.trackMarkers=E}return d}hasPoint(t){return this?.trackPoints?.has(t)}getPoint(t){return this?.trackPoints?.get(t)}getNearPoint(t){const e=Array.from(this?.trackPoints?.values()),s=e[0],r=e[e.length-1];return t<=(s.rawIndex??0)?s:t>=(r.rawIndex??0)?r:e.find(a=>(a.rawIndex??0)>=t)}hasMarker(t){return this?.trackMarkers?.has(t)}getMarker(t){return this?.trackMarkers?.get(t)}getPointMarkers(t){return Array.from(this?.trackMarkers?.values()).filter(e=>e.pointId===t)}projection(t,e,s){const{coordinate:r,trackPoints:a,trackMarkers:l}=this||{};if(!r||!a?.size)return;const h=r.getDestRelativeMap(t),u=r.getDestRelativeMap(e);if(!h||!u)return;const d=Array.from(l?.values()),p={srcToDstRelativeMap:h,srcCoordinate:r,dstCoordinate:t},m={srcToDstRelativeMap:u,srcCoordinate:r,dstCoordinate:e},{pointLax:_=0,trackCRSType:E}=s||{},w=new Map;let S;for(const g of a.values()){const R=g.projection(p,m);if(!R)continue;if(R.index=w.size,r.modelType===xt.CoordinateModelType.GeoModel){const{point:T}=R;if(E&&T){const[U,B]=um.transform([T.lon,T.lat],um.WGS84,E);R.point=new xt.Point({...T,lon:U,lat:B})}}if(_<=0){w.set(R.id,R);continue}if(d.find(T=>T.pointId===R.id)){w.set(R.id,R),S=R;continue}if(!w.size){w.set(R.id,R),S=R;continue}R.position&&S?.position&&xt.Point.distXY(R.position,S.position)>=_&&(w.set(R.id,R),S=R)}const v=new ar(this);return v.trackPoints=w,v.coordinate=t,v.realseeSetting=s,v}getPathMarkers(t){const{pointType:e=Aa.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===Aa.NUMBER?l=this.getPointsByNumber(a,s):e===Aa.DISTANCE&&(l=this.getPointsByDistance(a,r)),this.createPathMarkers(a,l)}getPointsByDistance(t,e){if(!t.position||e<=0)return[];const{x:s,y:r}=t.position;return Array.from(this.trackPoints.values()).filter(a=>!a.position||!t.position||Math.abs(a.position.x-s)>e||Math.abs(a.position.y-r)>e?!1:xt.Point.distXY(a.position,t.position)<=e)}getPointsByNumber(t,e){const s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}createPathMarkers(t,e){const{pathPin:s,pathRedPin:r}=this.realseeSetting||{},a=t.position;if(!a)return[];const l=[];for(const h of e){const u=h.position;if(!u)continue;const{d,yaw:p,pitch:m}=gs.toSphericalCoord(a,u);if(d===0)continue;const _=Math.min(120/(d/2e3),120),E=this.getPointMarkers(h.id).length>0;l.push({id:h.id,image:E?r:s,position:new xt.Position({yaw:p,pitch:m}),data:{...h,markerType:dh.pin},size:{width:_,height:_/2},hoverScale:{amount:1},opacity:.8,anchor:"center center"})}return l}getViolationMarkers(t){if(!t)return[];const e=this.getPointMarkers(t.id);return this.createViolationMarkers(e)}createViolationMarkers(t){return t.map((e,s)=>({id:e.id,image:e.markerIcon,position:e.perspective||new xt.Position({yaw:xt.Point.toDegrees(10)*s,pitch:0}),data:{...e,markerType:e.markerType},size:{width:50,height:50},hoverScale:{amount:1},opacity:.8,anchor:"bottom center"}))}getPreloadPoints(t){if(!t)return[];const{preloadStep:e=5}=this.realseeSetting||{},s=Array.from(this.trackPoints.values()),r=s.findIndex(h=>h.id===t?.id);if(r===-1)return[];const a=Math.max(0,r-e),l=Math.min(s.length,r+e+1);return s.slice(a,l)}}const{cloneDeep:dm,deepMergeProps:FM,getDiffProps:zM}=xt.utils;function HM(n,t,e,s,r){const a=y.ref(),l=y.ref(!1),h=y.ref(new Set),u=y.ref(new Set),d=y.ref(dm(Hh)),p=y.computed(()=>d.value),m=y.ref(),_=y.computed(()=>{const{currentRecord:pt}=y.unref(t)||{};return Array.from(pt?.trackPoints?.values()||[])});y.watch(()=>dm(n.value?.viewer),E,{immediate:!0,deep:!0});function E(pt,Rt){const Y=zM(pt,Rt);S(Y)}function w(){return p.value}function S(pt){pt&&FM(d.value,pt)}function v(){y.unref(e)?.container?.addEventListener("mousedown",P),y.unref(e)?.container?.addEventListener("touchstart",P),y.unref(e)?.container?.addEventListener("mouseover",T),y.unref(e)?.container?.addEventListener("mouseout",U),y.unref(e)?.addEventListener(jt.ReadyEvent.type,pt=>{r("ready",pt)}),y.unref(e)?.addEventListener(jt.SizeUpdatedEvent.type,pt=>{r("size-updated",pt)}),y.unref(e)?.addEventListener(jt.PanoramaLoadedEvent.type,pt=>{r("panorama-loaded",pt)}),y.unref(e)?.addEventListener(jt.PanoramaErrorEvent.type,pt=>{r("panorama-error",pt)}),y.unref(e)?.addEventListener(jt.ClickEvent.type,pt=>{r("click",pt)}),y.unref(e)?.addEventListener(jt.PositionUpdatedEvent.type,pt=>{r("position-updated",pt)}),y.unref(e)?.addEventListener(jt.ZoomUpdatedEvent.type,pt=>{r("zoom-updated",pt)})}function g(){}function R(pt){r("panorama-complete",pt)}function P(pt){r("mousedown",pt)}function T(pt){Z(!0)}function U(pt){Z(!1)}async function B(pt,Rt){if(l.value){a.value={currentPoint:pt,options:Rt};return}try{l.value=!0;const{loadingPh:Y=!1}=p.value,{panorama:st,placeholderImg:ft}=pt;ft&&!Y?(await e.value?.setPanorama(ft,Rt),await e.value?.setPanorama(st,{showLoader:!1})):await e.value?.setPanorama(st,Rt),await N(st)}catch(Y){console.error(Y)}finally{l.value=!1,D(),z(),R(a.value)}}async function N(pt){try{if(xt.utils.isObject(pt)){const Rt=pt.tileUrl(Math.floor(pt.cols/2),0);if(Rt){const Y=await fetch(Rt);if(Y.ok)return await Y.blob()}}}catch{}}async function z(){if(await y.nextTick(),a.value){const{currentPoint:pt,options:Rt}=a.value;a.value=void 0,B(pt,Rt)}}async function D(){let{currentPoint:pt,currentRecord:Rt}=y.unref(t)||{};if(pt&&Rt){const Y=Rt.getPreloadPoints(pt);for(const st of Y)if(!h.value.has(st.id)&&!u.value.has(st.id)){u.value.add(st.id);const{panorama:ft,placeholderImg:Dt}=st||{},Ut=[];if(xt.utils.isObject(ft)){const zt=ft.tileUrl(Math.floor(ft.cols/2),0);Ut.push(fetch(ft.baseUrl),fetch(zt))}else Ut.push(fetch(ft)),Dt&&Ut.push(fetch(Dt));Promise.all(Ut).then(()=>{h.value.add(st.id)}).finally(()=>{u.value.delete(st.id)}).catch(zt=>{console.error(zt)})}}}function M(){k()}function k(){const{handleViolationMarkerFn:pt,handlePathMarkerFn:Rt}=y.unref(n)?.marker||{},{currentPoint:Y,currentRecord:st,currentMarker:ft}=y.unref(t)||{};if(Y&&st){const Dt=st?.getPathMarkers(Y)?.map(ce=>Rt?.(ce)||ce),Ut=st?.getViolationMarkers(Y)?.map(ce=>pt?.(ce)||ce),zt=[...Dt,...Ut];if(y.unref(s)?.setMarkers(zt),ft){const ce=Ut.find(at=>at.data.id===ft.id);if(!ce)return;y.unref(s)?.gotoMarker(ce.id,100)}}}function Z(pt){S({mouseover:pt})}function J(pt){S({mousedown:pt})}function V(){return y.unref(d)?.mouseover??!1}function $(){return y.unref(d)?.mousedown??!1}function K(pt){S({moveDirection:pt})}function ut(pt){m.value=pt}async function G(){const{currentPoint:pt}=y.unref(t)||{};if(pt){const Rt=Tt(pt);m.value=void 0,await B(pt,Rt)}}function Tt(pt){const{defaultTransition:Rt}=p.value,Y={showLoader:!1,transition:Rt},st=Mt(pt);return{...Y,...m.value,...st?{position:st}:{}}}function lt(pt){return Math.max(50,Math.min(1e3,pt-100))}function Mt(pt,Rt){const{viewMode:Y,moveDirection:st=1,moveThresh:ft=0}=p.value;if(!pt||Y===ir.Auto||st===Yi.Stationary)return;const Dt=e.value?.getPosition()?.yaw??0,Ut=Rt??ft;if(Y===ir.FollowView){const zt=pt.point.yaw??0;return Math.abs(zt-Dt)>=Ut?{yaw:zt,pitch:0}:void 0}if(Y===ir.FollowRoad){const{index:zt=0,point:ce}=pt,at=_.value[zt+st]?.point;if(!ce||!at)return;const C=gs?.toSphericalCoord(ce,at);if(!C)return;const it=C.yaw??0;if(Math.abs(it-Dt)>=Ut)return{yaw:it,pitch:0}}}return{getProps:p,viewerAction:{getState:w,setState:S,isMouseover:V,isMousedown:$,setMousedown:J,setMouseover:Z,setPanoramaPath:B,setViewerStatus:ut,setMoveDirection:K,updateMarkers:k,preloadPanorama:D,loadMarkers:M,updateViewer:G,getPanoramaOptions:Tt,getTransitionSpeed:lt,getMovePosition:Mt},handleViewerEvents:v,handleUninstallEvents:g}}const{cloneDeep:fm,deepMergeProps:VM,getDiffProps:GM}=xt.utils;function WM(n,t,e,s,r){const a=y.ref(fm(Gh)),l=y.computed(()=>a.value);y.watch(()=>fm(n.value?.marker),h,{immediate:!0,deep:!0});function h(_,E){const w=GM(_,E);u(w)}function u(_){_&&VM(a.value,_)}function d(){y.unref(s)?.addEventListener(xp.SelectMarkerEvent.type,p)}async function p(_){const{id:E,data:w}=_.marker.config,{onPointChange:S,onMarkerChange:v}=l.value;w.markerType==dh.pin?(await S?.(_),y.unref(t)?.selectPoint(w),r("select-point",w)):(await v?.(_),y.unref(s)?.gotoMarker(E,500),y.unref(t)?.selectMarker(w),r("select-marker",w))}return{getProps:l,markerAction:{},handleMarkerEvents:d}}const ZM={class:"vsleem-viewer"},pm=Pn(y.defineComponent({name:"Viewer",__name:"Viewer",emits:["register","ready","click","mousedown","size-updated","zoom-updated","position-updated","panorama-loaded","panorama-error","panorama-complete","select-point","select-marker"],setup(n,{expose:t,emit:e}){const s=e,r=y.ref(),a=y.ref(),l=y.ref(""),h=y.ref(),u=y.ref(),d=y.computed(()=>y.unref(y.unref(h))),p=y.computed(()=>y.unref(y.unref(u))),{getProps:m,handleViewerEvents:_,viewerAction:E}=HM(d,p,r,a,s),{handleMarkerEvents:w,markerAction:S}=WM(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(U),y.onBeforeUnmount(P);function v(B){B&&(g(),_(),w())}function g(){const{currentPoint:B}=p.value;if(y.unref(r)||!B)return;const N=R(),z=new HS(N),D=z.getPlugin(jp);r.value=Object.assign(z,E),a.value=Object.assign(D,S)}function R(){const{currentPoint:B}=p.value,N=E.getMovePosition(B,0);N&&E.setState({defaultYaw:N.yaw,defaultPitch:N.pitch});let z;xt.utils.isObject(B?.panorama)&&(z=$S);const{viewMode:D,moveThresh:M,moveDirection:k,mousedown:Z,mouseover:J,loadingPh:V,...$}=m.value;return{...$,container:l.value,panorama:B?.panorama,adapter:z,plugins:[[jp,[]]]}}function P(){r.value?.destroy()}function T(B,N){h.value=B,u.value=N}function U(){s("register",r,a,T)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(B,N)=>(y.openBlock(),y.createElementBlock("div",ZM,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-3371c619"]]);function XM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getMap:a}}function YM(n,t){const e=y.ref(),s=y.ref(!1);function r(l,h){y.unref(s)||(e.value=l,y.unref(n)&&y.unref(t)&&h(n,t),s.value=!0)}function a(){return y.unref(y.unref(e))}return{register:r,getPlaybar:a}}function qM(n,t){return xt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:xt.RequestMethod.GET,params:n},t)}function QM(n,t){const{setReferPoint:e,setRealseeState:s}=t,r=y.ref(),a=y.ref(),l=y.ref(),h=y.reactive(new Map),u=y.ref(!1),d=y.ref(!1),p=y.ref(),m=y.ref(),_=y.ref(),E=y.ref(),w=y.computed(()=>a.value?.findCsById(p.value)),S=y.computed(()=>w.value?.findParentSpace()),v=y.computed(()=>xt.Coordinate.getCommonCoordinate(Array.from(h.values(),at=>at.coordinate))),g=y.computed(()=>h.get(m.value??"")),R=y.computed(()=>N.value.get(m.value??"")),P=y.computed(()=>g.value?.getPoint(_.value??"")),T=y.computed(()=>R.value?.getPoint(_.value??"")),U=y.computed(()=>R.value?.getMarker(E.value??"")),B=y.computed(()=>R.value?.getPointMarkers(T.value?.id??"")||[]),N=y.computed(()=>{const at=new Map;if(!w.value||!v.value)return at;for(const C of h.values()){const it=C.projection(w.value,v.value,n.value.realseeSetting);it&&at.set(it.id,it)}return at}),z=y.computed(()=>{const at=new Map;if(!N.value.size)return at;for(const C of N.value.values()){const{trackMarkers:it}=C;for(const ct of it.values()){const _t=C.getPoint(ct.pointId);if(_t){const ht=at.get(_t)??[];ht.push(ct),ht.length===1&&at.set(_t,ht)}}}return at});async function D(at){const{projectId:C,patrolId:it}=at||{},ct=it?Array.isArray(it)?it:[it]:[];try{if(!C||!ct.length)throw new xt.AppError(ze.StoreMissParams,"缺少必要的查询参数");if(u.value=!0,C!=a.value?.projectId){const[Nt,pe]=await Promise.all([xt.DataSource.getProjectDetail(C),xt.DataSource.getCoordinateTree(C)]);if(!Nt)throw new xt.AppError(ze.StoreNoProjectDetail,`未查询到项目ID为 ${C} 的项目详情`);const{tileLayers:ge=[]}=n.value.map||{};if(ge.length){const O=ge[ge.length-1]||{},b=xt.utils.getMapProvider(O?.url),Q=b?.CRSTypes?.[Nt.mapArea??0];Q&&Q!==xt.CRSTypes.WGS84&&(Nt.CRSType=Q,Nt.mapType=b.name,s({realseeSetting:{trackCRSType:Q}}))}if(r.value=Nt,!pe)throw new xt.AppError(ze.StoreNoCSTree,`未查询到项目ID为 ${C} 的坐标系树`);a.value=pe}const[_t,...ht]=ct,Ot=await M(_t);if(!Ot)return;const yt=Ot.coordinate.findChildModel([xt.CoordinateModelType.CADModel,xt.CoordinateModelType.GeoModel]);if(yt?.modelType===xt.CoordinateModelType.CADModel&&!yt?.modelValue)throw new xt.AppError(ze.StroeNoModelValue,`没有找到当前坐标系${yt?.id||""}的modelKey字段值`);l.value=yt?.getMappedCsTree(),h.clear(),h.set(Ot.id,Ot),Z({modelCsId:yt?.id,...at}),pt(ht)}catch(_t){console.error(_t),n.value.fetchError?.(_t)}finally{u.value=!1}}async function M(at){try{let C=await qM({...n.value.fetchParams,id:at});if(C=await n.value.handleResponseFn?.(C)||C,!C)throw new xt.AppError(ze.StoreNoRecord,`未查询到ID为 ${at} 的巡检记录`);const it=st();C.color=C.color||it;const{appSetting:ct}=n.value,_t=await ar.parsedModel(C,a.value,ct);if(!_t?.trackPoints?.size||!_t.coordinate)throw new xt.AppError(ze.StoreInvRecord,`ID为 ${at} 是无效的巡检记录`);let ht;if(u.value?ht=a.value?.findCsById(_t.coordinateId):l.value&&(ht=l.value.findCsById(_t.coordinateId)),!ht)throw new xt.AppError(ze.StoreRecordOutCSTree,`ID为 ${at} 的巡检记录不在映射坐标系树内`);if(ht?.modelType===xt.CoordinateModelType.GeoModel){const yt=a.value?.findClosestModel(xt.CoordinateModelType.GeoModel);if(yt&&!yt.relativeMap?.refPoint){const Nt=Array.from(_t.trackPoints.values()),pe=new xt.GeoPoint(Nt[0].point),ge=new xt.RelativeMap({refPoint:pe});yt.setOptions({relativeMap:ge})}}const Ot=new ar(_t);return n.value.fetchSuccess?.(Ot,a.value),Ot}catch(C){console.error(C),n.value.fetchError?.(C)}}function k(at=!1){d.value=at}function Z(at){const{patrolId:C,pointId:it,modelCsId:ct}=at,_t=C?Array.isArray(C)?C:[C]:[],ht=h.get(_t[0]);if(ht){const Ot=Array.from(ht.trackPoints.values());m.value=ht.id,_.value=it??Ot[0]?.id}ct&&(p.value=ct)}function J(at){const{id:C}=at;if(l.value?.findCsById(C)?.type===xt.CoordinateType.Model)p.value=C;else throw new xt.AppError(ze.StoreNoCSByID,`ID为 ${C} 的模型坐标系不在映射坐标系树内`)}function V(at){const C=Mt(at.id??"");if(!C)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${at.id} 的巡检记录`);const it=Array.from(C.trackPoints.values());m.value=C.id,_.value=it[0]?.id}function $(at){const{patrolId:C,id:it=""}=at,ct=Mt(C??"");if(!ct)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${C} 的巡检记录`);if(!ct?.hasPoint(it))throw new xt.AppError(ze.StoreSelectNoPoint,`未找到ID为 ${it} 的轨迹点`);m.value=ct.id,_.value=it}function K(at){if(at){const{patrolId:C,id:it=""}=at,ct=Mt(C??"");if(!ct)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${C} 的巡检记录`);if(!ct?.hasMarker(it))throw new xt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${it} 的问题标记`);E.value=it}else E.value=void 0}function ut(at){const C=h.get(at.patrolId);if(!C)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${at.patrolId} 的巡检记录`);C.trackMarkers.set(at.id,at)}function G(at){const C=h.get(at.patrolId??"");if(!C)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${at.patrolId} 的巡检记录`);C.trackMarkers.delete(at.id??"")}function Tt(at){const C=h.get(at.patrolId??"");if(!C)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${at.patrolId} 的巡检记录`);const it=C.trackMarkers.get(at.id??"");if(!it)throw new xt.AppError(ze.StoreSelectNoMarker,`未找到ID为 ${at.id} 的问题标记`);Object.assign(it,at)}function lt(at){return N.value.has(at)}function Mt(at){return N.value.get(at)}async function Gt(at){if(!h.has(at)){const C=await M(at);if(C){const it=new ar(C);return h.set(it.id,it),it}}}async function pt(at){if(at.length)for(const C of at)await Gt(C)}function Rt(at){if(R.value?.id===at)throw new xt.AppError(ze.StoreSelectedMarker,`ID为 ${at} 的巡检记录正在被使用,无法删除`);return h.delete(at)}async function Y(at){const C=h.get(at.id??"");if(!C)throw new xt.AppError(ze.StoreSelectNoRecord,`未找到ID为 ${at.id} 的巡检记录`);Object.assign(C,at)}function st(){const at=u.value?[]:Array.from(h.values()).map(it=>it.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find(it=>!at.includes(it?.toUpperCase?.()))}function ft(){return w.value?.findClosestModel(xt.CoordinateModelType.BIMModel)}function Dt(at){let C=1/0,it;if(at.position){for(const ct of N.value.values())if(ct.trackPoints?.size)for(const _t of ct.trackPoints.values()){if(!_t.position)continue;const ht=xt.Point.distXY(at.position,_t.position);if(ht===0){C=ht,it=_t;break}ht<C&&(C=ht,it=_t)}if(it)return it}}function Ut(at){if(!w.value||!v.value||!at)return;const C=a.value?.findCsById(at.coordinate.id);if(!C)return;const it=C?.getDestRelativeMap(w.value),ct=C?.getDestRelativeMap(v.value);if(!it||!ct)return;const _t={srcToDstRelativeMap:it,srcCoordinate:C,dstCoordinate:w.value},ht={srcToDstRelativeMap:ct,srcCoordinate:C,dstCoordinate:v.value};return at.projection(_t,ht)}function zt(){return ce.value}const ce=y.computed(()=>({ready:d.value,rawDataSource:h,currentProject:r.value,coordinateTree:a.value,mappedCoordinateTree:l.value,dataSource:N.value,comCoordinate:v.value,currentModel:w.value,currentSpace:S.value,currentRawRecord:g.value,currentRecord:R.value,currentRawPoint:P.value,currentPoint:T.value,currentMarker:U.value,currentPointMarkers:B.value,groupedMarkers:z.value,reload:D,fetchRecord:M,selectModel:J,selectRecord:V,selectPoint:$,selectMarker:K,setReferPoint:e,addMarker:ut,removeMarker:G,updateMarker:Tt,hasRecord:lt,getRecord:Mt,addRecord:Gt,batchAddRecords:pt,removeRecord:Rt,updateRecord:Y,findClosestBIMModel:ft,findClosestPoint:Dt,normalizeToModelPoint:Ut}));return{storeRef:ce,getStore:zt,setReady:k}}function jM(n,t){const e=y.ref(),s=y.ref(),r=y.ref(!1);function a(u,d,p){y.unref(r)||(e.value=u,s.value=d,y.unref(n)&&y.unref(t)&&p(n,t),r.value=!0)}function l(){return y.unref(y.unref(e))}function h(){return y.unref(y.unref(s))}return{register:a,getViewer:l,getMarker:h}}const{cloneDeep:mm,deepMergeProps:JM,getDiffProps:KM}=xt.utils;function gm(n,t){const e=y.ref(mm(Wh)),s=y.computed(()=>e.value);y.watch(()=>mm(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>T(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=QM(s,{setReferPoint:B,setRealseeState:R}),{register:h,getViewer:u,getMarker:d}=jM(s,r),{register:p,getMap:m}=XM(s,r),{register:_,getPlaybar:E}=YM(s,r);y.onMounted(w),y.onBeforeUnmount(S);async function w(){const{appSetting:N,immediate:z}=y.unref(s);N&&xt.http.setRequestGlobalConfig(N),z&&(await T(!0),setTimeout(P,0))}function S(){t?.("destroy")}function v(N,z){const D=KM(N,z);R(D)}function g(){return s.value}function R(N){N&&JM(e.value,N)}function P(){l(!0),t?.("ready")}async function T(N){const{searchInfo:z}=s.value;N&&z&&(await r.value?.reload(z),t?.("reload"))}function U(){const N=xt.utils.cloneDeep(s.value),z=a();if(z){const{currentModel:J,currentRecord:V,currentPoint:$}=z,{projectId:K=0,id:ut=""}=V||{},G=$?.id,Tt=J?.id;N.searchInfo={projectId:K,patrolId:ut,pointId:G,modelCsId:Tt}}const D=u();if(D){const J=xt.utils.cloneDeep(s.value.viewer),V=D.getPosition(),$=D.getZoomLevel(),{yaw:K,pitch:ut}=V||{};N.viewer={...J,defaultZoomLvl:$,defaultYaw:K,defaultPitch:ut}}d()&&(N.marker=xt.utils.cloneDeep(s.value.marker));const k=m();if(k){const{size:J,radarAngle:V,...$}=k.getState()||{};N.map={...$}}const Z=E();if(Z){const{showPlay:J,showSpeed:V,...$}=Z.getState()||{};N.playbar={...$,showPlay:!1,showSpeed:!1}}return N}async function B(N,z){const D=a();if(D){const M=u();if(!M)return;const{viewMode:k}=M?.getState()||{};if(k!==ir.Auto)throw new xt.AppError(ze.ViewModeNoAuto,"视图预览不是自由模式");const Z=D.normalizeToModelPoint(N);if(!Z?.point)return;const J=D.findClosestPoint(Z);if(!J?.point)return;const{zoom:V=0}=z,{yaw:$=0,pitch:K=0}=z.position||{},G={yaw:Z.point.yaw-J.point.yaw+$,pitch:K};D?.selectPoint?.(J),M.setViewerStatus({position:G,zoom:V}),D.currentPoint?.id===J.id&&M.updateViewer()}}return{getProps:s,storeRef:r,registerViewer:h,registerMap:p,registerPlaybar:_,getStore:a,getViewer:u,getMarker:d,getPlaybar:E,getMap:m,getOptions:U,getState:g,setState:R}}function $M(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:E,coordinateTree:w,mappedCoordinateTree:S,currentSpace:v,currentModel:g,currentRecord:R,currentPoint:P,currentMarker:T,currentPointMarkers:U}=n.value||{};return{dataSource:E,coordinateTree:w,mappedCoordinateTree:S,currentSpace:v,currentModel:g,currentRecord:R,currentPoint:P,currentPointMarkers:U,currentMarker:T}});y.watch(()=>n.value?.currentModel?.id,h,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,u,{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,d,{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m,{immediate:!0});function h(E){E&&r("change-model",n.value?.currentModel)}function u(E){E&&r("change-record",n.value?.currentRecord)}function d(E,w){E&&(p(E,w),r("change-point",n.value?.currentPoint))}function p(E,w){_(w),t()?.updateViewer?.()}function m(E){if(E){const{currentRecord:w,currentRawPoint:S,selectPoint:v}=n.value;if(w?.id===S?.patrolId){const g=w?.getNearPoint(S?.rawIndex||0);g&&v?.(g)}}}function _(E){const w=t(),{moveDirection:S}=w?.getState()||{};if(S!==Yi.Stationary){const v=n.value?.currentPoint,g=n.value.currentRecord?.getPoint(E??""),R=(v?.index??0)-(g?.index??0)>=0?Yi.Forward:Yi.Backward;w?.setMoveDirection(R)}}return{getShow:a,getBindValue:l}}function tT(n,t){const{getMap:e,getViewer:s}=n;function r(){t("map-ready")}function a(){t("map-resize")}function l(_){t("map-collapse",_)}function h(){t("map-dragger")}function u(_){t("map-angle-updated",_)}function d(_,E){p(),t("map-select-point",_,E)}function p(){const{rotation:_}=e()?.getState?.()||{},E=_?void 0:Yi.Stationary;s()?.setMoveDirection(E)}return{mapEvents:{ready:r,resize:a,collapse:l,dragger:h,angleUpdated:u,selectPoint:d}}}function eT(n,t){const{getViewer:e,getPlaybar:s,setState:r}=n;function a(){t("playbar-ready")}function l(T){E(),t("playbar-slider",T)}function h(T){w(),t("playbar-backward",T)}function u(T){v(!1),t("playbar-pause",T)}function d(T){v(!0),t("playbar-play",T)}function p(T){S(),t("playbar-forward",T)}function m(T){g(T),t("playbar-speed",T)}function _(T){t("playbar-select-point",T)}function E(){const{rotation:T}=s()?.getState()||{};R(T?.slider)}function w(){const{rotation:T}=s()?.getState()||{};R(T?.backward)}function S(){const{rotation:T}=s()?.getState()||{};R(T?.forward)}function v(T){const{rotation:U}=s()?.getState()||{};R(U?.play),e()?.setState({loadingPh:T})}function g(T){const B={speed:e()?.getTransitionSpeed(T)};r({playbar:{speed:T}}),e()?.setState({defaultTransition:B})}function R(T){const U=T?void 0:Yi.Stationary;e()?.setMoveDirection(U)}return{playbarEvents:{ready:a,backward:h,pause:u,play:d,forward:p,slider:l,speed:m,selectPoint:_}}}function nT(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(M){g(M),t("viewer-ready")}function h(M){t("viewer-click",M)}function u(M){R(),t("viewer-mousedown",M)}function d(M){P(M),t("viewer-size-updated",M)}function p(M){T(M),t("viewer-zoom-updated",M)}function m(M){U(M),t("viewer-position-updated",M,z(M))}function _(M){B(),t("viewer-panorama-loaded",M)}function E(M){t("viewer-panorama-error",M)}function w(M){N(M),t("viewer-panorama-complete")}function S(M){t("viewer-select-point",M)}function v(M){t("viewer-select-marker",M)}function g(M){const{defaultYaw:k=0,defaultPitch:Z=0}=M?.currentTarget.config;a.value={yaw:k,pitch:Z},e()?.setRadarYaw(k),e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function R(M){e()?.setCollapse(!0)}function P(M){e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function T(M){e()?.setRadarHFov(M?.currentTarget?.state?.hFov??90)}function U(M){e()?.setRadarYaw(M.position.yaw??0)}function B(){r()?.loadMarkers()}function N(M){M||s()?.playNext()}function z(M){const{yaw:k,pitch:Z}=M.position,{yaw:J,pitch:V}=y.unref(a);return a.value=M.position,{yaw:k-J,pitch:Z-V}}return{viewerEvents:{ready:l,click:h,mousedown:u,sizeUpdated:d,zoomUpdated:p,positionUpdated:m,panoramaLoaded:_,panoramaError:E,panoramaComplete:w,selectPoint:S,selectMarker:v}}}const iT={class:"vsleem-realsee"},_m=Pn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>el},viewer:{},marker:{},playbar:{default:()=>_o},map:{default:()=>go},immediate:{type:Boolean,default:!0},fetchParams:{},handleResponseFn:{},fetchSuccess:{},fetchError:{}},emits:["ready","reload","destroy","change-model","change-record","change-point","map-ready","map-resize","map-collapse","map-dragger","map-angle-updated","map-select-point","viewer-ready","viewer-click","viewer-mousedown","viewer-size-updated","viewer-zoom-updated","viewer-position-updated","viewer-panorama-loaded","viewer-panorama-error","viewer-panorama-complete","viewer-select-point","viewer-select-marker","playbar-ready","playbar-backward","playbar-pause","playbar-play","playbar-forward","playbar-speed","playbar-slider","playbar-select-point"],setup(n,{expose:t,emit:e}){const s=n,r=e,{registerViewer:a,registerMap:l,registerPlaybar:h,getProps:u,...d}=gm(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:w,getBindValue:S}=$M(p,m,_,E,r),{viewerEvents:v}=nT(d,r),{mapEvents:g}=tT(d,r),{playbarEvents:R}=eT(d,r);return t(d),(P,T)=>(y.openBlock(),y.createElementBlock("div",iT,[y.createVNode(pm,y.mergeProps({onRegister:y.unref(a)},y.toHandlers(y.unref(v))),null,16,["onRegister"]),y.unref(u).map&&y.unref(w)?(y.openBlock(),y.createBlock(Yh,y.mergeProps({key:0,onRegister:y.unref(l)},y.toHandlers(y.unref(g))),{extra:y.withCtx(U=>[y.renderSlot(P.$slots,"mapExtra",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),left:y.withCtx(U=>[y.renderSlot(P.$slots,"mapLeft",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),right:y.withCtx(U=>[y.renderSlot(P.$slots,"mapRight",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),default:y.withCtx(U=>[y.renderSlot(P.$slots,"mapDefault",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.unref(u).playbar&&y.unref(w)?(y.openBlock(),y.createBlock(Qh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(R))),{slider:y.withCtx(U=>[y.renderSlot(P.$slots,"playbarSlider",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),box:y.withCtx(U=>[y.renderSlot(P.$slots,"playbarBox",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),caption:y.withCtx(U=>[y.renderSlot(P.$slots,"playbarCaption",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),button:y.withCtx(U=>[y.renderSlot(P.$slots,"playbarButton",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),default:y.withCtx(U=>[y.renderSlot(P.$slots,"playbarDefault",y.normalizeProps(y.guardReactiveProps(U)),void 0,!0)]),_:3},16,["onRegister"])):y.createCommentVNode("",!0),y.renderSlot(P.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)]))}}),[["__scopeId","data-v-cb8f711d"]]);Ce.APP_SETTING=Fh,Ce.DirectionMoveEnum=Yi,Ce.MAP_CONFIG=go,Ce.MAP_GEO_OPTIONS=Vh,Ce.MARKER_CONFIG=Gh,Ce.Map=Yh,Ce.PLAYBAR_CONFIG=_o,Ce.Playbar=Qh,Ce.REALSEE_CONFIG=Wh,Ce.REALSEE_SETTING=el,Ce.Realsee=_m,Ce.RealseeErrorCode=ze,Ce.RealseePlugin=_m,Ce.TILE_LAYERS=nl,Ce.TRACK_COLOR_LIST=zh,Ce.TrackMarker=no,Ce.TrackPoint=gs,Ce.TrackRecord=ar,Ce.TrackRecordTypeEnum=Jp,Ce.VIEWER_CONFIG=Hh,Ce.ViewModeEnum=ir,Ce.Viewer=pm,Ce.useRealsee=gm,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));