@vsleem-realsee-viewer/realsee-plugin 2.0.21 → 2.0.23
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.
- package/dist/core/TrackPoint.d.ts +2 -1
- package/dist/hooks/useViewerContext.d.ts +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2498 -2480
- package/dist/index.umd.js +160 -160
- package/dist/settings/index.d.ts +8 -1
- package/dist/types/realsee.d.ts +2 -8
- package/dist/types/store.d.ts +9 -0
- package/dist/types/viewer.d.ts +3 -1
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(Be,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):(Be=typeof globalThis<"u"?globalThis:Be||self,y(Be.RealseePlugin={},Be.Vue,Be.VSLeemShared))})(this,(function(Be,y,Tt){"use strict";const Da={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],pathPin:"data:image/png;base64,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",pathRedPin:"data:image/png;base64,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"},mh={navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,moveInertia:!1,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},gh=[{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=b72aa81ac2b3cae941d1eb213499e15e",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=b72aa81ac2b3cae941d1eb213499e15e",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],dg={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},io={showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,minSize:200,maxSize:500,size:200,yaw:0,tileLayers:gh},_h={},so={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1},vh={appSetting:Tt.APP_SETTING,realseeSetting:Da,playbar:so,map:io,immediate:!0},{cloneDeep:yh,deepMergeProps:fg,getDiffProps:pg}=Tt.utils;function mg(n,t,e,s,r,a){const l=y.ref(yh(io)),h=y.computed(()=>({...l.value,radarAngle:d.value})),u=y.computed(()=>{const{minSize:M=0,size:k=200}=y.unref(h)||{},H=k>M?1:.6;return{width:`${k}px`,height:`${k}px`,opacity:H}}),d=y.computed(()=>{const{currentPoint:M}=t.value||{},k=l.value?.radarYaw||0,H=M?.point.yaw||0;return Tt.Point.toDegrees(H+k)}),p=y.computed(()=>{const{dataSource:M,coordinateTree:k,mappedCoordinateTree:H,currentSpace:Z,currentModel:Q,currentRecord:at,currentPoint:$,currentMarker:dt,currentPointMarkers:G}=t.value||{};return{dataSource:M,coordinateTree:k,mappedCoordinateTree:H,currentSpace:Z,currentModel:Q,currentRecord:at,currentPoint:$,currentPointMarkers:G,currentMarker:dt,state:h.value}});y.watch(()=>yh(n.value?.map),m,{immediate:!0,deep:!0}),y.watch(()=>d.value,N);function m(M,k){const H=pg(M,k);E(H)}function _(){return h.value}function E(M){M&&fg(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 D(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function C(){try{return E({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{E({showMarker:!0})}}function A(){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 F(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:D,domElement:C},handleReady:A,handleDragger:B,handleCollapse:U,handleAngleUpdated:N,handleSelectPoint:F}}const gg=["width","height","href"],_g=["x"],vg={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},yg=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,gg),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",vg,y.toDisplayString(l.value),1)],8,_g)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),bn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},Eg=bn(yg,[["__scopeId","data-v-79e5c590"]]),xg=["cx","cy","r","stroke-width","fill"],wg=bn(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,xg)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),Sg=["d"],Mg=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),D=u+l*Math.sin(S),C=d>180?1:0;return`M ${h} ${u} L ${w} ${v} A ${l} ${l} 0 ${C} 1 ${g} ${D} 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,Sg)],4)):y.createCommentVNode("",!0)}}),Tg=["width","height"],bg=["width","height","href"],Ag=1.2,Cg=1.05,Pg=bn(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}),D=y.ref({...r}),C=y.ref(),A=y.ref(),U=y.ref({...a});let B;const N=y.computed(()=>{const{x:R,y:ht,zoom:ft}=y.unref(g);return{transform:`translate(${R}px, ${ht}px) scale(${ft})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,G),y.onMounted(()=>{G(h.url),it()}),y.onBeforeUnmount(()=>{tt()});const F=R=>{R.preventDefault(),R.stopPropagation();const ht=y.unref(p)?.getBoundingClientRect();if(!ht)return;const ft=R.clientX-ht.left,At=R.clientY-ht.top,vt=R.deltaY>0?-1:1;ee(ft,At,vt,Ag)},I=R=>{if(R.button!==0)return;R.preventDefault(),R.stopPropagation(),_.value=!0;const{pageX:ht,pageY:ft}=R,{x:At,y:vt,zoom:qt}=y.unref(g);S.value={x:At,y:vt,zoom:qt,pageX:ht,pageY:ft}},M=R=>{if(!_.value)return;R.preventDefault(),R.stopPropagation();const{pageX:ht,pageY:ft}=R,{pageX:At,pageY:vt,x:qt,y:Mt}=S.value;g.value.x=Math.round(qt+(ht-At)),g.value.y=Math.round(Mt+(ft-vt))},k=R=>{_.value&&(R.preventDefault(),R.stopPropagation(),_.value=!1)},H=R=>{_.value&&k(R)},Z=R=>{R.preventDefault(),R.stopPropagation(),It()},Q=R=>{const ht=R.touches;ht.length===1?Yt(ht[0]):ht.length===2&&J(ht[0],ht[1])},at=R=>{R.preventDefault(),R.stopPropagation();const ht=R.touches;_.value&&ht.length===1?ct(ht[0]):E.value&&ht.length===2&&pt(ht[0],ht[1])},$=R=>{R.touches.length===0?Nt():R.touches.length===1&&st(R.touches[0])};function dt(){v.value=!1,g.value={...s},D.value={...r},C.value=void 0,A.value=void 0,U.value={...a}}async function G(R){if(!R)return;dt();const ht=new Image;ht.crossOrigin="Anonymous",ht.src=R,ht.onload=()=>{const{naturalWidth:ft,naturalHeight:At}=ht;v.value=!0,D.value.naturalWidth=ft,D.value.naturalHeight=At,A.value=ht,gt(),u("ready",y.unref(D.value),y.unref(g))},ht.onerror=ft=>{console.error("图片加载失败:",ft)}}function it(){B=new ResizeObserver(gt);const R=y.unref(p);R&&B.observe(R)}function tt(){B&&B.disconnect()}function gt(){if(!y.unref(v))return;const{naturalWidth:R,naturalHeight:ht}=y.unref(D),{clientWidth:ft=0,clientHeight:At=0}=y.unref(p)||{},vt=Math.min(ft/R,At/ht),qt=R*vt,Mt=ht*vt,Gt={...y.unref(g)},Se=U.value,Ae=Se.width===0&&Se.height===0,O=Se.width!==ft||Se.height!==At;if(Ae){const b=(ft-qt)/2,j=(At-Mt)/2;D.value={...D.value,width:qt,height:Mt,scale:vt},g.value.x=b,g.value.y=j,g.value.zoom=1}else if(O){const b=Gt.x+D.value.width*Gt.zoom/2,j=Gt.y+D.value.height*Gt.zoom/2,ot=b/Se.width,_t=j/Se.height,rt=ot*ft,Vt=_t*At,St=rt-qt*Gt.zoom/2,Ft=Vt-Mt*Gt.zoom/2;D.value={...D.value,width:qt,height:Mt,scale:vt},g.value.x=Math.round(St),g.value.y=Math.round(Ft)}U.value={width:ft,height:At},u("resize",y.unref(D))}function It(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:R=0,clientHeight:ht=0}=y.unref(p)||{},{width:ft,height:At}=y.unref(D),vt=(R-ft)/2,qt=(ht-At)/2;g.value.x=vt,g.value.y=qt,g.value.zoom=1,U.value={width:R,height:ht},u("zoom-updated",y.unref(g))}function ee(R,ht,ft,At){const{x:vt,y:qt,zoom:Mt}=y.unref(g);let Gt=Mt*(ft>0?At:1/At);Gt=Math.max(l.min,Math.min(l.max,Gt));const Se=(R-vt)/Mt,Ae=(ht-qt)/Mt,O=R-Se*Gt,b=ht-Ae*Gt;g.value.x=Math.round(O),g.value.y=Math.round(b),g.value.zoom=Gt,u("zoom-updated",y.unref(g))}function Yt(R){_.value=!0;const{pageX:ht,pageY:ft}=R,{x:At,y:vt,zoom:qt}=y.unref(g);S.value={x:At,y:vt,zoom:qt,pageX:ht,pageY:ft}}function J(R,ht){E.value=!0,_.value=!1,w.value=lt(R,ht)}function ct(R){const{pageX:ht,pageY:ft}=R,{pageX:At,pageY:vt,x:qt,y:Mt}=S.value;g.value.x=Math.round(qt+(ht-At)),g.value.y=Math.round(Mt+(ft-vt))}function pt(R,ht){const ft=y.unref(p)?.getBoundingClientRect();if(!ft)return;const At=lt(R,ht);if(w.value>0){const vt=(R.clientX+ht.clientX)/2-ft.left,qt=(R.clientY+ht.clientY)/2-ft.top,Gt=At/w.value>1?1:-1;ee(vt,qt,Gt,Cg)}w.value=At}function Nt(){_.value=!1,E.value=!1,w.value=0}function st(R){E.value=!1,_.value=!0;const{pageX:ht,pageY:ft}=R,{x:At,y:vt,zoom:qt}=y.unref(g);S.value={x:At,y:vt,zoom:qt,pageX:ht,pageY:ft}}function lt(R,ht){const ft=R.clientX-ht.clientX,At=R.clientY-ht.clientY;return Math.sqrt(ft*ft+At*At)}async function Dt(){if(!A.value){console.warn("图片实例未找到");return}const R=d.value;if(!R){console.error("未找到 SVG 元素");return}try{const ht=document.createElement("canvas"),ft=ht.getContext("2d");if(!ft)throw new Error("无法获取 Canvas 2D 上下文");ht.width=A.value.width,ht.height=A.value.height,ft.drawImage(A.value,0,0),C.value=ht.toDataURL("image/webp",1),await new Promise(Mt=>setTimeout(Mt,500));const At=new XMLSerializer().serializeToString(R),vt=new Blob([At],{type:"image/svg+xml;charset=utf-8"}),qt=URL.createObjectURL(vt);return await Bt(qt)}catch(ht){console.error("导出 SVG 到 PNG 失败:",ht)}finally{C.value=""}}function Bt(R){return new Promise((ht,ft)=>{const At=new Image;At.src=R,At.onload=()=>{try{URL.revokeObjectURL(R);const vt=document.createElement("canvas"),qt=vt.getContext("2d");if(!qt)throw new Error("无法获取 Canvas 2D 上下文");const Mt=y.unref(p),{width:Gt,height:Se}=Mt?.getBoundingClientRect()||{width:800,height:600},{zoom:Ae=1,x:O=0,y:b=0}=y.unref(g);vt.width=Gt,vt.height=Se,qt.setTransform(Ae,0,0,Ae,O,b),qt.drawImage(At,0,0),ht(vt)}catch(vt){ft(vt)}},At.onerror=()=>{URL.revokeObjectURL(R),ft(new Error("SVG 图像加载失败"))}})}return t({domElement:Dt}),(R,ht)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:Z,onWheel:F,onMousedown:I,onMousemove:M,onMouseup:k,onMouseleave:H,onTouchstart:Q,onTouchmove:at,onTouchend:$},[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:D.value?.width,height:D.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:D.value?.width,height:D.value?.height,href:C.value||R.url,crossOrigin:"anonymous"},null,8,bg)):y.createCommentVNode("",!0),y.renderSlot(R.$slots,"default",{},void 0,!0)],8,Tg))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),Rg={class:"vsleem-map-cad"},Lg=bn(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",Rg,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(Pg,{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,([D,C])=>(y.openBlock(),y.createElementBlock("g",{key:D},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(C.trackPoints,([A,U])=>(y.openBlock(),y.createBlock(wg,{key:A,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(Mg,{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,([D,C])=>(y.openBlock(),y.createBlock(Eg,{key:D.id,point:D,markers:C,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(A=>E(D,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"]]),Ig="data:image/png;base64,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",Dg="data:image/png;base64,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",kg="data:image/png;base64,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",Ug={class:"vsleem-map-dragger"},Og=["src"],Ng=["src"],Bg=bn(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(D){y.unref(a)!=D&&u()}function u(){const{min:D,max:C}=s,A=y.unref(a)?C:D;a.value=!y.unref(a),r("collapse",y.unref(a)),r("dragger",A)}function d(D){const{size:C}=s;l.value={x:D.pageX,y:D.pageY,size:C}}function p(D){if(y.unref(l)){const{min:C=0,max:A=0}=s,{x:U=0,size:B=0}=y.unref(l)||{};let N=Math.min(Math.max(B-(D.pageX-U),C),A);r("dragger",N)}}function m(){l.value=void 0}function _(D){d(D),document.addEventListener("mousemove",E),document.addEventListener("mouseup",S)}function E(D){p(D)}function S(){m(),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S)}function w(D){d(D.touches[0]),document.addEventListener("touchmove",v),document.addEventListener("touchend",g)}function v(D){p(D.touches[0])}function g(){m(),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",g)}return t({collapse:h}),(D,C)=>(y.openBlock(),y.createElementBlock("div",Ug,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:u},[y.createElementVNode("img",{src:a.value?y.unref(Ig):y.unref(Dg)},null,8,Og)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:_,onTouchstart:w},[y.createElementVNode("img",{src:y.unref(kg)},null,8,Ng)],32)]))}}),[["__scopeId","data-v-f432df8d"]]);function Fg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ir={exports:{}};/* @preserve
|
|
1
|
+
(function(ke,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):(ke=typeof globalThis<"u"?globalThis:ke||self,y(ke.RealseePlugin={},ke.Vue,ke.VSLeemShared))})(this,(function(ke,y,Tt){"use strict";const mg="data:image/png;base64,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",gg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAABWCAMAAACO0TaWAAABjFBMVEUAAADSZGSkhYXVZGSnhITXY2PYY2PQZGSmhISlhITZYmKmhITPYWHMZGTKYmLOZWWmhISlhISlhITNY2PSYmK6QECmhISmhoamhITGYGClhITQX1/OXFy7VVWlhITTX1/BS0vYYGCmg4O/R0fEXl7KVlbVXV2lg4PGUVHBWlrJYWGmg4Olg4PQWlquSEi2UFDKV1elhIS0Tk67QkKlhISlhISlhIS+WVnVYGDDTU20Tk7RX1/NWVm+RUXGXV3FT0/BXV3CXV2lhITJUFC/XFy3Rka8Y2OyS0vGU1PFTEy6W1vLXl7KVVXPV1e2UVG0Skq8Xl61UlKzUlLOVVWyUlKsTEzDXFy5Y2O4VFSzbm6zUVGzVVWrRka2ZWWzbm6tWVm1TU27YGDTW1uueHiyZGSuUFC0UlKrSUm+YWG1SEivUFC5Xl6+Wlq4aGi2Vla0YGDLXV20VFS2bW21VFSwdHSre3u0amq/VlataWmtTU27ZWW2U1O2YmK5Wlq3bW2ud3e4YWG+U1OzWFiwZ2dFqcd9AAAAhHRSTlMArgaqDaajsgkUoCOttre1ET0csaqXNhlNuTGqqLQtpJyfKZq3op9HoLe1UVejr7SlVLKbQkRKtaafxaelmMCezMdcm9KmpLCimtWznp2Mt8LAo5uXyLOsy4it1q+JgF29u5xdM9TKu7Kwy8rEklNFt311b2xpJLcqwZtjZ5Z/dLOvTT3bswQEAAAOYElEQVRo3uzXe1MSYRgF8IqKSBBsNwEpyBs4qwwSYLCoqEATpBDmJOpUWI4zDqWZozVZ0+2Ld57nfdeXki5KTf3RWWmAEn6ezq565n/+50/l3A9y5t+JQl06ynmOevxvwBXzvBVPm9Dzlv9vqSX0COnY3t6rVJZisdjNVbMljVU8tVSp7G1vHzCd2R2gO6LCuXNIStOsVovF4tXvBH9VrTZMkm/vOKT6T5uVlamOjcNKrGZWt4oJi5WQGWw5kKuJI3iiuFU1Y6sVKpub/pNmZT0AtQGpREBIuXGUjLipDCJTiNV3tdFY3RVNM/nPYT0be4s1k6kSysBMDsdIZqRdMrlcLpMRfnYnJNpkM9X8m8lysDirlmLmVkJQGQolI+8gw/gYHx8fHh4e5wP3xeM7w7jdGUHILdVW0YuHB57f2TI3y9jDRbNKvcpSMywl5jhnEse1SRwt4cfjk5OT44wXbLSdU+bElrm6xy3/FrHCcrG0AKLmIAWVna3EAEfHPb4FAnjmyE4BGyF0rkToKUFe3HZgbCzuXOvYWTKrhJ0a5AUQlaUSGiCYitOJD3kLyOg62EIeBToq0HgtkBMwJ6rmLu+iE7Gsdi/WwAwSPILcCMaoqAFdCgFyHktA/oHoAAt39loWZkLTqmnSsuWiubQhxJ1oDyqNKjfLIxBbVZ2SgEUyZ53tc5YO/FM9QEcgmw1lYeaeIRbkKYgXpfi02o2KuQUtz4CbtXpF8ObtaN1+v396ljKNey9azGfP4uZkdFoPoOdQKBqNouZ5mEvccoLEvOMT75a7pSGg2lYs92rDMpngJIPm1JxOwz87U5hpNpeRFRHc+9BszhQgZ7FNwHWbbgvo2bSezgItySzmjivYMSo+YbnYLbpFtaxlrDVXOAUVUlidmuafLTTXl1fez1HGvgo9s/J8uVmYmTZ4GHzTEWwZYkzjWhQhcqbE4s1Dx4lGIa4J2zXsFtrcCLSEDenXBBY9Caym4eafLjSXV4QzHh8dHfW1Bo/jcWa/f7NemPGLLVOgtUkxDSMcHZ6fHxEdm6uvueITlHuwaiauTtH1YBjaKM5pnePUeQKsRYzZ8vrz/TmSwjkxEYmkUslkskckmUylUpHIxATccTI/+lCY4ZZFaBgQ6ywWHedL6BgV0+X418C0XMfjzSLtVgzhWiiUDcAagJaxltZfvveceoV1IpJiZS+lzwo/YnkqMiHMz9cLfoA18To2IttsaSTEZHTMYnPX4fklMC93yUxASydZlLrN6mlgEaZa2unyh/fAkpWoxAwOBAcGBrpU8CgYDBKczUSeew+x5sSWmAwuyBeEl0seQcdTVxuLXtrEL2zB8TpWpSnQbqPREGttWIJNnmJWt8vYQZyxoELKwCsUrxV+xG6gyZxCyyy+qyHcsOgY4guhizCHo3IUWzEe8c+5O7GiNQXWZqlbVa0dq9WMwj1oR30CS5US00Fp+YXNgzgQghMa5p5khMQr5WkGi+hcMXfM4gWIBweLi14HwD/jftoEt5SbH44i2Ww6rdPXb2GZiymssBYr6EOvgiqZl76KlIMNM5FRcsQXH9tvzoJLh9UxwFIcDgtwDZPAhn/OvVGSU0gjtK+W2bo0lzFd3h+LQ0szYKxHQM99L3BLM5VMHY/NrRc0VTGBWyvGJvKlqUblh2De7mZx8EaeuPi0dBZY4qp2XXbNmFnfH/NNJHv6MAOJFdSf/obqIXEXOk754nPrs+S1q1FwxVixbDg/OFj/5AD4R9wauLyFELV7gb0Ci3btKBftNufGfKmeXhoCYdl6gh/70XFfb3Iivl/2ay6IvwVfBJjEAGdqV9SEj193HVcWq2hXcEOSq6vlug23YfjL+3Eflau0J/xpGuJgb9IXXynf1e5Sw2oSEoyOwwsEjlUAxhu05Xq8e5vEjYZDxL2guIjdbne73N2GUV4Z8yVRLmsJe6KwWILHyn7DgPcITGEvTyKKk+5GvcvrQcHt19BVz5Ty8wv4Xn4xdEFybbJdcLEFqtfinlyrzmovwKnR5VnDcLnonLDLhhW4H4u4ny/Vdrng9muo1IiLdi9KLyK3C67bZaDemdujkR7idvKLADXc1+N7VNYMw+22t2+4n8CZWpeXFny8Xo+3q44L2QKmy9o074m/p/F2XYhBc/D19BH3tFp+M4CDvZFHZQMFu6lfTXp16ZUN50v1DXqvtl/yLurFeMOol2Z/tAZq1+5i79DQ2tNIb1CctacPzpUrXb3Jh+UHhtGN120pGF4JFouov+2iN2tX7/WP+fsL4Fpe3TrZ5Hpd3X7jQflREvV6OuFywV4M4kNdeN3wQuyUC07DSwn3P7mff/Wu3RlH9Q7US3mca9AKL9Wrrg3QuroNeB9iDmoNp18wvGu32EtgdVH7puBX7wZ4EMc/f6dO9Yb6aTuSK8G0XqvfZ9dxttELdN7vQ8uLV9fsRz/CK29/+Mn9j9eD7D3++W/hjYaJa80XWtUveY2hB7fWnnbeL/937qxdb+nX/u2AEXjRL9dzbL5X4EW9ljctvU65XuWtxfrEok4fvtZ/3qx9vDVkdMMLsLoCI8obVt5jXy97+/svCzC8X59uEGO/Q7eu15cGfsPlbGNzE/UO+bneln6V9zL3++wle8+19T5BvS1e3q/sl8F+FPwxtvawk+vvOck1Y/D64XVjDqpfHOwlMPVbHv2ON/ilfTt+TSIM4wD+QxC0bGGF0y03HLGxWdYEVxAcd3AYTCo3tMGcrjJRzJGZsRy0H+of7/s87/v4lC/rhkMY0XNBzJ8++/L1vXvvbsY7p16Mra/0dz6FQqTztb2bC1Oe36ClS7Qvtbd5E6+p72S+16W/T3ry9Xa8iZ2X6tV8MeDyxQ7AD1CIxwfd7ickPOVtoxsLHw5aL/KId+PB/CbyJe/v+Up95+DtfU+sntPfRPoNeTHwnh/wBoFf1yofEPFUV5MfKt2R4fK3TfKVdLUO8D7aSSZk/XW89R55NeB74pUGw7tpwPlct1b5doPFmItike3PSq2bs9wUvMSVfK8xGFrjxfrrFeNyNnXO54ufdnDxMCcBywqhAROYE04TOFet7f1ckMclmPOljOXd0JeD1iiXgzZ9Au68cDGTF5RzFO/9j9nEslyguefzoof1l1cIBUvCAr6VSm1wwi9yuVGr+4rIF9xsAtttQ2vCfZCCF1rhant1dQgHcamDez5eTWR31myBtcEaMFWCA0bCJ2kWM3nvaAGbeXc3r09rYf3x6nGtCixXgbic7m3l6g6OvIRAG/YL8WU5ObkFXozX/fcZu0LoOc6QBYyEUQmUmMVEbldb3YNXR9/kbgnT+X/+5NvR573dVnd0mMPkjRbceSrD5NqgJ2NwM/3yto2XvO715HK80PFswO4aIWCJeCMNMZPJPKq2Wru7e5XK5yOZz5XK3u5uq1UdtQ8POdl8Ps1aDneiDPAqF4DMWqmXLVB73R09vGaFiGd7pTVKWCs8uarhmGfxBtWYQmbyYe4Q0263qzrtNqCgkpWxNKK9hTLgwHWvw+VTcabUaxbO38nQ7pg2rcOwlJmTSrheWSUwKAXElgw01DIgykAKKmqg2BSw+Mdc/apNpuv1muu4aSA7mfP2gOsArwGsCSvY7OOEvImMiXwCMswYZtuDkAaaf8zWp9QDzCZXwWKRray7eh7mdL0yuLYN4nWXNDRifUBg9roRa4v55Awxk03OzDZ2jPxEAyqwHK3prWmuhOue11b8/SS4q7hMEa7jtY2Ibzd7KeQrYo143ApdiyHeJLJFExtwUVKmJ0zlGuDSXHvLVq0CaZVbCuvEtXcN/nZVyuBkx9dVQsEqlpTniYyBGWhh63ABiGqD1TVBs9UvmpzWVoJyk9MVbhR4PXnsxzIZBatYhsGUspA5aWL/cWDQVwMFlYukVlcLb6YfHme3CxPpRoG/vgtWCOyKpcgyt2BgjsJ5hCkH5wqsGy20epKIhR2Ey7cTXa5bYYDpS1fYztaDlFz7aI15xhlb9G27e0bWzmGhZCXsXW0tn34nqxDzy4NsEuGCuyDcaPBiHBE3i0HJRCwZC9lN2cJlzAIgw9WZDFa/ZVoFaM+yEq4+HYq+d7i6TBEnm/vhXYgxrljMmvNdi9ZDmSpV60Rv50rQbiWpucTVp2/R26sFlHiRSzHshH0rdsnaDTdrB6pUHcYa7Uo/7AytdhnhytPN6DH7QURsHj2hFd6SqQWhHbIkHTlKtRflis2UPP+0mRUthetsZiNKzBEb8dbxOx8h8whZv36K5mNSbj7X0VzH2CUv7JxtiZaq4IYb3QkV44nk8DQISi6Z0RcdvbrlYDXZTl2ekrLW7mKnuUlwk8VxfuwLst9fUrOiL8JW6G/W56UgANZEK1qpwhT3CViMR08cMpFRDK80Po3Iwhw1rhQ3Qp6VgrB8OjBYRMu9Fa3LjR558nTHPPU15OzWWbHsB/2Y5iwjJIepULn2inmBXy42yEpYiZZ7K9ppxdxjIRf4vYutwWkn8AMv9kzVUQMnUWOoa1jeP6Zc7SsTCcZytKq9rJiabMmImdAPB8fFcuD7nhfjsN1hJE8mswQoSTvF+pDfRDFWwSLaS2pVrCFzysZs0VA3ToudchD6yNvz8PKWDogpz8OvFPrlcrFYbzwkKahqXVydEht9H0leB7BmRaPT/D7RWaPRKE5MHZ8NH8IJqJUyla0IlmsArKu9PFmKAbO83wK1vE1EcthZL0M/4VNibjMUUqGydRZYEQuZzYKGOqHvQYHuDF6WokAZCimoiPUPq2JnQLZmQUMNtnFbuo4gx85VKwWVrc6tzRmaGQ31HX0LCnbgdUAkpHGKVKmwzhKrZDGzGqNvQTmj70sxVO4Jgjpjq4tWNdwMZ7uOJTJT713OkBqNFrbAodLRD+DEXIU/H1K24n+bq/r3WeO5yn9E9n/+yfkFEtaOmV3W9SYAAAAASUVORK5CYII=",gh={...Tt.APP_SETTING,obsType:"hs"},_h=["#3CDE99","#DE3CB9","#683CDE","#3CA0DE","#D8DE3C","#DEA03C","#DE3C3C"],Da={pointLax:0,pointType:0,pointNumber:5,pointDistance:5e3,preloadStep:5,trackColorRange:_h,pathPin:mg,pathRedPin:gg},vh={navbar:!1,defaultYaw:0,defaultPitch:0,defaultZoomLvl:30,moveInertia:!1,minFov:20,maxFov:120,loadingImg:"",loadingTxt:"Loading...",size:{width:"100%",height:"100%"}},ka=[{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=b72aa81ac2b3cae941d1eb213499e15e",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=b72aa81ac2b3cae941d1eb213499e15e",options:{subdomains:["0","1","2","3","4","5","6","7"]}}],yh={center:[31.3016935,120.5810725],zoom:17,attributionControl:!0,zoomControl:!1},io={showRadar:!0,showPoint:!0,showMarker:!0,showDragger:!0,minSize:200,maxSize:500,size:200,yaw:0,tileLayers:ka},Eh={},so={speed:1e3,baseSpeed:1e3,step:.5,threshold:2e3,showPlay:!0,showSpeed:!0,count:1,index:1},xh={appSetting:gh,realseeSetting:Da,playbar:so,map:io,immediate:!0},{cloneDeep:wh,deepMergeProps:_g,getDiffProps:vg}=Tt.utils;function yg(n,t,e,s,r,a){const l=y.ref(wh(io)),h=y.computed(()=>({...l.value,radarAngle:d.value})),u=y.computed(()=>{const{minSize:M=0,size:k=200}=y.unref(h)||{},H=k>M?1:.6;return{width:`${k}px`,height:`${k}px`,opacity:H}}),d=y.computed(()=>{const{currentPoint:M}=t.value||{},k=l.value?.radarYaw||0,H=M?.point.yaw||0;return Tt.Point.toDegrees(H+k)}),p=y.computed(()=>{const{dataSource:M,coordinateTree:k,mappedCoordinateTree:H,currentSpace:Z,currentModel:j,currentRecord:at,currentPoint:$,currentMarker:dt,currentPointMarkers:G}=t.value||{};return{dataSource:M,coordinateTree:k,mappedCoordinateTree:H,currentSpace:Z,currentModel:j,currentRecord:at,currentPoint:$,currentPointMarkers:G,currentMarker:dt,state:h.value}});y.watch(()=>wh(n.value?.map),m,{immediate:!0,deep:!0}),y.watch(()=>d.value,N);function m(M,k){const H=vg(M,k);E(H)}function _(){return h.value}function E(M){M&&_g(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 D(){s.value?.needUpdate?.(),r.value?.needUpdate?.()}async function C(){try{return E({showMarker:!1}),await r.value?.domElement?.()}catch{}finally{E({showMarker:!0})}}function A(){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 F(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:D,domElement:C},handleReady:A,handleDragger:B,handleCollapse:U,handleAngleUpdated:N,handleSelectPoint:F}}const Eg=["width","height","href"],xg=["x"],wg={xmlns:"http://www.w3.org/1999/xhtml",class:"map-marker-tag"},Sg=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,Eg),l.value>1?(y.openBlock(),y.createElementBlock("foreignObject",{key:0,width:"10",height:"10",x:e.value-10},[y.createElementVNode("div",wg,y.toDisplayString(l.value),1)],8,xg)):y.createCommentVNode("",!0)],4)):y.createCommentVNode("",!0)}}),bn=(n,t)=>{const e=n.__vccOpts||n;for(const[s,r]of t)e[s]=r;return e},Mg=bn(Sg,[["__scopeId","data-v-79e5c590"]]),Tg=["cx","cy","r","stroke-width","fill"],bg=bn(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,Tg)):y.createCommentVNode("",!0)}}),[["__scopeId","data-v-77fec65e"]]),Ag=["d"],Cg=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),D=u+l*Math.sin(S),C=d>180?1:0;return`M ${h} ${u} L ${w} ${v} A ${l} ${l} 0 ${C} 1 ${g} ${D} 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,Ag)],4)):y.createCommentVNode("",!0)}}),Pg=["width","height"],Rg=["width","height","href"],Lg=1.2,Ig=1.05,Dg=bn(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}),D=y.ref({...r}),C=y.ref(),A=y.ref(),U=y.ref({...a});let B;const N=y.computed(()=>{const{x:R,y:ht,zoom:ft}=y.unref(g);return{transform:`translate(${R}px, ${ht}px) scale(${ft})`,transformOrigin:"0 0",position:"absolute",left:"0",top:"0",width:"100%",height:"100%"}});y.watch(()=>h.url,G),y.onMounted(()=>{G(h.url),it()}),y.onBeforeUnmount(()=>{tt()});const F=R=>{R.preventDefault(),R.stopPropagation();const ht=y.unref(p)?.getBoundingClientRect();if(!ht)return;const ft=R.clientX-ht.left,Ct=R.clientY-ht.top,vt=R.deltaY>0?-1:1;Jt(ft,Ct,vt,Lg)},I=R=>{if(R.button!==0)return;R.preventDefault(),R.stopPropagation(),_.value=!0;const{pageX:ht,pageY:ft}=R,{x:Ct,y:vt,zoom:qt}=y.unref(g);S.value={x:Ct,y:vt,zoom:qt,pageX:ht,pageY:ft}},M=R=>{if(!_.value)return;R.preventDefault(),R.stopPropagation();const{pageX:ht,pageY:ft}=R,{pageX:Ct,pageY:vt,x:qt,y:Mt}=S.value;g.value.x=Math.round(qt+(ht-Ct)),g.value.y=Math.round(Mt+(ft-vt))},k=R=>{_.value&&(R.preventDefault(),R.stopPropagation(),_.value=!1)},H=R=>{_.value&&k(R)},Z=R=>{R.preventDefault(),R.stopPropagation(),At()},j=R=>{const ht=R.touches;ht.length===1?Ft(ht[0]):ht.length===2&&Q(ht[0],ht[1])},at=R=>{R.preventDefault(),R.stopPropagation();const ht=R.touches;_.value&&ht.length===1?lt(ht[0]):E.value&&ht.length===2&&pt(ht[0],ht[1])},$=R=>{R.touches.length===0?Nt():R.touches.length===1&&st(R.touches[0])};function dt(){v.value=!1,g.value={...s},D.value={...r},C.value=void 0,A.value=void 0,U.value={...a}}async function G(R){if(!R)return;dt();const ht=new Image;ht.crossOrigin="Anonymous",ht.src=R,ht.onload=()=>{const{naturalWidth:ft,naturalHeight:Ct}=ht;v.value=!0,D.value.naturalWidth=ft,D.value.naturalHeight=Ct,A.value=ht,gt(),u("ready",y.unref(D.value),y.unref(g))},ht.onerror=ft=>{console.error("图片加载失败:",ft)}}function it(){B=new ResizeObserver(gt);const R=y.unref(p);R&&B.observe(R)}function tt(){B&&B.disconnect()}function gt(){if(!y.unref(v))return;const{naturalWidth:R,naturalHeight:ht}=y.unref(D),{clientWidth:ft=0,clientHeight:Ct=0}=y.unref(p)||{},vt=Math.min(ft/R,Ct/ht),qt=R*vt,Mt=ht*vt,Wt={...y.unref(g)},Se=U.value,Ae=Se.width===0&&Se.height===0,O=Se.width!==ft||Se.height!==Ct;if(Ae){const b=(ft-qt)/2,J=(Ct-Mt)/2;D.value={...D.value,width:qt,height:Mt,scale:vt},g.value.x=b,g.value.y=J,g.value.zoom=1}else if(O){const b=Wt.x+D.value.width*Wt.zoom/2,J=Wt.y+D.value.height*Wt.zoom/2,ot=b/Se.width,_t=J/Se.height,rt=ot*ft,Gt=_t*Ct,St=rt-qt*Wt.zoom/2,zt=Gt-Mt*Wt.zoom/2;D.value={...D.value,width:qt,height:Mt,scale:vt},g.value.x=Math.round(St),g.value.y=Math.round(zt)}U.value={width:ft,height:Ct},u("resize",y.unref(D))}function At(){if(!y.unref(v)||!y.unref(p))return;const{clientWidth:R=0,clientHeight:ht=0}=y.unref(p)||{},{width:ft,height:Ct}=y.unref(D),vt=(R-ft)/2,qt=(ht-Ct)/2;g.value.x=vt,g.value.y=qt,g.value.zoom=1,U.value={width:R,height:ht},u("zoom-updated",y.unref(g))}function Jt(R,ht,ft,Ct){const{x:vt,y:qt,zoom:Mt}=y.unref(g);let Wt=Mt*(ft>0?Ct:1/Ct);Wt=Math.max(l.min,Math.min(l.max,Wt));const Se=(R-vt)/Mt,Ae=(ht-qt)/Mt,O=R-Se*Wt,b=ht-Ae*Wt;g.value.x=Math.round(O),g.value.y=Math.round(b),g.value.zoom=Wt,u("zoom-updated",y.unref(g))}function Ft(R){_.value=!0;const{pageX:ht,pageY:ft}=R,{x:Ct,y:vt,zoom:qt}=y.unref(g);S.value={x:Ct,y:vt,zoom:qt,pageX:ht,pageY:ft}}function Q(R,ht){E.value=!0,_.value=!1,w.value=ct(R,ht)}function lt(R){const{pageX:ht,pageY:ft}=R,{pageX:Ct,pageY:vt,x:qt,y:Mt}=S.value;g.value.x=Math.round(qt+(ht-Ct)),g.value.y=Math.round(Mt+(ft-vt))}function pt(R,ht){const ft=y.unref(p)?.getBoundingClientRect();if(!ft)return;const Ct=ct(R,ht);if(w.value>0){const vt=(R.clientX+ht.clientX)/2-ft.left,qt=(R.clientY+ht.clientY)/2-ft.top,Wt=Ct/w.value>1?1:-1;Jt(vt,qt,Wt,Ig)}w.value=Ct}function Nt(){_.value=!1,E.value=!1,w.value=0}function st(R){E.value=!1,_.value=!0;const{pageX:ht,pageY:ft}=R,{x:Ct,y:vt,zoom:qt}=y.unref(g);S.value={x:Ct,y:vt,zoom:qt,pageX:ht,pageY:ft}}function ct(R,ht){const ft=R.clientX-ht.clientX,Ct=R.clientY-ht.clientY;return Math.sqrt(ft*ft+Ct*Ct)}async function Dt(){if(!A.value){console.warn("图片实例未找到");return}const R=d.value;if(!R){console.error("未找到 SVG 元素");return}try{const ht=document.createElement("canvas"),ft=ht.getContext("2d");if(!ft)throw new Error("无法获取 Canvas 2D 上下文");ht.width=A.value.width,ht.height=A.value.height,ft.drawImage(A.value,0,0),C.value=ht.toDataURL("image/webp",1),await new Promise(Mt=>setTimeout(Mt,500));const Ct=new XMLSerializer().serializeToString(R),vt=new Blob([Ct],{type:"image/svg+xml;charset=utf-8"}),qt=URL.createObjectURL(vt);return await Bt(qt)}catch(ht){console.error("导出 SVG 到 PNG 失败:",ht)}finally{C.value=""}}function Bt(R){return new Promise((ht,ft)=>{const Ct=new Image;Ct.src=R,Ct.onload=()=>{try{URL.revokeObjectURL(R);const vt=document.createElement("canvas"),qt=vt.getContext("2d");if(!qt)throw new Error("无法获取 Canvas 2D 上下文");const Mt=y.unref(p),{width:Wt,height:Se}=Mt?.getBoundingClientRect()||{width:800,height:600},{zoom:Ae=1,x:O=0,y:b=0}=y.unref(g);vt.width=Wt,vt.height=Se,qt.setTransform(Ae,0,0,Ae,O,b),qt.drawImage(Ct,0,0),ht(vt)}catch(vt){ft(vt)}},Ct.onerror=()=>{URL.revokeObjectURL(R),ft(new Error("SVG 图像加载失败"))}})}return t({domElement:Dt}),(R,ht)=>(y.openBlock(),y.createElementBlock("div",{ref_key:"wrapperRef",ref:p,class:"map-wrapper",onDblclick:Z,onWheel:F,onMousedown:I,onMousemove:M,onMouseup:k,onMouseleave:H,onTouchstart:j,onTouchmove:at,onTouchend:$},[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:D.value?.width,height:D.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:D.value?.width,height:D.value?.height,href:C.value||R.url,crossOrigin:"anonymous"},null,8,Rg)):y.createCommentVNode("",!0),y.renderSlot(R.$slots,"default",{},void 0,!0)],8,Pg))],4)],544))}}),[["__scopeId","data-v-8b4f0684"]]),kg={class:"vsleem-map-cad"},Ug=bn(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",kg,[v.store?.currentModel?.modelValue?(y.openBlock(),y.createBlock(Dg,{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,([D,C])=>(y.openBlock(),y.createElementBlock("g",{key:D},[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(C.trackPoints,([A,U])=>(y.openBlock(),y.createBlock(bg,{key:A,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(Cg,{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,([D,C])=>(y.openBlock(),y.createBlock(Mg,{key:D.id,point:D,markers:C,imgZoom:l.value,imgScale:h.value,wrapScale:u.value,onClick:y.withModifiers(A=>E(D,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"]]),Og="data:image/png;base64,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",Ng="data:image/png;base64,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",Bg="data:image/png;base64,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",Fg={class:"vsleem-map-dragger"},zg=["src"],Hg=["src"],Vg=bn(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(D){y.unref(a)!=D&&u()}function u(){const{min:D,max:C}=s,A=y.unref(a)?C:D;a.value=!y.unref(a),r("collapse",y.unref(a)),r("dragger",A)}function d(D){const{size:C}=s;l.value={x:D.pageX,y:D.pageY,size:C}}function p(D){if(y.unref(l)){const{min:C=0,max:A=0}=s,{x:U=0,size:B=0}=y.unref(l)||{};let N=Math.min(Math.max(B-(D.pageX-U),C),A);r("dragger",N)}}function m(){l.value=void 0}function _(D){d(D),document.addEventListener("mousemove",E),document.addEventListener("mouseup",S)}function E(D){p(D)}function S(){m(),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",S)}function w(D){d(D.touches[0]),document.addEventListener("touchmove",v),document.addEventListener("touchend",g)}function v(D){p(D.touches[0])}function g(){m(),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",g)}return t({collapse:h}),(D,C)=>(y.openBlock(),y.createElementBlock("div",Fg,[y.createElementVNode("div",{class:"map-dragger-button collapse",onClick:u},[y.createElementVNode("img",{src:a.value?y.unref(Og):y.unref(Ng)},null,8,zg)]),y.createElementVNode("div",{class:"map-dragger-button arraw",onMousedown:_,onTouchstart:w},[y.createElementVNode("img",{src:y.unref(Bg)},null,8,Hg)],32)]))}}),[["__scopeId","data-v-f432df8d"]]);function Gg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ir={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 zg=ir.exports,Eh;function Hg(){return Eh||(Eh=1,(function(n,t){(function(e,s){s(t)})(zg,(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,T,z;return z=function(){f=!1,x&&(T.apply(c,x),x=!1)},T=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(z,o),f=!0)},T}function p(i,o,c){var f=o[1],x=o[0],T=f-x;return i===f&&c?i:((i-x)%T+T)%T+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 D(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 A(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 F(i){var o=+new Date,c=Math.max(0,16-(o-N));return N=o+c,window.setTimeout(i,c)}var I=window.requestAnimationFrame||B("RequestAnimationFrame")||F,M=window.cancelAnimationFrame||B("CancelAnimationFrame")||B("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function k(i,o,c){if(c&&I===F)i.call(o);else return I.call(window,l(i,o))}function H(i){i&&M.call(window,i)}var Z={__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:D,isArray:C,indexOf:A,emptyImageUrl:U,requestFn:I,cancelFn:M,requestAnimFrame:k,cancelAnimFrame:H};function Q(){}Q.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&&(at(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 T=0,z=f._initHooks.length;T<z;T++)f._initHooks[T].call(this)}},o},Q.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},Q.mergeOptions=function(i){return r(this.prototype.options,i),this},Q.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 at(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 $={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,T=i.length;x<T;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,T=0,z=i.length;T<z;T++)x?this._off(i[T]):this._off(i[T],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,T;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,T=f.length;x<T;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var z=this._listens(i,o,c);if(z!==!1){var q=f[z];this._firingCount&&(q.fn=m,this._events[i]=f=f.slice()),f.splice(z,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 T=0,z=x.length;T<z;T++){var q=x[T],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 T=this._events&&this._events[i];if(T&&T.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var z in this._eventParents)if(this._eventParents[z].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,T=f.length;x<T;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,T=i.length;x<T;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)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var dt=Q.extend($);function G(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var it=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(tt(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(tt(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=it(this.x),this.y=it(this.y),this},distanceTo:function(i){i=tt(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=tt(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=tt(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 tt(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 gt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}gt.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof G||typeof i[0]=="number"||"x"in i)o=c=tt(i);else if(i=It(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 tt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return tt(this.min.x,this.max.y)},getTopRight:function(){return tt(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=tt(i):i=It(i),i instanceof gt?(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=It(i);var o=this.min,c=this.max,f=i.min,x=i.max,T=x.x>=o.x&&f.x<=c.x,z=x.y>=o.y&&f.y<=c.y;return T&&z},overlaps:function(i){i=It(i);var o=this.min,c=this.max,f=i.min,x=i.max,T=x.x>o.x&&f.x<c.x,z=x.y>o.y&&f.y<c.y;return T&&z},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 It(tt(o.x-f,o.y-x),tt(c.x+f,c.y+x))},equals:function(i){return i?(i=It(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function It(i,o){return!i||i instanceof gt?i:new gt(i,o)}function ee(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}ee.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof J)f=i,x=i;else if(i instanceof ee){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(ct(i)||Yt(i)):this;return!o&&!c?(this._southWest=new J(f.lat,f.lng),this._northEast=new J(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 ee(new J(o.lat-f,o.lng-x),new J(c.lat+f,c.lng+x))},getCenter:function(){return new J((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 J(this.getNorth(),this.getWest())},getSouthEast:function(){return new J(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 J||"lat"in i?i=ct(i):i=Yt(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof ee?(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=Yt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),T=x.lat>=o.lat&&f.lat<=c.lat,z=x.lng>=o.lng&&f.lng<=c.lng;return T&&z},overlaps:function(i){i=Yt(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),T=x.lat>o.lat&&f.lat<c.lat,z=x.lng>o.lng&&f.lng<c.lng;return T&&z},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Yt(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Yt(i,o){return i instanceof ee?i:new ee(i,o)}function J(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)}J.prototype={equals:function(i,o){if(!i)return!1;i=ct(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 Nt.distance(this,ct(i))},wrap:function(){return Nt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Yt([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new J(this.lat,this.lng,this.alt)}};function ct(i,o,c){return i instanceof J?i:C(i)&&typeof i[0]!="object"?i.length===3?new J(i[0],i[1],i[2]):i.length===2?new J(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new J(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new J(i,o,c)}var pt={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 gt(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 J(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 T=i.getSouthWest(),z=i.getNorthEast(),q=new J(T.lat-f,T.lng-x),nt=new J(z.lat-f,z.lng-x);return new ee(q,nt)}},Nt=r({},pt,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,T=Math.sin((o.lat-i.lat)*c/2),z=Math.sin((o.lng-i.lng)*c/2),q=T*T+Math.cos(f)*Math.cos(x)*z*z,nt=2*Math.atan2(Math.sqrt(q),Math.sqrt(1-q));return this.R*nt}}),st=6378137,lt={R:st,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 J((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=st*Math.PI;return new gt([-i,-i],[i,i])})()};function Dt(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}Dt.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 Bt(i,o,c,f){return new Dt(i,o,c,f)}var R=r({},Nt,{code:"EPSG:3857",projection:lt,transformation:(function(){var i=.5/(Math.PI*lt.R);return Bt(i,.5,-i,.5)})()}),ht=r({},R,{code:"EPSG:900913"});function ft(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function At(i,o){var c="",f,x,T,z,q,nt;for(f=0,T=i.length;f<T;f++){for(q=i[f],x=0,z=q.length;x<z;x++)nt=q[x],c+=(x?"L":"M")+nt.x+" "+nt.y;c+=o?Xt.svg?"z":"x":""}return c||"M0 0"}var vt=document.documentElement.style,qt="ActiveXObject"in window,Mt=qt&&!document.addEventListener,Gt="msLaunchUri"in navigator&&!("documentMode"in document),Se=Mn("webkit"),Ae=Mn("android"),O=Mn("android 2")||Mn("android 3"),b=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),j=Ae&&Mn("Google")&&b<537&&!("AudioNode"in window),ot=!!window.opera,_t=!Gt&&Mn("chrome"),rt=Mn("gecko")&&!Se&&!ot&&!qt,Vt=!_t&&Mn("safari"),St=Mn("phantom"),Ft="OTransition"in vt,Wt=navigator.platform.indexOf("Win")===0,xt=qt&&"transition"in vt,Rt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!O,se="MozPerspective"in vt,Zt=!window.L_DISABLE_3D&&(xt||Rt||se)&&!Ft&&!St,Ct=typeof orientation<"u"||Mn("mobile"),ce=Ct&&Se,V=Ct&&Rt,wt=!window.PointerEvent&&window.MSPointerEvent,bt=!!(window.PointerEvent||wt),Ot="ontouchstart"in window||!!window.TouchEvent,yt=!window.L_NO_TOUCH&&(Ot||bt),ut=Ct&&ot,Ht=Ct&&rt,le=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ie=(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})(),Sn=!!(document.createElementNS&&ft("svg").createSVGRect),In=!!Sn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ga=!Sn&&(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}})(),vi=navigator.platform.indexOf("Mac")===0,Zr=navigator.platform.indexOf("Linux")===0;function Mn(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Xt={ie:qt,ielt9:Mt,edge:Gt,webkit:Se,android:Ae,android23:O,androidStock:j,opera:ot,chrome:_t,gecko:rt,safari:Vt,phantom:St,opera12:Ft,win:Wt,ie3d:xt,webkit3d:Rt,gecko3d:se,any3d:Zt,mobile:Ct,mobileWebkit:ce,mobileWebkit3d:V,msPointer:wt,pointer:bt,touch:yt,touchNative:Ot,mobileOpera:ut,mobileGecko:Ht,retina:le,passiveEvents:Ie,canvas:Me,svg:Sn,vml:ga,inlineSvg:In,mac:vi,linux:Zr},ls=Xt.msPointer?"MSPointerDown":"pointerdown",Xr=Xt.msPointer?"MSPointerMove":"pointermove",cs=Xt.msPointer?"MSPointerUp":"pointerup",Yr=Xt.msPointer?"MSPointerCancel":"pointercancel",js={touchstart:ls,touchmove:Xr,touchend:cs,touchcancel:Yr},_a={touchstart:X,touchmove:K,touchend:K,touchcancel:K},Gi={},va=!1;function Wc(i,o,c){return o==="touchstart"&&et(),_a[o]?(c=_a[o].bind(this,c),i.addEventListener(js[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function Zc(i,o,c){if(!js[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(js[o],c,!1)}function Xc(i){Gi[i.pointerId]=i}function P(i){Gi[i.pointerId]&&(Gi[i.pointerId]=i)}function W(i){delete Gi[i.pointerId]}function et(){va||(document.addEventListener(ls,Xc,!0),document.addEventListener(Xr,P,!0),document.addEventListener(cs,W,!0),document.addEventListener(Yr,W,!0),va=!0)}function K(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Gi)o.touches.push(Gi[c]);o.changedTouches=[o],i(o)}}function X(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&en(o),K(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 Lt=200;function zt(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(T){if(T.detail!==1){f=T.detail;return}if(!(T.pointerType==="mouse"||T.sourceCapabilities&&!T.sourceCapabilities.firesTouchEvents)){var z=Dp(T);if(!(z.some(function(nt){return nt instanceof HTMLLabelElement&&nt.attributes.for})&&!z.some(function(nt){return nt instanceof HTMLInputElement||nt instanceof HTMLSelectElement}))){var q=Date.now();q-c<=Lt?(f++,f===2&&o(Et(T))):f=1,c=q}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function Ut(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var ne=tn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ie=tn(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Jt=ie==="webkitTransition"||ie==="OTransition"?ie+"End":"transitionend";function fe(i){return typeof i=="string"?document.getElementById(i):i}function ye(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 re(i){var o=i.parentNode;o&&o.removeChild(i)}function Te(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Qt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Re(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=ti(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function te(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 T=ti(i);$e(i,(T?T+" ":"")+o)}}function De(i,o){i.classList!==void 0?i.classList.remove(o):$e(i,E((" "+ti(i)+" ").replace(" "+o+" "," ")))}function $e(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function ti(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&&mn(i,o)}function mn(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 tn(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Ne(i,o,c){var f=o||new G(0,0);i.style[ne]=(Xt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function ve(i,o){i._leaflet_pos=o,Xt.any3d?Ne(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Gn(i){return i._leaflet_pos||new G(0,0)}var Tn,qr,Yc;if("onselectstart"in document)Tn=function(){he(window,"selectstart",en)},qr=function(){ke(window,"selectstart",en)};else{var Qr=tn(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Tn=function(){if(Qr){var i=document.documentElement.style;Yc=i[Qr],i[Qr]="none"}},qr=function(){Qr&&(document.documentElement.style[Qr]=Yc,Yc=void 0)}}function qc(){he(window,"dragstart",en)}function Qc(){ke(window,"dragstart",en)}var ya,jc;function Jc(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Ea(),ya=i,jc=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Ea))}function Ea(){ya&&(ya.style.outlineStyle=jc,ya=void 0,jc=void 0,ke(window,"keydown",Ea))}function Lp(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function Kc(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var nM={__proto__:null,TRANSFORM:ne,TRANSITION:ie,TRANSITION_END:Jt,get:fe,getStyle:ye,create:Kt,remove:re,empty:Te,toFront:Qt,toBack:Re,hasClass:ge,addClass:te,removeClass:De,setClass:$e,getClass:ti,setOpacity:_e,testProp:tn,setTransform:Ne,setPosition:ve,getPosition:Gn,get disableTextSelection(){return Tn},get enableTextSelection(){return qr},disableImageDrag:qc,enableImageDrag:Qc,preventOutline:Jc,restoreOutline:Ea,getSizedParentNode:Lp,getScale:Kc};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)th(i,x,o[x],c);else{o=S(o);for(var T=0,z=o.length;T<z;T++)th(i,o[T],c,f)}return this}var ei="_leaflet_events";function ke(i,o,c,f){if(arguments.length===1)Ip(i),delete i[ei];else if(o&&typeof o=="object")for(var x in o)eh(i,x,o[x],c);else if(o=S(o),arguments.length===2)Ip(i,function(q){return A(o,q)!==-1});else for(var T=0,z=o.length;T<z;T++)eh(i,o[T],c,f);return this}function Ip(i,o){for(var c in i[ei]){var f=c.split(/\d/)[0];(!o||o(f))&&eh(i,f,null,null,c)}}var $c={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function th(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ei]&&i[ei][x])return this;var T=function(q){return c.call(f||i,q||window.event)},z=T;!Xt.touchNative&&Xt.pointer&&o.indexOf("touch")===0?T=Wc(i,o,T):Xt.touch&&o==="dblclick"?T=zt(i,T):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener($c[o]||o,T,Xt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(T=function(q){q=q||window.event,ih(i,q)&&z(q)},i.addEventListener($c[o],T,!1)):i.addEventListener(o,z,!1):i.attachEvent("on"+o,T),i[ei]=i[ei]||{},i[ei][x]=T}function eh(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var T=i[ei]&&i[ei][x];if(!T)return this;!Xt.touchNative&&Xt.pointer&&o.indexOf("touch")===0?Zc(i,o,T):Xt.touch&&o==="dblclick"?Ut(i,T):"removeEventListener"in i?i.removeEventListener($c[o]||o,T,!1):i.detachEvent("on"+o,T),i[ei][x]=null}function hs(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function nh(i){return th(i,"wheel",hs),this}function jr(i){return he(i,"mousedown touchstart dblclick contextmenu",hs),i._leaflet_disable_click=!0,this}function en(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function us(i){return en(i),hs(i),this}function Dp(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function kp(i,o){if(!o)return new G(i.clientX,i.clientY);var c=Kc(o),f=c.boundingClientRect;return new G((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var iM=Xt.linux&&Xt.chrome?window.devicePixelRatio:Xt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Up(i){return Xt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/iM: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 ih(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 sM={__proto__:null,on:he,off:ke,stopPropagation:hs,disableScrollPropagation:nh,disableClickPropagation:jr,preventDefault:en,stop:us,getPropagationPath:Dp,getMousePosition:kp,getWheelDelta:Up,isExternalTarget:ih,addListener:he,removeListener:ke},Op=dt.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=Gn(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(),ve(this._el,c),this.fire("step")},_complete:function(){H(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),Ee=dt.extend({options:{crs:R,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(ct(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ie&&Xt.any3d&&!Xt.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(ct(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||(Xt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(Xt.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),T=i instanceof G?i:this.latLngToContainerPoint(i),z=T.subtract(x).multiplyBy(1-1/f),q=this.containerPointToLatLng(x.add(z));return this.setView(q,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Yt(i);var c=tt(o.paddingTopLeft||o.padding||[0,0]),f=tt(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 T=f.subtract(c).divideBy(2),z=this.project(i.getSouthWest(),x),q=this.project(i.getNorthEast(),x),nt=this.unproject(z.add(q).divideBy(2).add(T),x);return{center:nt,zoom:x}},fitBounds:function(i,o){if(i=Yt(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=tt(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 Op,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||!Xt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),T=this.getSize(),z=this._zoom;i=ct(i),o=o===void 0?z:o;var q=Math.max(T.x,T.y),nt=q*this.getZoomScale(z,o),mt=x.distanceTo(f)||1,kt=1.42,oe=kt*kt;function pe(Ve){var Ia=Ve?-1:1,XM=Ve?nt:q,YM=nt*nt-q*q+Ia*oe*oe*mt*mt,qM=2*XM*oe*mt,ph=YM/qM,gm=Math.sqrt(ph*ph+1)-ph,QM=gm<1e-9?-18:Math.log(gm);return QM}function hn(Ve){return(Math.exp(Ve)-Math.exp(-Ve))/2}function Qe(Ve){return(Math.exp(Ve)+Math.exp(-Ve))/2}function kn(Ve){return hn(Ve)/Qe(Ve)}var gn=pe(0);function nr(Ve){return q*(Qe(gn)/Qe(gn+kt*Ve))}function VM(Ve){return q*(Qe(gn)*kn(gn+kt*Ve)-hn(gn))/oe}function GM(Ve){return 1-Math.pow(1-Ve,1.5)}var WM=Date.now(),pm=(pe(1)-gn)/kt,ZM=c.duration?1e3*c.duration:1e3*pm*.8;function mm(){var Ve=(Date.now()-WM)/ZM,Ia=GM(Ve)*pm;Ve<=1?(this._flyToFrame=k(mm,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(VM(Ia)/mt)),z),this.getScaleZoom(q/nr(Ia),z),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),mm.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=Yt(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,Yt(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=tt(o.paddingTopLeft||o.padding||[0,0]),f=tt(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),T=this.project(i),z=this.getPixelBounds(),q=It([z.min.add(c),z.max.subtract(f)]),nt=q.getSize();if(!q.contains(T)){this._enforcingBounds=!0;var mt=T.subtract(q.getCenter()),kt=q.extend(T).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(),T=f.subtract(x);return!T.x&&!T.y?this:(i.animate&&i.pan?this.panBy(T):(i.pan&&this._rawPanBy(T),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 J(o,c),x=f.toBounds(i.coords.accuracy*2),T=this._locateOptions;if(T.setView){var z=this.getBoundsZoom(x);this.setView(f,T.maxZoom?Math.min(z,T.maxZoom):z)}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&&(H(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=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 ee(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=Yt(i),c=tt(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),T=this.getMaxZoom(),z=i.getNorthWest(),q=i.getSouthEast(),nt=this.getSize().subtract(c),mt=It(this.project(q,f),this.project(z,f)).getSize(),kt=Xt.any3d?this.options.zoomSnap:1,oe=nt.x/mt.x,pe=nt.y/mt.y,hn=o?Math.max(oe,pe):Math.min(oe,pe);return f=this.getScaleZoom(hn,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(T,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 gt(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(ct(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(tt(i),o)},layerPointToLatLng:function(i){var o=tt(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(ct(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(ct(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Yt(i))},distance:function(i,o){return this.options.crs.distance(ct(i),ct(o))},containerPointToLayerPoint:function(i){return tt(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return tt(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(tt(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ct(i)))},mouseEventToContainerPoint:function(i){return kp(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&&Xt.any3d,te(i,"leaflet-container"+(Xt.touch?" leaflet-touch":"")+(Xt.retina?" leaflet-retina":"")+(Xt.ielt9?" leaflet-oldie":"")+(Xt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=ye(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),ve(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){ve(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 H(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){ve(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?ke: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),Xt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){H(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",T=i.target||i.srcElement,z=!1;T;){if(f=this._targets[u(T)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){z=!0;break}if(f&&f.listens(o,!0)&&(x&&!ih(T,i)||(c.push(f),x))||T===this._container)break;T=T.parentNode}return!c.length&&!z&&!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"&&Jc(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 T=[],z=0;z<c.length;z++)c[z].listens(o,!0)&&T.push(c[z]);x=T.concat(x)}if(x.length){o==="contextmenu"&&en(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(z=0;z<x.length;z++)if(x[z].fire(o,nt,!0),nt.originalEvent._stopped||x[z].options.bubblingMouseEvents===!1&&A(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 Gn(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 It([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),T=new gt(f.subtract(x),f.add(x)),z=this._getBoundsOffset(T,c,o);return Math.abs(z.x)<=1&&Math.abs(z.y)<=1?i:this.unproject(f.add(z),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new gt(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=It(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),T=f.max.subtract(i.max),z=this._rebound(x.x,-T.x),q=this._rebound(x.y,-T.y);return new G(z,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=Xt.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(){De(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=ne,f=this._proxy.style[c];Ne(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();Ne(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&&De(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 rM(i,o){return new Ee(i,o)}var Wn=Q.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 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?(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()}}),Jr=function(i){return new Wn(i)};Ee.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,T){var z=o+x+" "+o+T;i[x+T]=Kt("div",z,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 Np=Wn.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 Wn.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"):De(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return De(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),jr(o),nh(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(T){T.keyCode===13&&this._expandSafely()},click:function(T){en(T),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;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 T=document.createElement("span");o.appendChild(T),T.appendChild(f),T.appendChild(x);var z=i.overlay?this._overlaysList:this._baseLayersList;return z.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var T=i.length-1;T>=0;T--)o=i[T],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(T=0;T<x.length;T++)this._map.hasLayer(x[T])&&this._map.removeLayer(x[T]);for(T=0;T<f.length;T++)this._map.hasLayer(f[T])||this._map.addLayer(f[T]);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",en),this.expand();var o=this;setTimeout(function(){ke(i,"click",en),o._preventClick=!1})}}),oM=function(i,o,c){return new Np(i,o,c)},sh=Wn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</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 T=Kt("a",c,f);return T.innerHTML=i,T.href="#",T.title=o,T.setAttribute("role","button"),T.setAttribute("aria-label",o),jr(T),he(T,"click",us),he(T,"click",x,this),he(T,"click",this._refocusOnMap,this),T},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";De(this._zoomInButton,o),De(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"))}});Ee.mergeOptions({zoomControl:!0}),Ee.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new sh,this.addControl(this.zoomControl))});var aM=function(i){return new sh(i)},Bp=Wn.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}}),lM=function(i){return new Bp(i)},cM='<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>',rh=Wn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Xt.inlineSvg?cM+" ":"")+"Leaflet</a>"},initialize:function(i){w(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=Kt("div","leaflet-control-attribution"),jr(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> ')}}});Ee.mergeOptions({attributionControl:!0}),Ee.addInitHook(function(){this.options.attributionControl&&new rh().addTo(this)});var hM=function(i){return new rh(i)};Wn.Layers=Np,Wn.Zoom=sh,Wn.Scale=Bp,Wn.Attribution=rh,Jr.layers=oM,Jr.zoom=aM,Jr.scale=lM,Jr.attribution=hM;var ni=Q.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}});ni.addTo=function(i,o){return i.addHandler(o,this),this};var uM={Events:$},Fp=Xt.touch?"touchstart mousedown":"mousedown",Wi=dt.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,Fp,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Wi._dragging===this&&this.finishDrag(!0),ke(this._dragStartTarget,Fp,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){Wi._dragging===this&&this.finishDrag();return}if(!(Wi._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Wi._dragging=this,this._preventOutline&&Jc(this._element),qc(),Tn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=Lp(this._element);this._startPoint=new G(o.clientX,o.clientY),this._startPos=Gn(this._element),this._parentScale=Kc(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,en(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),ve(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){De(document.body,"leaflet-dragging"),this._lastTarget&&(De(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),ke(document,"mousemove touchmove",this._onMove,this),ke(document,"mouseup touchend touchcancel",this._onUp,this),Qc(),qr();var o=this._moved&&this._moving;this._moving=!1,Wi._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function zp(i,o,c){var f,x=[1,4,2,8],T,z,q,nt,mt,kt,oe,pe;for(T=0,kt=i.length;T<kt;T++)i[T]._code=ds(i[T],o);for(q=0;q<4;q++){for(oe=x[q],f=[],T=0,kt=i.length,z=kt-1;T<kt;z=T++)nt=i[T],mt=i[z],nt._code&oe?mt._code&oe||(pe=xa(mt,nt,oe,o,c),pe._code=ds(pe,o),f.push(pe)):(mt._code&oe&&(pe=xa(mt,nt,oe,o,c),pe._code=ds(pe,o),f.push(pe)),f.push(nt));i=f}return i}function Hp(i,o){var c,f,x,T,z,q,nt,mt,kt;if(!i||i.length===0)throw new Error("latlngs not passed");Dn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var oe=ct([0,0]),pe=Yt(i),hn=pe.getNorthWest().distanceTo(pe.getSouthWest())*pe.getNorthEast().distanceTo(pe.getNorthWest());hn<1700&&(oe=oh(i));var Qe=i.length,kn=[];for(c=0;c<Qe;c++){var gn=ct(i[c]);kn.push(o.project(ct([gn.lat-oe.lat,gn.lng-oe.lng])))}for(q=nt=mt=0,c=0,f=Qe-1;c<Qe;f=c++)x=kn[c],T=kn[f],z=x.y*T.x-T.y*x.x,nt+=(x.x+T.x)*z,mt+=(x.y+T.y)*z,q+=z*3;q===0?kt=kn[0]:kt=[nt/q,mt/q];var nr=o.unproject(tt(kt));return ct([nr.lat+oe.lat,nr.lng+oe.lng])}function oh(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var T=ct(i[x]);o+=T.lat,c+=T.lng,f++}return ct([o/f,c/f])}var dM={__proto__:null,clipPolygon:zp,polygonCenter:Hp,centroid:oh};function Vp(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=mM(i,c),i=pM(i,c),i}function Gp(i,o,c){return Math.sqrt(Kr(i,o,c,!0))}function fM(i,o,c){return Kr(i,o,c)}function pM(i,o){var c=i.length,f=typeof Uint8Array<"u"?Uint8Array:Array,x=new f(c);x[0]=x[c-1]=1,ah(i,x,o,0,c-1);var T,z=[];for(T=0;T<c;T++)x[T]&&z.push(i[T]);return z}function ah(i,o,c,f,x){var T=0,z,q,nt;for(q=f+1;q<=x-1;q++)nt=Kr(i[q],i[f],i[x],!0),nt>T&&(z=q,T=nt);T>c&&(o[z]=1,ah(i,o,c,f,z),ah(i,o,c,z,x))}function mM(i,o){for(var c=[i[0]],f=1,x=0,T=i.length;f<T;f++)gM(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<T-1&&c.push(i[T-1]),c}var Wp;function Zp(i,o,c,f,x){var T=f?Wp:ds(i,c),z=ds(o,c),q,nt,mt;for(Wp=z;;){if(!(T|z))return[i,o];if(T&z)return!1;q=T||z,nt=xa(i,o,q,c,x),mt=ds(nt,c),q===T?(i=nt,T=mt):(o=nt,z=mt)}}function xa(i,o,c,f,x){var T=o.x-i.x,z=o.y-i.y,q=f.min,nt=f.max,mt,kt;return c&8?(mt=i.x+T*(nt.y-i.y)/z,kt=nt.y):c&4?(mt=i.x+T*(q.y-i.y)/z,kt=q.y):c&2?(mt=nt.x,kt=i.y+z*(nt.x-i.x)/T):c&1&&(mt=q.x,kt=i.y+z*(q.x-i.x)/T),new G(mt,kt,x)}function ds(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 gM(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function Kr(i,o,c,f){var x=o.x,T=o.y,z=c.x-x,q=c.y-T,nt=z*z+q*q,mt;return nt>0&&(mt=((i.x-x)*z+(i.y-T)*q)/nt,mt>1?(x=c.x,T=c.y):mt>0&&(x+=z*mt,T+=q*mt)),z=i.x-x,q=i.y-T,f?z*z+q*q:new G(x,T)}function Dn(i){return!C(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Xp(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dn(i)}function Yp(i,o){var c,f,x,T,z,q,nt,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Dn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var kt=ct([0,0]),oe=Yt(i),pe=oe.getNorthWest().distanceTo(oe.getSouthWest())*oe.getNorthEast().distanceTo(oe.getNorthWest());pe<1700&&(kt=oh(i));var hn=i.length,Qe=[];for(c=0;c<hn;c++){var kn=ct(i[c]);Qe.push(o.project(ct([kn.lat-kt.lat,kn.lng-kt.lng])))}for(c=0,f=0;c<hn-1;c++)f+=Qe[c].distanceTo(Qe[c+1])/2;if(f===0)mt=Qe[0];else for(c=0,T=0;c<hn-1;c++)if(z=Qe[c],q=Qe[c+1],x=z.distanceTo(q),T+=x,T>f){nt=(T-f)/x,mt=[q.x-nt*(q.x-z.x),q.y-nt*(q.y-z.y)];break}var gn=o.unproject(tt(mt));return ct([gn.lat+kt.lat,gn.lng+kt.lng])}var _M={__proto__:null,simplify:Vp,pointToSegmentDistance:Gp,closestPointOnSegment:fM,clipSegment:Zp,_getEdgeIntersection:xa,_getBitCode:ds,_sqClosestPointOnSegment:Kr,isFlat:Dn,_flat:Xp,polylineCenter:Yp},lh={project:function(i){return new G(i.lng,i.lat)},unproject:function(i){return new J(i.y,i.x)},bounds:new gt([-180,-90],[180,90])},ch={R:6378137,R_MINOR:6356752314245179e-9,bounds:new gt([-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,T=Math.sqrt(1-x*x),z=T*Math.sin(f),q=Math.tan(Math.PI/4-f/2)/Math.pow((1-z)/(1+z),T/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),T=Math.exp(-i.y/c),z=Math.PI/2-2*Math.atan(T),q=0,nt=.1,mt;q<15&&Math.abs(nt)>1e-7;q++)mt=x*Math.sin(z),mt=Math.pow((1-mt)/(1+mt),x/2),nt=Math.PI/2-2*Math.atan(T*mt)-z,z+=nt;return new J(z*o,i.x*o/c)}},vM={__proto__:null,LonLat:lh,Mercator:ch,SphericalMercator:lt},yM=r({},Nt,{code:"EPSG:3395",projection:ch,transformation:(function(){var i=.5/(Math.PI*ch.R);return Bt(i,.5,-i,.5)})()}),qp=r({},Nt,{code:"EPSG:4326",projection:lh,transformation:Bt(1/180,1,-1/180,.5)}),EM=r({},pt,{projection:lh,transformation:Bt(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});pt.Earth=Nt,pt.EPSG3395=yM,pt.EPSG3857=R,pt.EPSG900913=ht,pt.EPSG4326=qp,pt.Simple=EM;var Zn=dt.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})}}});Ee.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 Js=Zn.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)}}),xM=function(i,o){return new Js(i,o)},yi=Js.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),Js.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),Js.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 ee;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),wM=function(i,o){return new yi(i,o)},Ks=Q.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=tt(f),T=tt(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),T&&(i.style.marginLeft=-T.x+"px",i.style.marginTop=-T.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 Xt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function SM(i){return new Ks(i)}var $r=Ks.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 $r.imagePath!="string"&&($r.imagePath=this._detectIconPath()),(this.options.imagePath||$r.imagePath)+Ks.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var T=f.exec(c);return T&&T[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=ye(i,"background-image")||ye(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):""}}),Qp=ni.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Wi(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&&De(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,T=Gn(o._icon),z=c.getPixelBounds(),q=c.getPixelOrigin(),nt=It(z.min._subtract(q).add(x),z.max._subtract(q).subtract(x));if(!nt.contains(T)){var mt=tt((Math.max(nt.max.x,T.x)-nt.max.x)/(z.max.x-nt.max.x)-(Math.min(nt.min.x,T.x)-nt.min.x)/(z.min.x-nt.min.x),(Math.max(nt.max.y,T.y)-nt.max.y)/(z.max.y-nt.max.y)-(Math.min(nt.min.y,T.y)-nt.min.y)/(z.min.y-nt.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),ve(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&&(H(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Gn(o._icon),x=o._map.layerPointToLatLng(f);c&&ve(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){H(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),wa=Zn.extend({options:{icon:new $r,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=ct(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=ct(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),T=!1;x!==this._shadow&&(this._removeShadow(),T=!0),x&&(te(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&T&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ke(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&&ve(this._icon,i),this._shadow&&ve(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),Qp)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Qp(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?tt(o.iconSize):tt(0,0),f=o.iconAnchor?tt(o.iconAnchor):tt(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 MM(i,o){return new wa(i,o)}var Zi=Zn.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)}}),Sa=Zi.extend({options:{fill:!0,radius:10},initialize:function(i,o){w(this,o),this._latlng=ct(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=ct(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 Zi.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 gt(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 TM(i,o){return new Sa(i,o)}var hh=Sa.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),w(this,o),this._latlng=ct(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 ee(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:Zi.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===Nt.distance){var x=Math.PI/180,T=this._mRadius/Nt.R/x,z=c.project([o+T,i]),q=c.project([o-T,i]),nt=z.add(q).divideBy(2),mt=c.unproject(nt).lat,kt=Math.acos((Math.cos(T*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(kt)||kt===0)&&(kt=T/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-z.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 bM(i,o,c){return new hh(i,o,c)}var Ei=Zi.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=Kr,x,T,z=0,q=this._parts.length;z<q;z++)for(var nt=this._parts[z],mt=1,kt=nt.length;mt<kt;mt++){x=nt[mt-1],T=nt[mt];var oe=f(i,x,T,!0);oe<o&&(o=oe,c=f(i,x,T))}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 Yp(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=ct(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new ee,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Dn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Dn(i),f=0,x=i.length;f<x;f++)c?(o[f]=ct(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new gt;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 gt([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof J,x=i.length,T,z;if(f){for(z=[],T=0;T<x;T++)z[T]=this._map.latLngToLayerPoint(i[T]),c.extend(z[T]);o.push(z)}else for(T=0;T<x;T++)this._projectLatlngs(i[T],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,T,z,q,nt;for(c=0,x=0,T=this._rings.length;c<T;c++)for(nt=this._rings[c],f=0,z=nt.length;f<z-1;f++)q=Zp(nt[f],nt[f+1],i,f,!0),q&&(o[x]=o[x]||[],o[x].push(q[0]),(q[1]!==nt[f+1]||f===z-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]=Vp(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,T,z,q,nt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,T=this._parts.length;c<T;c++)for(q=this._parts[c],f=0,z=q.length,x=z-1;f<z;x=f++)if(!(!o&&f===0)&&Gp(i,q[x],q[f])<=nt)return!0;return!1}});function AM(i,o){return new Ei(i,o)}Ei._flat=Xp;var $s=Ei.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 Hp(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Ei.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof J&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Ei.prototype._setLatLngs.call(this,i),Dn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dn(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 gt(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,T;f<x;f++)T=zp(this._rings[f],i,!0),T.length&&this._parts.push(T)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,T,z,q,nt,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(T=0,nt=this._parts.length;T<nt;T++)for(c=this._parts[T],z=0,mt=c.length,q=mt-1;z<mt;q=z++)f=c[z],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||Ei.prototype._containsPoint.call(this,i,!0)}});function CM(i,o){return new $s(i,o)}var xi=yi.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 T=this.options;if(T.filter&&!T.filter(i))return this;var z=Ma(i,T);return z?(z.feature=Aa(i),z.defaultOptions=z.options,this.resetStyle(z),T.onEachFeature&&T.onEachFeature(i,z),this.addLayer(z)):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 Ma(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],T=o&&o.pointToLayer,z=o&&o.coordsToLatLng||uh,q,nt,mt,kt;if(!f&&!c)return null;switch(c.type){case"Point":return q=z(f),jp(T,i,q,o);case"MultiPoint":for(mt=0,kt=f.length;mt<kt;mt++)q=z(f[mt]),x.push(jp(T,i,q,o));return new yi(x);case"LineString":case"MultiLineString":return nt=Ta(f,c.type==="LineString"?0:1,z),new Ei(nt,o);case"Polygon":case"MultiPolygon":return nt=Ta(f,c.type==="Polygon"?1:2,z),new $s(nt,o);case"GeometryCollection":for(mt=0,kt=c.geometries.length;mt<kt;mt++){var oe=Ma({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);oe&&x.push(oe)}return new yi(x);case"FeatureCollection":for(mt=0,kt=c.features.length;mt<kt;mt++){var pe=Ma(c.features[mt],o);pe&&x.push(pe)}return new yi(x);default:throw new Error("Invalid GeoJSON object.")}}function jp(i,o,c,f){return i?i(o,c):new wa(c,f&&f.markersInheritOptions&&f)}function uh(i){return new J(i[1],i[0],i[2])}function Ta(i,o,c){for(var f=[],x=0,T=i.length,z;x<T;x++)z=o?Ta(i[x],o-1,c):(c||uh)(i[x]),f.push(z);return f}function dh(i,o){return i=ct(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function ba(i,o,c,f){for(var x=[],T=0,z=i.length;T<z;T++)x.push(o?ba(i[T],Dn(i[T])?0:o-1,c,f):dh(i[T],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function tr(i,o){return i.feature?r({},i.feature,{geometry:o}):Aa(o)}function Aa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var fh={toGeoJSON:function(i){return tr(this,{type:"Point",coordinates:dh(this.getLatLng(),i)})}};wa.include(fh),hh.include(fh),Sa.include(fh),Ei.include({toGeoJSON:function(i){var o=!Dn(this._latlngs),c=ba(this._latlngs,o?1:0,!1,i);return tr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),$s.include({toGeoJSON:function(i){var o=!Dn(this._latlngs),c=o&&!Dn(this._latlngs[0]),f=ba(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),tr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),Js.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),tr(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 T=x.toGeoJSON(i);if(c)f.push(T.geometry);else{var z=Aa(T);z.type==="FeatureCollection"?f.push.apply(f,z.features):f.push(z)}}}),c?tr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function Jp(i,o){return new xi(i,o)}var PM=Jp,Ca=Zn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Yt(o),w(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(){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&&Qt(this._image),this},bringToBack:function(){return this._map&&Re(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Yt(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;Ne(this._image,c,o)},_reset:function(){var i=this._image,o=new gt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();ve(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()}}),RM=function(i,o,c){return new Ca(i,o,c)},Kp=Ca.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}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 T=0;T<this._url.length;T++){var z=Kt("source");z.src=this._url[T],o.appendChild(z)}}});function LM(i,o,c){return new Kp(i,o,c)}var $p=Ca.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 IM(i,o,c){return new $p(i,o,c)}var ii=Zn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof J||C(i))?(this._latlng=ct(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&&(te(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&&(De(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=ct(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&&Re(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof yi){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=tt(this.options.offset),c=this._getAnchor();this._zoomAnimated?ve(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]}});Ee.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}}),Zn.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 Pa=ii.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,ii.prototype.openOn.call(this,i)},onAdd:function(i){ii.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Zi||this._source.on("preclick",hs))},onRemove:function(i){ii.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Zi||this._source.off("preclick",hs))},getEvents:function(){var i=ii.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),jr(o),nh(this._contentNode),he(o,"contextmenu",hs),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">×</span>',he(f,"click",function(x){en(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,T="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",te(i,T)):De(i,T),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();ve(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(ye(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new G(this._containerLeft,-c-this._containerBottom);x._add(Gn(this._container));var T=i.layerPointToContainerPoint(x),z=tt(this.options.autoPanPadding),q=tt(this.options.autoPanPaddingTopLeft||z),nt=tt(this.options.autoPanPaddingBottomRight||z),mt=i.getSize(),kt=0,oe=0;T.x+f+nt.x>mt.x&&(kt=T.x+f-mt.x+nt.x),T.x-kt-q.x<0&&(kt=T.x-q.x),T.y+c+nt.y>mt.y&&(oe=T.y+c-mt.y+nt.y),T.y-oe-q.y<0&&(oe=T.y-q.y),(kt||oe)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([kt,oe]))}},_getAnchor:function(){return tt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),DM=function(i,o){return new Pa(i,o)};Ee.mergeOptions({closePopupOnClick:!0}),Ee.include({openPopup:function(i,o,c){return this._initOverlay(Pa,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Zn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Pa,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 yi||(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)){us(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof Zi)){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 Ra=ii.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ii.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){ii.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=ii.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,T=f.latLngToContainerPoint(f.getCenter()),z=f.layerPointToContainerPoint(i),q=this.options.direction,nt=x.offsetWidth,mt=x.offsetHeight,kt=tt(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):z.x<T.x?(q="right",o=0,c=mt/2):(q="left",o=nt+(kt.x+oe.x)*2,c=mt/2),i=i.subtract(tt(o,c,!0)).add(kt).add(oe),De(x,"leaflet-tooltip-right"),De(x,"leaflet-tooltip-left"),De(x,"leaflet-tooltip-top"),De(x,"leaflet-tooltip-bottom"),te(x,"leaflet-tooltip-"+q),ve(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 tt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),kM=function(i,o){return new Ra(i,o)};Ee.include({openTooltip:function(i,o,c){return this._initOverlay(Ra,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Zn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ra,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 yi||(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 tm=Ks.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=tt(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function UM(i){return new tm(i)}Ks.Default=$r;var to=Zn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Xt.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&&(Qt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Re(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,T;f<x;f++)T=o[f].style.zIndex,o[f]!==this._container&&T&&(c=i(c,+T));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Xt.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 T=Math.min(1,(i-x.loaded)/200);_e(x.el,T),T<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(H(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)):(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=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)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),T=Math.floor(o/2),z=c-1,q=new G(+x,+T);q.z=+z;var nt=this._tileCoordsToKey(q),mt=this._tiles[nt];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),z>f?this._retainParent(x,T,z,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var T=2*o;T<2*o+2;T++){var z=new G(x,T);z.z=c+1;var q=this._tileCoordsToKey(z),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,T,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 T=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||T)&&(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();Xt.any3d?Ne(i.el,x,f):ve(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(),T=o.getSize().divideBy(f*2);return new gt(x.subtract(T),x.add(T))},_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),T=x.getCenter(),z=[],q=this.options.keepBuffer,nt=new gt(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 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 oe=x.min.y;oe<=x.max.y;oe++)for(var pe=x.min.x;pe<=x.max.x;pe++){var hn=new G(pe,oe);if(hn.z=this._tileZoom,!!this._isValidTile(hn)){var Qe=this._tiles[this._tileCoordsToKey(hn)];Qe?Qe.current=!0:z.push(hn)}}if(z.sort(function(gn,nr){return gn.distanceTo(T)-nr.distanceTo(T)}),z.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kn=document.createDocumentFragment();for(pe=0;pe<z.length;pe++)this._addTile(z[pe],kn);this._level.el.appendChild(kn)}}}},_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 Yt(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),T=o.unproject(f,i.z),z=o.unproject(x,i.z);return[T,z]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new ee(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){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,Xt.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)),ve(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),H(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"),Xt.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 gt(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 OM(i){return new to(i)}var er=to.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&&Xt.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:Xt.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 D(this._url,r(o,this.options))},_tileOnLoad:function(i,o){Xt.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),to.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===U))return to.prototype._tileReady.call(this,i,o,c)}});function em(i,o){return new er(i,o)}var nm=er.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&&Xt.retina?2:1,T=this.getTileSize();c.width=T.x*x,c.height=T.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,er.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=It(c.project(o[0]),c.project(o[1])),x=f.min,T=f.max,z=(this._wmsVersion>=1.3&&this._crs===qp?[x.y,x.x,T.y,T.x]:[x.x,x.y,T.x,T.y]).join(","),q=er.prototype.getTileUrl.call(this,i);return q+v(this.wmsParams,q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+z},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function NM(i,o){return new nm(i,o)}er.WMS=nm,em.wms=NM;var wi=Zn.extend({options:{padding:.1},initialize:function(i){w(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),T=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));Xt.any3d?Ne(this._container,T,c):ve(this._container,T)},_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 gt(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),im=wi.extend({options:{tolerance:0},getEvents:function(){var i=wi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){wi.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(){H(this._redrawRequest),delete this._ctx,re(this._container),ke(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)){wi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=Xt.retina?2:1;ve(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",Xt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){wi.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 gt,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,T,z=i._parts,q=z.length,nt=this._ctx;if(q){for(nt.beginPath(),c=0;c<q;c++){for(f=0,x=z[c].length;f<x;f++)T=z[c][f],nt[f?"lineTo":"moveTo"](T.x,T.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&&(De(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 sm(i){return Xt.canvas?new im(i):null}var eo=(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">')}})(),BM={_initContainer:function(){this._container=Kt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(wi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=eo("shape");te(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=eo("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=eo("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=eo("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){Re(i._container)}},La=Xt.vml?eo:ft,no=wi.extend({_initContainer:function(){this._container=La("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=La("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){re(this._container),ke(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){wi.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)),ve(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=La("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){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,At(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 ",T=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,T)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){Qt(i._path)},_bringToBack:function(i){Re(i._path)}});Xt.vml&&no.include(BM);function rm(i){return Xt.svg||Xt.vml?new no(i):null}Ee.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&&sm(i)||rm(i)}});var om=$s.extend({initialize:function(i,o){$s.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Yt(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function FM(i,o){return new om(i,o)}no.create=La,no.pointsToPath=At,xi.geometryToLayer=Ma,xi.coordsToLatLng=uh,xi.coordsToLatLngs=Ta,xi.latLngToCoords=dh,xi.latLngsToCoords=ba,xi.getFeature=tr,xi.asFeature=Aa,Ee.mergeOptions({boxZoom:!0});var am=ni.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(){ke(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(),Tn(),qc(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:us,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 gt(this._point,this._startPoint),c=o.getSize();ve(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),De(this._container,"leaflet-crosshair")),qr(),Qc(),ke(document,{contextmenu:us,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 ee(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())}});Ee.addInitHook("addHandler","boxZoom",am),Ee.mergeOptions({doubleClickZoom:!0});var lm=ni.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)}});Ee.addInitHook("addHandler","doubleClickZoom",lm),Ee.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cm=ni.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Wi(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(){De(this._map._container,"leaflet-grab"),De(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=Yt(this._map.options.maxBounds);this._offsetLimit=It(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,T=(f+o+c)%i-o-c,z=Math.abs(x+c)<Math.abs(T+c)?x:T;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=z},_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]),T=(this._lastTime-this._times[0])/1e3,z=c.easeLinearity,q=x.multiplyBy(z/T),nt=q.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,nt),kt=q.multiplyBy(mt/nt),oe=mt/(c.inertiaDeceleration*z),pe=kt.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:z,noMoveStart:!0,animate:!0})}))}}});Ee.addInitHook("addHandler","dragging",cm),Ee.mergeOptions({keyboard:!0,keyboardPanDelta:80});var hm=ni.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(),ke(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(){ke(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=tt(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(tt(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;us(i)}}});Ee.addInitHook("addHandler","keyboard",hm),Ee.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var um=ni.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){ke(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=Up(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),us(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,T=c?Math.ceil(x/c)*c:x,z=i._limitZoom(o+(this._delta>0?T:-T))-o;this._delta=0,this._startTime=null,z&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+z):i.setZoomAround(this._lastMousePos,o+z))}});Ee.addInitHook("addHandler","scrollWheelZoom",um);var zM=600;Ee.mergeOptions({tapHold:Xt.touchNative&&Xt.safari&&Xt.mobile,tapTolerance:15});var dm=ni.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){ke(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",en),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),zM),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){ke(document,"touchend",en),ke(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),ke(document,"touchend touchcancel contextmenu",this._cancel,this),ke(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)}});Ee.addInitHook("addHandler","tapHold",dm),Ee.mergeOptions({touchZoom:Xt.touch,bounceAtZoomLimits:!0});var fm=ni.extend({addHooks:function(){te(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){De(this._map._container,"leaflet-touch-zoom"),ke(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),en(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 T=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&T.x===0&&T.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(T),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),H(this._animRequest);var z=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(z,this,!0),en(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,H(this._animRequest),ke(document,"touchmove",this._onTouchMove,this),ke(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))}});Ee.addInitHook("addHandler","touchZoom",fm),Ee.BoxZoom=am,Ee.DoubleClickZoom=lm,Ee.Drag=cm,Ee.Keyboard=hm,Ee.ScrollWheelZoom=um,Ee.TapHold=dm,Ee.TouchZoom=fm,e.Bounds=gt,e.Browser=Xt,e.CRS=pt,e.Canvas=im,e.Circle=hh,e.CircleMarker=Sa,e.Class=Q,e.Control=Wn,e.DivIcon=tm,e.DivOverlay=ii,e.DomEvent=sM,e.DomUtil=nM,e.Draggable=Wi,e.Evented=dt,e.FeatureGroup=yi,e.GeoJSON=xi,e.GridLayer=to,e.Handler=ni,e.Icon=Ks,e.ImageOverlay=Ca,e.LatLng=J,e.LatLngBounds=ee,e.Layer=Zn,e.LayerGroup=Js,e.LineUtil=_M,e.Map=Ee,e.Marker=wa,e.Mixin=uM,e.Path=Zi,e.Point=G,e.PolyUtil=dM,e.Polygon=$s,e.Polyline=Ei,e.Popup=Pa,e.PosAnimation=Op,e.Projection=vM,e.Rectangle=om,e.Renderer=wi,e.SVG=no,e.SVGOverlay=$p,e.TileLayer=er,e.Tooltip=Ra,e.Transformation=Dt,e.Util=Z,e.VideoOverlay=Kp,e.bind=l,e.bounds=It,e.canvas=sm,e.circle=bM,e.circleMarker=TM,e.control=Jr,e.divIcon=UM,e.extend=r,e.featureGroup=wM,e.geoJSON=Jp,e.geoJson=PM,e.gridLayer=OM,e.icon=SM,e.imageOverlay=RM,e.latLng=ct,e.latLngBounds=Yt,e.layerGroup=xM,e.map=rM,e.marker=MM,e.point=tt,e.polygon=CM,e.polyline=AM,e.popup=DM,e.rectangle=FM,e.setOptions=w,e.stamp=u,e.svg=rm,e.svgOverlay=IM,e.tileLayer=em,e.tooltip=kM,e.transformation=Bt,e.version=s,e.videoOverlay=LM;var HM=window.L;e.noConflict=function(){return window.L=HM,this},window.L=e}))})(ir,ir.exports)),ir.exports}var Vg=Hg();const _n=Fg(Vg);function Gg(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===Tt.AppObsType.Hw){const m=fs(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 fs(n,v)}}}else if(s===Tt.AppObsType.Ali){const m=fs(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 fs(n,v)}}}else if(s===Tt.AppObsType.Hs){const m=fs(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 fs(n,v)}}}else return s===Tt.AppObsType.Aws?n:s===Tt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function Wg(n,t){if(n){const{obsType:e}=t||{};if(e===Tt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await Tt.api.getImageInfo(s);return{width:r,height:a}}else if(e===Tt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Tt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===Tt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Tt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===Tt.AppObsType.Aws?{width:5760,height:2880}:e===Tt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function fs(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class Zg{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=_n.marker(t.latLng,{icon:_n.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 Wg=ir.exports,Sh;function Zg(){return Sh||(Sh=1,(function(n,t){(function(e,s){s(t)})(Wg,(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,T,z;return z=function(){f=!1,x&&(T.apply(c,x),x=!1)},T=function(){f?x=arguments:(i.apply(c,arguments),setTimeout(z,o),f=!0)},T}function p(i,o,c){var f=o[1],x=o[0],T=f-x;return i===f&&c?i:((i-x)%T+T)%T+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 D(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 A(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 F(i){var o=+new Date,c=Math.max(0,16-(o-N));return N=o+c,window.setTimeout(i,c)}var I=window.requestAnimationFrame||B("RequestAnimationFrame")||F,M=window.cancelAnimationFrame||B("CancelAnimationFrame")||B("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function k(i,o,c){if(c&&I===F)i.call(o);else return I.call(window,l(i,o))}function H(i){i&&M.call(window,i)}var Z={__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:D,isArray:C,indexOf:A,emptyImageUrl:U,requestFn:I,cancelFn:M,requestAnimFrame:k,cancelAnimFrame:H};function j(){}j.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&&(at(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 T=0,z=f._initHooks.length;T<z;T++)f._initHooks[T].call(this)}},o},j.include=function(i){var o=this.prototype.options;return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},j.mergeOptions=function(i){return r(this.prototype.options,i),this},j.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 at(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 $={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,T=i.length;x<T;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,T=0,z=i.length;T<z;T++)x?this._off(i[T]):this._off(i[T],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,T;if(this._events&&(f=this._events[i],!!f)){if(arguments.length===1){if(this._firingCount)for(x=0,T=f.length;x<T;x++)f[x].fn=m;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var z=this._listens(i,o,c);if(z!==!1){var q=f[z];this._firingCount&&(q.fn=m,this._events[i]=f=f.slice()),f.splice(z,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 T=0,z=x.length;T<z;T++){var q=x[T],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 T=this._events&&this._events[i];if(T&&T.length&&this._listens(i,x,c)!==!1)return!0;if(f){for(var z in this._eventParents)if(this._eventParents[z].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,T=f.length;x<T;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,T=i.length;x<T;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)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var dt=j.extend($);function G(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var it=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(tt(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(tt(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=it(this.x),this.y=it(this.y),this},distanceTo:function(i){i=tt(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=tt(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=tt(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 tt(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 gt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}gt.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof G||typeof i[0]=="number"||"x"in i)o=c=tt(i);else if(i=At(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 tt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return tt(this.min.x,this.max.y)},getTopRight:function(){return tt(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=tt(i):i=At(i),i instanceof gt?(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=At(i);var o=this.min,c=this.max,f=i.min,x=i.max,T=x.x>=o.x&&f.x<=c.x,z=x.y>=o.y&&f.y<=c.y;return T&&z},overlaps:function(i){i=At(i);var o=this.min,c=this.max,f=i.min,x=i.max,T=x.x>o.x&&f.x<c.x,z=x.y>o.y&&f.y<c.y;return T&&z},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 At(tt(o.x-f,o.y-x),tt(c.x+f,c.y+x))},equals:function(i){return i?(i=At(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function At(i,o){return!i||i instanceof gt?i:new gt(i,o)}function Jt(i,o){if(i)for(var c=o?[i,o]:i,f=0,x=c.length;f<x;f++)this.extend(c[f])}Jt.prototype={extend:function(i){var o=this._southWest,c=this._northEast,f,x;if(i instanceof Q)f=i,x=i;else if(i instanceof Jt){if(f=i._southWest,x=i._northEast,!f||!x)return this}else return i?this.extend(lt(i)||Ft(i)):this;return!o&&!c?(this._southWest=new Q(f.lat,f.lng),this._northEast=new Q(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 Jt(new Q(o.lat-f,o.lng-x),new Q(c.lat+f,c.lng+x))},getCenter:function(){return new Q((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 Q(this.getNorth(),this.getWest())},getSouthEast:function(){return new Q(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 Q||"lat"in i?i=lt(i):i=Ft(i);var o=this._southWest,c=this._northEast,f,x;return i instanceof Jt?(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=Ft(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),T=x.lat>=o.lat&&f.lat<=c.lat,z=x.lng>=o.lng&&f.lng<=c.lng;return T&&z},overlaps:function(i){i=Ft(i);var o=this._southWest,c=this._northEast,f=i.getSouthWest(),x=i.getNorthEast(),T=x.lat>o.lat&&f.lat<c.lat,z=x.lng>o.lng&&f.lng<c.lng;return T&&z},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=Ft(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Ft(i,o){return i instanceof Jt?i:new Jt(i,o)}function Q(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)}Q.prototype={equals:function(i,o){if(!i)return!1;i=lt(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 Nt.distance(this,lt(i))},wrap:function(){return Nt.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return Ft([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new Q(this.lat,this.lng,this.alt)}};function lt(i,o,c){return i instanceof Q?i:C(i)&&typeof i[0]!="object"?i.length===3?new Q(i[0],i[1],i[2]):i.length===2?new Q(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new Q(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new Q(i,o,c)}var pt={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 gt(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 Q(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 T=i.getSouthWest(),z=i.getNorthEast(),q=new Q(T.lat-f,T.lng-x),nt=new Q(z.lat-f,z.lng-x);return new Jt(q,nt)}},Nt=r({},pt,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,f=i.lat*c,x=o.lat*c,T=Math.sin((o.lat-i.lat)*c/2),z=Math.sin((o.lng-i.lng)*c/2),q=T*T+Math.cos(f)*Math.cos(x)*z*z,nt=2*Math.atan2(Math.sqrt(q),Math.sqrt(1-q));return this.R*nt}}),st=6378137,ct={R:st,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 Q((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:(function(){var i=st*Math.PI;return new gt([-i,-i],[i,i])})()};function Dt(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}Dt.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 Bt(i,o,c,f){return new Dt(i,o,c,f)}var R=r({},Nt,{code:"EPSG:3857",projection:ct,transformation:(function(){var i=.5/(Math.PI*ct.R);return Bt(i,.5,-i,.5)})()}),ht=r({},R,{code:"EPSG:900913"});function ft(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ct(i,o){var c="",f,x,T,z,q,nt;for(f=0,T=i.length;f<T;f++){for(q=i[f],x=0,z=q.length;x<z;x++)nt=q[x],c+=(x?"L":"M")+nt.x+" "+nt.y;c+=o?Yt.svg?"z":"x":""}return c||"M0 0"}var vt=document.documentElement.style,qt="ActiveXObject"in window,Mt=qt&&!document.addEventListener,Wt="msLaunchUri"in navigator&&!("documentMode"in document),Se=Mn("webkit"),Ae=Mn("android"),O=Mn("android 2")||Mn("android 3"),b=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),J=Ae&&Mn("Google")&&b<537&&!("AudioNode"in window),ot=!!window.opera,_t=!Wt&&Mn("chrome"),rt=Mn("gecko")&&!Se&&!ot&&!qt,Gt=!_t&&Mn("safari"),St=Mn("phantom"),zt="OTransition"in vt,Zt=navigator.platform.indexOf("Win")===0,xt=qt&&"transition"in vt,Lt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!O,se="MozPerspective"in vt,Xt=!window.L_DISABLE_3D&&(xt||Lt||se)&&!zt&&!St,Pt=typeof orientation<"u"||Mn("mobile"),ce=Pt&&Se,V=Pt&&Lt,wt=!window.PointerEvent&&window.MSPointerEvent,bt=!!(window.PointerEvent||wt),Ot="ontouchstart"in window||!!window.TouchEvent,yt=!window.L_NO_TOUCH&&(Ot||bt),ut=Pt&&ot,Vt=Pt&&rt,le=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ie=(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})(),Sn=!!(document.createElementNS&&ft("svg").createSVGRect),In=!!Sn&&(function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ga=!Sn&&(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}})(),vi=navigator.platform.indexOf("Mac")===0,Zr=navigator.platform.indexOf("Linux")===0;function Mn(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var Yt={ie:qt,ielt9:Mt,edge:Wt,webkit:Se,android:Ae,android23:O,androidStock:J,opera:ot,chrome:_t,gecko:rt,safari:Gt,phantom:St,opera12:zt,win:Zt,ie3d:xt,webkit3d:Lt,gecko3d:se,any3d:Xt,mobile:Pt,mobileWebkit:ce,mobileWebkit3d:V,msPointer:wt,pointer:bt,touch:yt,touchNative:Ot,mobileOpera:ut,mobileGecko:Vt,retina:le,passiveEvents:Ie,canvas:Me,svg:Sn,vml:ga,inlineSvg:In,mac:vi,linux:Zr},ls=Yt.msPointer?"MSPointerDown":"pointerdown",Xr=Yt.msPointer?"MSPointerMove":"pointermove",cs=Yt.msPointer?"MSPointerUp":"pointerup",Yr=Yt.msPointer?"MSPointerCancel":"pointercancel",js={touchstart:ls,touchmove:Xr,touchend:cs,touchcancel:Yr},_a={touchstart:X,touchmove:K,touchend:K,touchcancel:K},Gi={},va=!1;function Zc(i,o,c){return o==="touchstart"&&et(),_a[o]?(c=_a[o].bind(this,c),i.addEventListener(js[o],c,!1),c):(console.warn("wrong event specified:",o),m)}function Xc(i,o,c){if(!js[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(js[o],c,!1)}function Yc(i){Gi[i.pointerId]=i}function P(i){Gi[i.pointerId]&&(Gi[i.pointerId]=i)}function W(i){delete Gi[i.pointerId]}function et(){va||(document.addEventListener(ls,Yc,!0),document.addEventListener(Xr,P,!0),document.addEventListener(cs,W,!0),document.addEventListener(Yr,W,!0),va=!0)}function K(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in Gi)o.touches.push(Gi[c]);o.changedTouches=[o],i(o)}}function X(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&en(o),K(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 Ht(i,o){i.addEventListener("dblclick",o);var c=0,f;function x(T){if(T.detail!==1){f=T.detail;return}if(!(T.pointerType==="mouse"||T.sourceCapabilities&&!T.sourceCapabilities.firesTouchEvents)){var z=Op(T);if(!(z.some(function(nt){return nt instanceof HTMLLabelElement&&nt.attributes.for})&&!z.some(function(nt){return nt instanceof HTMLInputElement||nt instanceof HTMLSelectElement}))){var q=Date.now();q-c<=It?(f++,f===2&&o(Et(T))):f=1,c=q}}}return i.addEventListener("click",x),{dblclick:o,simDblclick:x}}function Ut(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var ne=tn(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ie=tn(["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 ye(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 Qt(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function Re(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=ti(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 T=ti(i);$e(i,(T?T+" ":"")+o)}}function De(i,o){i.classList!==void 0?i.classList.remove(o):$e(i,E((" "+ti(i)+" ").replace(" "+o+" "," ")))}function $e(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function ti(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&&mn(i,o)}function mn(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 tn(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Be(i,o,c){var f=o||new G(0,0);i.style[ne]=(Yt.ie3d?"translate("+f.x+"px,"+f.y+"px)":"translate3d("+f.x+"px,"+f.y+"px,0)")+(c?" scale("+c+")":"")}function ve(i,o){i._leaflet_pos=o,Yt.any3d?Be(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Gn(i){return i._leaflet_pos||new G(0,0)}var Tn,qr,qc;if("onselectstart"in document)Tn=function(){he(window,"selectstart",en)},qr=function(){Ue(window,"selectstart",en)};else{var Qr=tn(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Tn=function(){if(Qr){var i=document.documentElement.style;qc=i[Qr],i[Qr]="none"}},qr=function(){Qr&&(document.documentElement.style[Qr]=qc,qc=void 0)}}function Qc(){he(window,"dragstart",en)}function jc(){Ue(window,"dragstart",en)}var ya,Jc;function Kc(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(Ea(),ya=i,Jc=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",Ea))}function Ea(){ya&&(ya.style.outlineStyle=Jc,ya=void 0,Jc=void 0,Ue(window,"keydown",Ea))}function kp(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function $c(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var oM={__proto__:null,TRANSFORM:ne,TRANSITION:ie,TRANSITION_END:Kt,get:fe,getStyle:ye,create:$t,remove:re,empty:Te,toFront:Qt,toBack:Re,hasClass:ge,addClass:ee,removeClass:De,setClass:$e,getClass:ti,setOpacity:_e,testProp:tn,setTransform:Be,setPosition:ve,getPosition:Gn,get disableTextSelection(){return Tn},get enableTextSelection(){return qr},disableImageDrag:Qc,enableImageDrag:jc,preventOutline:Kc,restoreOutline:Ea,getSizedParentNode:kp,getScale:$c};function he(i,o,c,f){if(o&&typeof o=="object")for(var x in o)eh(i,x,o[x],c);else{o=S(o);for(var T=0,z=o.length;T<z;T++)eh(i,o[T],c,f)}return this}var ei="_leaflet_events";function Ue(i,o,c,f){if(arguments.length===1)Up(i),delete i[ei];else if(o&&typeof o=="object")for(var x in o)nh(i,x,o[x],c);else if(o=S(o),arguments.length===2)Up(i,function(q){return A(o,q)!==-1});else for(var T=0,z=o.length;T<z;T++)nh(i,o[T],c,f);return this}function Up(i,o){for(var c in i[ei]){var f=c.split(/\d/)[0];(!o||o(f))&&nh(i,f,null,null,c)}}var th={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function eh(i,o,c,f){var x=o+u(c)+(f?"_"+u(f):"");if(i[ei]&&i[ei][x])return this;var T=function(q){return c.call(f||i,q||window.event)},z=T;!Yt.touchNative&&Yt.pointer&&o.indexOf("touch")===0?T=Zc(i,o,T):Yt.touch&&o==="dblclick"?T=Ht(i,T):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(th[o]||o,T,Yt.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(T=function(q){q=q||window.event,sh(i,q)&&z(q)},i.addEventListener(th[o],T,!1)):i.addEventListener(o,z,!1):i.attachEvent("on"+o,T),i[ei]=i[ei]||{},i[ei][x]=T}function nh(i,o,c,f,x){x=x||o+u(c)+(f?"_"+u(f):"");var T=i[ei]&&i[ei][x];if(!T)return this;!Yt.touchNative&&Yt.pointer&&o.indexOf("touch")===0?Xc(i,o,T):Yt.touch&&o==="dblclick"?Ut(i,T):"removeEventListener"in i?i.removeEventListener(th[o]||o,T,!1):i.detachEvent("on"+o,T),i[ei][x]=null}function hs(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function ih(i){return eh(i,"wheel",hs),this}function jr(i){return he(i,"mousedown touchstart dblclick contextmenu",hs),i._leaflet_disable_click=!0,this}function en(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function us(i){return en(i),hs(i),this}function Op(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function Np(i,o){if(!o)return new G(i.clientX,i.clientY);var c=$c(o),f=c.boundingClientRect;return new G((i.clientX-f.left)/c.x-o.clientLeft,(i.clientY-f.top)/c.y-o.clientTop)}var aM=Yt.linux&&Yt.chrome?window.devicePixelRatio:Yt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Bp(i){return Yt.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/aM: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 sh(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 lM={__proto__:null,on:he,off:Ue,stopPropagation:hs,disableScrollPropagation:ih,disableClickPropagation:jr,preventDefault:en,stop:us,getPropagationPath:Op,getMousePosition:Np,getWheelDelta:Bp,isExternalTarget:sh,addListener:he,removeListener:Ue},Fp=dt.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=Gn(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(),ve(this._el,c),this.fire("step")},_complete:function(){H(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),Ee=dt.extend({options:{crs:R,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(lt(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ie&&Yt.any3d&&!Yt.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(lt(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||(Yt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(Yt.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),T=i instanceof G?i:this.latLngToContainerPoint(i),z=T.subtract(x).multiplyBy(1-1/f),q=this.containerPointToLatLng(x.add(z));return this.setView(q,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():Ft(i);var c=tt(o.paddingTopLeft||o.padding||[0,0]),f=tt(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 T=f.subtract(c).divideBy(2),z=this.project(i.getSouthWest(),x),q=this.project(i.getNorthEast(),x),nt=this.unproject(z.add(q).divideBy(2).add(T),x);return{center:nt,zoom:x}},fitBounds:function(i,o){if(i=Ft(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=tt(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 Fp,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||!Yt.any3d)return this.setView(i,o,c);this._stop();var f=this.project(this.getCenter()),x=this.project(i),T=this.getSize(),z=this._zoom;i=lt(i),o=o===void 0?z:o;var q=Math.max(T.x,T.y),nt=q*this.getZoomScale(z,o),mt=x.distanceTo(f)||1,kt=1.42,oe=kt*kt;function pe(Ve){var Ia=Ve?-1:1,jM=Ve?nt:q,JM=nt*nt-q*q+Ia*oe*oe*mt*mt,KM=2*jM*oe*mt,mh=JM/KM,ym=Math.sqrt(mh*mh+1)-mh,$M=ym<1e-9?-18:Math.log(ym);return $M}function hn(Ve){return(Math.exp(Ve)-Math.exp(-Ve))/2}function Qe(Ve){return(Math.exp(Ve)+Math.exp(-Ve))/2}function kn(Ve){return hn(Ve)/Qe(Ve)}var gn=pe(0);function nr(Ve){return q*(Qe(gn)/Qe(gn+kt*Ve))}function XM(Ve){return q*(Qe(gn)*kn(gn+kt*Ve)-hn(gn))/oe}function YM(Ve){return 1-Math.pow(1-Ve,1.5)}var qM=Date.now(),_m=(pe(1)-gn)/kt,QM=c.duration?1e3*c.duration:1e3*_m*.8;function vm(){var Ve=(Date.now()-qM)/QM,Ia=YM(Ve)*_m;Ve<=1?(this._flyToFrame=k(vm,this),this._move(this.unproject(f.add(x.subtract(f).multiplyBy(XM(Ia)/mt)),z),this.getScaleZoom(q/nr(Ia),z),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),vm.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=Ft(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,Ft(i));return c.equals(f)||this.panTo(f,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=tt(o.paddingTopLeft||o.padding||[0,0]),f=tt(o.paddingBottomRight||o.padding||[0,0]),x=this.project(this.getCenter()),T=this.project(i),z=this.getPixelBounds(),q=At([z.min.add(c),z.max.subtract(f)]),nt=q.getSize();if(!q.contains(T)){this._enforcingBounds=!0;var mt=T.subtract(q.getCenter()),kt=q.extend(T).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(),T=f.subtract(x);return!T.x&&!T.y?this:(i.animate&&i.pan?this.panBy(T):(i.pan&&this._rawPanBy(T),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 Q(o,c),x=f.toBounds(i.coords.accuracy*2),T=this._locateOptions;if(T.setView){var z=this.getBoundsZoom(x);this.setView(f,T.maxZoom?Math.min(z,T.maxZoom):z)}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&&(H(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 Jt(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=Ft(i),c=tt(c||[0,0]);var f=this.getZoom()||0,x=this.getMinZoom(),T=this.getMaxZoom(),z=i.getNorthWest(),q=i.getSouthEast(),nt=this.getSize().subtract(c),mt=At(this.project(q,f),this.project(z,f)).getSize(),kt=Yt.any3d?this.options.zoomSnap:1,oe=nt.x/mt.x,pe=nt.y/mt.y,hn=o?Math.max(oe,pe):Math.min(oe,pe);return f=this.getScaleZoom(hn,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(T,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 gt(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(lt(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(tt(i),o)},layerPointToLatLng:function(i){var o=tt(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(lt(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(lt(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(Ft(i))},distance:function(i,o){return this.options.crs.distance(lt(i),lt(o))},containerPointToLayerPoint:function(i){return tt(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return tt(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(tt(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(lt(i)))},mouseEventToContainerPoint:function(i){return Np(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&&Yt.any3d,ee(i,"leaflet-container"+(Yt.touch?" leaflet-touch":"")+(Yt.retina?" leaflet-retina":"")+(Yt.ielt9?" leaflet-oldie":"")+(Yt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=ye(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),ve(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){ve(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 H(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){ve(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),Yt.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){H(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",T=i.target||i.srcElement,z=!1;T;){if(f=this._targets[u(T)],f&&(o==="click"||o==="preclick")&&this._draggableMoved(f)){z=!0;break}if(f&&f.listens(o,!0)&&(x&&!sh(T,i)||(c.push(f),x))||T===this._container)break;T=T.parentNode}return!c.length&&!z&&!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"&&Kc(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 T=[],z=0;z<c.length;z++)c[z].listens(o,!0)&&T.push(c[z]);x=T.concat(x)}if(x.length){o==="contextmenu"&&en(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(z=0;z<x.length;z++)if(x[z].fire(o,nt,!0),nt.originalEvent._stopped||x[z].options.bubblingMouseEvents===!1&&A(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 Gn(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 At([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),T=new gt(f.subtract(x),f.add(x)),z=this._getBoundsOffset(T,c,o);return Math.abs(z.x)<=1&&Math.abs(z.y)<=1?i:this.unproject(f.add(z),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),f=new gt(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(f,o))},_getBoundsOffset:function(i,o,c){var f=At(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),x=f.min.subtract(i.min),T=f.max.subtract(i.max),z=this._rebound(x.x,-T.x),q=this._rebound(x.y,-T.y);return new G(z,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=Yt.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(){De(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];Be(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();Be(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&&De(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 cM(i,o){return new Ee(i,o)}var Wn=j.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()}}),Jr=function(i){return new Wn(i)};Ee.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,T){var z=o+x+" "+o+T;i[x+T]=$t("div",z,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 zp=Wn.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 Wn.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"):De(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return De(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),jr(o),ih(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(T){T.keyCode===13&&this._expandSafely()},click:function(T){en(T),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 T=document.createElement("span");o.appendChild(T),T.appendChild(f),T.appendChild(x);var z=i.overlay?this._overlaysList:this._baseLayersList;return z.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,f=[],x=[];this._handlingClick=!0;for(var T=i.length-1;T>=0;T--)o=i[T],c=this._getLayer(o.layerId).layer,o.checked?f.push(c):o.checked||x.push(c);for(T=0;T<x.length;T++)this._map.hasLayer(x[T])&&this._map.removeLayer(x[T]);for(T=0;T<f.length;T++)this._map.hasLayer(f[T])||this._map.addLayer(f[T]);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",en),this.expand();var o=this;setTimeout(function(){Ue(i,"click",en),o._preventClick=!1})}}),hM=function(i,o,c){return new zp(i,o,c)},rh=Wn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</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 T=$t("a",c,f);return T.innerHTML=i,T.href="#",T.title=o,T.setAttribute("role","button"),T.setAttribute("aria-label",o),jr(T),he(T,"click",us),he(T,"click",x,this),he(T,"click",this._refocusOnMap,this),T},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";De(this._zoomInButton,o),De(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"))}});Ee.mergeOptions({zoomControl:!0}),Ee.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new rh,this.addControl(this.zoomControl))});var uM=function(i){return new rh(i)},Hp=Wn.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}}),dM=function(i){return new Hp(i)},fM='<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>',oh=Wn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Yt.inlineSvg?fM+" ":"")+"Leaflet</a>"},initialize:function(i){w(this,i),this._attributions={}},onAdd:function(i){i.attributionControl=this,this._container=$t("div","leaflet-control-attribution"),jr(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> ')}}});Ee.mergeOptions({attributionControl:!0}),Ee.addInitHook(function(){this.options.attributionControl&&new oh().addTo(this)});var pM=function(i){return new oh(i)};Wn.Layers=zp,Wn.Zoom=rh,Wn.Scale=Hp,Wn.Attribution=oh,Jr.layers=hM,Jr.zoom=uM,Jr.scale=dM,Jr.attribution=pM;var ni=j.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}});ni.addTo=function(i,o){return i.addHandler(o,this),this};var mM={Events:$},Vp=Yt.touch?"touchstart mousedown":"mousedown",Wi=dt.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,Vp,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Wi._dragging===this&&this.finishDrag(!0),Ue(this._dragStartTarget,Vp,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){Wi._dragging===this&&this.finishDrag();return}if(!(Wi._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(Wi._dragging=this,this._preventOutline&&Kc(this._element),Qc(),Tn(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=kp(this._element);this._startPoint=new G(o.clientX,o.clientY),this._startPos=Gn(this._element),this._parentScale=$c(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,en(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),ve(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){De(document.body,"leaflet-dragging"),this._lastTarget&&(De(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Ue(document,"mousemove touchmove",this._onMove,this),Ue(document,"mouseup touchend touchcancel",this._onUp,this),jc(),qr();var o=this._moved&&this._moving;this._moving=!1,Wi._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function Gp(i,o,c){var f,x=[1,4,2,8],T,z,q,nt,mt,kt,oe,pe;for(T=0,kt=i.length;T<kt;T++)i[T]._code=ds(i[T],o);for(q=0;q<4;q++){for(oe=x[q],f=[],T=0,kt=i.length,z=kt-1;T<kt;z=T++)nt=i[T],mt=i[z],nt._code&oe?mt._code&oe||(pe=xa(mt,nt,oe,o,c),pe._code=ds(pe,o),f.push(pe)):(mt._code&oe&&(pe=xa(mt,nt,oe,o,c),pe._code=ds(pe,o),f.push(pe)),f.push(nt));i=f}return i}function Wp(i,o){var c,f,x,T,z,q,nt,mt,kt;if(!i||i.length===0)throw new Error("latlngs not passed");Dn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var oe=lt([0,0]),pe=Ft(i),hn=pe.getNorthWest().distanceTo(pe.getSouthWest())*pe.getNorthEast().distanceTo(pe.getNorthWest());hn<1700&&(oe=ah(i));var Qe=i.length,kn=[];for(c=0;c<Qe;c++){var gn=lt(i[c]);kn.push(o.project(lt([gn.lat-oe.lat,gn.lng-oe.lng])))}for(q=nt=mt=0,c=0,f=Qe-1;c<Qe;f=c++)x=kn[c],T=kn[f],z=x.y*T.x-T.y*x.x,nt+=(x.x+T.x)*z,mt+=(x.y+T.y)*z,q+=z*3;q===0?kt=kn[0]:kt=[nt/q,mt/q];var nr=o.unproject(tt(kt));return lt([nr.lat+oe.lat,nr.lng+oe.lng])}function ah(i){for(var o=0,c=0,f=0,x=0;x<i.length;x++){var T=lt(i[x]);o+=T.lat,c+=T.lng,f++}return lt([o/f,c/f])}var gM={__proto__:null,clipPolygon:Gp,polygonCenter:Wp,centroid:ah};function Zp(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=yM(i,c),i=vM(i,c),i}function Xp(i,o,c){return Math.sqrt(Kr(i,o,c,!0))}function _M(i,o,c){return Kr(i,o,c)}function vM(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 T,z=[];for(T=0;T<c;T++)x[T]&&z.push(i[T]);return z}function lh(i,o,c,f,x){var T=0,z,q,nt;for(q=f+1;q<=x-1;q++)nt=Kr(i[q],i[f],i[x],!0),nt>T&&(z=q,T=nt);T>c&&(o[z]=1,lh(i,o,c,f,z),lh(i,o,c,z,x))}function yM(i,o){for(var c=[i[0]],f=1,x=0,T=i.length;f<T;f++)EM(i[f],i[x])>o&&(c.push(i[f]),x=f);return x<T-1&&c.push(i[T-1]),c}var Yp;function qp(i,o,c,f,x){var T=f?Yp:ds(i,c),z=ds(o,c),q,nt,mt;for(Yp=z;;){if(!(T|z))return[i,o];if(T&z)return!1;q=T||z,nt=xa(i,o,q,c,x),mt=ds(nt,c),q===T?(i=nt,T=mt):(o=nt,z=mt)}}function xa(i,o,c,f,x){var T=o.x-i.x,z=o.y-i.y,q=f.min,nt=f.max,mt,kt;return c&8?(mt=i.x+T*(nt.y-i.y)/z,kt=nt.y):c&4?(mt=i.x+T*(q.y-i.y)/z,kt=q.y):c&2?(mt=nt.x,kt=i.y+z*(nt.x-i.x)/T):c&1&&(mt=q.x,kt=i.y+z*(q.x-i.x)/T),new G(mt,kt,x)}function ds(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 EM(i,o){var c=o.x-i.x,f=o.y-i.y;return c*c+f*f}function Kr(i,o,c,f){var x=o.x,T=o.y,z=c.x-x,q=c.y-T,nt=z*z+q*q,mt;return nt>0&&(mt=((i.x-x)*z+(i.y-T)*q)/nt,mt>1?(x=c.x,T=c.y):mt>0&&(x+=z*mt,T+=q*mt)),z=i.x-x,q=i.y-T,f?z*z+q*q:new G(x,T)}function Dn(i){return!C(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Qp(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Dn(i)}function jp(i,o){var c,f,x,T,z,q,nt,mt;if(!i||i.length===0)throw new Error("latlngs not passed");Dn(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var kt=lt([0,0]),oe=Ft(i),pe=oe.getNorthWest().distanceTo(oe.getSouthWest())*oe.getNorthEast().distanceTo(oe.getNorthWest());pe<1700&&(kt=ah(i));var hn=i.length,Qe=[];for(c=0;c<hn;c++){var kn=lt(i[c]);Qe.push(o.project(lt([kn.lat-kt.lat,kn.lng-kt.lng])))}for(c=0,f=0;c<hn-1;c++)f+=Qe[c].distanceTo(Qe[c+1])/2;if(f===0)mt=Qe[0];else for(c=0,T=0;c<hn-1;c++)if(z=Qe[c],q=Qe[c+1],x=z.distanceTo(q),T+=x,T>f){nt=(T-f)/x,mt=[q.x-nt*(q.x-z.x),q.y-nt*(q.y-z.y)];break}var gn=o.unproject(tt(mt));return lt([gn.lat+kt.lat,gn.lng+kt.lng])}var xM={__proto__:null,simplify:Zp,pointToSegmentDistance:Xp,closestPointOnSegment:_M,clipSegment:qp,_getEdgeIntersection:xa,_getBitCode:ds,_sqClosestPointOnSegment:Kr,isFlat:Dn,_flat:Qp,polylineCenter:jp},ch={project:function(i){return new G(i.lng,i.lat)},unproject:function(i){return new Q(i.y,i.x)},bounds:new gt([-180,-90],[180,90])},hh={R:6378137,R_MINOR:6356752314245179e-9,bounds:new gt([-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,T=Math.sqrt(1-x*x),z=T*Math.sin(f),q=Math.tan(Math.PI/4-f/2)/Math.pow((1-z)/(1+z),T/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),T=Math.exp(-i.y/c),z=Math.PI/2-2*Math.atan(T),q=0,nt=.1,mt;q<15&&Math.abs(nt)>1e-7;q++)mt=x*Math.sin(z),mt=Math.pow((1-mt)/(1+mt),x/2),nt=Math.PI/2-2*Math.atan(T*mt)-z,z+=nt;return new Q(z*o,i.x*o/c)}},wM={__proto__:null,LonLat:ch,Mercator:hh,SphericalMercator:ct},SM=r({},Nt,{code:"EPSG:3395",projection:hh,transformation:(function(){var i=.5/(Math.PI*hh.R);return Bt(i,.5,-i,.5)})()}),Jp=r({},Nt,{code:"EPSG:4326",projection:ch,transformation:Bt(1/180,1,-1/180,.5)}),MM=r({},pt,{projection:ch,transformation:Bt(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});pt.Earth=Nt,pt.EPSG3395=SM,pt.EPSG3857=R,pt.EPSG900913=ht,pt.EPSG4326=Jp,pt.Simple=MM;var Zn=dt.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})}}});Ee.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 Js=Zn.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)}}),TM=function(i,o){return new Js(i,o)},yi=Js.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),Js.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),Js.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 Jt;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),bM=function(i,o){return new yi(i,o)},Ks=j.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=tt(f),T=tt(o==="shadow"&&c.shadowAnchor||c.iconAnchor||x&&x.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),T&&(i.style.marginLeft=-T.x+"px",i.style.marginTop=-T.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 Yt.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function AM(i){return new Ks(i)}var $r=Ks.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 $r.imagePath!="string"&&($r.imagePath=this._detectIconPath()),(this.options.imagePath||$r.imagePath)+Ks.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,f,x){var T=f.exec(c);return T&&T[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=ye(i,"background-image")||ye(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):""}}),Kp=ni.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new Wi(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&&De(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,T=Gn(o._icon),z=c.getPixelBounds(),q=c.getPixelOrigin(),nt=At(z.min._subtract(q).add(x),z.max._subtract(q).subtract(x));if(!nt.contains(T)){var mt=tt((Math.max(nt.max.x,T.x)-nt.max.x)/(z.max.x-nt.max.x)-(Math.min(nt.min.x,T.x)-nt.min.x)/(z.min.x-nt.min.x),(Math.max(nt.max.y,T.y)-nt.max.y)/(z.max.y-nt.max.y)-(Math.min(nt.min.y,T.y)-nt.min.y)/(z.min.y-nt.min.y)).multiplyBy(f);c.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),ve(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&&(H(this._panRequest),this._panRequest=k(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,f=Gn(o._icon),x=o._map.layerPointToLatLng(f);c&&ve(c,f),o._latlng=x,i.latlng=x,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){H(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),wa=Zn.extend({options:{icon:new $r,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=lt(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=lt(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),T=!1;x!==this._shadow&&(this._removeShadow(),T=!0),x&&(ee(x,o),x.alt=""),this._shadow=x,i.opacity<1&&this._updateOpacity(),f&&this.getPane().appendChild(this._icon),this._initInteraction(),x&&T&&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&&ve(this._icon,i),this._shadow&&ve(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),Kp)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Kp(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?tt(o.iconSize):tt(0,0),f=o.iconAnchor?tt(o.iconAnchor):tt(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 CM(i,o){return new wa(i,o)}var Zi=Zn.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)}}),Sa=Zi.extend({options:{fill:!0,radius:10},initialize:function(i,o){w(this,o),this._latlng=lt(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=lt(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 Zi.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 gt(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 PM(i,o){return new Sa(i,o)}var uh=Sa.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),w(this,o),this._latlng=lt(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 Jt(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:Zi.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,f=c.options.crs;if(f.distance===Nt.distance){var x=Math.PI/180,T=this._mRadius/Nt.R/x,z=c.project([o+T,i]),q=c.project([o-T,i]),nt=z.add(q).divideBy(2),mt=c.unproject(nt).lat,kt=Math.acos((Math.cos(T*x)-Math.sin(o*x)*Math.sin(mt*x))/(Math.cos(o*x)*Math.cos(mt*x)))/x;(isNaN(kt)||kt===0)&&(kt=T/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-z.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 RM(i,o,c){return new uh(i,o,c)}var Ei=Zi.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=Kr,x,T,z=0,q=this._parts.length;z<q;z++)for(var nt=this._parts[z],mt=1,kt=nt.length;mt<kt;mt++){x=nt[mt-1],T=nt[mt];var oe=f(i,x,T,!0);oe<o&&(o=oe,c=f(i,x,T))}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 jp(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=lt(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new Jt,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Dn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Dn(i),f=0,x=i.length;f<x;f++)c?(o[f]=lt(i[f]),this._bounds.extend(o[f])):o[f]=this._convertLatLngs(i[f]);return o},_project:function(){var i=new gt;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 gt([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var f=i[0]instanceof Q,x=i.length,T,z;if(f){for(z=[],T=0;T<x;T++)z[T]=this._map.latLngToLayerPoint(i[T]),c.extend(z[T]);o.push(z)}else for(T=0;T<x;T++)this._projectLatlngs(i[T],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,T,z,q,nt;for(c=0,x=0,T=this._rings.length;c<T;c++)for(nt=this._rings[c],f=0,z=nt.length;f<z-1;f++)q=qp(nt[f],nt[f+1],i,f,!0),q&&(o[x]=o[x]||[],o[x].push(q[0]),(q[1]!==nt[f+1]||f===z-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]=Zp(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,T,z,q,nt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,T=this._parts.length;c<T;c++)for(q=this._parts[c],f=0,z=q.length,x=z-1;f<z;x=f++)if(!(!o&&f===0)&&Xp(i,q[x],q[f])<=nt)return!0;return!1}});function LM(i,o){return new Ei(i,o)}Ei._flat=Qp;var $s=Ei.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 Wp(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Ei.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof Q&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Ei.prototype._setLatLngs.call(this,i),Dn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Dn(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 gt(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,T;f<x;f++)T=Gp(this._rings[f],i,!0),T.length&&this._parts.push(T)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,f,x,T,z,q,nt,mt;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(T=0,nt=this._parts.length;T<nt;T++)for(c=this._parts[T],z=0,mt=c.length,q=mt-1;z<mt;q=z++)f=c[z],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||Ei.prototype._containsPoint.call(this,i,!0)}});function IM(i,o){return new $s(i,o)}var xi=yi.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 T=this.options;if(T.filter&&!T.filter(i))return this;var z=Ma(i,T);return z?(z.feature=Aa(i),z.defaultOptions=z.options,this.resetStyle(z),T.onEachFeature&&T.onEachFeature(i,z),this.addLayer(z)):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 Ma(i,o){var c=i.type==="Feature"?i.geometry:i,f=c?c.coordinates:null,x=[],T=o&&o.pointToLayer,z=o&&o.coordsToLatLng||dh,q,nt,mt,kt;if(!f&&!c)return null;switch(c.type){case"Point":return q=z(f),$p(T,i,q,o);case"MultiPoint":for(mt=0,kt=f.length;mt<kt;mt++)q=z(f[mt]),x.push($p(T,i,q,o));return new yi(x);case"LineString":case"MultiLineString":return nt=Ta(f,c.type==="LineString"?0:1,z),new Ei(nt,o);case"Polygon":case"MultiPolygon":return nt=Ta(f,c.type==="Polygon"?1:2,z),new $s(nt,o);case"GeometryCollection":for(mt=0,kt=c.geometries.length;mt<kt;mt++){var oe=Ma({geometry:c.geometries[mt],type:"Feature",properties:i.properties},o);oe&&x.push(oe)}return new yi(x);case"FeatureCollection":for(mt=0,kt=c.features.length;mt<kt;mt++){var pe=Ma(c.features[mt],o);pe&&x.push(pe)}return new yi(x);default:throw new Error("Invalid GeoJSON object.")}}function $p(i,o,c,f){return i?i(o,c):new wa(c,f&&f.markersInheritOptions&&f)}function dh(i){return new Q(i[1],i[0],i[2])}function Ta(i,o,c){for(var f=[],x=0,T=i.length,z;x<T;x++)z=o?Ta(i[x],o-1,c):(c||dh)(i[x]),f.push(z);return f}function fh(i,o){return i=lt(i),i.alt!==void 0?[_(i.lng,o),_(i.lat,o),_(i.alt,o)]:[_(i.lng,o),_(i.lat,o)]}function ba(i,o,c,f){for(var x=[],T=0,z=i.length;T<z;T++)x.push(o?ba(i[T],Dn(i[T])?0:o-1,c,f):fh(i[T],f));return!o&&c&&x.length>0&&x.push(x[0].slice()),x}function tr(i,o){return i.feature?r({},i.feature,{geometry:o}):Aa(o)}function Aa(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var ph={toGeoJSON:function(i){return tr(this,{type:"Point",coordinates:fh(this.getLatLng(),i)})}};wa.include(ph),uh.include(ph),Sa.include(ph),Ei.include({toGeoJSON:function(i){var o=!Dn(this._latlngs),c=ba(this._latlngs,o?1:0,!1,i);return tr(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),$s.include({toGeoJSON:function(i){var o=!Dn(this._latlngs),c=o&&!Dn(this._latlngs[0]),f=ba(this._latlngs,c?2:o?1:0,!0,i);return o||(f=[f]),tr(this,{type:(c?"Multi":"")+"Polygon",coordinates:f})}}),Js.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),tr(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 T=x.toGeoJSON(i);if(c)f.push(T.geometry);else{var z=Aa(T);z.type==="FeatureCollection"?f.push.apply(f,z.features):f.push(z)}}}),c?tr(this,{geometries:f,type:"GeometryCollection"}):{type:"FeatureCollection",features:f}}});function tm(i,o){return new xi(i,o)}var DM=tm,Ca=Zn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=Ft(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&&Qt(this._image),this},bringToBack:function(){return this._map&&Re(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=Ft(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;Be(this._image,c,o)},_reset:function(){var i=this._image,o=new gt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();ve(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()}}),kM=function(i,o,c){return new Ca(i,o,c)},em=Ca.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 T=0;T<this._url.length;T++){var z=$t("source");z.src=this._url[T],o.appendChild(z)}}});function UM(i,o,c){return new em(i,o,c)}var nm=Ca.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 OM(i,o,c){return new nm(i,o,c)}var ii=Zn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof Q||C(i))?(this._latlng=lt(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&&(De(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=lt(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&&Re(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof yi){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=tt(this.options.offset),c=this._getAnchor();this._zoomAnimated?ve(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]}});Ee.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}}),Zn.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 Pa=ii.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,ii.prototype.openOn.call(this,i)},onAdd:function(i){ii.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Zi||this._source.on("preclick",hs))},onRemove:function(i){ii.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Zi||this._source.off("preclick",hs))},getEvents:function(){var i=ii.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),jr(o),ih(this._contentNode),he(o,"contextmenu",hs),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">×</span>',he(f,"click",function(x){en(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,T="leaflet-popup-scrolled";x&&f>x?(o.height=x+"px",ee(i,T)):De(i,T),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();ve(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(ye(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,f=this._containerWidth,x=new G(this._containerLeft,-c-this._containerBottom);x._add(Gn(this._container));var T=i.layerPointToContainerPoint(x),z=tt(this.options.autoPanPadding),q=tt(this.options.autoPanPaddingTopLeft||z),nt=tt(this.options.autoPanPaddingBottomRight||z),mt=i.getSize(),kt=0,oe=0;T.x+f+nt.x>mt.x&&(kt=T.x+f-mt.x+nt.x),T.x-kt-q.x<0&&(kt=T.x-q.x),T.y+c+nt.y>mt.y&&(oe=T.y+c-mt.y+nt.y),T.y-oe-q.y<0&&(oe=T.y-q.y),(kt||oe)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([kt,oe]))}},_getAnchor:function(){return tt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),NM=function(i,o){return new Pa(i,o)};Ee.mergeOptions({closePopupOnClick:!0}),Ee.include({openPopup:function(i,o,c){return this._initOverlay(Pa,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),Zn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Pa,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 yi||(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)){us(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof Zi)){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 Ra=ii.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){ii.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){ii.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=ii.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,T=f.latLngToContainerPoint(f.getCenter()),z=f.layerPointToContainerPoint(i),q=this.options.direction,nt=x.offsetWidth,mt=x.offsetHeight,kt=tt(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):z.x<T.x?(q="right",o=0,c=mt/2):(q="left",o=nt+(kt.x+oe.x)*2,c=mt/2),i=i.subtract(tt(o,c,!0)).add(kt).add(oe),De(x,"leaflet-tooltip-right"),De(x,"leaflet-tooltip-left"),De(x,"leaflet-tooltip-top"),De(x,"leaflet-tooltip-bottom"),ee(x,"leaflet-tooltip-"+q),ve(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 tt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),BM=function(i,o){return new Ra(i,o)};Ee.include({openTooltip:function(i,o,c){return this._initOverlay(Ra,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),Zn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ra,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 yi||(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 im=Ks.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=tt(c.bgPos);o.style.backgroundPosition=-f.x+"px "+-f.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function FM(i){return new im(i)}Ks.Default=$r;var to=Zn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Yt.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&&(Qt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Re(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,T;f<x;f++)T=o[f].style.zIndex,o[f]!==this._container&&T&&(c=i(c,+T));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Yt.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 T=Math.min(1,(i-x.loaded)/200);_e(x.el,T),T<1?o=!0:(x.active?c=!0:this._onOpaqueTile(x),x.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(H(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),T=Math.floor(o/2),z=c-1,q=new G(+x,+T);q.z=+z;var nt=this._tileCoordsToKey(q),mt=this._tiles[nt];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),z>f?this._retainParent(x,T,z,f):!1)},_retainChildren:function(i,o,c,f){for(var x=2*i;x<2*i+2;x++)for(var T=2*o;T<2*o+2;T++){var z=new G(x,T);z.z=c+1;var q=this._tileCoordsToKey(z),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,T,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 T=this.options.updateWhenZooming&&x!==this._tileZoom;(!f||T)&&(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();Yt.any3d?Be(i.el,x,f):ve(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(),T=o.getSize().divideBy(f*2);return new gt(x.subtract(T),x.add(T))},_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),T=x.getCenter(),z=[],q=this.options.keepBuffer,nt=new gt(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 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 oe=x.min.y;oe<=x.max.y;oe++)for(var pe=x.min.x;pe<=x.max.x;pe++){var hn=new G(pe,oe);if(hn.z=this._tileZoom,!!this._isValidTile(hn)){var Qe=this._tiles[this._tileCoordsToKey(hn)];Qe?Qe.current=!0:z.push(hn)}}if(z.sort(function(gn,nr){return gn.distanceTo(T)-nr.distanceTo(T)}),z.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kn=document.createDocumentFragment();for(pe=0;pe<z.length;pe++)this._addTile(z[pe],kn);this._level.el.appendChild(kn)}}}},_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 Ft(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),T=o.unproject(f,i.z),z=o.unproject(x,i.z);return[T,z]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new Jt(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,Yt.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)),ve(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),H(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"),Yt.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 gt(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 zM(i){return new to(i)}var er=to.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&&Yt.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:Yt.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 D(this._url,r(o,this.options))},_tileOnLoad:function(i,o){Yt.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),to.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===U))return to.prototype._tileReady.call(this,i,o,c)}});function sm(i,o){return new er(i,o)}var rm=er.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&&Yt.retina?2:1,T=this.getTileSize();c.width=T.x*x,c.height=T.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,er.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,f=At(c.project(o[0]),c.project(o[1])),x=f.min,T=f.max,z=(this._wmsVersion>=1.3&&this._crs===Jp?[x.y,x.x,T.y,T.x]:[x.x,x.y,T.x,T.y]).join(","),q=er.prototype.getTileUrl.call(this,i);return q+v(this.wmsParams,q,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+z},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function HM(i,o){return new rm(i,o)}er.WMS=rm,sm.wms=HM;var wi=Zn.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),T=f.multiplyBy(-c).add(x).subtract(this._map._getNewPixelOrigin(i,o));Yt.any3d?Be(this._container,T,c):ve(this._container,T)},_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 gt(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),om=wi.extend({options:{tolerance:0},getEvents:function(){var i=wi.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){wi.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(){H(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)){wi.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),f=Yt.retina?2:1;ve(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",Yt.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){wi.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 gt,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,T,z=i._parts,q=z.length,nt=this._ctx;if(q){for(nt.beginPath(),c=0;c<q;c++){for(f=0,x=z[c].length;f<x;f++)T=z[c][f],nt[f?"lineTo":"moveTo"](T.x,T.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&&(De(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 am(i){return Yt.canvas?new om(i):null}var eo=(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">')}})(),VM={_initContainer:function(){this._container=$t("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(wi.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=eo("shape");ee(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=eo("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=eo("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=eo("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){Re(i._container)}},La=Yt.vml?eo:ft,no=wi.extend({_initContainer:function(){this._container=La("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=La("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)){wi.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)),ve(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=La("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,Ct(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 ",T=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+x+c*2+",0 "+x+-c*2+",0 ";this._setPath(i,T)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){Qt(i._path)},_bringToBack:function(i){Re(i._path)}});Yt.vml&&no.include(VM);function lm(i){return Yt.svg||Yt.vml?new no(i):null}Ee.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&&am(i)||lm(i)}});var cm=$s.extend({initialize:function(i,o){$s.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))},_boundsToLatLngs:function(i){return i=Ft(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function GM(i,o){return new cm(i,o)}no.create=La,no.pointsToPath=Ct,xi.geometryToLayer=Ma,xi.coordsToLatLng=dh,xi.coordsToLatLngs=Ta,xi.latLngToCoords=fh,xi.latLngsToCoords=ba,xi.getFeature=tr,xi.asFeature=Aa,Ee.mergeOptions({boxZoom:!0});var hm=ni.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(),Tn(),Qc(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:us,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 gt(this._point,this._startPoint),c=o.getSize();ve(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),De(this._container,"leaflet-crosshair")),qr(),jc(),Ue(document,{contextmenu:us,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 Jt(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())}});Ee.addInitHook("addHandler","boxZoom",hm),Ee.mergeOptions({doubleClickZoom:!0});var um=ni.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)}});Ee.addInitHook("addHandler","doubleClickZoom",um),Ee.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var dm=ni.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new Wi(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(){De(this._map._container,"leaflet-grab"),De(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=Ft(this._map.options.maxBounds);this._offsetLimit=At(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,T=(f+o+c)%i-o-c,z=Math.abs(x+c)<Math.abs(T+c)?x:T;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=z},_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]),T=(this._lastTime-this._times[0])/1e3,z=c.easeLinearity,q=x.multiplyBy(z/T),nt=q.distanceTo([0,0]),mt=Math.min(c.inertiaMaxSpeed,nt),kt=q.multiplyBy(mt/nt),oe=mt/(c.inertiaDeceleration*z),pe=kt.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:z,noMoveStart:!0,animate:!0})}))}}});Ee.addInitHook("addHandler","dragging",dm),Ee.mergeOptions({keyboard:!0,keyboardPanDelta:80});var fm=ni.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=tt(f).multiplyBy(3)),c.options.maxBounds&&(f=c._limitOffset(tt(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;us(i)}}});Ee.addInitHook("addHandler","keyboard",fm),Ee.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var pm=ni.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=Bp(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),us(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,T=c?Math.ceil(x/c)*c:x,z=i._limitZoom(o+(this._delta>0?T:-T))-o;this._delta=0,this._startTime=null,z&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+z):i.setZoomAround(this._lastMousePos,o+z))}});Ee.addInitHook("addHandler","scrollWheelZoom",pm);var WM=600;Ee.mergeOptions({tapHold:Yt.touchNative&&Yt.safari&&Yt.mobile,tapTolerance:15});var mm=ni.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",en),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),WM),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){Ue(document,"touchend",en),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)}});Ee.addInitHook("addHandler","tapHold",mm),Ee.mergeOptions({touchZoom:Yt.touch,bounceAtZoomLimits:!0});var gm=ni.extend({addHooks:function(){ee(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){De(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),en(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 T=c._add(f)._divideBy(2)._subtract(this._centerPoint);if(x===1&&T.x===0&&T.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(T),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),H(this._animRequest);var z=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=k(z,this,!0),en(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,H(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))}});Ee.addInitHook("addHandler","touchZoom",gm),Ee.BoxZoom=hm,Ee.DoubleClickZoom=um,Ee.Drag=dm,Ee.Keyboard=fm,Ee.ScrollWheelZoom=pm,Ee.TapHold=mm,Ee.TouchZoom=gm,e.Bounds=gt,e.Browser=Yt,e.CRS=pt,e.Canvas=om,e.Circle=uh,e.CircleMarker=Sa,e.Class=j,e.Control=Wn,e.DivIcon=im,e.DivOverlay=ii,e.DomEvent=lM,e.DomUtil=oM,e.Draggable=Wi,e.Evented=dt,e.FeatureGroup=yi,e.GeoJSON=xi,e.GridLayer=to,e.Handler=ni,e.Icon=Ks,e.ImageOverlay=Ca,e.LatLng=Q,e.LatLngBounds=Jt,e.Layer=Zn,e.LayerGroup=Js,e.LineUtil=xM,e.Map=Ee,e.Marker=wa,e.Mixin=mM,e.Path=Zi,e.Point=G,e.PolyUtil=gM,e.Polygon=$s,e.Polyline=Ei,e.Popup=Pa,e.PosAnimation=Fp,e.Projection=wM,e.Rectangle=cm,e.Renderer=wi,e.SVG=no,e.SVGOverlay=nm,e.TileLayer=er,e.Tooltip=Ra,e.Transformation=Dt,e.Util=Z,e.VideoOverlay=em,e.bind=l,e.bounds=At,e.canvas=am,e.circle=RM,e.circleMarker=PM,e.control=Jr,e.divIcon=FM,e.extend=r,e.featureGroup=bM,e.geoJSON=tm,e.geoJson=DM,e.gridLayer=zM,e.icon=AM,e.imageOverlay=kM,e.latLng=lt,e.latLngBounds=Ft,e.layerGroup=TM,e.map=cM,e.marker=CM,e.point=tt,e.polygon=IM,e.polyline=LM,e.popup=NM,e.rectangle=GM,e.setOptions=w,e.stamp=u,e.svg=lm,e.svgOverlay=OM,e.tileLayer=sm,e.tooltip=BM,e.transformation=Bt,e.version=s,e.videoOverlay=UM;var ZM=window.L;e.noConflict=function(){return window.L=ZM,this},window.L=e}))})(ir,ir.exports)),ir.exports}var Xg=Zg();const _n=Gg(Xg);function Yg(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===Tt.AppObsType.Hw){const m=fs(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 fs(n,v)}}}else if(s===Tt.AppObsType.Ali){const m=fs(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 fs(n,v)}}}else if(s===Tt.AppObsType.Hs){const m=fs(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 fs(n,v)}}}else return s===Tt.AppObsType.Aws?n:s===Tt.AppObsType.Minio?`${r}/plain/${n}`:n}return n}async function qg(n,t){if(n){const{obsType:e}=t||{};if(e===Tt.AppObsType.Hw){let s="x-image-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const{width:r,height:a}=await Tt.api.getImageInfo(s);return{width:r,height:a}}else if(e===Tt.AppObsType.Ali){let s="x-oss-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Tt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else if(e===Tt.AppObsType.Hs){let s="x-tos-process=image/info";s=n.includes("?")?`${n}&${s}`:`${n}?${s}`;const r=await Tt.api.getImageInfo(s),{ImageHeight:a,ImageWidth:l}=r;return{...r,width:l.value,height:a.value}}else return e===Tt.AppObsType.Aws?{width:5760,height:2880}:e===Tt.AppObsType.Minio?{width:5760,height:2880}:{width:5760,height:2880}}}function fs(n,t){return n.includes("?")?`${n}&${t}`:`${n}?${t}`}class Qg{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=_n.marker(t.latLng,{icon:_n.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=_n.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(_n.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 Xg={class:"vsleem-map-geo"},Yg=bn(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=Tt.utils.debounce(F,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(()=>p.value,d),y.onMounted(()=>{m(),_(),v(),w(),E()}),y.onUnmounted(()=>{N()});function m(){const{currentPoint:M}=s.store||{},k={...dg};if(M){const{point:H}=M;k.center=[H.lat,H.lon]}l.value=_n.map(a.value,k),r("ready",l.value)}function _(){const{tileLayers:M=gh}=s.map||{};M.length&&l.value&&M?.forEach(k=>_n.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:H}=s.map,Z=_n.latLng(M.lat,M.lon);h.value?h.value.setOptions({latLng:Z,hFov:H,angle:k}):(h.value=new Zg({latLng:Z,hFov:H,angle:k}),h.value?.addTo(l.value))}function S(){E()}async function w(){const{dataSource:M}=s.store||{},{showPoint:k,showMarker:H}=s.map;for(const Z of M?.values()||[])for(const Q of Z.trackPoints.values()){const{lon:at,lat:$}=Q.point,dt=_n.latLng($,at);k&&g(Q,dt),H&&D(Q,dt)}}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 H=_n.circleMarker(k,{fillColor:M.color,fillOpacity:1,radius:3,opacity:0}).addTo(l.value);u.value.push(H),C(H,M)}}function D(M,k){const H=s.store?.groupedMarkers.get(M);if(H?.length&&l.value){const Z=_n.icon({iconUrl:H[0].markerIcon,iconSize:_n.point([30,35]),iconAnchor:_n.point([15,35])}),Q=_n.marker(k,{icon:Z}).addTo(l.value);u.value.push(Q),A(Q,M,H)}}function C(M,k){M?.addEventListener("click",H=>{H.originalEvent.preventDefault(),H.originalEvent.stopPropagation(),U(k)})}function A(M,k,H){M?.addEventListener("click",Z=>{Z.originalEvent.preventDefault(),Z.originalEvent.stopPropagation(),B(k,H)})}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 F(){const{currentPoint:M}=s.store||{};if(M){const{point:k}=M,H=l.value?.getZoom()??17;l.value?.setView([k.lat,k.lon],H)}l.value?.invalidateSize(!0)}function I(){v(),w(),E()}return t({needUpdate:I}),(M,k)=>(y.openBlock(),y.createElementBlock("div",Xg,[y.createElementVNode("div",{ref_key:"mapElRef",ref:a,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-248ebdab"]]),xh=bn(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:D,handleSelectPoint:C}=mg(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,A,{immediate:!0}),y.onMounted(B);function A(N){N&&(r.value=w)}function U(N,F){d.value=N,u.value=F}function B(){s("register",r,U)}return t(w),(N,F)=>(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(S))),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(S))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(Bg,{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(D)},null,8,["min","max","size","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(Tt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(Yg,{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(Lg,{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(N.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.renderSlot(N.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)],4))}}),[["__scopeId","data-v-49a6a917"]]),{cloneDeep:wh,deepMergeProps:qg,getDiffProps:Qg}=Tt.utils;function jg(n,t,e,s){const r=y.ref(wh(so)),a=y.computed(()=>{const{currentRecord:H,currentPoint:Z}=y.unref(t)||{},Q=H?.trackPoints?.size??0,at=Z?.index??0;return{...r.value,count:Q,index:at}}),l=y.computed(()=>{const{currentRecord:H}=y.unref(t)||{};return Array.from(H?.trackPoints?.values()||[])}),h=y.computed(()=>{const{dataSource:H,coordinateTree:Z,mappedCoordinateTree:Q,currentSpace:at,currentModel:$,currentRecord:dt,currentPoint:G,currentMarker:it,currentPointMarkers:tt}=t.value||{};return{dataSource:H,coordinateTree:Z,mappedCoordinateTree:Q,currentSpace:at,currentModel:$,currentRecord:dt,currentPoint:G,currentPointMarkers:tt,currentMarker:it,state:a.value}});y.watch(()=>wh(n.value?.playbar),u,{immediate:!0,deep:!0});function u(H,Z){const Q=Qg(H,Z);p(Q)}function d(){return a.value}function p(H){H&&qg(r.value,H)}function m(H){return l.value[H]}function _(){s("ready")}function E(H){const Z=m(H);Z&&(C(Z),s("backward",Z))}function S(H){const Z=m(H);Z&&s("pause",Z)}function w(H){const Z=m(H);Z&&(C(Z),s("play",Z))}function v(H){const Z=m(H);Z&&(C(Z),s("forward",Z))}function g(H){s("speed",H)}function D(H){const Z=m(H);Z&&(C(Z),s("slider",Z))}function C(H){y.unref(t)?.selectPoint(H),s("select-point",H)}function A(){y.unref(e)?.handleBackward?.()}function U(){y.unref(e)?.handlePlay?.()}function B(){y.unref(e)?.handlePause?.()}function N(){y.unref(e)?.handleForward?.()}function F(){y.unref(e)?.handleSpeed?.()}function I(){y.unref(e)?.handlePlayNext?.()}function M(H=0){return m(H)?.uxTime?.split(" ")?.[1]||null}return{getProps:a,getBindValue:h,playbarAction:{getState:d,setState:p,backward:A,play:U,pause:B,forward:N,speed:F,playNext:I},formatter:M,handleReady:_,handleBackward:E,handlePause:S,handlePlay:w,handleForward:v,handleSlider:D,handleSpeed:g}}const Jg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAAAXNSR0IArs4c6QAACaVJREFUeF7tnf2V1DYUR61OoBO2E6gEUkmgkmwnoRMFJV5wZpkd61nS+7pzTk7+iGVJ9+laP3vG2bLxgQAE7hIosIEABO4TQBBWBwTeIIAgLA8IIAhrAAIyAuwgMm60SkIAQZIUmmnKCCCIjButkhBAkCSFZpoyAggi40arJAQQJEmhmaaMAILIuNEqCQEESVJopikjgCAybrRKQgBBkhSaacoIIIiMG62SEECQJIVmmjICCCLjRqskBBAkSaGZpowAgsi40SoJAQRJUmimKSOAIDJutEpCAEGSFJppygggiIwbrZIQQJAkhWaaMgIIIuNGqyQEECRJoZmmjACCyLjRKgkBBElSaKYpI4AgMm60SkIAQZIUmmnKCCCIjButkhBAkCSFZpoyAggi40arJAQQJEmhmaaMAILIuNEqCQEESVJopikjgCAybrRKQgBBkhSaacoIIIiMG62SEECQJIVmmjICCCLjRqskBBAkSaGZpowAgsi40SoJAQRJUmimKSOAIDJutEpCAEGSFJppygggiIwbrZIQQBDFQtdaP2/b9vHHP9+3bftWSvmqOJxlXddaP2zb1ub+8vlUSmkMzH0QRKEktdZ327b9uW1bWyjHz1Mp5VlhSMu63C8KX246bHM2KQmCLFsa/3W0Xz3/utPtcynlafGQlnVXa23zvr0ovPT/3uIugiDLlsdDOf4dSSklZE0eyNGm3nYQcxEzZDEWrvnTXd2JFq/aRxPkjTh5O/cvP+b+x2mgiw5EkAWga63tfqPdjD/8RBLkQZxEkIerIcEBJ6LF/yhEEaRTjsaAHSSBDz+n2BEtwglSa227Zds1ez4I0kPL87G7HO2JTXuc2/XxvoP0xMkbMAjStVKcHiyIFmF2kN44iSBOF7l02FflaP163EGkcRJBpCvNYbuzj3EfTc2bIFfiJII8Wg1B/vvFaOE2Yo3YMQ+T5x4kiA+Xn1S9xcHLDjJYjoYEQSIJMih3v0LiQZBRcZKIFcmIw1wmXD1/nt26ICPjJIIEFGSmHNafYk2Ug4gVwZVJ0cL8TfqsOMkOEsGKfQ6Tr55mI9bsHZOnWAEkWSWHtYi1UA4ilkdPFkULkxFrRZwkYnm04lekaq+G3ns1dtrMLDzFWrljErGmLaV5J14cLUztIEpyELHmLeexZ1aIFiYE0YiTRKyxa3f62S68yzBsbBoRS3PHJGINWzpzT6QYLVR3ECNyELHmLm/52Q1ECzVBhK/GymG/3ZIfK84iKz2voavnzymsilgW4iT3INKVu6CdRTnatFcIYiVOIsiChS7pwli0WBaxrMVJBJGs3sltDEaLJYIMfDV2VoW4B5lF9ux5jUaL6YJYjZPsIGdX7uTjjEeLqYI4kYPHvJMduHt6T3KMvknX/lVAZ82JWJ3ALh/u6Oo5/DGvhzhJxLq8xOUn8CjHqB3EoRxELPlS72/pLFoMuwfxFifZQfrX9uUWTq+elyOW1x3zUHDuQS6v/gcn8C6HNGIFkIOINVMO59HiUsTyHCeJWDOt2M8d5OopilgRdkwi1kRJosnRE7GCyUHEGu1JoGjRFbEixUki1mgrfsWq0381dtIQpp32rZ+7R9wxiViDl1LAaHFqBwkuBxHrqieBo8VDQSy/v3K1ruwgAwgmuHrefYpl/f2VAeV9OQVfFEpgZpLj9ilW9DjJTbrEiEObJNHiVcTKEicR5IIgUR/jnkDyfv9/Ar87cWykQ4hYZ6u5X0H/Pnt8sOO+btv2MdiczkwHQc5Qasck3j3OIop4HIKcrWrGe48Dm+/btmWLV3wPclaOfQdpC6T9bY6MC4WI1bNYJh9bJp9ffPqsMav91KTW2u6/sl0ciFi9tuyStBvWNItlFyTjDoogvYLscav9KbT248QUkhx/rJjoW3TuQSRyvLTZv01PIcntr3kTRU12kIuSpIgdv/u5e5KoiSBXBDnsJmHfBWlzvPc+yP7o+3PgqIkgIwSJ/kXiiRemokZNBBklyEGScE+4Hv0BHQd/xkBaZgSRkrvXLmLseCTIIWq2L1LbE74oHwSZUcloT7jOCrLvopHuxxBkhiDRfprSI0iw+zEEmSXIIXa4/4lGryCB7scQZLYgEWKHRJAgvzhAkBWCeI8dUkECRE0EWSWI59hxRRDnkiDISkG8xo6rghzux7w94UKQ1YJ4vKKOEsRh1EQQDUG8STJSEGdRE0G0BPEUO0YL4ihqIoi2IB5ixwxBnEiCIBYEsR47ZgniIGoiiBVBLF9RZwpiPGoiiCVBrEqyQhCjURNBrAliMXasEsRg1EQQi4JYix0rBdklaS+dWXiVF0EsC2IldqwWxFDURBDrgliIHRqCGImaCOJBEO3YoSXIIWpqvcqLIF4E0Ywd2oLsc9f4oSOCeBJEK3ZYEETpfgxBvAlyiB3LXuW1IojC/RiCeBVkZeywJMjiqIkgngVZFTusCbIwaiKId0FWxA6LgiySBEEiCDI7dlgVZMEvDhAkiiAzr6jWBZkYNREkkiCzJPEgyKSoiSDRBJkRO7wIMiFqIkhUQUbGDk+CDJYEQSILMip2eBNkYNREkOiCjLiiehRkUNREkAyCXJXEsyAXoyaCZBHkSuzwLsiFqIkgmQSRxo4IguyS9L7KiyAZBemNHVEEEURNBMkqSE/siCRIZ9REkMyCnI0d0QQ5RM1Hr/IiSHZBTsSO51LKU1ROtda3XuV9KqU8W5t7sTagDOOptb7btq1dUdu/jx+Ti2RkTWqt7f/B9eXmnGYvDAgysvqd59oXS3va066c3yxeQTundOrw/W/bN1E+/LhIfC2lfDrVUOEgBFGATpd+CCCIn1oxUgUCCKIAnS79EEAQP7VipAoEEEQBOl36IYAgfmrFSBUIIIgCdLr0QwBB/NSKkSoQQBAF6HTphwCC+KkVI1UggCAK0OnSDwEE8VMrRqpAAEEUoNOlHwII4qdWjFSBAIIoQKdLPwQQxE+tGKkCAQRRgE6XfgggiJ9aMVIFAgiiAJ0u/RBAED+1YqQKBBBEATpd+iGAIH5qxUgVCCCIAnS69EMAQfzUipEqEEAQBeh06YcAgvipFSNVIIAgCtDp0g8BBPFTK0aqQABBFKDTpR8CCOKnVoxUgQCCKECnSz8EEMRPrRipAgEEUYBOl34IIIifWjFSBQIIogCdLv0QQBA/tWKkCgQQRAE6XfohgCB+asVIFQggiAJ0uvRDAEH81IqRKhBAEAXodOmHAIL4qRUjVSCAIArQ6dIPAQTxUytGqkAAQRSg06UfAgjip1aMVIEAgihAp0s/BBDET60YqQKBfwD4AKH2xW3zZwAAAABJRU5ErkJggg==",Kg="data:image/png;base64,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",$g="data:image/png;base64,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",t_="data:image/png;base64,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",e_={class:"vsleem-playbar-box"},n_={class:"playbar-box-caption"},i_={style:{flex:"1"}},s_={class:"playbar-box-btns"},r_=["src"],o_=["src"],a_=["src"],l_=["src"],c_=["title"],h_=bn(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",D(-1))}function E(){u.value||(l.value=!0,r("play",D(1)))}function S(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function w(){d.value||r("forward",D(1))}async function v(){const A=C();r("speed",A)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",D(1))},s.state.speed)))}function D(A){let U=s.state.index+A;return U<0||U>=s.state.count&&(U=s.state.count-1),U}function C(){const{speed:A,step:U,baseSpeed:B,threshold:N}=s.state;let I=B/A+U;const M=N/B;return I>M&&(I=U),Math.round(B/I)}return t({handleBackward:_,handlePlay:E,handlePause:S,handleForward:w,handlePlayNext:g,handleSpeed:v}),(A,U)=>(y.openBlock(),y.createElementBlock("div",e_,[y.createElementVNode("div",n_,[y.renderSlot(A.$slots,"caption",{state:A.state,currentPoint:A.currentPoint},()=>[y.createElementVNode("span",i_,y.toDisplayString(A.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(A.state.index+1)+" / "+y.toDisplayString(A.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",s_,[y.renderSlot(A.$slots,"button",{state:A.state,currentPoint:A.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(Jg),alt:""},null,8,r_)],2),A.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($g),alt:""},null,8,a_)])):(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(t_),alt:""},null,8,o_)],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(Kg),alt:""},null,8,l_)],2),A.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,c_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),u_={key:0,class:"vsleem-handle-tooltip"},d_=["innerHTML"],f_=bn(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 A=Math.round(C.offsetX/d.value)*d.value;a.value=A,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=A=>{D(A,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=A=>{D(A.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 D(C,A){const U=_(Math.round((C.clientX-A)/d.value)*d.value);U>h.value?a.value=h.value:0<=U&&U<=h.value?a.value=U:a.value=0}return(C,A)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:C.disabled}]),ref_key:"slider",ref:l},[A[1]||(A[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",u_,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,d_),A[0]||(A[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-9038462b"]]),Sh=bn(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.computed(()=>y.unref(y.unref(h))),d=y.computed(()=>y.unref(y.unref(l))),{getProps:p,getBindValue:m,playbarAction:_,formatter:E,handleReady:S,handleBackward:w,handlePause:v,handlePlay:g,handleForward:D,handleSlider:C,handleSpeed:A}=jg(u,d,a,s);y.watch(()=>y.unref(d)?.ready,U,{immediate:!0}),y.onMounted(N);function U(F){F&&(S(),r.value=_)}function B(F,I){h.value=F,l.value=I}function N(){s("register",r,B)}return t(_),(F,I)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(p)?.style)},[y.renderSlot(F.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(m))),()=>[y.createVNode(f_,{min:0,max:y.unref(p).count-1,value:y.unref(p).index,class:"vsleem-silder","tip-formatter":y.unref(E),onAfterChange:y.unref(C)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(F.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(m))),()=>[y.createVNode(h_,{ref_key:"playerElRef",ref:a,state:y.unref(m).state,currentPoint:y.unref(m).currentPoint,class:"vsleem-player",onBackward:y.unref(w),onPlay:y.unref(g),onPause:y.unref(v),onForward:y.unref(D),onSpeed:y.unref(A)},{caption:y.withCtx(M=>[y.renderSlot(F.$slots,"caption",y.normalizeProps(y.guardReactiveProps(M)),void 0,!0)]),button:y.withCtx(M=>[y.renderSlot(F.$slots,"button",y.normalizeProps(y.guardReactiveProps(M)),void 0,!0)]),_:3},8,["state","currentPoint","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(F.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(m))),void 0,!0)],4))}}),[["__scopeId","data-v-78ea95cf"]]);/**
|
|
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=_n.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(_n.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 jg={class:"vsleem-map-geo"},Jg=bn(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=Tt.utils.debounce(F,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(()=>p.value,d),y.onMounted(()=>{m(),_(),v(),w(),E()}),y.onUnmounted(()=>{N()});function m(){const{currentPoint:M}=s.store||{},k={...yh};if(M){const{point:H}=M;k.center=[H.lat,H.lon]}l.value=_n.map(a.value,k),r("ready",l.value)}function _(){const{tileLayers:M=ka}=s.map||{};M.length&&l.value&&M?.forEach(k=>_n.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:H}=s.map,Z=_n.latLng(M.lat,M.lon);h.value?h.value.setOptions({latLng:Z,hFov:H,angle:k}):(h.value=new Qg({latLng:Z,hFov:H,angle:k}),h.value?.addTo(l.value))}function S(){E()}async function w(){const{dataSource:M}=s.store||{},{showPoint:k,showMarker:H}=s.map;for(const Z of M?.values()||[])for(const j of Z.trackPoints.values()){const{lon:at,lat:$}=j.point,dt=_n.latLng($,at);k&&g(j,dt),H&&D(j,dt)}}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 H=_n.circleMarker(k,{fillColor:M.color,fillOpacity:1,radius:3,opacity:0}).addTo(l.value);u.value.push(H),C(H,M)}}function D(M,k){const H=s.store?.groupedMarkers.get(M);if(H?.length&&l.value){const Z=_n.icon({iconUrl:H[0].markerIcon,iconSize:_n.point([30,35]),iconAnchor:_n.point([15,35])}),j=_n.marker(k,{icon:Z}).addTo(l.value);u.value.push(j),A(j,M,H)}}function C(M,k){M?.addEventListener("click",H=>{H.originalEvent.preventDefault(),H.originalEvent.stopPropagation(),U(k)})}function A(M,k,H){M?.addEventListener("click",Z=>{Z.originalEvent.preventDefault(),Z.originalEvent.stopPropagation(),B(k,H)})}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 F(){const{currentPoint:M}=s.store||{};if(M){const{point:k}=M,H=l.value?.getZoom()??17;l.value?.setView([k.lat,k.lon],H)}l.value?.invalidateSize(!0)}function I(){v(),w(),E()}return t({needUpdate:I}),(M,k)=>(y.openBlock(),y.createElementBlock("div",jg,[y.createElementVNode("div",{ref_key:"mapElRef",ref:a,style:{width:"100%",height:"100%"}},null,512)]))}}),[["__scopeId","data-v-248ebdab"]]),Mh=bn(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:D,handleSelectPoint:C}=yg(p,m,a,l,h,s);y.watch(()=>y.unref(m)?.ready,A,{immediate:!0}),y.onMounted(B);function A(N){N&&(r.value=w)}function U(N,F){d.value=N,u.value=F}function B(){s("register",r,U)}return t(w),(N,F)=>(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(S))),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(S))),void 0,!0),y.unref(_).showDragger?(y.openBlock(),y.createBlock(Vg,{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(D)},null,8,["min","max","size","onCollapse","onDragger"])):y.createCommentVNode("",!0),m.value?.currentModel?.modelType===y.unref(Tt.CoordinateModelType).GeoModel?(y.openBlock(),y.createBlock(Jg,{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(Ug,{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(N.$slots,"right",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0),y.renderSlot(N.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(S))),void 0,!0)],4))}}),[["__scopeId","data-v-49a6a917"]]),{cloneDeep:Th,deepMergeProps:Kg,getDiffProps:$g}=Tt.utils;function t_(n,t,e,s){const r=y.ref(Th(so)),a=y.computed(()=>{const{currentRecord:H,currentPoint:Z}=y.unref(t)||{},j=H?.trackPoints?.size??0,at=Z?.index??0;return{...r.value,count:j,index:at}}),l=y.computed(()=>{const{currentRecord:H}=y.unref(t)||{};return Array.from(H?.trackPoints?.values()||[])}),h=y.computed(()=>{const{dataSource:H,coordinateTree:Z,mappedCoordinateTree:j,currentSpace:at,currentModel:$,currentRecord:dt,currentPoint:G,currentMarker:it,currentPointMarkers:tt}=t.value||{};return{dataSource:H,coordinateTree:Z,mappedCoordinateTree:j,currentSpace:at,currentModel:$,currentRecord:dt,currentPoint:G,currentPointMarkers:tt,currentMarker:it,state:a.value}});y.watch(()=>Th(n.value?.playbar),u,{immediate:!0,deep:!0});function u(H,Z){const j=$g(H,Z);p(j)}function d(){return a.value}function p(H){H&&Kg(r.value,H)}function m(H){return l.value[H]}function _(){s("ready")}function E(H){const Z=m(H);Z&&(C(Z),s("backward",Z))}function S(H){const Z=m(H);Z&&s("pause",Z)}function w(H){const Z=m(H);Z&&(C(Z),s("play",Z))}function v(H){const Z=m(H);Z&&(C(Z),s("forward",Z))}function g(H){s("speed",H)}function D(H){const Z=m(H);Z&&(C(Z),s("slider",Z))}function C(H){y.unref(t)?.selectPoint(H),s("select-point",H)}function A(){y.unref(e)?.handleBackward?.()}function U(){y.unref(e)?.handlePlay?.()}function B(){y.unref(e)?.handlePause?.()}function N(){y.unref(e)?.handleForward?.()}function F(){y.unref(e)?.handleSpeed?.()}function I(){y.unref(e)?.handlePlayNext?.()}function M(H=0){return m(H)?.uxTime?.split(" ")?.[1]||null}return{getProps:a,getBindValue:h,playbarAction:{getState:d,setState:p,backward:A,play:U,pause:B,forward:N,speed:F,playNext:I},formatter:M,handleReady:_,handleBackward:E,handlePause:S,handlePlay:w,handleForward:v,handleSlider:D,handleSpeed:g}}const e_="data:image/png;base64,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",n_="data:image/png;base64,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",i_="data:image/png;base64,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",s_="data:image/png;base64,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",r_={class:"vsleem-playbar-box"},o_={class:"playbar-box-caption"},a_={style:{flex:"1"}},l_={class:"playbar-box-btns"},c_=["src"],h_=["src"],u_=["src"],d_=["src"],f_=["title"],p_=bn(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",D(-1))}function E(){u.value||(l.value=!0,r("play",D(1)))}function S(){l.value=!1,a&&(clearTimeout(a),a=void 0,r("pause",s.state.index))}function w(){d.value||r("forward",D(1))}async function v(){const A=C();r("speed",A)}function g(){l.value&&(u.value?(l.value=!1,clearTimeout(a),a=void 0):(clearTimeout(a),a=setTimeout(()=>{r("play",D(1))},s.state.speed)))}function D(A){let U=s.state.index+A;return U<0||U>=s.state.count&&(U=s.state.count-1),U}function C(){const{speed:A,step:U,baseSpeed:B,threshold:N}=s.state;let I=B/A+U;const M=N/B;return I>M&&(I=U),Math.round(B/I)}return t({handleBackward:_,handlePlay:E,handlePause:S,handleForward:w,handlePlayNext:g,handleSpeed:v}),(A,U)=>(y.openBlock(),y.createElementBlock("div",r_,[y.createElementVNode("div",o_,[y.renderSlot(A.$slots,"caption",{state:A.state,currentPoint:A.currentPoint},()=>[y.createElementVNode("span",a_,y.toDisplayString(A.currentPoint?.uxTime),1),y.createElementVNode("span",null,y.toDisplayString(A.state.index+1)+" / "+y.toDisplayString(A.state.count)+" 帧",1)],!0)]),y.createElementVNode("div",l_,[y.renderSlot(A.$slots,"button",{state:A.state,currentPoint:A.currentPoint},()=>[y.createElementVNode("div",{class:y.normalizeClass(["playbar-box-button",{disabled:h.value}]),onClick:_},[y.createElementVNode("img",{class:"playbar-box-icon",src:y.unref(e_),alt:""},null,8,c_)],2),A.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(i_),alt:""},null,8,u_)])):(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(s_),alt:""},null,8,h_)],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(n_),alt:""},null,8,d_)],2),A.state.showSpeed?(y.openBlock(),y.createElementBlock("div",{key:1,class:"playbar-box-button",onClick:v,title:m.value},y.toDisplayString(p.value)+"X ",9,f_)):y.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-d9b98a6f"]]),m_={key:0,class:"vsleem-handle-tooltip"},g_=["innerHTML"],__=bn(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 A=Math.round(C.offsetX/d.value)*d.value;a.value=A,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=A=>{D(A,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=A=>{D(A.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 D(C,A){const U=_(Math.round((C.clientX-A)/d.value)*d.value);U>h.value?a.value=h.value:0<=U&&U<=h.value?a.value=U:a.value=0}return(C,A)=>(y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["vsleem-playbar-silder",{disabled:C.disabled}]),ref_key:"slider",ref:l},[A[1]||(A[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",m_,[y.createElementVNode("div",{class:"vsleem-content",innerHTML:m.value},null,8,g_),A[0]||(A[0]=y.createElementVNode("div",{class:"vsleem-arrow"},null,-1))]))],38)],2))}}),[["__scopeId","data-v-9038462b"]]),bh=bn(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.computed(()=>y.unref(y.unref(h))),d=y.computed(()=>y.unref(y.unref(l))),{getProps:p,getBindValue:m,playbarAction:_,formatter:E,handleReady:S,handleBackward:w,handlePause:v,handlePlay:g,handleForward:D,handleSlider:C,handleSpeed:A}=t_(u,d,a,s);y.watch(()=>y.unref(d)?.ready,U,{immediate:!0}),y.onMounted(N);function U(F){F&&(S(),r.value=_)}function B(F,I){h.value=F,l.value=I}function N(){s("register",r,B)}return t(_),(F,I)=>(y.openBlock(),y.createElementBlock("div",{class:"vsleem-playbar",style:y.normalizeStyle(y.unref(p)?.style)},[y.renderSlot(F.$slots,"slider",y.normalizeProps(y.guardReactiveProps(y.unref(m))),()=>[y.createVNode(__,{min:0,max:y.unref(p).count-1,value:y.unref(p).index,class:"vsleem-silder","tip-formatter":y.unref(E),onAfterChange:y.unref(C)},null,8,["max","value","tip-formatter","onAfterChange"])],!0),y.renderSlot(F.$slots,"box",y.normalizeProps(y.guardReactiveProps(y.unref(m))),()=>[y.createVNode(p_,{ref_key:"playerElRef",ref:a,state:y.unref(m).state,currentPoint:y.unref(m).currentPoint,class:"vsleem-player",onBackward:y.unref(w),onPlay:y.unref(g),onPause:y.unref(v),onForward:y.unref(D),onSpeed:y.unref(A)},{caption:y.withCtx(M=>[y.renderSlot(F.$slots,"caption",y.normalizeProps(y.guardReactiveProps(M)),void 0,!0)]),button:y.withCtx(M=>[y.renderSlot(F.$slots,"button",y.normalizeProps(y.guardReactiveProps(M)),void 0,!0)]),_:3},8,["state","currentPoint","onBackward","onPlay","onPause","onForward","onSpeed"])],!0),y.renderSlot(F.$slots,"default",y.normalizeProps(y.guardReactiveProps(y.unref(m))),void 0,!0)],4))}}),[["__scopeId","data-v-78ea95cf"]]);/**
|
|
11
11
|
* @license
|
|
12
12
|
* Copyright 2010-2025 Three.js Authors
|
|
13
13
|
* SPDX-License-Identifier: MIT
|
|
14
|
-
*/const ka="179",p_=0,Mh=1,m_=2,Th=1,g_=2,si=3,Si=0,un=1,ri=2,Mi=0,ps=1,bh=2,Ah=3,Ch=4,__=5,Xi=100,v_=101,y_=102,E_=103,x_=104,w_=200,S_=201,M_=202,T_=203,Ua=204,Oa=205,b_=206,A_=207,C_=208,P_=209,R_=210,L_=211,I_=212,D_=213,k_=214,Na=0,Ba=1,Fa=2,ms=3,za=4,Ha=5,Va=6,Ga=7,Ph=0,U_=1,O_=2,Ti=0,Rh=1,N_=2,B_=3,F_=4,z_=5,H_=6,V_=7,Lh=300,gs=301,_s=302,Wa=303,Za=304,ro=306,Xa=1e3,Yi=1001,Ya=1002,Un=1003,G_=1004,oo=1005,vn=1006,qa=1007,bi=1008,oi=1009,Ih=1010,Dh=1011,sr=1012,Qa=1013,qi=1014,ai=1015,rr=1016,ja=1017,Ja=1018,or=1020,kh=35902,Uh=1021,Oh=1022,On=1023,ar=1026,lr=1027,Nh=1028,Ka=1029,Bh=1030,$a=1031,tl=1033,ao=33776,lo=33777,co=33778,ho=33779,el=35840,nl=35841,il=35842,sl=35843,rl=36196,ol=37492,al=37496,ll=37808,cl=37809,hl=37810,ul=37811,dl=37812,fl=37813,pl=37814,ml=37815,gl=37816,_l=37817,vl=37818,yl=37819,El=37820,xl=37821,uo=36492,wl=36494,Sl=36495,Fh=36283,Ml=36284,Tl=36285,bl=36286,W_=3200,Z_=3201,X_=0,Y_=1,Ai="",An="srgb",Qi="srgb-linear",fo="linear",Le="srgb",vs=7680,zh=519,q_=512,Q_=513,j_=514,Hh=515,J_=516,K_=517,$_=518,tv=519,Vh=35044,Gh="300 es",Xn=2e3,po=2001;class ys{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 nn=["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 Wh=1234567;const cr=Math.PI/180,hr=180/Math.PI;function Es(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(nn[n&255]+nn[n>>8&255]+nn[n>>16&255]+nn[n>>24&255]+"-"+nn[t&255]+nn[t>>8&255]+"-"+nn[t>>16&15|64]+nn[t>>24&255]+"-"+nn[e&63|128]+nn[e>>8&255]+"-"+nn[e>>16&255]+nn[e>>24&255]+nn[s&255]+nn[s>>8&255]+nn[s>>16&255]+nn[s>>24&255]).toLowerCase()}function me(n,t,e){return Math.max(t,Math.min(e,n))}function Al(n,t){return(n%t+t)%t}function ev(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function nv(n,t,e){return n!==t?(e-n)/(t-n):0}function ur(n,t,e){return(1-e)*n+e*t}function iv(n,t,e,s){return ur(n,t,1-Math.exp(-e*s))}function sv(n,t=1){return t-Math.abs(Al(n,t*2)-t)}function rv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function ov(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function av(n,t){return n+Math.floor(Math.random()*(t-n+1))}function lv(n,t){return n+Math.random()*(t-n)}function cv(n){return n*(.5-Math.random())}function hv(n){n!==void 0&&(Wh=n);let t=Wh+=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 uv(n){return n*cr}function dv(n){return n*hr}function fv(n){return(n&n-1)===0&&n!==0}function pv(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function mv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function gv(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 xs(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 rn(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 xe={DEG2RAD:cr,RAD2DEG:hr,generateUUID:Es,clamp:me,euclideanModulo:Al,mapLinear:ev,inverseLerp:nv,lerp:ur,damp:iv,pingpong:sv,smoothstep:rv,smootherstep:ov,randInt:av,randFloat:lv,randFloatSpread:cv,seededRandom:hv,degToRad:uv,radToDeg:dv,isPowerOfTwo:fv,ceilPowerOfTwo:pv,floorPowerOfTwo:mv,setQuaternionFromProperEuler:gv,normalize:rn,denormalize:xs};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 ji{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,D=g>=0?1:-1,C=1-g*g;if(C>Number.EPSILON){const U=Math.sqrt(C),B=Math.atan2(U,g*D);v=Math.sin(v*B)/U,h=Math.sin(h*B)/U}const A=h*D;if(u=u*v+_*A,d=d*v+E*A,p=p*v+S*A,m=m*v+w*A,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 Y{constructor(t=0,e=0,s=0){Y.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(Zh.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Zh.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 Cl.copy(this).projectOnVector(t),this.sub(Cl)}reflect(t){return this.sub(Cl.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 Cl=new Y,Zh=new ji;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],D=r[1],C=r[4],A=r[7],U=r[2],B=r[5],N=r[8];return a[0]=l*w+h*D+u*U,a[3]=l*v+h*C+u*B,a[6]=l*g+h*A+u*N,a[1]=d*w+p*D+m*U,a[4]=d*v+p*C+m*B,a[7]=d*g+p*A+m*N,a[2]=_*w+E*D+S*U,a[5]=_*v+E*C+S*B,a[8]=_*g+E*A+S*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,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(Pl.makeScale(t,e)),this}rotate(t){return this.premultiply(Pl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Pl.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 Pl=new ue;function Xh(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function dr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function _v(){const n=dr("canvas");return n.style.display="block",n}const Yh={};function ws(n){n in Yh||(Yh[n]=!0,console.warn(n))}function vv(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 qh=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Qh=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function yv(){const n={enabled:!0,workingColorSpace:Qi,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Le&&(r.r=li(r.r),r.g=li(r.g),r.b=li(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===Le&&(r.r=Ss(r.r),r.g=Ss(r.g),r.b=Ss(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===Ai?fo: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 ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return ws("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({[Qi]:{primaries:t,whitePoint:s,transfer:fo,toXYZ:qh,fromXYZ:Qh,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:An},outputColorSpaceConfig:{drawingBufferColorSpace:An}},[An]:{primaries:t,whitePoint:s,transfer:Le,toXYZ:qh,fromXYZ:Qh,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:An}}}),n}const we=yv();function li(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ss(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ms;class Ev{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{Ms===void 0&&(Ms=dr("canvas")),Ms.width=t.width,Ms.height=t.height;const r=Ms.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ms}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=dr("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]=li(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(li(e[s]/255)*255):e[s]=li(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 xv=0;class Rl{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:xv++}),this.uuid=Es(),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(Ll(r[l].image)):a.push(Ll(r[l]))}else a=Ll(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function Ll(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Ev.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 wv=0;const Il=new Y;class je extends ys{constructor(t=je.DEFAULT_IMAGE,e=je.DEFAULT_MAPPING,s=Yi,r=Yi,a=vn,l=bi,h=On,u=oi,d=je.DEFAULT_ANISOTROPY,p=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:wv++}),this.uuid=Es(),this.name="",this.source=new Rl(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(Il).x}get height(){return this.source.getSize(Il).y}get depth(){return this.source.getSize(Il).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!==Lh)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Xa:t.x=t.x-Math.floor(t.x);break;case Yi:t.x=t.x<0?0:1;break;case Ya: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 Xa:t.y=t.y-Math.floor(t.y);break;case Yi:t.y=t.y<0?0:1;break;case Ya: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=Lh,je.DEFAULT_ANISOTROPY=1;class Fe{constructor(t=0,e=0,s=0,r=1){Fe.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,A=(E+1)/2,U=(g+1)/2,B=(p+_)/4,N=(m+w)/4,F=(S+v)/4;return C>A&&C>U?C<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(C),r=B/s,a=N/s):A>U?A<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(A),s=B/r,a=F/r):U<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(U),s=N/a,r=F/a),this.set(s,r,a,e),this}let D=Math.sqrt((v-S)*(v-S)+(m-w)*(m-w)+(_-p)*(_-p));return Math.abs(D)<.001&&(D=1),this.x=(v-S)/D,this.y=(m-w)/D,this.z=(_-p)/D,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 Sv extends ys{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:vn,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 Fe(0,0,t,e),this.scissorTest=!1,this.viewport=new Fe(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:vn,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 Rl(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 Ci extends Sv{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class jh 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=Un,this.minFilter=Un,this.wrapR=Yi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Mv 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=Un,this.minFilter=Un,this.wrapR=Yi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ts{constructor(t=new Y(1/0,1/0,1/0),e=new Y(-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(Nn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Nn.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=Nn.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,Nn):Nn.fromBufferAttribute(a,l),Nn.applyMatrix4(t.matrixWorld),this.expandByPoint(Nn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),mo.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),mo.copy(s.boundingBox)),mo.applyMatrix4(t.matrixWorld),this.union(mo)}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,Nn),Nn.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(fr),go.subVectors(this.max,fr),bs.subVectors(t.a,fr),As.subVectors(t.b,fr),Cs.subVectors(t.c,fr),Pi.subVectors(As,bs),Ri.subVectors(Cs,As),Ji.subVectors(bs,Cs);let e=[0,-Pi.z,Pi.y,0,-Ri.z,Ri.y,0,-Ji.z,Ji.y,Pi.z,0,-Pi.x,Ri.z,0,-Ri.x,Ji.z,0,-Ji.x,-Pi.y,Pi.x,0,-Ri.y,Ri.x,0,-Ji.y,Ji.x,0];return!Dl(e,bs,As,Cs,go)||(e=[1,0,0,0,1,0,0,0,1],!Dl(e,bs,As,Cs,go))?!1:(_o.crossVectors(Pi,Ri),e=[_o.x,_o.y,_o.z],Dl(e,bs,As,Cs,go))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Nn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Nn).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:(ci[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ci[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ci[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ci[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ci[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ci[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ci[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ci[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ci),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 ci=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],Nn=new Y,mo=new Ts,bs=new Y,As=new Y,Cs=new Y,Pi=new Y,Ri=new Y,Ji=new Y,fr=new Y,go=new Y,_o=new Y,Ki=new Y;function Dl(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){Ki.fromArray(n,a);const h=r.x*Math.abs(Ki.x)+r.y*Math.abs(Ki.y)+r.z*Math.abs(Ki.z),u=t.dot(Ki),d=e.dot(Ki),p=s.dot(Ki);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const Tv=new Ts,pr=new Y,kl=new Y;class vo{constructor(t=new Y,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):Tv.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;pr.subVectors(t,this.center);const e=pr.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(pr,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):(kl.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(pr.copy(t.center).add(kl)),this.expandByPoint(pr.copy(t.center).sub(kl))),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 hi=new Y,Ul=new Y,yo=new Y,Li=new Y,Ol=new Y,Eo=new Y,Nl=new Y;class Bl{constructor(t=new Y,e=new Y(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,hi)),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=hi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(hi.copy(this.origin).addScaledVector(this.direction,e),hi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){Ul.copy(t).add(e).multiplyScalar(.5),yo.copy(e).sub(t).normalize(),Li.copy(this.origin).sub(Ul);const a=t.distanceTo(e)*.5,l=-this.direction.dot(yo),h=Li.dot(this.direction),u=-Li.dot(yo),d=Li.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(Ul).addScaledVector(yo,_),E}intersectSphere(t,e){hi.subVectors(t.center,this.origin);const s=hi.dot(this.direction),r=hi.dot(hi)-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,hi)!==null}intersectTriangle(t,e,s,r,a){Ol.subVectors(e,t),Eo.subVectors(s,t),Nl.crossVectors(Ol,Eo);let l=this.direction.dot(Nl),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Li.subVectors(this.origin,t);const u=h*this.direction.dot(Eo.crossVectors(Li,Eo));if(u<0)return null;const d=h*this.direction.dot(Ol.cross(Li));if(d<0||u+d>l)return null;const p=-h*Li.dot(Nl);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 Ue{constructor(t,e,s,r,a,l,h,u,d,p,m,_,E,S,w,v){Ue.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 Ue().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/Ps.setFromMatrixColumn(t,0).length(),a=1/Ps.setFromMatrixColumn(t,1).length(),l=1/Ps.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(bv,t,Av)}lookAt(t,e,s){const r=this.elements;return yn.subVectors(t,e),yn.lengthSq()===0&&(yn.z=1),yn.normalize(),Ii.crossVectors(s,yn),Ii.lengthSq()===0&&(Math.abs(s.z)===1?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),Ii.crossVectors(s,yn)),Ii.normalize(),xo.crossVectors(yn,Ii),r[0]=Ii.x,r[4]=xo.x,r[8]=yn.x,r[1]=Ii.y,r[5]=xo.y,r[9]=yn.y,r[2]=Ii.z,r[6]=xo.z,r[10]=yn.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],D=s[3],C=s[7],A=s[11],U=s[15],B=r[0],N=r[4],F=r[8],I=r[12],M=r[1],k=r[5],H=r[9],Z=r[13],Q=r[2],at=r[6],$=r[10],dt=r[14],G=r[3],it=r[7],tt=r[11],gt=r[15];return a[0]=l*B+h*M+u*Q+d*G,a[4]=l*N+h*k+u*at+d*it,a[8]=l*F+h*H+u*$+d*tt,a[12]=l*I+h*Z+u*dt+d*gt,a[1]=p*B+m*M+_*Q+E*G,a[5]=p*N+m*k+_*at+E*it,a[9]=p*F+m*H+_*$+E*tt,a[13]=p*I+m*Z+_*dt+E*gt,a[2]=S*B+w*M+v*Q+g*G,a[6]=S*N+w*k+v*at+g*it,a[10]=S*F+w*H+v*$+g*tt,a[14]=S*I+w*Z+v*dt+g*gt,a[3]=D*B+C*M+A*Q+U*G,a[7]=D*N+C*k+A*at+U*it,a[11]=D*F+C*H+A*$+U*tt,a[15]=D*I+C*Z+A*dt+U*gt,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],D=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,A=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,B=e*D+s*C+r*A+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]=D*N,t[1]=(w*_*a-m*v*a-w*r*E+s*v*E+m*r*g-s*_*g)*N,t[2]=(h*v*a-w*u*a+w*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]=C*N,t[5]=(p*v*a-S*_*a+S*r*E-e*v*E-p*r*g+e*_*g)*N,t[6]=(S*u*a-l*v*a-S*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]=A*N,t[9]=(S*m*a-p*w*a-S*s*E+e*w*E+p*s*g-e*m*g)*N,t[10]=(l*w*a-S*h*a+S*s*d-e*w*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*w*r-S*m*r+S*s*_-e*w*_-p*s*v+e*m*v)*N,t[14]=(S*h*r-l*w*r-S*s*u+e*w*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,S=a*m,w=l*p,v=l*m,g=h*m,D=u*d,C=u*p,A=u*m,U=s.x,B=s.y,N=s.z;return r[0]=(1-(w+g))*U,r[1]=(E+A)*U,r[2]=(S-C)*U,r[3]=0,r[4]=(E-A)*B,r[5]=(1-(_+g))*B,r[6]=(v+D)*B,r[7]=0,r[8]=(S+C)*N,r[9]=(v-D)*N,r[10]=(1-(_+w))*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=Ps.set(r[0],r[1],r[2]).length();const l=Ps.set(r[4],r[5],r[6]).length(),h=Ps.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],Bn.copy(this);const d=1/a,p=1/l,m=1/h;return Bn.elements[0]*=d,Bn.elements[1]*=d,Bn.elements[2]*=d,Bn.elements[4]*=p,Bn.elements[5]*=p,Bn.elements[6]*=p,Bn.elements[8]*=m,Bn.elements[9]*=m,Bn.elements[10]*=m,e.setFromRotationMatrix(Bn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=Xn,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===Xn)S=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(h===po)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=Xn,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===Xn)S=-2/(l-a),w=-(l+a)/(l-a);else if(h===po)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 Ps=new Y,Bn=new Ue,bv=new Y(0,0,0),Av=new Y(1,1,1),Ii=new Y,xo=new Y,yn=new Y,Jh=new Ue,Kh=new ji;class Yn{constructor(t=0,e=0,s=0,r=Yn.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 Jh.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Jh,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Kh.setFromEuler(this),this.setFromQuaternion(Kh,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}}Yn.DEFAULT_ORDER="XYZ";class Fl{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 Cv=0;const $h=new Y,Rs=new ji,ui=new Ue,wo=new Y,mr=new Y,Pv=new Y,Rv=new ji,tu=new Y(1,0,0),eu=new Y(0,1,0),nu=new Y(0,0,1),iu={type:"added"},Lv={type:"removed"},Ls={type:"childadded",child:null},zl={type:"childremoved",child:null};class on extends ys{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Cv++}),this.uuid=Es(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=on.DEFAULT_UP.clone();const t=new Y,e=new Yn,s=new ji,r=new Y(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 Ue},normalMatrix:{value:new ue}}),this.matrix=new Ue,this.matrixWorld=new Ue,this.matrixAutoUpdate=on.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Fl,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 Rs.setFromAxisAngle(t,e),this.quaternion.multiply(Rs),this}rotateOnWorldAxis(t,e){return Rs.setFromAxisAngle(t,e),this.quaternion.premultiply(Rs),this}rotateX(t){return this.rotateOnAxis(tu,t)}rotateY(t){return this.rotateOnAxis(eu,t)}rotateZ(t){return this.rotateOnAxis(nu,t)}translateOnAxis(t,e){return $h.copy(t).applyQuaternion(this.quaternion),this.position.add($h.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(tu,t)}translateY(t){return this.translateOnAxis(eu,t)}translateZ(t){return this.translateOnAxis(nu,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ui.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?wo.copy(t):wo.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),mr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ui.lookAt(mr,wo,this.up):ui.lookAt(wo,mr,this.up),this.quaternion.setFromRotationMatrix(ui),r&&(ui.extractRotation(r.matrixWorld),Rs.setFromRotationMatrix(ui),this.quaternion.premultiply(Rs.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(iu),Ls.child=t,this.dispatchEvent(Ls),Ls.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(Lv),zl.child=t,this.dispatchEvent(zl),zl.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),ui.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ui.multiply(t.parent.matrixWorld)),t.applyMatrix4(ui),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(iu),Ls.child=t,this.dispatchEvent(Ls),Ls.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(mr,t,Pv),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mr,Rv,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}}on.DEFAULT_UP=new Y(0,1,0),on.DEFAULT_MATRIX_AUTO_UPDATE=!0,on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Fn=new Y,di=new Y,Hl=new Y,fi=new Y,Is=new Y,Ds=new Y,su=new Y,Vl=new Y,Gl=new Y,Wl=new Y,Zl=new Fe,Xl=new Fe,Yl=new Fe;class zn{constructor(t=new Y,e=new Y,s=new Y){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Fn.subVectors(t,e),r.cross(Fn);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){Fn.subVectors(r,e),di.subVectors(s,e),Hl.subVectors(t,e);const l=Fn.dot(Fn),h=Fn.dot(di),u=Fn.dot(Hl),d=di.dot(di),p=di.dot(Hl),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,fi)===null?!1:fi.x>=0&&fi.y>=0&&fi.x+fi.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,fi)===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,fi.x),u.addScaledVector(l,fi.y),u.addScaledVector(h,fi.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return Zl.setScalar(0),Xl.setScalar(0),Yl.setScalar(0),Zl.fromBufferAttribute(t,e),Xl.fromBufferAttribute(t,s),Yl.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(Zl,a.x),l.addScaledVector(Xl,a.y),l.addScaledVector(Yl,a.z),l}static isFrontFacing(t,e,s,r){return Fn.subVectors(s,e),di.subVectors(t,e),Fn.cross(di).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 Fn.subVectors(this.c,this.b),di.subVectors(this.a,this.b),Fn.cross(di).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return zn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return zn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return zn.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;Is.subVectors(r,s),Ds.subVectors(a,s),Vl.subVectors(t,s);const u=Is.dot(Vl),d=Ds.dot(Vl);if(u<=0&&d<=0)return e.copy(s);Gl.subVectors(t,r);const p=Is.dot(Gl),m=Ds.dot(Gl);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(Is,l);Wl.subVectors(t,a);const E=Is.dot(Wl),S=Ds.dot(Wl);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(Ds,h);const v=p*S-E*m;if(v<=0&&m-p>=0&&E-S>=0)return su.subVectors(a,r),h=(m-p)/(m-p+(E-S)),e.copy(r).addScaledVector(su,h);const g=1/(v+w+_);return l=w*g,h=_*g,e.copy(s).addScaledVector(Is,l).addScaledVector(Ds,h)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const ru={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},Di={h:0,s:0,l:0},So={h:0,s:0,l:0};function ql(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 Ce{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=An){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,we.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=we.workingColorSpace){return this.r=t,this.g=e,this.b=s,we.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=we.workingColorSpace){if(t=Al(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=ql(l,a,t+1/3),this.g=ql(l,a,t),this.b=ql(l,a,t-1/3)}return we.colorSpaceToWorking(this,r),this}setStyle(t,e=An){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=An){const s=ru[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=li(t.r),this.g=li(t.g),this.b=li(t.b),this}copyLinearToSRGB(t){return this.r=Ss(t.r),this.g=Ss(t.g),this.b=Ss(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=An){return we.workingToColorSpace(sn.copy(this),t),Math.round(me(sn.r*255,0,255))*65536+Math.round(me(sn.g*255,0,255))*256+Math.round(me(sn.b*255,0,255))}getHexString(t=An){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=we.workingColorSpace){we.workingToColorSpace(sn.copy(this),e);const s=sn.r,r=sn.g,a=sn.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=we.workingColorSpace){return we.workingToColorSpace(sn.copy(this),e),t.r=sn.r,t.g=sn.g,t.b=sn.b,t}getStyle(t=An){we.workingToColorSpace(sn.copy(this),t);const e=sn.r,s=sn.g,r=sn.b;return t!==An?`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(Di),this.setHSL(Di.h+t,Di.s+e,Di.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(Di),t.getHSL(So);const s=ur(Di.h,So.h,e),r=ur(Di.s,So.s,e),a=ur(Di.l,So.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 sn=new Ce;Ce.NAMES=ru;let Iv=0;class gr extends ys{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Iv++}),this.uuid=Es(),this.name="",this.type="Material",this.blending=ps,this.side=Si,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Ua,this.blendDst=Oa,this.blendEquation=Xi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ce(0,0,0),this.blendAlpha=0,this.depthFunc=ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=zh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=vs,this.stencilZFail=vs,this.stencilZPass=vs,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!==ps&&(s.blending=this.blending),this.side!==Si&&(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!==Ua&&(s.blendSrc=this.blendSrc),this.blendDst!==Oa&&(s.blendDst=this.blendDst),this.blendEquation!==Xi&&(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!==zh&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==vs&&(s.stencilFail=this.stencilFail),this.stencilZFail!==vs&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==vs&&(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 ki extends gr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(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 Yn,this.combine=Ph,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 ze=new Y,Mo=new be;let Dv=0;class qn{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:Dv++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=Vh,this.updateRanges=[],this.gpuType=ai,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++)Mo.fromBufferAttribute(this,e),Mo.applyMatrix3(t),this.setXY(e,Mo.x,Mo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyMatrix3(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyMatrix4(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyNormalMatrix(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.transformDirection(t),this.setXYZ(e,ze.x,ze.y,ze.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=xs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=rn(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=xs(e,this.array)),e}setX(t,e){return this.normalized&&(e=rn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=xs(e,this.array)),e}setY(t,e){return this.normalized&&(e=rn(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=xs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=rn(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=xs(e,this.array)),e}setW(t,e){return this.normalized&&(e=rn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=rn(e,this.array),s=rn(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=rn(e,this.array),s=rn(s,this.array),r=rn(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=rn(e,this.array),s=rn(s,this.array),r=rn(r,this.array),a=rn(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!==Vh&&(t.usage=this.usage),t}}class ou extends qn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class au extends qn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class En extends qn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let kv=0;const Cn=new Ue,Ql=new on,ks=new Y,xn=new Ts,_r=new Ts,Xe=new Y;class Qn extends ys{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:kv++}),this.uuid=Es(),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(Xh(t)?au:ou)(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 Cn.makeRotationFromQuaternion(t),this.applyMatrix4(Cn),this}rotateX(t){return Cn.makeRotationX(t),this.applyMatrix4(Cn),this}rotateY(t){return Cn.makeRotationY(t),this.applyMatrix4(Cn),this}rotateZ(t){return Cn.makeRotationZ(t),this.applyMatrix4(Cn),this}translate(t,e,s){return Cn.makeTranslation(t,e,s),this.applyMatrix4(Cn),this}scale(t,e,s){return Cn.makeScale(t,e,s),this.applyMatrix4(Cn),this}lookAt(t){return Ql.lookAt(t),Ql.updateMatrix(),this.applyMatrix4(Ql.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.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 En(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 Ts);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 Y(-1/0,-1/0,-1/0),new Y(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];xn.setFromBufferAttribute(a),this.morphTargetsRelative?(Xe.addVectors(this.boundingBox.min,xn.min),this.boundingBox.expandByPoint(Xe),Xe.addVectors(this.boundingBox.max,xn.max),this.boundingBox.expandByPoint(Xe)):(this.boundingBox.expandByPoint(xn.min),this.boundingBox.expandByPoint(xn.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 vo);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 Y,1/0);return}if(t){const s=this.boundingSphere.center;if(xn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];_r.setFromBufferAttribute(h),this.morphTargetsRelative?(Xe.addVectors(xn.min,_r.min),xn.expandByPoint(Xe),Xe.addVectors(xn.max,_r.max),xn.expandByPoint(Xe)):(xn.expandByPoint(_r.min),xn.expandByPoint(_r.max))}xn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Xe.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Xe));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++)Xe.fromBufferAttribute(h,d),u&&(ks.fromBufferAttribute(t,d),Xe.add(ks)),r=Math.max(r,s.distanceToSquared(Xe))}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 qn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let F=0;F<s.count;F++)h[F]=new Y,u[F]=new Y;const d=new Y,p=new Y,m=new Y,_=new be,E=new be,S=new be,w=new Y,v=new Y;function g(F,I,M){d.fromBufferAttribute(s,F),p.fromBufferAttribute(s,I),m.fromBufferAttribute(s,M),_.fromBufferAttribute(a,F),E.fromBufferAttribute(a,I),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[F].add(w),h[I].add(w),h[M].add(w),u[F].add(v),u[I].add(v),u[M].add(v))}let D=this.groups;D.length===0&&(D=[{start:0,count:t.count}]);for(let F=0,I=D.length;F<I;++F){const M=D[F],k=M.start,H=M.count;for(let Z=k,Q=k+H;Z<Q;Z+=3)g(t.getX(Z+0),t.getX(Z+1),t.getX(Z+2))}const C=new Y,A=new Y,U=new Y,B=new Y;function N(F){U.fromBufferAttribute(r,F),B.copy(U);const I=h[F];C.copy(I),C.sub(U.multiplyScalar(U.dot(I))).normalize(),A.crossVectors(B,I);const k=A.dot(u[F])<0?-1:1;l.setXYZW(F,C.x,C.y,C.z,k)}for(let F=0,I=D.length;F<I;++F){const M=D[F],k=M.start,H=M.count;for(let Z=k,Q=k+H;Z<Q;Z+=3)N(t.getX(Z+0)),N(t.getX(Z+1)),N(t.getX(Z+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 qn(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 Y,a=new Y,l=new Y,h=new Y,u=new Y,d=new Y,p=new Y,m=new Y;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++)Xe.fromBufferAttribute(t,e),Xe.normalize(),t.setXYZ(e,Xe.x,Xe.y,Xe.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 qn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Qn,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 lu=new Ue,$i=new Bl,To=new vo,cu=new Y,bo=new Y,Ao=new Y,Co=new Y,jl=new Y,Po=new Y,hu=new Y,Ro=new Y;class dn extends on{constructor(t=new Qn,e=new ki){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){Po.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(jl.fromBufferAttribute(m,t),l?Po.addScaledVector(jl,p):Po.addScaledVector(jl.sub(e),p))}e.add(Po)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),To.copy(s.boundingSphere),To.applyMatrix4(a),$i.copy(t.ray).recast(t.near),!(To.containsPoint($i.origin)===!1&&($i.intersectSphere(To,cu)===null||$i.origin.distanceToSquared(cu)>(t.far-t.near)**2))&&(lu.copy(a).invert(),$i.copy(t.ray).applyMatrix4(lu),!(s.boundingBox!==null&&$i.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,$i)))}_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],D=Math.max(v.start,E.start),C=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let A=D,U=C;A<U;A+=3){const B=h.getX(A),N=h.getX(A+1),F=h.getX(A+2);r=Lo(this,g,t,s,d,p,m,B,N,F),r&&(r.faceIndex=Math.floor(A/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 D=h.getX(v),C=h.getX(v+1),A=h.getX(v+2);r=Lo(this,l,t,s,d,p,m,D,C,A),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],D=Math.max(v.start,E.start),C=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let A=D,U=C;A<U;A+=3){const B=A,N=A+1,F=A+2;r=Lo(this,g,t,s,d,p,m,B,N,F),r&&(r.faceIndex=Math.floor(A/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 D=v,C=v+1,A=v+2;r=Lo(this,l,t,s,d,p,m,D,C,A),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function Uv(n,t,e,s,r,a,l,h){let u;if(t.side===un?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Si,h),u===null)return null;Ro.copy(h),Ro.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Ro);return d<e.near||d>e.far?null:{distance:d,point:Ro.clone(),object:n}}function Lo(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,bo),n.getVertexPosition(u,Ao),n.getVertexPosition(d,Co);const p=Uv(n,t,e,s,bo,Ao,Co,hu);if(p){const m=new Y;zn.getBarycoord(hu,bo,Ao,Co,m),r&&(p.uv=zn.getInterpolatedAttribute(r,h,u,d,m,new be)),a&&(p.uv1=zn.getInterpolatedAttribute(a,h,u,d,m,new be)),l&&(p.normal=zn.getInterpolatedAttribute(l,h,u,d,m,new Y),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new Y,materialIndex:0};zn.getNormal(bo,Ao,Co,_.normal),p.face=_,p.barycoord=m}return p}class vr extends Qn{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 En(d,3)),this.setAttribute("normal",new En(p,3)),this.setAttribute("uv",new En(m,2));function S(w,v,g,D,C,A,U,B,N,F,I){const M=A/N,k=U/F,H=A/2,Z=U/2,Q=B/2,at=N+1,$=F+1;let dt=0,G=0;const it=new Y;for(let tt=0;tt<$;tt++){const gt=tt*k-Z;for(let It=0;It<at;It++){const ee=It*M-H;it[w]=ee*D,it[v]=gt*C,it[g]=Q,d.push(it.x,it.y,it.z),it[w]=0,it[v]=0,it[g]=B>0?1:-1,p.push(it.x,it.y,it.z),m.push(It/N),m.push(1-tt/F),dt+=1}}for(let tt=0;tt<F;tt++)for(let gt=0;gt<N;gt++){const It=_+gt+at*tt,ee=_+gt+at*(tt+1),Yt=_+(gt+1)+at*(tt+1),J=_+(gt+1)+at*tt;u.push(It,ee,J),u.push(ee,Yt,J),G+=6}h.addGroup(E,G,I),E+=G,_+=dt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new vr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Us(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 an(n){const t={};for(let e=0;e<n.length;e++){const s=Us(n[e]);for(const r in s)t[r]=s[r]}return t}function Ov(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function uu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:we.workingColorSpace}const Nv={clone:Us,merge:an};var Bv=`void main() {
|
|
14
|
+
*/const Ua="179",v_=0,Ah=1,y_=2,Ch=1,E_=2,si=3,Si=0,un=1,ri=2,Mi=0,ps=1,Ph=2,Rh=3,Lh=4,x_=5,Xi=100,w_=101,S_=102,M_=103,T_=104,b_=200,A_=201,C_=202,P_=203,Oa=204,Na=205,R_=206,L_=207,I_=208,D_=209,k_=210,U_=211,O_=212,N_=213,B_=214,Ba=0,Fa=1,za=2,ms=3,Ha=4,Va=5,Ga=6,Wa=7,Ih=0,F_=1,z_=2,Ti=0,Dh=1,H_=2,V_=3,G_=4,W_=5,Z_=6,X_=7,kh=300,gs=301,_s=302,Za=303,Xa=304,ro=306,Ya=1e3,Yi=1001,qa=1002,Un=1003,Y_=1004,oo=1005,vn=1006,Qa=1007,bi=1008,oi=1009,Uh=1010,Oh=1011,sr=1012,ja=1013,qi=1014,ai=1015,rr=1016,Ja=1017,Ka=1018,or=1020,Nh=35902,Bh=1021,Fh=1022,On=1023,ar=1026,lr=1027,zh=1028,$a=1029,Hh=1030,tl=1031,el=1033,ao=33776,lo=33777,co=33778,ho=33779,nl=35840,il=35841,sl=35842,rl=35843,ol=36196,al=37492,ll=37496,cl=37808,hl=37809,ul=37810,dl=37811,fl=37812,pl=37813,ml=37814,gl=37815,_l=37816,vl=37817,yl=37818,El=37819,xl=37820,wl=37821,uo=36492,Sl=36494,Ml=36495,Vh=36283,Tl=36284,bl=36285,Al=36286,q_=3200,Q_=3201,j_=0,J_=1,Ai="",An="srgb",Qi="srgb-linear",fo="linear",Le="srgb",vs=7680,Gh=519,K_=512,$_=513,tv=514,Wh=515,ev=516,nv=517,iv=518,sv=519,Zh=35044,Xh="300 es",Xn=2e3,po=2001;class ys{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 nn=["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 Yh=1234567;const cr=Math.PI/180,hr=180/Math.PI;function Es(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(nn[n&255]+nn[n>>8&255]+nn[n>>16&255]+nn[n>>24&255]+"-"+nn[t&255]+nn[t>>8&255]+"-"+nn[t>>16&15|64]+nn[t>>24&255]+"-"+nn[e&63|128]+nn[e>>8&255]+"-"+nn[e>>16&255]+nn[e>>24&255]+nn[s&255]+nn[s>>8&255]+nn[s>>16&255]+nn[s>>24&255]).toLowerCase()}function me(n,t,e){return Math.max(t,Math.min(e,n))}function Cl(n,t){return(n%t+t)%t}function rv(n,t,e,s,r){return s+(n-t)*(r-s)/(e-t)}function ov(n,t,e){return n!==t?(e-n)/(t-n):0}function ur(n,t,e){return(1-e)*n+e*t}function av(n,t,e,s){return ur(n,t,1-Math.exp(-e*s))}function lv(n,t=1){return t-Math.abs(Cl(n,t*2)-t)}function cv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function hv(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function uv(n,t){return n+Math.floor(Math.random()*(t-n+1))}function dv(n,t){return n+Math.random()*(t-n)}function fv(n){return n*(.5-Math.random())}function pv(n){n!==void 0&&(Yh=n);let t=Yh+=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 mv(n){return n*cr}function gv(n){return n*hr}function _v(n){return(n&n-1)===0&&n!==0}function vv(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function yv(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function Ev(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 xs(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 rn(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 xe={DEG2RAD:cr,RAD2DEG:hr,generateUUID:Es,clamp:me,euclideanModulo:Cl,mapLinear:rv,inverseLerp:ov,lerp:ur,damp:av,pingpong:lv,smoothstep:cv,smootherstep:hv,randInt:uv,randFloat:dv,randFloatSpread:fv,seededRandom:pv,degToRad:mv,radToDeg:gv,isPowerOfTwo:_v,ceilPowerOfTwo:vv,floorPowerOfTwo:yv,setQuaternionFromProperEuler:Ev,normalize:rn,denormalize:xs};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 ji{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,D=g>=0?1:-1,C=1-g*g;if(C>Number.EPSILON){const U=Math.sqrt(C),B=Math.atan2(U,g*D);v=Math.sin(v*B)/U,h=Math.sin(h*B)/U}const A=h*D;if(u=u*v+_*A,d=d*v+E*A,p=p*v+S*A,m=m*v+w*A,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 Y{constructor(t=0,e=0,s=0){Y.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(qh.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(qh.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 Pl.copy(this).projectOnVector(t),this.sub(Pl)}reflect(t){return this.sub(Pl.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 Pl=new Y,qh=new ji;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],D=r[1],C=r[4],A=r[7],U=r[2],B=r[5],N=r[8];return a[0]=l*w+h*D+u*U,a[3]=l*v+h*C+u*B,a[6]=l*g+h*A+u*N,a[1]=d*w+p*D+m*U,a[4]=d*v+p*C+m*B,a[7]=d*g+p*A+m*N,a[2]=_*w+E*D+S*U,a[5]=_*v+E*C+S*B,a[8]=_*g+E*A+S*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,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(Rl.makeScale(t,e)),this}rotate(t){return this.premultiply(Rl.makeRotation(-t)),this}translate(t,e){return this.premultiply(Rl.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 Rl=new ue;function Qh(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function dr(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function xv(){const n=dr("canvas");return n.style.display="block",n}const jh={};function ws(n){n in jh||(jh[n]=!0,console.warn(n))}function wv(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 Jh=new ue().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Kh=new ue().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Sv(){const n={enabled:!0,workingColorSpace:Qi,spaces:{},convert:function(r,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Le&&(r.r=li(r.r),r.g=li(r.g),r.b=li(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===Le&&(r.r=Ss(r.r),r.g=Ss(r.g),r.b=Ss(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===Ai?fo: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 ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),n.workingToColorSpace(r,a)},toWorkingColorSpace:function(r,a){return ws("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({[Qi]:{primaries:t,whitePoint:s,transfer:fo,toXYZ:Jh,fromXYZ:Kh,luminanceCoefficients:e,workingColorSpaceConfig:{unpackColorSpace:An},outputColorSpaceConfig:{drawingBufferColorSpace:An}},[An]:{primaries:t,whitePoint:s,transfer:Le,toXYZ:Jh,fromXYZ:Kh,luminanceCoefficients:e,outputColorSpaceConfig:{drawingBufferColorSpace:An}}}),n}const we=Sv();function li(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function Ss(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}let Ms;class Mv{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{Ms===void 0&&(Ms=dr("canvas")),Ms.width=t.width,Ms.height=t.height;const r=Ms.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),s=Ms}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=dr("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]=li(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(li(e[s]/255)*255):e[s]=li(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 Tv=0;class Ll{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Tv++}),this.uuid=Es(),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(Il(r[l].image)):a.push(Il(r[l]))}else a=Il(r);s.url=a}return e||(t.images[this.uuid]=s),s}}function Il(n){return typeof HTMLImageElement<"u"&&n instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&n instanceof ImageBitmap?Mv.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 bv=0;const Dl=new Y;class je extends ys{constructor(t=je.DEFAULT_IMAGE,e=je.DEFAULT_MAPPING,s=Yi,r=Yi,a=vn,l=bi,h=On,u=oi,d=je.DEFAULT_ANISOTROPY,p=Ai){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:bv++}),this.uuid=Es(),this.name="",this.source=new Ll(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(Dl).x}get height(){return this.source.getSize(Dl).y}get depth(){return this.source.getSize(Dl).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!==kh)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Ya:t.x=t.x-Math.floor(t.x);break;case Yi:t.x=t.x<0?0:1;break;case qa: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 Ya:t.y=t.y-Math.floor(t.y);break;case Yi:t.y=t.y<0?0:1;break;case qa: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=kh,je.DEFAULT_ANISOTROPY=1;class Fe{constructor(t=0,e=0,s=0,r=1){Fe.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,A=(E+1)/2,U=(g+1)/2,B=(p+_)/4,N=(m+w)/4,F=(S+v)/4;return C>A&&C>U?C<.01?(s=0,r=.707106781,a=.707106781):(s=Math.sqrt(C),r=B/s,a=N/s):A>U?A<.01?(s=.707106781,r=0,a=.707106781):(r=Math.sqrt(A),s=B/r,a=F/r):U<.01?(s=.707106781,r=.707106781,a=0):(a=Math.sqrt(U),s=N/a,r=F/a),this.set(s,r,a,e),this}let D=Math.sqrt((v-S)*(v-S)+(m-w)*(m-w)+(_-p)*(_-p));return Math.abs(D)<.001&&(D=1),this.x=(v-S)/D,this.y=(m-w)/D,this.z=(_-p)/D,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 Av extends ys{constructor(t=1,e=1,s={}){super(),s=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:vn,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 Fe(0,0,t,e),this.scissorTest=!1,this.viewport=new Fe(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:vn,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 Ll(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 Ci extends Av{constructor(t=1,e=1,s={}){super(t,e,s),this.isWebGLRenderTarget=!0}}class $h 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=Un,this.minFilter=Un,this.wrapR=Yi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}}class Cv 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=Un,this.minFilter=Un,this.wrapR=Yi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Ts{constructor(t=new Y(1/0,1/0,1/0),e=new Y(-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(Nn.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,s=t.count;e<s;e++)this.expandByPoint(Nn.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=Nn.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,Nn):Nn.fromBufferAttribute(a,l),Nn.applyMatrix4(t.matrixWorld),this.expandByPoint(Nn);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),mo.copy(t.boundingBox)):(s.boundingBox===null&&s.computeBoundingBox(),mo.copy(s.boundingBox)),mo.applyMatrix4(t.matrixWorld),this.union(mo)}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,Nn),Nn.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(fr),go.subVectors(this.max,fr),bs.subVectors(t.a,fr),As.subVectors(t.b,fr),Cs.subVectors(t.c,fr),Pi.subVectors(As,bs),Ri.subVectors(Cs,As),Ji.subVectors(bs,Cs);let e=[0,-Pi.z,Pi.y,0,-Ri.z,Ri.y,0,-Ji.z,Ji.y,Pi.z,0,-Pi.x,Ri.z,0,-Ri.x,Ji.z,0,-Ji.x,-Pi.y,Pi.x,0,-Ri.y,Ri.x,0,-Ji.y,Ji.x,0];return!kl(e,bs,As,Cs,go)||(e=[1,0,0,0,1,0,0,0,1],!kl(e,bs,As,Cs,go))?!1:(_o.crossVectors(Pi,Ri),e=[_o.x,_o.y,_o.z],kl(e,bs,As,Cs,go))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Nn).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Nn).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:(ci[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ci[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ci[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ci[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ci[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ci[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ci[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ci[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ci),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 ci=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],Nn=new Y,mo=new Ts,bs=new Y,As=new Y,Cs=new Y,Pi=new Y,Ri=new Y,Ji=new Y,fr=new Y,go=new Y,_o=new Y,Ki=new Y;function kl(n,t,e,s,r){for(let a=0,l=n.length-3;a<=l;a+=3){Ki.fromArray(n,a);const h=r.x*Math.abs(Ki.x)+r.y*Math.abs(Ki.y)+r.z*Math.abs(Ki.z),u=t.dot(Ki),d=e.dot(Ki),p=s.dot(Ki);if(Math.max(-Math.max(u,d,p),Math.min(u,d,p))>h)return!1}return!0}const Pv=new Ts,pr=new Y,Ul=new Y;class vo{constructor(t=new Y,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):Pv.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;pr.subVectors(t,this.center);const e=pr.lengthSq();if(e>this.radius*this.radius){const s=Math.sqrt(e),r=(s-this.radius)*.5;this.center.addScaledVector(pr,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):(Ul.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(pr.copy(t.center).add(Ul)),this.expandByPoint(pr.copy(t.center).sub(Ul))),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 hi=new Y,Ol=new Y,yo=new Y,Li=new Y,Nl=new Y,Eo=new Y,Bl=new Y;class Fl{constructor(t=new Y,e=new Y(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,hi)),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=hi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(hi.copy(this.origin).addScaledVector(this.direction,e),hi.distanceToSquared(t))}distanceSqToSegment(t,e,s,r){Ol.copy(t).add(e).multiplyScalar(.5),yo.copy(e).sub(t).normalize(),Li.copy(this.origin).sub(Ol);const a=t.distanceTo(e)*.5,l=-this.direction.dot(yo),h=Li.dot(this.direction),u=-Li.dot(yo),d=Li.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(Ol).addScaledVector(yo,_),E}intersectSphere(t,e){hi.subVectors(t.center,this.origin);const s=hi.dot(this.direction),r=hi.dot(hi)-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,hi)!==null}intersectTriangle(t,e,s,r,a){Nl.subVectors(e,t),Eo.subVectors(s,t),Bl.crossVectors(Nl,Eo);let l=this.direction.dot(Bl),h;if(l>0){if(r)return null;h=1}else if(l<0)h=-1,l=-l;else return null;Li.subVectors(this.origin,t);const u=h*this.direction.dot(Eo.crossVectors(Li,Eo));if(u<0)return null;const d=h*this.direction.dot(Nl.cross(Li));if(d<0||u+d>l)return null;const p=-h*Li.dot(Bl);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/Ps.setFromMatrixColumn(t,0).length(),a=1/Ps.setFromMatrixColumn(t,1).length(),l=1/Ps.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(Rv,t,Lv)}lookAt(t,e,s){const r=this.elements;return yn.subVectors(t,e),yn.lengthSq()===0&&(yn.z=1),yn.normalize(),Ii.crossVectors(s,yn),Ii.lengthSq()===0&&(Math.abs(s.z)===1?yn.x+=1e-4:yn.z+=1e-4,yn.normalize(),Ii.crossVectors(s,yn)),Ii.normalize(),xo.crossVectors(yn,Ii),r[0]=Ii.x,r[4]=xo.x,r[8]=yn.x,r[1]=Ii.y,r[5]=xo.y,r[9]=yn.y,r[2]=Ii.z,r[6]=xo.z,r[10]=yn.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],D=s[3],C=s[7],A=s[11],U=s[15],B=r[0],N=r[4],F=r[8],I=r[12],M=r[1],k=r[5],H=r[9],Z=r[13],j=r[2],at=r[6],$=r[10],dt=r[14],G=r[3],it=r[7],tt=r[11],gt=r[15];return a[0]=l*B+h*M+u*j+d*G,a[4]=l*N+h*k+u*at+d*it,a[8]=l*F+h*H+u*$+d*tt,a[12]=l*I+h*Z+u*dt+d*gt,a[1]=p*B+m*M+_*j+E*G,a[5]=p*N+m*k+_*at+E*it,a[9]=p*F+m*H+_*$+E*tt,a[13]=p*I+m*Z+_*dt+E*gt,a[2]=S*B+w*M+v*j+g*G,a[6]=S*N+w*k+v*at+g*it,a[10]=S*F+w*H+v*$+g*tt,a[14]=S*I+w*Z+v*dt+g*gt,a[3]=D*B+C*M+A*j+U*G,a[7]=D*N+C*k+A*at+U*it,a[11]=D*F+C*H+A*$+U*tt,a[15]=D*I+C*Z+A*dt+U*gt,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],D=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,A=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,B=e*D+s*C+r*A+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]=D*N,t[1]=(w*_*a-m*v*a-w*r*E+s*v*E+m*r*g-s*_*g)*N,t[2]=(h*v*a-w*u*a+w*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]=C*N,t[5]=(p*v*a-S*_*a+S*r*E-e*v*E-p*r*g+e*_*g)*N,t[6]=(S*u*a-l*v*a-S*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]=A*N,t[9]=(S*m*a-p*w*a-S*s*E+e*w*E+p*s*g-e*m*g)*N,t[10]=(l*w*a-S*h*a+S*s*d-e*w*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*w*r-S*m*r+S*s*_-e*w*_-p*s*v+e*m*v)*N,t[14]=(S*h*r-l*w*r-S*s*u+e*w*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,S=a*m,w=l*p,v=l*m,g=h*m,D=u*d,C=u*p,A=u*m,U=s.x,B=s.y,N=s.z;return r[0]=(1-(w+g))*U,r[1]=(E+A)*U,r[2]=(S-C)*U,r[3]=0,r[4]=(E-A)*B,r[5]=(1-(_+g))*B,r[6]=(v+D)*B,r[7]=0,r[8]=(S+C)*N,r[9]=(v-D)*N,r[10]=(1-(_+w))*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=Ps.set(r[0],r[1],r[2]).length();const l=Ps.set(r[4],r[5],r[6]).length(),h=Ps.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],Bn.copy(this);const d=1/a,p=1/l,m=1/h;return Bn.elements[0]*=d,Bn.elements[1]*=d,Bn.elements[2]*=d,Bn.elements[4]*=p,Bn.elements[5]*=p,Bn.elements[6]*=p,Bn.elements[8]*=m,Bn.elements[9]*=m,Bn.elements[10]*=m,e.setFromRotationMatrix(Bn),s.x=a,s.y=l,s.z=h,this}makePerspective(t,e,s,r,a,l,h=Xn,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===Xn)S=-(l+a)/(l-a),w=-2*l*a/(l-a);else if(h===po)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=Xn,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===Xn)S=-2/(l-a),w=-(l+a)/(l-a);else if(h===po)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 Ps=new Y,Bn=new Oe,Rv=new Y(0,0,0),Lv=new Y(1,1,1),Ii=new Y,xo=new Y,yn=new Y,tu=new Oe,eu=new ji;class Yn{constructor(t=0,e=0,s=0,r=Yn.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 tu.makeRotationFromQuaternion(t),this.setFromRotationMatrix(tu,e,s)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return eu.setFromEuler(this),this.setFromQuaternion(eu,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}}Yn.DEFAULT_ORDER="XYZ";class zl{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 Iv=0;const nu=new Y,Rs=new ji,ui=new Oe,wo=new Y,mr=new Y,Dv=new Y,kv=new ji,iu=new Y(1,0,0),su=new Y(0,1,0),ru=new Y(0,0,1),ou={type:"added"},Uv={type:"removed"},Ls={type:"childadded",child:null},Hl={type:"childremoved",child:null};class on extends ys{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Iv++}),this.uuid=Es(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=on.DEFAULT_UP.clone();const t=new Y,e=new Yn,s=new ji,r=new Y(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=on.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new zl,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 Rs.setFromAxisAngle(t,e),this.quaternion.multiply(Rs),this}rotateOnWorldAxis(t,e){return Rs.setFromAxisAngle(t,e),this.quaternion.premultiply(Rs),this}rotateX(t){return this.rotateOnAxis(iu,t)}rotateY(t){return this.rotateOnAxis(su,t)}rotateZ(t){return this.rotateOnAxis(ru,t)}translateOnAxis(t,e){return nu.copy(t).applyQuaternion(this.quaternion),this.position.add(nu.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(iu,t)}translateY(t){return this.translateOnAxis(su,t)}translateZ(t){return this.translateOnAxis(ru,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(ui.copy(this.matrixWorld).invert())}lookAt(t,e,s){t.isVector3?wo.copy(t):wo.set(t,e,s);const r=this.parent;this.updateWorldMatrix(!0,!1),mr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ui.lookAt(mr,wo,this.up):ui.lookAt(wo,mr,this.up),this.quaternion.setFromRotationMatrix(ui),r&&(ui.extractRotation(r.matrixWorld),Rs.setFromRotationMatrix(ui),this.quaternion.premultiply(Rs.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(ou),Ls.child=t,this.dispatchEvent(Ls),Ls.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(Uv),Hl.child=t,this.dispatchEvent(Hl),Hl.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),ui.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),ui.multiply(t.parent.matrixWorld)),t.applyMatrix4(ui),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(ou),Ls.child=t,this.dispatchEvent(Ls),Ls.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(mr,t,Dv),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(mr,kv,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}}on.DEFAULT_UP=new Y(0,1,0),on.DEFAULT_MATRIX_AUTO_UPDATE=!0,on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Fn=new Y,di=new Y,Vl=new Y,fi=new Y,Is=new Y,Ds=new Y,au=new Y,Gl=new Y,Wl=new Y,Zl=new Y,Xl=new Fe,Yl=new Fe,ql=new Fe;class zn{constructor(t=new Y,e=new Y,s=new Y){this.a=t,this.b=e,this.c=s}static getNormal(t,e,s,r){r.subVectors(s,e),Fn.subVectors(t,e),r.cross(Fn);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){Fn.subVectors(r,e),di.subVectors(s,e),Vl.subVectors(t,e);const l=Fn.dot(Fn),h=Fn.dot(di),u=Fn.dot(Vl),d=di.dot(di),p=di.dot(Vl),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,fi)===null?!1:fi.x>=0&&fi.y>=0&&fi.x+fi.y<=1}static getInterpolation(t,e,s,r,a,l,h,u){return this.getBarycoord(t,e,s,r,fi)===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,fi.x),u.addScaledVector(l,fi.y),u.addScaledVector(h,fi.z),u)}static getInterpolatedAttribute(t,e,s,r,a,l){return Xl.setScalar(0),Yl.setScalar(0),ql.setScalar(0),Xl.fromBufferAttribute(t,e),Yl.fromBufferAttribute(t,s),ql.fromBufferAttribute(t,r),l.setScalar(0),l.addScaledVector(Xl,a.x),l.addScaledVector(Yl,a.y),l.addScaledVector(ql,a.z),l}static isFrontFacing(t,e,s,r){return Fn.subVectors(s,e),di.subVectors(t,e),Fn.cross(di).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 Fn.subVectors(this.c,this.b),di.subVectors(this.a,this.b),Fn.cross(di).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return zn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return zn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,s,r,a){return zn.getInterpolation(t,this.a,this.b,this.c,e,s,r,a)}containsPoint(t){return zn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return zn.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;Is.subVectors(r,s),Ds.subVectors(a,s),Gl.subVectors(t,s);const u=Is.dot(Gl),d=Ds.dot(Gl);if(u<=0&&d<=0)return e.copy(s);Wl.subVectors(t,r);const p=Is.dot(Wl),m=Ds.dot(Wl);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(Is,l);Zl.subVectors(t,a);const E=Is.dot(Zl),S=Ds.dot(Zl);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(Ds,h);const v=p*S-E*m;if(v<=0&&m-p>=0&&E-S>=0)return au.subVectors(a,r),h=(m-p)/(m-p+(E-S)),e.copy(r).addScaledVector(au,h);const g=1/(v+w+_);return l=w*g,h=_*g,e.copy(s).addScaledVector(Is,l).addScaledVector(Ds,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},Di={h:0,s:0,l:0},So={h:0,s:0,l:0};function Ql(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 Ce{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=An){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,we.colorSpaceToWorking(this,e),this}setRGB(t,e,s,r=we.workingColorSpace){return this.r=t,this.g=e,this.b=s,we.colorSpaceToWorking(this,r),this}setHSL(t,e,s,r=we.workingColorSpace){if(t=Cl(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=Ql(l,a,t+1/3),this.g=Ql(l,a,t),this.b=Ql(l,a,t-1/3)}return we.colorSpaceToWorking(this,r),this}setStyle(t,e=An){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=An){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=li(t.r),this.g=li(t.g),this.b=li(t.b),this}copyLinearToSRGB(t){return this.r=Ss(t.r),this.g=Ss(t.g),this.b=Ss(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=An){return we.workingToColorSpace(sn.copy(this),t),Math.round(me(sn.r*255,0,255))*65536+Math.round(me(sn.g*255,0,255))*256+Math.round(me(sn.b*255,0,255))}getHexString(t=An){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=we.workingColorSpace){we.workingToColorSpace(sn.copy(this),e);const s=sn.r,r=sn.g,a=sn.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=we.workingColorSpace){return we.workingToColorSpace(sn.copy(this),e),t.r=sn.r,t.g=sn.g,t.b=sn.b,t}getStyle(t=An){we.workingToColorSpace(sn.copy(this),t);const e=sn.r,s=sn.g,r=sn.b;return t!==An?`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(Di),this.setHSL(Di.h+t,Di.s+e,Di.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(Di),t.getHSL(So);const s=ur(Di.h,So.h,e),r=ur(Di.s,So.s,e),a=ur(Di.l,So.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 sn=new Ce;Ce.NAMES=lu;let Ov=0;class gr extends ys{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Ov++}),this.uuid=Es(),this.name="",this.type="Material",this.blending=ps,this.side=Si,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Oa,this.blendDst=Na,this.blendEquation=Xi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ce(0,0,0),this.blendAlpha=0,this.depthFunc=ms,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Gh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=vs,this.stencilZFail=vs,this.stencilZPass=vs,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!==ps&&(s.blending=this.blending),this.side!==Si&&(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!==Oa&&(s.blendSrc=this.blendSrc),this.blendDst!==Na&&(s.blendDst=this.blendDst),this.blendEquation!==Xi&&(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!==Gh&&(s.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(s.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(s.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==vs&&(s.stencilFail=this.stencilFail),this.stencilZFail!==vs&&(s.stencilZFail=this.stencilZFail),this.stencilZPass!==vs&&(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 ki extends gr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ce(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 Yn,this.combine=Ih,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 ze=new Y,Mo=new be;let Nv=0;class qn{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:Nv++}),this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=s,this.usage=Zh,this.updateRanges=[],this.gpuType=ai,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++)Mo.fromBufferAttribute(this,e),Mo.applyMatrix3(t),this.setXY(e,Mo.x,Mo.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyMatrix3(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyMatrix4(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.applyNormalMatrix(t),this.setXYZ(e,ze.x,ze.y,ze.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)ze.fromBufferAttribute(this,e),ze.transformDirection(t),this.setXYZ(e,ze.x,ze.y,ze.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=xs(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=rn(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=xs(e,this.array)),e}setX(t,e){return this.normalized&&(e=rn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=xs(e,this.array)),e}setY(t,e){return this.normalized&&(e=rn(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=xs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=rn(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=xs(e,this.array)),e}setW(t,e){return this.normalized&&(e=rn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=rn(e,this.array),s=rn(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=rn(e,this.array),s=rn(s,this.array),r=rn(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=rn(e,this.array),s=rn(s,this.array),r=rn(r,this.array),a=rn(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!==Zh&&(t.usage=this.usage),t}}class cu extends qn{constructor(t,e,s){super(new Uint16Array(t),e,s)}}class hu extends qn{constructor(t,e,s){super(new Uint32Array(t),e,s)}}class En extends qn{constructor(t,e,s){super(new Float32Array(t),e,s)}}let Bv=0;const Cn=new Oe,jl=new on,ks=new Y,xn=new Ts,_r=new Ts,Xe=new Y;class Qn extends ys{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Bv++}),this.uuid=Es(),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(Qh(t)?hu:cu)(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 Cn.makeRotationFromQuaternion(t),this.applyMatrix4(Cn),this}rotateX(t){return Cn.makeRotationX(t),this.applyMatrix4(Cn),this}rotateY(t){return Cn.makeRotationY(t),this.applyMatrix4(Cn),this}rotateZ(t){return Cn.makeRotationZ(t),this.applyMatrix4(Cn),this}translate(t,e,s){return Cn.makeTranslation(t,e,s),this.applyMatrix4(Cn),this}scale(t,e,s){return Cn.makeScale(t,e,s),this.applyMatrix4(Cn),this}lookAt(t){return jl.lookAt(t),jl.updateMatrix(),this.applyMatrix4(jl.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ks).negate(),this.translate(ks.x,ks.y,ks.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 En(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 Ts);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 Y(-1/0,-1/0,-1/0),new Y(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];xn.setFromBufferAttribute(a),this.morphTargetsRelative?(Xe.addVectors(this.boundingBox.min,xn.min),this.boundingBox.expandByPoint(Xe),Xe.addVectors(this.boundingBox.max,xn.max),this.boundingBox.expandByPoint(Xe)):(this.boundingBox.expandByPoint(xn.min),this.boundingBox.expandByPoint(xn.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 vo);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 Y,1/0);return}if(t){const s=this.boundingSphere.center;if(xn.setFromBufferAttribute(t),e)for(let a=0,l=e.length;a<l;a++){const h=e[a];_r.setFromBufferAttribute(h),this.morphTargetsRelative?(Xe.addVectors(xn.min,_r.min),xn.expandByPoint(Xe),Xe.addVectors(xn.max,_r.max),xn.expandByPoint(Xe)):(xn.expandByPoint(_r.min),xn.expandByPoint(_r.max))}xn.getCenter(s);let r=0;for(let a=0,l=t.count;a<l;a++)Xe.fromBufferAttribute(t,a),r=Math.max(r,s.distanceToSquared(Xe));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++)Xe.fromBufferAttribute(h,d),u&&(ks.fromBufferAttribute(t,d),Xe.add(ks)),r=Math.max(r,s.distanceToSquared(Xe))}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 qn(new Float32Array(4*s.count),4));const l=this.getAttribute("tangent"),h=[],u=[];for(let F=0;F<s.count;F++)h[F]=new Y,u[F]=new Y;const d=new Y,p=new Y,m=new Y,_=new be,E=new be,S=new be,w=new Y,v=new Y;function g(F,I,M){d.fromBufferAttribute(s,F),p.fromBufferAttribute(s,I),m.fromBufferAttribute(s,M),_.fromBufferAttribute(a,F),E.fromBufferAttribute(a,I),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[F].add(w),h[I].add(w),h[M].add(w),u[F].add(v),u[I].add(v),u[M].add(v))}let D=this.groups;D.length===0&&(D=[{start:0,count:t.count}]);for(let F=0,I=D.length;F<I;++F){const M=D[F],k=M.start,H=M.count;for(let Z=k,j=k+H;Z<j;Z+=3)g(t.getX(Z+0),t.getX(Z+1),t.getX(Z+2))}const C=new Y,A=new Y,U=new Y,B=new Y;function N(F){U.fromBufferAttribute(r,F),B.copy(U);const I=h[F];C.copy(I),C.sub(U.multiplyScalar(U.dot(I))).normalize(),A.crossVectors(B,I);const k=A.dot(u[F])<0?-1:1;l.setXYZW(F,C.x,C.y,C.z,k)}for(let F=0,I=D.length;F<I;++F){const M=D[F],k=M.start,H=M.count;for(let Z=k,j=k+H;Z<j;Z+=3)N(t.getX(Z+0)),N(t.getX(Z+1)),N(t.getX(Z+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 qn(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 Y,a=new Y,l=new Y,h=new Y,u=new Y,d=new Y,p=new Y,m=new Y;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++)Xe.fromBufferAttribute(t,e),Xe.normalize(),t.setXYZ(e,Xe.x,Xe.y,Xe.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 qn(_,p,m)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Qn,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 uu=new Oe,$i=new Fl,To=new vo,du=new Y,bo=new Y,Ao=new Y,Co=new Y,Jl=new Y,Po=new Y,fu=new Y,Ro=new Y;class dn extends on{constructor(t=new Qn,e=new ki){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){Po.set(0,0,0);for(let u=0,d=a.length;u<d;u++){const p=h[u],m=a[u];p!==0&&(Jl.fromBufferAttribute(m,t),l?Po.addScaledVector(Jl,p):Po.addScaledVector(Jl.sub(e),p))}e.add(Po)}return e}raycast(t,e){const s=this.geometry,r=this.material,a=this.matrixWorld;r!==void 0&&(s.boundingSphere===null&&s.computeBoundingSphere(),To.copy(s.boundingSphere),To.applyMatrix4(a),$i.copy(t.ray).recast(t.near),!(To.containsPoint($i.origin)===!1&&($i.intersectSphere(To,du)===null||$i.origin.distanceToSquared(du)>(t.far-t.near)**2))&&(uu.copy(a).invert(),$i.copy(t.ray).applyMatrix4(uu),!(s.boundingBox!==null&&$i.intersectsBox(s.boundingBox)===!1)&&this._computeIntersections(t,e,$i)))}_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],D=Math.max(v.start,E.start),C=Math.min(h.count,Math.min(v.start+v.count,E.start+E.count));for(let A=D,U=C;A<U;A+=3){const B=h.getX(A),N=h.getX(A+1),F=h.getX(A+2);r=Lo(this,g,t,s,d,p,m,B,N,F),r&&(r.faceIndex=Math.floor(A/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 D=h.getX(v),C=h.getX(v+1),A=h.getX(v+2);r=Lo(this,l,t,s,d,p,m,D,C,A),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],D=Math.max(v.start,E.start),C=Math.min(u.count,Math.min(v.start+v.count,E.start+E.count));for(let A=D,U=C;A<U;A+=3){const B=A,N=A+1,F=A+2;r=Lo(this,g,t,s,d,p,m,B,N,F),r&&(r.faceIndex=Math.floor(A/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 D=v,C=v+1,A=v+2;r=Lo(this,l,t,s,d,p,m,D,C,A),r&&(r.faceIndex=Math.floor(v/3),e.push(r))}}}}function Fv(n,t,e,s,r,a,l,h){let u;if(t.side===un?u=s.intersectTriangle(l,a,r,!0,h):u=s.intersectTriangle(r,a,l,t.side===Si,h),u===null)return null;Ro.copy(h),Ro.applyMatrix4(n.matrixWorld);const d=e.ray.origin.distanceTo(Ro);return d<e.near||d>e.far?null:{distance:d,point:Ro.clone(),object:n}}function Lo(n,t,e,s,r,a,l,h,u,d){n.getVertexPosition(h,bo),n.getVertexPosition(u,Ao),n.getVertexPosition(d,Co);const p=Fv(n,t,e,s,bo,Ao,Co,fu);if(p){const m=new Y;zn.getBarycoord(fu,bo,Ao,Co,m),r&&(p.uv=zn.getInterpolatedAttribute(r,h,u,d,m,new be)),a&&(p.uv1=zn.getInterpolatedAttribute(a,h,u,d,m,new be)),l&&(p.normal=zn.getInterpolatedAttribute(l,h,u,d,m,new Y),p.normal.dot(s.direction)>0&&p.normal.multiplyScalar(-1));const _={a:h,b:u,c:d,normal:new Y,materialIndex:0};zn.getNormal(bo,Ao,Co,_.normal),p.face=_,p.barycoord=m}return p}class vr extends Qn{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 En(d,3)),this.setAttribute("normal",new En(p,3)),this.setAttribute("uv",new En(m,2));function S(w,v,g,D,C,A,U,B,N,F,I){const M=A/N,k=U/F,H=A/2,Z=U/2,j=B/2,at=N+1,$=F+1;let dt=0,G=0;const it=new Y;for(let tt=0;tt<$;tt++){const gt=tt*k-Z;for(let At=0;At<at;At++){const Jt=At*M-H;it[w]=Jt*D,it[v]=gt*C,it[g]=j,d.push(it.x,it.y,it.z),it[w]=0,it[v]=0,it[g]=B>0?1:-1,p.push(it.x,it.y,it.z),m.push(At/N),m.push(1-tt/F),dt+=1}}for(let tt=0;tt<F;tt++)for(let gt=0;gt<N;gt++){const At=_+gt+at*tt,Jt=_+gt+at*(tt+1),Ft=_+(gt+1)+at*(tt+1),Q=_+(gt+1)+at*tt;u.push(At,Jt,Q),u.push(Jt,Ft,Q),G+=6}h.addGroup(E,G,I),E+=G,_+=dt}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new vr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Us(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 an(n){const t={};for(let e=0;e<n.length;e++){const s=Us(n[e]);for(const r in s)t[r]=s[r]}return t}function zv(n){const t=[];for(let e=0;e<n.length;e++)t.push(n[e].clone());return t}function pu(n){const t=n.getRenderTarget();return t===null?n.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:we.workingColorSpace}const Hv={clone:Us,merge:an};var Vv=`void main() {
|
|
15
15
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
16
|
-
}`,
|
|
16
|
+
}`,Gv=`void main() {
|
|
17
17
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
18
|
-
}`;class pi extends gr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=
|
|
18
|
+
}`;class pi extends gr{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Vv,this.fragmentShader=Gv,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=Us(t.uniforms),this.uniformsGroups=zv(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 mu extends on{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=Xn,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 Ui=new Y,gu=new be,_u=new be;class Pn extends mu{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=hr*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(cr*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return hr*2*Math.atan(Math.tan(cr*.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){Ui.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Ui.x,Ui.y).multiplyScalar(-t/Ui.z),Ui.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),s.set(Ui.x,Ui.y).multiplyScalar(-t/Ui.z)}getViewSize(t,e){return this.getViewBounds(t,gu,_u),e.subVectors(_u,gu)}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(cr*.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 Os=-90,Ns=1;class Wv extends on{constructor(t,e,s){super(),this.type="CubeCamera",this.renderTarget=s,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Pn(Os,Ns,t,e);r.layers=this.layers,this.add(r);const a=new Pn(Os,Ns,t,e);a.layers=this.layers,this.add(a);const l=new Pn(Os,Ns,t,e);l.layers=this.layers,this.add(l);const h=new Pn(Os,Ns,t,e);h.layers=this.layers,this.add(h);const u=new Pn(Os,Ns,t,e);u.layers=this.layers,this.add(u);const d=new Pn(Os,Ns,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===Xn)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===po)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 vu extends je{constructor(t=[],e=gs,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 Zv extends Ci{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 vu(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,13 +50,13 @@
|
|
|
50
50
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
51
51
|
|
|
52
52
|
}
|
|
53
|
-
`},r=new vr(5,5,5),a=new pi({name:"CubemapFromEquirect",uniforms:Us(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:un,blending:Mi});a.uniforms.tEquirect.value=e;const l=new dn(r,a),h=e.minFilter;return e.minFilter===bi&&(e.minFilter=vn),new zv(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 Oi extends on{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Vv={type:"move"};class Jl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Oi,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 Oi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Y,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Y),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Oi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Y,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Y),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(Vv)))}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 Oi;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[e.jointName]=s,t.add(s)}return t.joints[e.jointName]}}class Kl extends on{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 Yn,this.environmentIntensity=1,this.environmentRotation=new Yn,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 $l=new Y,Gv=new Y,Wv=new ue;class ts{constructor(t=new Y(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=$l.subVectors(s,e).cross(Gv.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($l),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||Wv.getNormalMatrix(t),r=this.coplanarPoint($l).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 es=new vo,Zv=new be(.5,.5),Io=new Y;class tc{constructor(t=new ts,e=new ts,s=new ts,r=new ts,a=new ts,l=new ts){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=Xn,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],D=a[12],C=a[13],A=a[14],U=a[15];if(r[0].setComponents(d-l,E-p,g-S,U-D).normalize(),r[1].setComponents(d+l,E+p,g+S,U+D).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,A).normalize(),r[5].setComponents(d-u,E-_,g-v,U-A).normalize();else if(r[4].setComponents(d-u,E-_,g-v,U-A).normalize(),e===Xn)r[5].setComponents(d+u,E+_,g+v,U+A).normalize();else if(e===po)r[5].setComponents(u,_,v,A).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(),es.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),es.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(es)}intersectsSprite(t){es.center.set(0,0,0);const e=Zv.distanceTo(t.center);return es.radius=.7071067811865476+e,es.applyMatrix4(t.matrixWorld),this.intersectsSphere(es)}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(Io.x=r.normal.x>0?t.max.x:t.min.x,Io.y=r.normal.y>0?t.max.y:t.min.y,Io.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Io)<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 Xv extends gr{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ce(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 Do=new Y,ko=new Y,gu=new Ue,yr=new Bl,Uo=new vo,ec=new Y,_u=new Y;class Yv extends on{constructor(t=new Qn,e=new Xv){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++)Do.fromBufferAttribute(e,r-1),ko.fromBufferAttribute(e,r),s[r]=s[r-1],s[r]+=Do.distanceTo(ko);t.setAttribute("lineDistance",new En(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(),Uo.copy(s.boundingSphere),Uo.applyMatrix4(r),Uo.radius+=a,t.ray.intersectsSphere(Uo)===!1)return;gu.copy(r).invert(),yr.copy(t.ray).applyMatrix4(gu);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),D=p.getX(w+1),C=Oo(this,t,yr,u,g,D,w);C&&e.push(C)}if(this.isLineLoop){const w=p.getX(S-1),v=p.getX(E),g=Oo(this,t,yr,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=Oo(this,t,yr,u,w,w+1,w);g&&e.push(g)}if(this.isLineLoop){const w=Oo(this,t,yr,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 Oo(n,t,e,s,r,a,l){const h=n.geometry.attributes.position;if(Do.fromBufferAttribute(h,r),ko.fromBufferAttribute(h,a),e.distanceSqToSegment(Do,ko,ec,_u)>s)return;ec.applyMatrix4(n.matrixWorld);const d=t.ray.origin.distanceTo(ec);if(!(d<t.near||d>t.far))return{distance:d,point:_u.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const vu=new Y,yu=new Y;class qv extends Yv{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)vu.fromBufferAttribute(e,r),yu.fromBufferAttribute(e,r+1),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+vu.distanceTo(yu);t.setAttribute("lineDistance",new En(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Qv extends je{constructor(t,e,s,r,a=vn,l=vn,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 Eu extends je{constructor(t,e,s=qi,r,a,l,h=Un,u=Un,d,p=ar,m=1){if(p!==ar&&p!==lr)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 Rl(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 Er extends Qn{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 D=g*_-l;for(let C=0;C<d;C++){const A=C*m-a;S.push(A,-D,0),w.push(0,0,1),v.push(C/h),v.push(1-g/u)}}for(let g=0;g<u;g++)for(let D=0;D<h;D++){const C=D+d*g,A=D+d*(g+1),U=D+1+d*(g+1),B=D+1+d*g;E.push(C,A,B),E.push(A,U,B)}this.setIndex(E),this.setAttribute("position",new En(S,3)),this.setAttribute("normal",new En(w,3)),this.setAttribute("uv",new En(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Er(t.width,t.height,t.widthSegments,t.heightSegments)}}class Bs extends Qn{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 Y,_=new Y,E=[],S=[],w=[],v=[];for(let g=0;g<=s;g++){const D=[],C=g/s;let A=0;g===0&&l===0?A=.5/e:g===s&&u===Math.PI&&(A=-.5/e);for(let U=0;U<=e;U++){const B=U/e;m.x=-t*Math.cos(r+B*a)*Math.sin(l+C*h),m.y=t*Math.cos(l+C*h),m.z=t*Math.sin(r+B*a)*Math.sin(l+C*h),S.push(m.x,m.y,m.z),_.copy(m).normalize(),w.push(_.x,_.y,_.z),v.push(B+A,1-C),D.push(d++)}p.push(D)}for(let g=0;g<s;g++)for(let D=0;D<e;D++){const C=p[g][D+1],A=p[g][D],U=p[g+1][D],B=p[g+1][D+1];(g!==0||l>0)&&E.push(C,A,B),(g!==s-1||u<Math.PI)&&E.push(A,U,B)}this.setIndex(E),this.setAttribute("position",new En(S,3)),this.setAttribute("normal",new En(w,3)),this.setAttribute("uv",new En(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Bs(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class jv extends Qn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],s=new Set,r=new Y,a=new Y;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),D=h.getX(S+(v+1)%3);r.fromBufferAttribute(l,g),a.fromBufferAttribute(l,D),xu(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),xu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}this.setAttribute("position",new En(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function xu(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 Jv extends gr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=W_,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 Kv extends gr{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 Ni={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 $v{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 t0=new $v;let nc=class{constructor(t){this.manager=t!==void 0?t:t0,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}};nc.DEFAULT_MATERIAL_NAME="__DEFAULT";const mi={};class e0 extends Error{constructor(t,e){super(t),this.response=e}}class n0 extends nc{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=Ni.get(`file:${t}`);if(a!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(a),this.manager.itemEnd(t)},0),a;if(mi[t]!==void 0){mi[t].push({onLoad:e,onProgress:s,onError:r});return}mi[t]=[],mi[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=mi[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){D();function D(){m.read().then(({done:C,value:A})=>{if(C)g.close();else{w+=A.byteLength;const U=new ProgressEvent("progress",{lengthComputable:S,loaded:w,total:E});for(let B=0,N=p.length;B<N;B++){const F=p[B];F.onProgress&&F.onProgress(U)}g.enqueue(A),D()}},C=>{g.error(C)})}}});return new Response(v)}else throw new e0(`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=>{Ni.add(`file:${t}`,d);const p=mi[t];delete mi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onLoad&&E.onLoad(d)}}).catch(d=>{const p=mi[t];if(p===void 0)throw this.manager.itemError(t),d;delete mi[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 Fs=new WeakMap;class i0 extends nc{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=Ni.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=Fs.get(l);m===void 0&&(m=[],Fs.set(l,m)),m.push({onLoad:e,onError:r})}return l}const h=dr("img");function u(){p(),e&&e(this);const m=Fs.get(this)||[];for(let _=0;_<m.length;_++){const E=m[_];E.onLoad&&E.onLoad(this)}Fs.delete(this),a.manager.itemEnd(t)}function d(m){p(),r&&r(m),Ni.remove(`image:${t}`);const _=Fs.get(this)||[];for(let E=0;E<_.length;E++){const S=_[E];S.onError&&S.onError(m)}Fs.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),Ni.add(`image:${t}`,h),a.manager.itemStart(t),h.src=t,h}}class s0 extends du{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 r0 extends Pn{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const wu=new Ue;class o0{constructor(t,e,s=0,r=1/0){this.ray=new Bl(t,e),this.near=s,this.far=r,this.camera=null,this.layers=new Fl,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 wu.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(wu),this}intersectObject(t,e=!0,s=[]){return ic(t,this,s,e),s.sort(Su),s}intersectObjects(t,e=!0,s=[]){for(let r=0,a=t.length;r<a;r++)ic(t[r],this,s,e);return s.sort(Su),s}}function Su(n,t){return n.distance-t.distance}function ic(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++)ic(a[l],t,e,!0)}}function Mu(n,t,e,s){const r=a0(s);switch(e){case Uh:return n*t;case Nh:return n*t/r.components*r.byteLength;case Ka:return n*t/r.components*r.byteLength;case Bh:return n*t*2/r.components*r.byteLength;case $a:return n*t*2/r.components*r.byteLength;case Oh:return n*t*3/r.components*r.byteLength;case On:return n*t*4/r.components*r.byteLength;case tl:return n*t*4/r.components*r.byteLength;case ao:case lo:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case co:case ho:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case nl:case sl:return Math.max(n,16)*Math.max(t,8)/4;case el:case il:return Math.max(n,8)*Math.max(t,8)/2;case rl:case ol:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case al: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 cl:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case hl:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case ul:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case dl:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case fl:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case pl:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case ml:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case gl:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case _l:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case vl:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case yl:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case El:return Math.floor((n+11)/12)*Math.floor((t+9)/10)*16;case xl:return Math.floor((n+11)/12)*Math.floor((t+11)/12)*16;case uo:case wl:case Sl:return Math.ceil(n/4)*Math.ceil(t/4)*16;case Fh:case Ml:return Math.ceil(n/4)*Math.ceil(t/4)*8;case Tl:case bl:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function a0(n){switch(n){case oi:case Ih:return{byteLength:1,components:1};case sr:case Dh:case rr:return{byteLength:2,components:1};case ja:case Ja:return{byteLength:2,components:4};case qi:case Qa:case ai:return{byteLength:4,components:1};case kh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ka}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ka);/**
|
|
53
|
+
`},r=new vr(5,5,5),a=new pi({name:"CubemapFromEquirect",uniforms:Us(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,side:un,blending:Mi});a.uniforms.tEquirect.value=e;const l=new dn(r,a),h=e.minFilter;return e.minFilter===bi&&(e.minFilter=vn),new Wv(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 Oi extends on{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Xv={type:"move"};class Kl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Oi,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 Oi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Y,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Y),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Oi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Y,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Y),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(Xv)))}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 Oi;s.matrixAutoUpdate=!1,s.visible=!1,t.joints[e.jointName]=s,t.add(s)}return t.joints[e.jointName]}}class $l extends on{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 Yn,this.environmentIntensity=1,this.environmentRotation=new Yn,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 tc=new Y,Yv=new Y,qv=new ue;class ts{constructor(t=new Y(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=tc.subVectors(s,e).cross(Yv.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(tc),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||qv.getNormalMatrix(t),r=this.coplanarPoint(tc).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 es=new vo,Qv=new be(.5,.5),Io=new Y;class ec{constructor(t=new ts,e=new ts,s=new ts,r=new ts,a=new ts,l=new ts){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=Xn,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],D=a[12],C=a[13],A=a[14],U=a[15];if(r[0].setComponents(d-l,E-p,g-S,U-D).normalize(),r[1].setComponents(d+l,E+p,g+S,U+D).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,A).normalize(),r[5].setComponents(d-u,E-_,g-v,U-A).normalize();else if(r[4].setComponents(d-u,E-_,g-v,U-A).normalize(),e===Xn)r[5].setComponents(d+u,E+_,g+v,U+A).normalize();else if(e===po)r[5].setComponents(u,_,v,A).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(),es.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),es.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(es)}intersectsSprite(t){es.center.set(0,0,0);const e=Qv.distanceTo(t.center);return es.radius=.7071067811865476+e,es.applyMatrix4(t.matrixWorld),this.intersectsSphere(es)}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(Io.x=r.normal.x>0?t.max.x:t.min.x,Io.y=r.normal.y>0?t.max.y:t.min.y,Io.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Io)<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 jv extends gr{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ce(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 Do=new Y,ko=new Y,yu=new Oe,yr=new Fl,Uo=new vo,nc=new Y,Eu=new Y;class Jv extends on{constructor(t=new Qn,e=new jv){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++)Do.fromBufferAttribute(e,r-1),ko.fromBufferAttribute(e,r),s[r]=s[r-1],s[r]+=Do.distanceTo(ko);t.setAttribute("lineDistance",new En(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(),Uo.copy(s.boundingSphere),Uo.applyMatrix4(r),Uo.radius+=a,t.ray.intersectsSphere(Uo)===!1)return;yu.copy(r).invert(),yr.copy(t.ray).applyMatrix4(yu);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),D=p.getX(w+1),C=Oo(this,t,yr,u,g,D,w);C&&e.push(C)}if(this.isLineLoop){const w=p.getX(S-1),v=p.getX(E),g=Oo(this,t,yr,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=Oo(this,t,yr,u,w,w+1,w);g&&e.push(g)}if(this.isLineLoop){const w=Oo(this,t,yr,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 Oo(n,t,e,s,r,a,l){const h=n.geometry.attributes.position;if(Do.fromBufferAttribute(h,r),ko.fromBufferAttribute(h,a),e.distanceSqToSegment(Do,ko,nc,Eu)>s)return;nc.applyMatrix4(n.matrixWorld);const d=t.ray.origin.distanceTo(nc);if(!(d<t.near||d>t.far))return{distance:d,point:Eu.clone().applyMatrix4(n.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:n}}const xu=new Y,wu=new Y;class Kv extends Jv{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)xu.fromBufferAttribute(e,r),wu.fromBufferAttribute(e,r+1),s[r]=r===0?0:s[r-1],s[r+1]=s[r]+xu.distanceTo(wu);t.setAttribute("lineDistance",new En(s,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class $v extends je{constructor(t,e,s,r,a=vn,l=vn,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 Su extends je{constructor(t,e,s=qi,r,a,l,h=Un,u=Un,d,p=ar,m=1){if(p!==ar&&p!==lr)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 Ll(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 Er extends Qn{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 D=g*_-l;for(let C=0;C<d;C++){const A=C*m-a;S.push(A,-D,0),w.push(0,0,1),v.push(C/h),v.push(1-g/u)}}for(let g=0;g<u;g++)for(let D=0;D<h;D++){const C=D+d*g,A=D+d*(g+1),U=D+1+d*(g+1),B=D+1+d*g;E.push(C,A,B),E.push(A,U,B)}this.setIndex(E),this.setAttribute("position",new En(S,3)),this.setAttribute("normal",new En(w,3)),this.setAttribute("uv",new En(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Er(t.width,t.height,t.widthSegments,t.heightSegments)}}class Bs extends Qn{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 Y,_=new Y,E=[],S=[],w=[],v=[];for(let g=0;g<=s;g++){const D=[],C=g/s;let A=0;g===0&&l===0?A=.5/e:g===s&&u===Math.PI&&(A=-.5/e);for(let U=0;U<=e;U++){const B=U/e;m.x=-t*Math.cos(r+B*a)*Math.sin(l+C*h),m.y=t*Math.cos(l+C*h),m.z=t*Math.sin(r+B*a)*Math.sin(l+C*h),S.push(m.x,m.y,m.z),_.copy(m).normalize(),w.push(_.x,_.y,_.z),v.push(B+A,1-C),D.push(d++)}p.push(D)}for(let g=0;g<s;g++)for(let D=0;D<e;D++){const C=p[g][D+1],A=p[g][D],U=p[g+1][D],B=p[g+1][D+1];(g!==0||l>0)&&E.push(C,A,B),(g!==s-1||u<Math.PI)&&E.push(A,U,B)}this.setIndex(E),this.setAttribute("position",new En(S,3)),this.setAttribute("normal",new En(w,3)),this.setAttribute("uv",new En(v,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Bs(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class t0 extends Qn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},t!==null){const e=[],s=new Set,r=new Y,a=new Y;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),D=h.getX(S+(v+1)%3);r.fromBufferAttribute(l,g),a.fromBufferAttribute(l,D),Mu(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),Mu(r,a,s)===!0&&(e.push(r.x,r.y,r.z),e.push(a.x,a.y,a.z))}}this.setAttribute("position",new En(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}function Mu(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 e0 extends gr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=q_,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 n0 extends gr{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 Ni={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 i0{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 s0=new i0;let ic=class{constructor(t){this.manager=t!==void 0?t:s0,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}};ic.DEFAULT_MATERIAL_NAME="__DEFAULT";const mi={};class r0 extends Error{constructor(t,e){super(t),this.response=e}}class o0 extends ic{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=Ni.get(`file:${t}`);if(a!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e&&e(a),this.manager.itemEnd(t)},0),a;if(mi[t]!==void 0){mi[t].push({onLoad:e,onProgress:s,onError:r});return}mi[t]=[],mi[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=mi[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){D();function D(){m.read().then(({done:C,value:A})=>{if(C)g.close();else{w+=A.byteLength;const U=new ProgressEvent("progress",{lengthComputable:S,loaded:w,total:E});for(let B=0,N=p.length;B<N;B++){const F=p[B];F.onProgress&&F.onProgress(U)}g.enqueue(A),D()}},C=>{g.error(C)})}}});return new Response(v)}else throw new r0(`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=>{Ni.add(`file:${t}`,d);const p=mi[t];delete mi[t];for(let m=0,_=p.length;m<_;m++){const E=p[m];E.onLoad&&E.onLoad(d)}}).catch(d=>{const p=mi[t];if(p===void 0)throw this.manager.itemError(t),d;delete mi[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 Fs=new WeakMap;class a0 extends ic{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=Ni.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=Fs.get(l);m===void 0&&(m=[],Fs.set(l,m)),m.push({onLoad:e,onError:r})}return l}const h=dr("img");function u(){p(),e&&e(this);const m=Fs.get(this)||[];for(let _=0;_<m.length;_++){const E=m[_];E.onLoad&&E.onLoad(this)}Fs.delete(this),a.manager.itemEnd(t)}function d(m){p(),r&&r(m),Ni.remove(`image:${t}`);const _=Fs.get(this)||[];for(let E=0;E<_.length;E++){const S=_[E];S.onError&&S.onError(m)}Fs.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),Ni.add(`image:${t}`,h),a.manager.itemStart(t),h.src=t,h}}class l0 extends mu{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 c0 extends Pn{constructor(t=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=t}}const Tu=new Oe;class h0{constructor(t,e,s=0,r=1/0){this.ray=new Fl(t,e),this.near=s,this.far=r,this.camera=null,this.layers=new zl,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 Tu.identity().extractRotation(t.matrixWorld),this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Tu),this}intersectObject(t,e=!0,s=[]){return sc(t,this,s,e),s.sort(bu),s}intersectObjects(t,e=!0,s=[]){for(let r=0,a=t.length;r<a;r++)sc(t[r],this,s,e);return s.sort(bu),s}}function bu(n,t){return n.distance-t.distance}function sc(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++)sc(a[l],t,e,!0)}}function Au(n,t,e,s){const r=u0(s);switch(e){case Bh:return n*t;case zh:return n*t/r.components*r.byteLength;case $a:return n*t/r.components*r.byteLength;case Hh:return n*t*2/r.components*r.byteLength;case tl:return n*t*2/r.components*r.byteLength;case Fh:return n*t*3/r.components*r.byteLength;case On:return n*t*4/r.components*r.byteLength;case el:return n*t*4/r.components*r.byteLength;case ao:case lo:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case co:case ho:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case il:case rl:return Math.max(n,16)*Math.max(t,8)/4;case nl:case sl:return Math.max(n,8)*Math.max(t,8)/2;case ol:case al:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*8;case ll:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case cl:return Math.floor((n+3)/4)*Math.floor((t+3)/4)*16;case hl:return Math.floor((n+4)/5)*Math.floor((t+3)/4)*16;case ul:return Math.floor((n+4)/5)*Math.floor((t+4)/5)*16;case dl:return Math.floor((n+5)/6)*Math.floor((t+4)/5)*16;case fl:return Math.floor((n+5)/6)*Math.floor((t+5)/6)*16;case pl:return Math.floor((n+7)/8)*Math.floor((t+4)/5)*16;case ml:return Math.floor((n+7)/8)*Math.floor((t+5)/6)*16;case gl:return Math.floor((n+7)/8)*Math.floor((t+7)/8)*16;case _l:return Math.floor((n+9)/10)*Math.floor((t+4)/5)*16;case vl:return Math.floor((n+9)/10)*Math.floor((t+5)/6)*16;case yl:return Math.floor((n+9)/10)*Math.floor((t+7)/8)*16;case El:return Math.floor((n+9)/10)*Math.floor((t+9)/10)*16;case xl: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 uo:case Sl:case Ml:return Math.ceil(n/4)*Math.ceil(t/4)*16;case Vh:case Tl:return Math.ceil(n/4)*Math.ceil(t/4)*8;case bl:case Al:return Math.ceil(n/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${e} format.`)}function u0(n){switch(n){case oi:case Uh:return{byteLength:1,components:1};case sr:case Oh:case rr:return{byteLength:2,components:1};case Ja:case Ka:return{byteLength:2,components:4};case qi:case ja:case ai:return{byteLength:4,components:1};case Nh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${n}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Ua}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Ua);/**
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright 2010-2025 Three.js Authors
|
|
56
56
|
* SPDX-License-Identifier: MIT
|
|
57
|
-
*/function
|
|
57
|
+
*/function Cu(){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 d0(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 f0=`#ifdef USE_ALPHAHASH
|
|
58
58
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
59
|
-
#endif`,
|
|
59
|
+
#endif`,p0=`#ifdef USE_ALPHAHASH
|
|
60
60
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
61
61
|
float hash2D( vec2 value ) {
|
|
62
62
|
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
|
@@ -91,20 +91,20 @@
|
|
|
91
91
|
: cases.z;
|
|
92
92
|
return clamp( threshold , 1.0e-6, 1.0 );
|
|
93
93
|
}
|
|
94
|
-
#endif`,
|
|
94
|
+
#endif`,m0=`#ifdef USE_ALPHAMAP
|
|
95
95
|
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
96
|
-
#endif`,
|
|
96
|
+
#endif`,g0=`#ifdef USE_ALPHAMAP
|
|
97
97
|
uniform sampler2D alphaMap;
|
|
98
|
-
#endif`,
|
|
98
|
+
#endif`,_0=`#ifdef USE_ALPHATEST
|
|
99
99
|
#ifdef ALPHA_TO_COVERAGE
|
|
100
100
|
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
|
101
101
|
if ( diffuseColor.a == 0.0 ) discard;
|
|
102
102
|
#else
|
|
103
103
|
if ( diffuseColor.a < alphaTest ) discard;
|
|
104
104
|
#endif
|
|
105
|
-
#endif`,
|
|
105
|
+
#endif`,v0=`#ifdef USE_ALPHATEST
|
|
106
106
|
uniform float alphaTest;
|
|
107
|
-
#endif`,
|
|
107
|
+
#endif`,y0=`#ifdef USE_AOMAP
|
|
108
108
|
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
|
|
109
109
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
|
110
110
|
#if defined( USE_CLEARCOAT )
|
|
@@ -117,10 +117,10 @@
|
|
|
117
117
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
|
118
118
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
|
119
119
|
#endif
|
|
120
|
-
#endif`,
|
|
120
|
+
#endif`,E0=`#ifdef USE_AOMAP
|
|
121
121
|
uniform sampler2D aoMap;
|
|
122
122
|
uniform float aoMapIntensity;
|
|
123
|
-
#endif`,
|
|
123
|
+
#endif`,x0=`#ifdef USE_BATCHING
|
|
124
124
|
#if ! defined( GL_ANGLE_multi_draw )
|
|
125
125
|
#define gl_DrawID _gl_DrawID
|
|
126
126
|
uniform int _gl_DrawID;
|
|
@@ -154,15 +154,15 @@
|
|
|
154
154
|
int y = j / size;
|
|
155
155
|
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
|
|
156
156
|
}
|
|
157
|
-
#endif`,
|
|
157
|
+
#endif`,w0=`#ifdef USE_BATCHING
|
|
158
158
|
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
|
|
159
|
-
#endif`,
|
|
159
|
+
#endif`,S0=`vec3 transformed = vec3( position );
|
|
160
160
|
#ifdef USE_ALPHAHASH
|
|
161
161
|
vPosition = vec3( position );
|
|
162
|
-
#endif`,
|
|
162
|
+
#endif`,M0=`vec3 objectNormal = vec3( normal );
|
|
163
163
|
#ifdef USE_TANGENT
|
|
164
164
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
165
|
-
#endif`,
|
|
165
|
+
#endif`,T0=`float G_BlinnPhong_Implicit( ) {
|
|
166
166
|
return 0.25;
|
|
167
167
|
}
|
|
168
168
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
|
@@ -176,7 +176,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
176
176
|
float G = G_BlinnPhong_Implicit( );
|
|
177
177
|
float D = D_BlinnPhong( shininess, dotNH );
|
|
178
178
|
return F * ( G * D );
|
|
179
|
-
} // validated`,
|
|
179
|
+
} // validated`,b0=`#ifdef USE_IRIDESCENCE
|
|
180
180
|
const mat3 XYZ_TO_REC709 = mat3(
|
|
181
181
|
3.2404542, -0.9692660, 0.0556434,
|
|
182
182
|
-1.5371385, 1.8760108, -0.2040259,
|
|
@@ -239,7 +239,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
239
239
|
}
|
|
240
240
|
return max( I, vec3( 0.0 ) );
|
|
241
241
|
}
|
|
242
|
-
#endif`,
|
|
242
|
+
#endif`,A0=`#ifdef USE_BUMPMAP
|
|
243
243
|
uniform sampler2D bumpMap;
|
|
244
244
|
uniform float bumpScale;
|
|
245
245
|
vec2 dHdxy_fwd() {
|
|
@@ -260,7 +260,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
260
260
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
|
261
261
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
|
262
262
|
}
|
|
263
|
-
#endif`,
|
|
263
|
+
#endif`,C0=`#if NUM_CLIPPING_PLANES > 0
|
|
264
264
|
vec4 plane;
|
|
265
265
|
#ifdef ALPHA_TO_COVERAGE
|
|
266
266
|
float distanceToPlane, distanceGradient;
|
|
@@ -306,26 +306,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
306
306
|
if ( clipped ) discard;
|
|
307
307
|
#endif
|
|
308
308
|
#endif
|
|
309
|
-
#endif`,
|
|
309
|
+
#endif`,P0=`#if NUM_CLIPPING_PLANES > 0
|
|
310
310
|
varying vec3 vClipPosition;
|
|
311
311
|
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
312
|
-
#endif`,
|
|
312
|
+
#endif`,R0=`#if NUM_CLIPPING_PLANES > 0
|
|
313
313
|
varying vec3 vClipPosition;
|
|
314
|
-
#endif`,
|
|
314
|
+
#endif`,L0=`#if NUM_CLIPPING_PLANES > 0
|
|
315
315
|
vClipPosition = - mvPosition.xyz;
|
|
316
|
-
#endif`,
|
|
316
|
+
#endif`,I0=`#if defined( USE_COLOR_ALPHA )
|
|
317
317
|
diffuseColor *= vColor;
|
|
318
318
|
#elif defined( USE_COLOR )
|
|
319
319
|
diffuseColor.rgb *= vColor;
|
|
320
|
-
#endif`,
|
|
320
|
+
#endif`,D0=`#if defined( USE_COLOR_ALPHA )
|
|
321
321
|
varying vec4 vColor;
|
|
322
322
|
#elif defined( USE_COLOR )
|
|
323
323
|
varying vec3 vColor;
|
|
324
|
-
#endif`,
|
|
324
|
+
#endif`,k0=`#if defined( USE_COLOR_ALPHA )
|
|
325
325
|
varying vec4 vColor;
|
|
326
326
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
327
327
|
varying vec3 vColor;
|
|
328
|
-
#endif`,
|
|
328
|
+
#endif`,U0=`#if defined( USE_COLOR_ALPHA )
|
|
329
329
|
vColor = vec4( 1.0 );
|
|
330
330
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
331
331
|
vColor = vec3( 1.0 );
|
|
@@ -339,7 +339,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
339
339
|
#ifdef USE_BATCHING_COLOR
|
|
340
340
|
vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
|
|
341
341
|
vColor.xyz *= batchingColor.xyz;
|
|
342
|
-
#endif`,
|
|
342
|
+
#endif`,O0=`#define PI 3.141592653589793
|
|
343
343
|
#define PI2 6.283185307179586
|
|
344
344
|
#define PI_HALF 1.5707963267948966
|
|
345
345
|
#define RECIPROCAL_PI 0.3183098861837907
|
|
@@ -413,7 +413,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
|
|
|
413
413
|
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
414
414
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
|
415
415
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
|
416
|
-
} // validated`,
|
|
416
|
+
} // validated`,N0=`#ifdef ENVMAP_TYPE_CUBE_UV
|
|
417
417
|
#define cubeUV_minMipLevel 4.0
|
|
418
418
|
#define cubeUV_minTileSize 16.0
|
|
419
419
|
float getFace( vec3 direction ) {
|
|
@@ -506,7 +506,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
|
506
506
|
return vec4( mix( color0, color1, mipF ), 1.0 );
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
|
-
#endif`,
|
|
509
|
+
#endif`,B0=`vec3 transformedNormal = objectNormal;
|
|
510
510
|
#ifdef USE_TANGENT
|
|
511
511
|
vec3 transformedTangent = objectTangent;
|
|
512
512
|
#endif
|
|
@@ -535,21 +535,21 @@ transformedNormal = normalMatrix * transformedNormal;
|
|
|
535
535
|
#ifdef FLIP_SIDED
|
|
536
536
|
transformedTangent = - transformedTangent;
|
|
537
537
|
#endif
|
|
538
|
-
#endif`,
|
|
538
|
+
#endif`,F0=`#ifdef USE_DISPLACEMENTMAP
|
|
539
539
|
uniform sampler2D displacementMap;
|
|
540
540
|
uniform float displacementScale;
|
|
541
541
|
uniform float displacementBias;
|
|
542
|
-
#endif`,
|
|
542
|
+
#endif`,z0=`#ifdef USE_DISPLACEMENTMAP
|
|
543
543
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
544
|
-
#endif`,
|
|
544
|
+
#endif`,H0=`#ifdef USE_EMISSIVEMAP
|
|
545
545
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
546
546
|
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
|
|
547
547
|
emissiveColor = sRGBTransferEOTF( emissiveColor );
|
|
548
548
|
#endif
|
|
549
549
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
550
|
-
#endif`,
|
|
550
|
+
#endif`,V0=`#ifdef USE_EMISSIVEMAP
|
|
551
551
|
uniform sampler2D emissiveMap;
|
|
552
|
-
#endif`,
|
|
552
|
+
#endif`,G0="gl_FragColor = linearToOutputTexel( gl_FragColor );",W0=`vec4 LinearTransferOETF( in vec4 value ) {
|
|
553
553
|
return value;
|
|
554
554
|
}
|
|
555
555
|
vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
@@ -557,7 +557,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
|
557
557
|
}
|
|
558
558
|
vec4 sRGBTransferOETF( in vec4 value ) {
|
|
559
559
|
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
|
|
560
|
-
}`,
|
|
560
|
+
}`,Z0=`#ifdef USE_ENVMAP
|
|
561
561
|
#ifdef ENV_WORLDPOS
|
|
562
562
|
vec3 cameraToFrag;
|
|
563
563
|
if ( isOrthographic ) {
|
|
@@ -586,7 +586,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
586
586
|
#elif defined( ENVMAP_BLENDING_ADD )
|
|
587
587
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
|
588
588
|
#endif
|
|
589
|
-
#endif`,
|
|
589
|
+
#endif`,X0=`#ifdef USE_ENVMAP
|
|
590
590
|
uniform float envMapIntensity;
|
|
591
591
|
uniform float flipEnvMap;
|
|
592
592
|
uniform mat3 envMapRotation;
|
|
@@ -596,7 +596,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
596
596
|
uniform sampler2D envMap;
|
|
597
597
|
#endif
|
|
598
598
|
|
|
599
|
-
#endif`,
|
|
599
|
+
#endif`,Y0=`#ifdef USE_ENVMAP
|
|
600
600
|
uniform float reflectivity;
|
|
601
601
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
602
602
|
#define ENV_WORLDPOS
|
|
@@ -607,7 +607,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
607
607
|
#else
|
|
608
608
|
varying vec3 vReflect;
|
|
609
609
|
#endif
|
|
610
|
-
#endif`,
|
|
610
|
+
#endif`,q0=`#ifdef USE_ENVMAP
|
|
611
611
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
612
612
|
#define ENV_WORLDPOS
|
|
613
613
|
#endif
|
|
@@ -618,7 +618,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
618
618
|
varying vec3 vReflect;
|
|
619
619
|
uniform float refractionRatio;
|
|
620
620
|
#endif
|
|
621
|
-
#endif`,
|
|
621
|
+
#endif`,Q0=`#ifdef USE_ENVMAP
|
|
622
622
|
#ifdef ENV_WORLDPOS
|
|
623
623
|
vWorldPosition = worldPosition.xyz;
|
|
624
624
|
#else
|
|
@@ -635,18 +635,18 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
635
635
|
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
|
|
636
636
|
#endif
|
|
637
637
|
#endif
|
|
638
|
-
#endif`,
|
|
638
|
+
#endif`,j0=`#ifdef USE_FOG
|
|
639
639
|
vFogDepth = - mvPosition.z;
|
|
640
|
-
#endif`,
|
|
640
|
+
#endif`,J0=`#ifdef USE_FOG
|
|
641
641
|
varying float vFogDepth;
|
|
642
|
-
#endif`,
|
|
642
|
+
#endif`,K0=`#ifdef USE_FOG
|
|
643
643
|
#ifdef FOG_EXP2
|
|
644
644
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
|
|
645
645
|
#else
|
|
646
646
|
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
|
|
647
647
|
#endif
|
|
648
648
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
|
649
|
-
#endif
|
|
649
|
+
#endif`,$0=`#ifdef USE_FOG
|
|
650
650
|
uniform vec3 fogColor;
|
|
651
651
|
varying float vFogDepth;
|
|
652
652
|
#ifdef FOG_EXP2
|
|
@@ -655,7 +655,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
655
655
|
uniform float fogNear;
|
|
656
656
|
uniform float fogFar;
|
|
657
657
|
#endif
|
|
658
|
-
#endif`,
|
|
658
|
+
#endif`,ty=`#ifdef USE_GRADIENTMAP
|
|
659
659
|
uniform sampler2D gradientMap;
|
|
660
660
|
#endif
|
|
661
661
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
@@ -667,12 +667,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
|
667
667
|
vec2 fw = fwidth( coord ) * 0.5;
|
|
668
668
|
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
|
|
669
669
|
#endif
|
|
670
|
-
}`,
|
|
670
|
+
}`,ey=`#ifdef USE_LIGHTMAP
|
|
671
671
|
uniform sampler2D lightMap;
|
|
672
672
|
uniform float lightMapIntensity;
|
|
673
|
-
#endif`,
|
|
673
|
+
#endif`,ny=`LambertMaterial material;
|
|
674
674
|
material.diffuseColor = diffuseColor.rgb;
|
|
675
|
-
material.specularStrength = specularStrength
|
|
675
|
+
material.specularStrength = specularStrength;`,iy=`varying vec3 vViewPosition;
|
|
676
676
|
struct LambertMaterial {
|
|
677
677
|
vec3 diffuseColor;
|
|
678
678
|
float specularStrength;
|
|
@@ -686,7 +686,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
|
|
|
686
686
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
687
687
|
}
|
|
688
688
|
#define RE_Direct RE_Direct_Lambert
|
|
689
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,
|
|
689
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,sy=`uniform bool receiveShadow;
|
|
690
690
|
uniform vec3 ambientLightColor;
|
|
691
691
|
#if defined( USE_LIGHT_PROBES )
|
|
692
692
|
uniform vec3 lightProbe[ 9 ];
|
|
@@ -802,7 +802,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
802
802
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
|
803
803
|
return irradiance;
|
|
804
804
|
}
|
|
805
|
-
#endif`,
|
|
805
|
+
#endif`,ry=`#ifdef USE_ENVMAP
|
|
806
806
|
vec3 getIBLIrradiance( const in vec3 normal ) {
|
|
807
807
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
808
808
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
@@ -835,8 +835,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
835
835
|
#endif
|
|
836
836
|
}
|
|
837
837
|
#endif
|
|
838
|
-
#endif`,
|
|
839
|
-
material.diffuseColor = diffuseColor.rgb;`,
|
|
838
|
+
#endif`,oy=`ToonMaterial material;
|
|
839
|
+
material.diffuseColor = diffuseColor.rgb;`,ay=`varying vec3 vViewPosition;
|
|
840
840
|
struct ToonMaterial {
|
|
841
841
|
vec3 diffuseColor;
|
|
842
842
|
};
|
|
@@ -848,11 +848,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
|
|
|
848
848
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
849
849
|
}
|
|
850
850
|
#define RE_Direct RE_Direct_Toon
|
|
851
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,
|
|
851
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,ly=`BlinnPhongMaterial material;
|
|
852
852
|
material.diffuseColor = diffuseColor.rgb;
|
|
853
853
|
material.specularColor = specular;
|
|
854
854
|
material.specularShininess = shininess;
|
|
855
|
-
material.specularStrength = specularStrength;`,
|
|
855
|
+
material.specularStrength = specularStrength;`,cy=`varying vec3 vViewPosition;
|
|
856
856
|
struct BlinnPhongMaterial {
|
|
857
857
|
vec3 diffuseColor;
|
|
858
858
|
vec3 specularColor;
|
|
@@ -869,7 +869,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
|
|
|
869
869
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
870
870
|
}
|
|
871
871
|
#define RE_Direct RE_Direct_BlinnPhong
|
|
872
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,
|
|
872
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,hy=`PhysicalMaterial material;
|
|
873
873
|
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
|
874
874
|
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
|
|
875
875
|
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
|
|
@@ -955,7 +955,7 @@ material.roughness = min( material.roughness, 1.0 );
|
|
|
955
955
|
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
|
|
956
956
|
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
|
|
957
957
|
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
|
|
958
|
-
#endif`,
|
|
958
|
+
#endif`,uy=`struct PhysicalMaterial {
|
|
959
959
|
vec3 diffuseColor;
|
|
960
960
|
float roughness;
|
|
961
961
|
vec3 specularColor;
|
|
@@ -1256,7 +1256,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
|
|
|
1256
1256
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
|
1257
1257
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
|
1258
1258
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
|
1259
|
-
}`,
|
|
1259
|
+
}`,dy=`
|
|
1260
1260
|
vec3 geometryPosition = - vViewPosition;
|
|
1261
1261
|
vec3 geometryNormal = normal;
|
|
1262
1262
|
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
@@ -1371,7 +1371,7 @@ IncidentLight directLight;
|
|
|
1371
1371
|
#if defined( RE_IndirectSpecular )
|
|
1372
1372
|
vec3 radiance = vec3( 0.0 );
|
|
1373
1373
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
1374
|
-
#endif`,
|
|
1374
|
+
#endif`,fy=`#if defined( RE_IndirectDiffuse )
|
|
1375
1375
|
#ifdef USE_LIGHTMAP
|
|
1376
1376
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
|
1377
1377
|
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
|
|
@@ -1390,32 +1390,32 @@ IncidentLight directLight;
|
|
|
1390
1390
|
#ifdef USE_CLEARCOAT
|
|
1391
1391
|
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
|
|
1392
1392
|
#endif
|
|
1393
|
-
#endif`,
|
|
1393
|
+
#endif`,py=`#if defined( RE_IndirectDiffuse )
|
|
1394
1394
|
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
1395
1395
|
#endif
|
|
1396
1396
|
#if defined( RE_IndirectSpecular )
|
|
1397
1397
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
1398
|
-
#endif`,
|
|
1398
|
+
#endif`,my=`#if defined( USE_LOGDEPTHBUF )
|
|
1399
1399
|
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1400
|
-
#endif`,
|
|
1400
|
+
#endif`,gy=`#if defined( USE_LOGDEPTHBUF )
|
|
1401
1401
|
uniform float logDepthBufFC;
|
|
1402
1402
|
varying float vFragDepth;
|
|
1403
1403
|
varying float vIsPerspective;
|
|
1404
|
-
#endif`,
|
|
1404
|
+
#endif`,_y=`#ifdef USE_LOGDEPTHBUF
|
|
1405
1405
|
varying float vFragDepth;
|
|
1406
1406
|
varying float vIsPerspective;
|
|
1407
|
-
#endif`,
|
|
1407
|
+
#endif`,vy=`#ifdef USE_LOGDEPTHBUF
|
|
1408
1408
|
vFragDepth = 1.0 + gl_Position.w;
|
|
1409
1409
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
1410
|
-
#endif`,
|
|
1410
|
+
#endif`,yy=`#ifdef USE_MAP
|
|
1411
1411
|
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
|
|
1412
1412
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
1413
1413
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
|
1414
1414
|
#endif
|
|
1415
1415
|
diffuseColor *= sampledDiffuseColor;
|
|
1416
|
-
#endif`,
|
|
1416
|
+
#endif`,Ey=`#ifdef USE_MAP
|
|
1417
1417
|
uniform sampler2D map;
|
|
1418
|
-
#endif`,
|
|
1418
|
+
#endif`,xy=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
1419
1419
|
#if defined( USE_POINTS_UV )
|
|
1420
1420
|
vec2 uv = vUv;
|
|
1421
1421
|
#else
|
|
@@ -1427,7 +1427,7 @@ IncidentLight directLight;
|
|
|
1427
1427
|
#endif
|
|
1428
1428
|
#ifdef USE_ALPHAMAP
|
|
1429
1429
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
|
1430
|
-
#endif`,
|
|
1430
|
+
#endif`,wy=`#if defined( USE_POINTS_UV )
|
|
1431
1431
|
varying vec2 vUv;
|
|
1432
1432
|
#else
|
|
1433
1433
|
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
@@ -1439,19 +1439,19 @@ IncidentLight directLight;
|
|
|
1439
1439
|
#endif
|
|
1440
1440
|
#ifdef USE_ALPHAMAP
|
|
1441
1441
|
uniform sampler2D alphaMap;
|
|
1442
|
-
#endif`,
|
|
1442
|
+
#endif`,Sy=`float metalnessFactor = metalness;
|
|
1443
1443
|
#ifdef USE_METALNESSMAP
|
|
1444
1444
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
|
1445
1445
|
metalnessFactor *= texelMetalness.b;
|
|
1446
|
-
#endif`,
|
|
1446
|
+
#endif`,My=`#ifdef USE_METALNESSMAP
|
|
1447
1447
|
uniform sampler2D metalnessMap;
|
|
1448
|
-
#endif`,
|
|
1448
|
+
#endif`,Ty=`#ifdef USE_INSTANCING_MORPH
|
|
1449
1449
|
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
1450
1450
|
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
|
1451
1451
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1452
1452
|
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
|
1453
1453
|
}
|
|
1454
|
-
#endif`,
|
|
1454
|
+
#endif`,by=`#if defined( USE_MORPHCOLORS )
|
|
1455
1455
|
vColor *= morphTargetBaseInfluence;
|
|
1456
1456
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1457
1457
|
#if defined( USE_COLOR_ALPHA )
|
|
@@ -1460,12 +1460,12 @@ IncidentLight directLight;
|
|
|
1460
1460
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
|
|
1461
1461
|
#endif
|
|
1462
1462
|
}
|
|
1463
|
-
#endif`,
|
|
1463
|
+
#endif`,Ay=`#ifdef USE_MORPHNORMALS
|
|
1464
1464
|
objectNormal *= morphTargetBaseInfluence;
|
|
1465
1465
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1466
1466
|
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
|
|
1467
1467
|
}
|
|
1468
|
-
#endif`,
|
|
1468
|
+
#endif`,Cy=`#ifdef USE_MORPHTARGETS
|
|
1469
1469
|
#ifndef USE_INSTANCING_MORPH
|
|
1470
1470
|
uniform float morphTargetBaseInfluence;
|
|
1471
1471
|
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
@@ -1479,12 +1479,12 @@ IncidentLight directLight;
|
|
|
1479
1479
|
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
|
|
1480
1480
|
return texelFetch( morphTargetsTexture, morphUV, 0 );
|
|
1481
1481
|
}
|
|
1482
|
-
#endif`,
|
|
1482
|
+
#endif`,Py=`#ifdef USE_MORPHTARGETS
|
|
1483
1483
|
transformed *= morphTargetBaseInfluence;
|
|
1484
1484
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1485
1485
|
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
|
|
1486
1486
|
}
|
|
1487
|
-
#endif`,
|
|
1487
|
+
#endif`,Ry=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
|
1488
1488
|
#ifdef FLAT_SHADED
|
|
1489
1489
|
vec3 fdx = dFdx( vViewPosition );
|
|
1490
1490
|
vec3 fdy = dFdy( vViewPosition );
|
|
@@ -1525,7 +1525,7 @@ IncidentLight directLight;
|
|
|
1525
1525
|
tbn2[1] *= faceDirection;
|
|
1526
1526
|
#endif
|
|
1527
1527
|
#endif
|
|
1528
|
-
vec3 nonPerturbedNormal = normal;`,
|
|
1528
|
+
vec3 nonPerturbedNormal = normal;`,Ly=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
1529
1529
|
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1530
1530
|
#ifdef FLIP_SIDED
|
|
1531
1531
|
normal = - normal;
|
|
@@ -1540,25 +1540,25 @@ vec3 nonPerturbedNormal = normal;`,Ay=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1540
1540
|
normal = normalize( tbn * mapN );
|
|
1541
1541
|
#elif defined( USE_BUMPMAP )
|
|
1542
1542
|
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
|
|
1543
|
-
#endif`,
|
|
1543
|
+
#endif`,Iy=`#ifndef FLAT_SHADED
|
|
1544
1544
|
varying vec3 vNormal;
|
|
1545
1545
|
#ifdef USE_TANGENT
|
|
1546
1546
|
varying vec3 vTangent;
|
|
1547
1547
|
varying vec3 vBitangent;
|
|
1548
1548
|
#endif
|
|
1549
|
-
#endif`,
|
|
1549
|
+
#endif`,Dy=`#ifndef FLAT_SHADED
|
|
1550
1550
|
varying vec3 vNormal;
|
|
1551
1551
|
#ifdef USE_TANGENT
|
|
1552
1552
|
varying vec3 vTangent;
|
|
1553
1553
|
varying vec3 vBitangent;
|
|
1554
1554
|
#endif
|
|
1555
|
-
#endif`,
|
|
1555
|
+
#endif`,ky=`#ifndef FLAT_SHADED
|
|
1556
1556
|
vNormal = normalize( transformedNormal );
|
|
1557
1557
|
#ifdef USE_TANGENT
|
|
1558
1558
|
vTangent = normalize( transformedTangent );
|
|
1559
1559
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
1560
1560
|
#endif
|
|
1561
|
-
#endif`,
|
|
1561
|
+
#endif`,Uy=`#ifdef USE_NORMALMAP
|
|
1562
1562
|
uniform sampler2D normalMap;
|
|
1563
1563
|
uniform vec2 normalScale;
|
|
1564
1564
|
#endif
|
|
@@ -1580,13 +1580,13 @@ vec3 nonPerturbedNormal = normal;`,Ay=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1580
1580
|
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
|
|
1581
1581
|
return mat3( T * scale, B * scale, N );
|
|
1582
1582
|
}
|
|
1583
|
-
#endif`,
|
|
1583
|
+
#endif`,Oy=`#ifdef USE_CLEARCOAT
|
|
1584
1584
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
|
1585
|
-
#endif`,
|
|
1585
|
+
#endif`,Ny=`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
1586
1586
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1587
1587
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
|
1588
1588
|
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
|
|
1589
|
-
#endif`,
|
|
1589
|
+
#endif`,By=`#ifdef USE_CLEARCOATMAP
|
|
1590
1590
|
uniform sampler2D clearcoatMap;
|
|
1591
1591
|
#endif
|
|
1592
1592
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
@@ -1595,18 +1595,18 @@ vec3 nonPerturbedNormal = normal;`,Ay=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1595
1595
|
#endif
|
|
1596
1596
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
1597
1597
|
uniform sampler2D clearcoatRoughnessMap;
|
|
1598
|
-
#endif`,
|
|
1598
|
+
#endif`,Fy=`#ifdef USE_IRIDESCENCEMAP
|
|
1599
1599
|
uniform sampler2D iridescenceMap;
|
|
1600
1600
|
#endif
|
|
1601
1601
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
1602
1602
|
uniform sampler2D iridescenceThicknessMap;
|
|
1603
|
-
#endif`,
|
|
1603
|
+
#endif`,zy=`#ifdef OPAQUE
|
|
1604
1604
|
diffuseColor.a = 1.0;
|
|
1605
1605
|
#endif
|
|
1606
1606
|
#ifdef USE_TRANSMISSION
|
|
1607
1607
|
diffuseColor.a *= material.transmissionAlpha;
|
|
1608
1608
|
#endif
|
|
1609
|
-
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,
|
|
1609
|
+
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Hy=`vec3 packNormalToRGB( const in vec3 normal ) {
|
|
1610
1610
|
return normalize( normal ) * 0.5 + 0.5;
|
|
1611
1611
|
}
|
|
1612
1612
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
|
@@ -1675,9 +1675,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const
|
|
|
1675
1675
|
}
|
|
1676
1676
|
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
|
1677
1677
|
return ( near * far ) / ( ( far - near ) * depth - far );
|
|
1678
|
-
}`,
|
|
1678
|
+
}`,Vy=`#ifdef PREMULTIPLIED_ALPHA
|
|
1679
1679
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
1680
|
-
#endif`,
|
|
1680
|
+
#endif`,Gy=`vec4 mvPosition = vec4( transformed, 1.0 );
|
|
1681
1681
|
#ifdef USE_BATCHING
|
|
1682
1682
|
mvPosition = batchingMatrix * mvPosition;
|
|
1683
1683
|
#endif
|
|
@@ -1685,22 +1685,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
|
|
|
1685
1685
|
mvPosition = instanceMatrix * mvPosition;
|
|
1686
1686
|
#endif
|
|
1687
1687
|
mvPosition = modelViewMatrix * mvPosition;
|
|
1688
|
-
gl_Position = projectionMatrix * mvPosition;`,
|
|
1688
|
+
gl_Position = projectionMatrix * mvPosition;`,Wy=`#ifdef DITHERING
|
|
1689
1689
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
1690
|
-
#endif`,
|
|
1690
|
+
#endif`,Zy=`#ifdef DITHERING
|
|
1691
1691
|
vec3 dithering( vec3 color ) {
|
|
1692
1692
|
float grid_position = rand( gl_FragCoord.xy );
|
|
1693
1693
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
|
1694
1694
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
|
1695
1695
|
return color + dither_shift_RGB;
|
|
1696
1696
|
}
|
|
1697
|
-
#endif`,
|
|
1697
|
+
#endif`,Xy=`float roughnessFactor = roughness;
|
|
1698
1698
|
#ifdef USE_ROUGHNESSMAP
|
|
1699
1699
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
|
1700
1700
|
roughnessFactor *= texelRoughness.g;
|
|
1701
|
-
#endif`,
|
|
1701
|
+
#endif`,Yy=`#ifdef USE_ROUGHNESSMAP
|
|
1702
1702
|
uniform sampler2D roughnessMap;
|
|
1703
|
-
#endif`,
|
|
1703
|
+
#endif`,qy=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1704
1704
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1705
1705
|
#endif
|
|
1706
1706
|
#if NUM_SPOT_LIGHT_MAPS > 0
|
|
@@ -1895,7 +1895,7 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
1895
1895
|
}
|
|
1896
1896
|
return mix( 1.0, shadow, shadowIntensity );
|
|
1897
1897
|
}
|
|
1898
|
-
#endif`,
|
|
1898
|
+
#endif`,Qy=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1899
1899
|
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
|
|
1900
1900
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1901
1901
|
#endif
|
|
@@ -1936,7 +1936,7 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
1936
1936
|
};
|
|
1937
1937
|
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
|
|
1938
1938
|
#endif
|
|
1939
|
-
#endif`,
|
|
1939
|
+
#endif`,jy=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
|
|
1940
1940
|
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
|
|
1941
1941
|
vec4 shadowWorldPosition;
|
|
1942
1942
|
#endif
|
|
@@ -1968,7 +1968,7 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
1968
1968
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
|
1969
1969
|
}
|
|
1970
1970
|
#pragma unroll_loop_end
|
|
1971
|
-
#endif`,
|
|
1971
|
+
#endif`,Jy=`float getShadowMask() {
|
|
1972
1972
|
float shadow = 1.0;
|
|
1973
1973
|
#ifdef USE_SHADOWMAP
|
|
1974
1974
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
@@ -2000,12 +2000,12 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
2000
2000
|
#endif
|
|
2001
2001
|
#endif
|
|
2002
2002
|
return shadow;
|
|
2003
|
-
}`,
|
|
2003
|
+
}`,Ky=`#ifdef USE_SKINNING
|
|
2004
2004
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
|
2005
2005
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
|
2006
2006
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
|
2007
2007
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
|
2008
|
-
#endif
|
|
2008
|
+
#endif`,$y=`#ifdef USE_SKINNING
|
|
2009
2009
|
uniform mat4 bindMatrix;
|
|
2010
2010
|
uniform mat4 bindMatrixInverse;
|
|
2011
2011
|
uniform highp sampler2D boneTexture;
|
|
@@ -2020,7 +2020,7 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
2020
2020
|
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
|
|
2021
2021
|
return mat4( v1, v2, v3, v4 );
|
|
2022
2022
|
}
|
|
2023
|
-
#endif`,
|
|
2023
|
+
#endif`,tE=`#ifdef USE_SKINNING
|
|
2024
2024
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
|
2025
2025
|
vec4 skinned = vec4( 0.0 );
|
|
2026
2026
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
|
@@ -2028,7 +2028,7 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
2028
2028
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
2029
2029
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
2030
2030
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
2031
|
-
#endif`,
|
|
2031
|
+
#endif`,eE=`#ifdef USE_SKINNING
|
|
2032
2032
|
mat4 skinMatrix = mat4( 0.0 );
|
|
2033
2033
|
skinMatrix += skinWeight.x * boneMatX;
|
|
2034
2034
|
skinMatrix += skinWeight.y * boneMatY;
|
|
@@ -2039,17 +2039,17 @@ gl_Position = projectionMatrix * mvPosition;`,zy=`#ifdef DITHERING
|
|
|
2039
2039
|
#ifdef USE_TANGENT
|
|
2040
2040
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
2041
2041
|
#endif
|
|
2042
|
-
#endif`,
|
|
2042
|
+
#endif`,nE=`float specularStrength;
|
|
2043
2043
|
#ifdef USE_SPECULARMAP
|
|
2044
2044
|
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
|
|
2045
2045
|
specularStrength = texelSpecular.r;
|
|
2046
2046
|
#else
|
|
2047
2047
|
specularStrength = 1.0;
|
|
2048
|
-
#endif
|
|
2048
|
+
#endif`,iE=`#ifdef USE_SPECULARMAP
|
|
2049
2049
|
uniform sampler2D specularMap;
|
|
2050
|
-
#endif`,
|
|
2050
|
+
#endif`,sE=`#if defined( TONE_MAPPING )
|
|
2051
2051
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
2052
|
-
#endif`,
|
|
2052
|
+
#endif`,rE=`#ifndef saturate
|
|
2053
2053
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
|
2054
2054
|
#endif
|
|
2055
2055
|
uniform float toneMappingExposure;
|
|
@@ -2146,7 +2146,7 @@ vec3 NeutralToneMapping( vec3 color ) {
|
|
|
2146
2146
|
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
|
|
2147
2147
|
return mix( color, vec3( newPeak ), g );
|
|
2148
2148
|
}
|
|
2149
|
-
vec3 CustomToneMapping( vec3 color ) { return color; }`,
|
|
2149
|
+
vec3 CustomToneMapping( vec3 color ) { return color; }`,oE=`#ifdef USE_TRANSMISSION
|
|
2150
2150
|
material.transmission = transmission;
|
|
2151
2151
|
material.transmissionAlpha = 1.0;
|
|
2152
2152
|
material.thickness = thickness;
|
|
@@ -2167,7 +2167,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2167
2167
|
material.attenuationColor, material.attenuationDistance );
|
|
2168
2168
|
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
|
|
2169
2169
|
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
|
|
2170
|
-
#endif`,
|
|
2170
|
+
#endif`,aE=`#ifdef USE_TRANSMISSION
|
|
2171
2171
|
uniform float transmission;
|
|
2172
2172
|
uniform float thickness;
|
|
2173
2173
|
uniform float attenuationDistance;
|
|
@@ -2293,7 +2293,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2293
2293
|
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
|
|
2294
2294
|
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
|
|
2295
2295
|
}
|
|
2296
|
-
#endif`,
|
|
2296
|
+
#endif`,lE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2297
2297
|
varying vec2 vUv;
|
|
2298
2298
|
#endif
|
|
2299
2299
|
#ifdef USE_MAP
|
|
@@ -2363,7 +2363,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2363
2363
|
#ifdef USE_THICKNESSMAP
|
|
2364
2364
|
uniform mat3 thicknessMapTransform;
|
|
2365
2365
|
varying vec2 vThicknessMapUv;
|
|
2366
|
-
#endif`,
|
|
2366
|
+
#endif`,cE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2367
2367
|
varying vec2 vUv;
|
|
2368
2368
|
#endif
|
|
2369
2369
|
#ifdef USE_MAP
|
|
@@ -2457,7 +2457,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2457
2457
|
#ifdef USE_THICKNESSMAP
|
|
2458
2458
|
uniform mat3 thicknessMapTransform;
|
|
2459
2459
|
varying vec2 vThicknessMapUv;
|
|
2460
|
-
#endif`,
|
|
2460
|
+
#endif`,hE=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2461
2461
|
vUv = vec3( uv, 1 ).xy;
|
|
2462
2462
|
#endif
|
|
2463
2463
|
#ifdef USE_MAP
|
|
@@ -2528,7 +2528,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2528
2528
|
#endif
|
|
2529
2529
|
#ifdef USE_THICKNESSMAP
|
|
2530
2530
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
|
2531
|
-
#endif`,
|
|
2531
|
+
#endif`,uE=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
|
|
2532
2532
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
|
2533
2533
|
#ifdef USE_BATCHING
|
|
2534
2534
|
worldPosition = batchingMatrix * worldPosition;
|
|
@@ -2537,7 +2537,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,nE=`#ifdef USE_TRANSMISS
|
|
|
2537
2537
|
worldPosition = instanceMatrix * worldPosition;
|
|
2538
2538
|
#endif
|
|
2539
2539
|
worldPosition = modelMatrix * worldPosition;
|
|
2540
|
-
#endif`;const de={alphahash_fragment:
|
|
2540
|
+
#endif`;const de={alphahash_fragment:f0,alphahash_pars_fragment:p0,alphamap_fragment:m0,alphamap_pars_fragment:g0,alphatest_fragment:_0,alphatest_pars_fragment:v0,aomap_fragment:y0,aomap_pars_fragment:E0,batching_pars_vertex:x0,batching_vertex:w0,begin_vertex:S0,beginnormal_vertex:M0,bsdfs:T0,iridescence_fragment:b0,bumpmap_pars_fragment:A0,clipping_planes_fragment:C0,clipping_planes_pars_fragment:P0,clipping_planes_pars_vertex:R0,clipping_planes_vertex:L0,color_fragment:I0,color_pars_fragment:D0,color_pars_vertex:k0,color_vertex:U0,common:O0,cube_uv_reflection_fragment:N0,defaultnormal_vertex:B0,displacementmap_pars_vertex:F0,displacementmap_vertex:z0,emissivemap_fragment:H0,emissivemap_pars_fragment:V0,colorspace_fragment:G0,colorspace_pars_fragment:W0,envmap_fragment:Z0,envmap_common_pars_fragment:X0,envmap_pars_fragment:Y0,envmap_pars_vertex:q0,envmap_physical_pars_fragment:ry,envmap_vertex:Q0,fog_vertex:j0,fog_pars_vertex:J0,fog_fragment:K0,fog_pars_fragment:$0,gradientmap_pars_fragment:ty,lightmap_pars_fragment:ey,lights_lambert_fragment:ny,lights_lambert_pars_fragment:iy,lights_pars_begin:sy,lights_toon_fragment:oy,lights_toon_pars_fragment:ay,lights_phong_fragment:ly,lights_phong_pars_fragment:cy,lights_physical_fragment:hy,lights_physical_pars_fragment:uy,lights_fragment_begin:dy,lights_fragment_maps:fy,lights_fragment_end:py,logdepthbuf_fragment:my,logdepthbuf_pars_fragment:gy,logdepthbuf_pars_vertex:_y,logdepthbuf_vertex:vy,map_fragment:yy,map_pars_fragment:Ey,map_particle_fragment:xy,map_particle_pars_fragment:wy,metalnessmap_fragment:Sy,metalnessmap_pars_fragment:My,morphinstance_vertex:Ty,morphcolor_vertex:by,morphnormal_vertex:Ay,morphtarget_pars_vertex:Cy,morphtarget_vertex:Py,normal_fragment_begin:Ry,normal_fragment_maps:Ly,normal_pars_fragment:Iy,normal_pars_vertex:Dy,normal_vertex:ky,normalmap_pars_fragment:Uy,clearcoat_normal_fragment_begin:Oy,clearcoat_normal_fragment_maps:Ny,clearcoat_pars_fragment:By,iridescence_pars_fragment:Fy,opaque_fragment:zy,packing:Hy,premultiplied_alpha_fragment:Vy,project_vertex:Gy,dithering_fragment:Wy,dithering_pars_fragment:Zy,roughnessmap_fragment:Xy,roughnessmap_pars_fragment:Yy,shadowmap_pars_fragment:qy,shadowmap_pars_vertex:Qy,shadowmap_vertex:jy,shadowmask_pars_fragment:Jy,skinbase_vertex:Ky,skinning_pars_vertex:$y,skinning_vertex:tE,skinnormal_vertex:eE,specularmap_fragment:nE,specularmap_pars_fragment:iE,tonemapping_fragment:sE,tonemapping_pars_fragment:rE,transmission_fragment:oE,transmission_pars_fragment:aE,uv_pars_fragment:lE,uv_pars_vertex:cE,uv_vertex:hE,worldpos_vertex:uE,background_vert:`varying vec2 vUv;
|
|
2541
2541
|
uniform mat3 uvTransform;
|
|
2542
2542
|
void main() {
|
|
2543
2543
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
@@ -3593,7 +3593,7 @@ void main() {
|
|
|
3593
3593
|
#include <tonemapping_fragment>
|
|
3594
3594
|
#include <colorspace_fragment>
|
|
3595
3595
|
#include <fog_fragment>
|
|
3596
|
-
}`},Pt={common:{diffuse:{value:new Ce(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 Ce(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 Ce(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 Ce(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}}},jn={basic:{uniforms:an([Pt.common,Pt.specularmap,Pt.envmap,Pt.aomap,Pt.lightmap,Pt.fog]),vertexShader:de.meshbasic_vert,fragmentShader:de.meshbasic_frag},lambert:{uniforms:an([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 Ce(0)}}]),vertexShader:de.meshlambert_vert,fragmentShader:de.meshlambert_frag},phong:{uniforms:an([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 Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:de.meshphong_vert,fragmentShader:de.meshphong_frag},standard:{uniforms:an([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 Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag},toon:{uniforms:an([Pt.common,Pt.aomap,Pt.lightmap,Pt.emissivemap,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.gradientmap,Pt.fog,Pt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:de.meshtoon_vert,fragmentShader:de.meshtoon_frag},matcap:{uniforms:an([Pt.common,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,Pt.fog,{matcap:{value:null}}]),vertexShader:de.meshmatcap_vert,fragmentShader:de.meshmatcap_frag},points:{uniforms:an([Pt.points,Pt.fog]),vertexShader:de.points_vert,fragmentShader:de.points_frag},dashed:{uniforms:an([Pt.common,Pt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:de.linedashed_vert,fragmentShader:de.linedashed_frag},depth:{uniforms:an([Pt.common,Pt.displacementmap]),vertexShader:de.depth_vert,fragmentShader:de.depth_frag},normal:{uniforms:an([Pt.common,Pt.bumpmap,Pt.normalmap,Pt.displacementmap,{opacity:{value:1}}]),vertexShader:de.meshnormal_vert,fragmentShader:de.meshnormal_frag},sprite:{uniforms:an([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:an([Pt.common,Pt.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:de.distanceRGBA_vert,fragmentShader:de.distanceRGBA_frag},shadow:{uniforms:an([Pt.lights,Pt.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:de.shadow_vert,fragmentShader:de.shadow_frag}};jn.physical={uniforms:an([jn.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 Ce(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 Ce(0)},specularColor:{value:new Ce(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 No={r:0,b:0,g:0},ns=new Yn,lE=new Ue;function cE(n,t,e,s,r,a,l){const h=new Ce(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function S(C){let A=C.isScene===!0?C.background:null;return A&&A.isTexture&&(A=(C.backgroundBlurriness>0?e:t).get(A)),A}function w(C){let A=!1;const U=S(C);U===null?g(h,u):U&&U.isColor&&(g(U,1),A=!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||A)&&(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,A){const U=S(A);U&&(U.isCubeTexture||U.mapping===ro)?(p===void 0&&(p=new dn(new vr(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Us(jn.backgroundCube.uniforms),vertexShader:jn.backgroundCube.vertexShader,fragmentShader:jn.backgroundCube.fragmentShader,side:un,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(B,N,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),ns.copy(A.backgroundRotation),ns.x*=-1,ns.y*=-1,ns.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(ns.y*=-1,ns.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=A.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(lE.makeRotationFromEuler(ns)),p.material.toneMapped=we.getTransfer(U.colorSpace)!==Le,(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 dn(new Er(2,2),new pi({name:"BackgroundMaterial",uniforms:Us(jn.background.uniforms),vertexShader:jn.background.vertexShader,fragmentShader:jn.background.fragmentShader,side:Si,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=A.backgroundIntensity,d.material.toneMapped=we.getTransfer(U.colorSpace)!==Le,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,A){C.getRGB(No,uu(n)),s.buffers.color.setClear(No.r,No.g,No.b,A,l)}function D(){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,A=1){h.set(C),u=A,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(C){u=C,g(h,u)},render:w,addToRenderList:v,dispose:D}}function hE(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(M,k,H,Z,Q){let at=!1;const $=m(Z,H,k);a!==$&&(a=$,d(a.object)),at=E(M,Z,H,Q),at&&S(M,Z,H,Q),Q!==null&&t.update(Q,n.ELEMENT_ARRAY_BUFFER),(at||l)&&(l=!1,A(M,k,H,Z),Q!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(Q).buffer))}function u(){return n.createVertexArray()}function d(M){return n.bindVertexArray(M)}function p(M){return n.deleteVertexArray(M)}function m(M,k,H){const Z=H.wireframe===!0;let Q=s[M.id];Q===void 0&&(Q={},s[M.id]=Q);let at=Q[k.id];at===void 0&&(at={},Q[k.id]=at);let $=at[Z];return $===void 0&&($=_(u()),at[Z]=$),$}function _(M){const k=[],H=[],Z=[];for(let Q=0;Q<e;Q++)k[Q]=0,H[Q]=0,Z[Q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:H,attributeDivisors:Z,object:M,attributes:{},index:null}}function E(M,k,H,Z){const Q=a.attributes,at=k.attributes;let $=0;const dt=H.getAttributes();for(const G in dt)if(dt[G].location>=0){const tt=Q[G];let gt=at[G];if(gt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(gt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(gt=M.instanceColor)),tt===void 0||tt.attribute!==gt||gt&&tt.data!==gt.data)return!0;$++}return a.attributesNum!==$||a.index!==Z}function S(M,k,H,Z){const Q={},at=k.attributes;let $=0;const dt=H.getAttributes();for(const G in dt)if(dt[G].location>=0){let tt=at[G];tt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(tt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(tt=M.instanceColor));const gt={};gt.attribute=tt,tt&&tt.data&&(gt.data=tt.data),Q[G]=gt,$++}a.attributes=Q,a.attributesNum=$,a.index=Z}function w(){const M=a.newAttributes;for(let k=0,H=M.length;k<H;k++)M[k]=0}function v(M){g(M,0)}function g(M,k){const H=a.newAttributes,Z=a.enabledAttributes,Q=a.attributeDivisors;H[M]=1,Z[M]===0&&(n.enableVertexAttribArray(M),Z[M]=1),Q[M]!==k&&(n.vertexAttribDivisor(M,k),Q[M]=k)}function D(){const M=a.newAttributes,k=a.enabledAttributes;for(let H=0,Z=k.length;H<Z;H++)k[H]!==M[H]&&(n.disableVertexAttribArray(H),k[H]=0)}function C(M,k,H,Z,Q,at,$){$===!0?n.vertexAttribIPointer(M,k,H,Q,at):n.vertexAttribPointer(M,k,H,Z,Q,at)}function A(M,k,H,Z){w();const Q=Z.attributes,at=H.getAttributes(),$=k.defaultAttributeValues;for(const dt in at){const G=at[dt];if(G.location>=0){let it=Q[dt];if(it===void 0&&(dt==="instanceMatrix"&&M.instanceMatrix&&(it=M.instanceMatrix),dt==="instanceColor"&&M.instanceColor&&(it=M.instanceColor)),it!==void 0){const tt=it.normalized,gt=it.itemSize,It=t.get(it);if(It===void 0)continue;const ee=It.buffer,Yt=It.type,J=It.bytesPerElement,ct=Yt===n.INT||Yt===n.UNSIGNED_INT||it.gpuType===Qa;if(it.isInterleavedBufferAttribute){const pt=it.data,Nt=pt.stride,st=it.offset;if(pt.isInstancedInterleavedBuffer){for(let lt=0;lt<G.locationSize;lt++)g(G.location+lt,pt.meshPerAttribute);M.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=pt.meshPerAttribute*pt.count)}else for(let lt=0;lt<G.locationSize;lt++)v(G.location+lt);n.bindBuffer(n.ARRAY_BUFFER,ee);for(let lt=0;lt<G.locationSize;lt++)C(G.location+lt,gt/G.locationSize,Yt,tt,Nt*J,(st+gt/G.locationSize*lt)*J,ct)}else{if(it.isInstancedBufferAttribute){for(let pt=0;pt<G.locationSize;pt++)g(G.location+pt,it.meshPerAttribute);M.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=it.meshPerAttribute*it.count)}else for(let pt=0;pt<G.locationSize;pt++)v(G.location+pt);n.bindBuffer(n.ARRAY_BUFFER,ee);for(let pt=0;pt<G.locationSize;pt++)C(G.location+pt,gt/G.locationSize,Yt,tt,gt*J,gt/G.locationSize*pt*J,ct)}}else if($!==void 0){const tt=$[dt];if(tt!==void 0)switch(tt.length){case 2:n.vertexAttrib2fv(G.location,tt);break;case 3:n.vertexAttrib3fv(G.location,tt);break;case 4:n.vertexAttrib4fv(G.location,tt);break;default:n.vertexAttrib1fv(G.location,tt)}}}}D()}function U(){F();for(const M in s){const k=s[M];for(const H in k){const Z=k[H];for(const Q in Z)p(Z[Q].object),delete Z[Q];delete k[H]}delete s[M]}}function B(M){if(s[M.id]===void 0)return;const k=s[M.id];for(const H in k){const Z=k[H];for(const Q in Z)p(Z[Q].object),delete Z[Q];delete k[H]}delete s[M.id]}function N(M){for(const k in s){const H=s[k];if(H[M.id]===void 0)continue;const Z=H[M.id];for(const Q in Z)p(Z[Q].object),delete Z[Q];delete H[M.id]}}function F(){I(),l=!0,a!==r&&(a=r,d(a.object))}function I(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:F,resetDefaultState:I,dispose:U,releaseStatesOfGeometry:B,releaseStatesOfProgram:N,initAttributes:w,enableAttribute:v,disableUnusedAttributes:D}}function uE(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 dE(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!==On&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(N){const F=N===rr&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(N!==oi&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&N!==ai&&!F)}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),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),D=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),A=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=S>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:S,maxTextureSize:w,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:D,maxVaryings:C,maxFragmentUniforms:A,vertexTextures:U,maxSamples:B}}function fE(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ts,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 D=a?0:s,C=D*4;let A=g.clippingState||null;u.value=A,A=p(S,_,C,E);for(let U=0;U!==C;++U)A[U]=e[U];g.clippingState=A,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=D}};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,D=_.matrixWorldInverse;h.getNormalMatrix(D),(v===null||v.length<g)&&(v=new Float32Array(g));for(let C=0,A=E;C!==w;++C,A+=4)l.copy(m[C]).applyMatrix4(D,h),l.normal.toArray(v,A),v[A+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=w,t.numIntersection=0,v}}function pE(n){let t=new WeakMap;function e(l,h){return h===Wa?l.mapping=gs:h===Za&&(l.mapping=_s),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===Wa||h===Za)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 Hv(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 zs=4,bu=[.125,.215,.35,.446,.526,.582],is=20,sc=new s0,Au=new Ce;let rc=null,oc=0,ac=0,lc=!1;const ss=(1+Math.sqrt(5))/2,Hs=1/ss,Cu=[new Y(-ss,Hs,0),new Y(ss,Hs,0),new Y(-Hs,0,ss),new Y(Hs,0,ss),new Y(0,ss,-Hs),new Y(0,ss,Hs),new Y(-1,1,-1),new Y(1,1,-1),new Y(-1,1,1),new Y(1,1,1)],mE=new Y;class Pu{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=mE}=a;rc=this._renderer.getRenderTarget(),oc=this._renderer.getActiveCubeFace(),ac=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=Iu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Lu(),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(rc,oc,ac),this._renderer.xr.enabled=lc,t.scissorTest=!1,Bo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===gs||t.mapping===_s?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),rc=this._renderer.getRenderTarget(),oc=this._renderer.getActiveCubeFace(),ac=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:vn,minFilter:vn,generateMipmaps:!1,type:rr,format:On,colorSpace:Qi,depthBuffer:!1},r=Ru(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Ru(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=gE(a)),this._blurMaterial=_E(a,t,e)}return r}_compileMaterial(t){const e=new dn(this._lodPlanes[0],t);this._renderer.compile(e,sc)}_sceneToCubeUV(t,e,s,r,a){const u=new Pn(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(Au),m.toneMapping=Ti,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const w=new ki({name:"PMREM.Background",side:un,depthWrite:!1,depthTest:!1}),v=new dn(new vr,w);let g=!1;const D=t.background;D?D.isColor&&(w.color.copy(D),t.background=null,g=!0):(w.color.copy(Au),g=!0);for(let C=0;C<6;C++){const A=C%3;A===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)):A===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;Bo(r,A*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=D}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===gs||t.mapping===_s;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Iu()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Lu());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new dn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;Bo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,sc)}_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=Cu[(r-a-1)%Cu.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 dn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,S=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*is-1),w=a/S,v=isFinite(a)?1+Math.floor(p*w):is;v>is&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${is}`);const g=[];let D=0;for(let N=0;N<is;++N){const F=N/w,I=Math.exp(-F*F/2);g.push(I),N===0?D+=I:N<v&&(D+=2*I)}for(let N=0;N<g.length;N++)g[N]=g[N]/D;_.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 A=this._sizeLods[r],U=3*A*(r>C-zs?r-C+zs:0),B=4*(this._cubeSize-A);Bo(e,U,B,3*A,2*A),u.setRenderTarget(e),u.render(m,sc)}}function gE(n){const t=[],e=[],s=[];let r=n;const a=n-zs+1+bu.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-zs?u=bu[l-n+zs-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,D=new Float32Array(w*S*E),C=new Float32Array(v*S*E),A=new Float32Array(g*S*E);for(let B=0;B<E;B++){const N=B%3*2/3-1,F=B>2?0:-1,I=[N,F,0,N+2/3,F,0,N+2/3,F+1,0,N,F,0,N+2/3,F+1,0,N,F+1,0];D.set(I,w*S*B),C.set(_,v*S*B);const M=[B,B,B,B,B,B];A.set(M,g*S*B)}const U=new Qn;U.setAttribute("position",new qn(D,w)),U.setAttribute("uv",new qn(C,v)),U.setAttribute("faceIndex",new qn(A,g)),t.push(U),r>zs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function Ru(n,t,e){const s=new Ci(n,t,e);return s.texture.mapping=ro,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Bo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function _E(n,t,e){const s=new Float32Array(is),r=new Y(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:is,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:cc(),fragmentShader:`
|
|
3596
|
+
}`},Rt={common:{diffuse:{value:new Ce(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 Ce(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 Ce(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 Ce(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}}},jn={basic:{uniforms:an([Rt.common,Rt.specularmap,Rt.envmap,Rt.aomap,Rt.lightmap,Rt.fog]),vertexShader:de.meshbasic_vert,fragmentShader:de.meshbasic_frag},lambert:{uniforms:an([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 Ce(0)}}]),vertexShader:de.meshlambert_vert,fragmentShader:de.meshlambert_frag},phong:{uniforms:an([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 Ce(0)},specular:{value:new Ce(1118481)},shininess:{value:30}}]),vertexShader:de.meshphong_vert,fragmentShader:de.meshphong_frag},standard:{uniforms:an([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 Ce(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:de.meshphysical_vert,fragmentShader:de.meshphysical_frag},toon:{uniforms:an([Rt.common,Rt.aomap,Rt.lightmap,Rt.emissivemap,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.gradientmap,Rt.fog,Rt.lights,{emissive:{value:new Ce(0)}}]),vertexShader:de.meshtoon_vert,fragmentShader:de.meshtoon_frag},matcap:{uniforms:an([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,Rt.fog,{matcap:{value:null}}]),vertexShader:de.meshmatcap_vert,fragmentShader:de.meshmatcap_frag},points:{uniforms:an([Rt.points,Rt.fog]),vertexShader:de.points_vert,fragmentShader:de.points_frag},dashed:{uniforms:an([Rt.common,Rt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:de.linedashed_vert,fragmentShader:de.linedashed_frag},depth:{uniforms:an([Rt.common,Rt.displacementmap]),vertexShader:de.depth_vert,fragmentShader:de.depth_frag},normal:{uniforms:an([Rt.common,Rt.bumpmap,Rt.normalmap,Rt.displacementmap,{opacity:{value:1}}]),vertexShader:de.meshnormal_vert,fragmentShader:de.meshnormal_frag},sprite:{uniforms:an([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:an([Rt.common,Rt.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:de.distanceRGBA_vert,fragmentShader:de.distanceRGBA_frag},shadow:{uniforms:an([Rt.lights,Rt.fog,{color:{value:new Ce(0)},opacity:{value:1}}]),vertexShader:de.shadow_vert,fragmentShader:de.shadow_frag}};jn.physical={uniforms:an([jn.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 Ce(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 Ce(0)},specularColor:{value:new Ce(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 No={r:0,b:0,g:0},ns=new Yn,dE=new Oe;function fE(n,t,e,s,r,a,l){const h=new Ce(0);let u=a===!0?0:1,d,p,m=null,_=0,E=null;function S(C){let A=C.isScene===!0?C.background:null;return A&&A.isTexture&&(A=(C.backgroundBlurriness>0?e:t).get(A)),A}function w(C){let A=!1;const U=S(C);U===null?g(h,u):U&&U.isColor&&(g(U,1),A=!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||A)&&(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,A){const U=S(A);U&&(U.isCubeTexture||U.mapping===ro)?(p===void 0&&(p=new dn(new vr(1,1,1),new pi({name:"BackgroundCubeMaterial",uniforms:Us(jn.backgroundCube.uniforms),vertexShader:jn.backgroundCube.vertexShader,fragmentShader:jn.backgroundCube.fragmentShader,side:un,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(B,N,F){this.matrixWorld.copyPosition(F.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(p)),ns.copy(A.backgroundRotation),ns.x*=-1,ns.y*=-1,ns.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(ns.y*=-1,ns.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=A.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,p.material.uniforms.backgroundRotation.value.setFromMatrix4(dE.makeRotationFromEuler(ns)),p.material.toneMapped=we.getTransfer(U.colorSpace)!==Le,(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 dn(new Er(2,2),new pi({name:"BackgroundMaterial",uniforms:Us(jn.background.uniforms),vertexShader:jn.background.vertexShader,fragmentShader:jn.background.fragmentShader,side:Si,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=A.backgroundIntensity,d.material.toneMapped=we.getTransfer(U.colorSpace)!==Le,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,A){C.getRGB(No,pu(n)),s.buffers.color.setClear(No.r,No.g,No.b,A,l)}function D(){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,A=1){h.set(C),u=A,g(h,u)},getClearAlpha:function(){return u},setClearAlpha:function(C){u=C,g(h,u)},render:w,addToRenderList:v,dispose:D}}function pE(n,t){const e=n.getParameter(n.MAX_VERTEX_ATTRIBS),s={},r=_(null);let a=r,l=!1;function h(M,k,H,Z,j){let at=!1;const $=m(Z,H,k);a!==$&&(a=$,d(a.object)),at=E(M,Z,H,j),at&&S(M,Z,H,j),j!==null&&t.update(j,n.ELEMENT_ARRAY_BUFFER),(at||l)&&(l=!1,A(M,k,H,Z),j!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t.get(j).buffer))}function u(){return n.createVertexArray()}function d(M){return n.bindVertexArray(M)}function p(M){return n.deleteVertexArray(M)}function m(M,k,H){const Z=H.wireframe===!0;let j=s[M.id];j===void 0&&(j={},s[M.id]=j);let at=j[k.id];at===void 0&&(at={},j[k.id]=at);let $=at[Z];return $===void 0&&($=_(u()),at[Z]=$),$}function _(M){const k=[],H=[],Z=[];for(let j=0;j<e;j++)k[j]=0,H[j]=0,Z[j]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:k,enabledAttributes:H,attributeDivisors:Z,object:M,attributes:{},index:null}}function E(M,k,H,Z){const j=a.attributes,at=k.attributes;let $=0;const dt=H.getAttributes();for(const G in dt)if(dt[G].location>=0){const tt=j[G];let gt=at[G];if(gt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(gt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(gt=M.instanceColor)),tt===void 0||tt.attribute!==gt||gt&&tt.data!==gt.data)return!0;$++}return a.attributesNum!==$||a.index!==Z}function S(M,k,H,Z){const j={},at=k.attributes;let $=0;const dt=H.getAttributes();for(const G in dt)if(dt[G].location>=0){let tt=at[G];tt===void 0&&(G==="instanceMatrix"&&M.instanceMatrix&&(tt=M.instanceMatrix),G==="instanceColor"&&M.instanceColor&&(tt=M.instanceColor));const gt={};gt.attribute=tt,tt&&tt.data&&(gt.data=tt.data),j[G]=gt,$++}a.attributes=j,a.attributesNum=$,a.index=Z}function w(){const M=a.newAttributes;for(let k=0,H=M.length;k<H;k++)M[k]=0}function v(M){g(M,0)}function g(M,k){const H=a.newAttributes,Z=a.enabledAttributes,j=a.attributeDivisors;H[M]=1,Z[M]===0&&(n.enableVertexAttribArray(M),Z[M]=1),j[M]!==k&&(n.vertexAttribDivisor(M,k),j[M]=k)}function D(){const M=a.newAttributes,k=a.enabledAttributes;for(let H=0,Z=k.length;H<Z;H++)k[H]!==M[H]&&(n.disableVertexAttribArray(H),k[H]=0)}function C(M,k,H,Z,j,at,$){$===!0?n.vertexAttribIPointer(M,k,H,j,at):n.vertexAttribPointer(M,k,H,Z,j,at)}function A(M,k,H,Z){w();const j=Z.attributes,at=H.getAttributes(),$=k.defaultAttributeValues;for(const dt in at){const G=at[dt];if(G.location>=0){let it=j[dt];if(it===void 0&&(dt==="instanceMatrix"&&M.instanceMatrix&&(it=M.instanceMatrix),dt==="instanceColor"&&M.instanceColor&&(it=M.instanceColor)),it!==void 0){const tt=it.normalized,gt=it.itemSize,At=t.get(it);if(At===void 0)continue;const Jt=At.buffer,Ft=At.type,Q=At.bytesPerElement,lt=Ft===n.INT||Ft===n.UNSIGNED_INT||it.gpuType===ja;if(it.isInterleavedBufferAttribute){const pt=it.data,Nt=pt.stride,st=it.offset;if(pt.isInstancedInterleavedBuffer){for(let ct=0;ct<G.locationSize;ct++)g(G.location+ct,pt.meshPerAttribute);M.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=pt.meshPerAttribute*pt.count)}else for(let ct=0;ct<G.locationSize;ct++)v(G.location+ct);n.bindBuffer(n.ARRAY_BUFFER,Jt);for(let ct=0;ct<G.locationSize;ct++)C(G.location+ct,gt/G.locationSize,Ft,tt,Nt*Q,(st+gt/G.locationSize*ct)*Q,lt)}else{if(it.isInstancedBufferAttribute){for(let pt=0;pt<G.locationSize;pt++)g(G.location+pt,it.meshPerAttribute);M.isInstancedMesh!==!0&&Z._maxInstanceCount===void 0&&(Z._maxInstanceCount=it.meshPerAttribute*it.count)}else for(let pt=0;pt<G.locationSize;pt++)v(G.location+pt);n.bindBuffer(n.ARRAY_BUFFER,Jt);for(let pt=0;pt<G.locationSize;pt++)C(G.location+pt,gt/G.locationSize,Ft,tt,gt*Q,gt/G.locationSize*pt*Q,lt)}}else if($!==void 0){const tt=$[dt];if(tt!==void 0)switch(tt.length){case 2:n.vertexAttrib2fv(G.location,tt);break;case 3:n.vertexAttrib3fv(G.location,tt);break;case 4:n.vertexAttrib4fv(G.location,tt);break;default:n.vertexAttrib1fv(G.location,tt)}}}}D()}function U(){F();for(const M in s){const k=s[M];for(const H in k){const Z=k[H];for(const j in Z)p(Z[j].object),delete Z[j];delete k[H]}delete s[M]}}function B(M){if(s[M.id]===void 0)return;const k=s[M.id];for(const H in k){const Z=k[H];for(const j in Z)p(Z[j].object),delete Z[j];delete k[H]}delete s[M.id]}function N(M){for(const k in s){const H=s[k];if(H[M.id]===void 0)continue;const Z=H[M.id];for(const j in Z)p(Z[j].object),delete Z[j];delete H[M.id]}}function F(){I(),l=!0,a!==r&&(a=r,d(a.object))}function I(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:h,reset:F,resetDefaultState:I,dispose:U,releaseStatesOfGeometry:B,releaseStatesOfProgram:N,initAttributes:w,enableAttribute:v,disableUnusedAttributes:D}}function mE(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 gE(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!==On&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT))}function h(N){const F=N===rr&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(N!==oi&&s.convert(N)!==n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE)&&N!==ai&&!F)}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),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),D=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),C=n.getParameter(n.MAX_VARYING_VECTORS),A=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),U=S>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:S,maxTextureSize:w,maxCubemapSize:v,maxAttributes:g,maxVertexUniforms:D,maxVaryings:C,maxFragmentUniforms:A,vertexTextures:U,maxSamples:B}}function _E(n){const t=this;let e=null,s=0,r=!1,a=!1;const l=new ts,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 D=a?0:s,C=D*4;let A=g.clippingState||null;u.value=A,A=p(S,_,C,E);for(let U=0;U!==C;++U)A[U]=e[U];g.clippingState=A,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=D}};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,D=_.matrixWorldInverse;h.getNormalMatrix(D),(v===null||v.length<g)&&(v=new Float32Array(g));for(let C=0,A=E;C!==w;++C,A+=4)l.copy(m[C]).applyMatrix4(D,h),l.normal.toArray(v,A),v[A+3]=l.constant}u.value=v,u.needsUpdate=!0}return t.numPlanes=w,t.numIntersection=0,v}}function vE(n){let t=new WeakMap;function e(l,h){return h===Za?l.mapping=gs:h===Xa&&(l.mapping=_s),l}function s(l){if(l&&l.isTexture){const h=l.mapping;if(h===Za||h===Xa)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 Zv(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 zs=4,Pu=[.125,.215,.35,.446,.526,.582],is=20,rc=new l0,Ru=new Ce;let oc=null,ac=0,lc=0,cc=!1;const ss=(1+Math.sqrt(5))/2,Hs=1/ss,Lu=[new Y(-ss,Hs,0),new Y(ss,Hs,0),new Y(-Hs,0,ss),new Y(Hs,0,ss),new Y(0,ss,-Hs),new Y(0,ss,Hs),new Y(-1,1,-1),new Y(1,1,-1),new Y(-1,1,1),new Y(1,1,1)],yE=new Y;class Iu{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=yE}=a;oc=this._renderer.getRenderTarget(),ac=this._renderer.getActiveCubeFace(),lc=this._renderer.getActiveMipmapLevel(),cc=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=Uu(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=ku(),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(oc,ac,lc),this._renderer.xr.enabled=cc,t.scissorTest=!1,Bo(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===gs||t.mapping===_s?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),oc=this._renderer.getRenderTarget(),ac=this._renderer.getActiveCubeFace(),lc=this._renderer.getActiveMipmapLevel(),cc=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:vn,minFilter:vn,generateMipmaps:!1,type:rr,format:On,colorSpace:Qi,depthBuffer:!1},r=Du(t,e,s);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Du(t,e,s);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=EE(a)),this._blurMaterial=xE(a,t,e)}return r}_compileMaterial(t){const e=new dn(this._lodPlanes[0],t);this._renderer.compile(e,rc)}_sceneToCubeUV(t,e,s,r,a){const u=new Pn(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(Ru),m.toneMapping=Ti,m.autoClear=!1,m.state.buffers.depth.getReversed()&&(m.setRenderTarget(r),m.clearDepth(),m.setRenderTarget(null));const w=new ki({name:"PMREM.Background",side:un,depthWrite:!1,depthTest:!1}),v=new dn(new vr,w);let g=!1;const D=t.background;D?D.isColor&&(w.color.copy(D),t.background=null,g=!0):(w.color.copy(Ru),g=!0);for(let C=0;C<6;C++){const A=C%3;A===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)):A===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;Bo(r,A*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=D}_textureToCubeUV(t,e){const s=this._renderer,r=t.mapping===gs||t.mapping===_s;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Uu()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=ku());const a=r?this._cubemapMaterial:this._equirectMaterial,l=new dn(this._lodPlanes[0],a),h=a.uniforms;h.envMap.value=t;const u=this._cubeSize;Bo(e,0,0,3*u,2*u),s.setRenderTarget(e),s.render(l,rc)}_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=Lu[(r-a-1)%Lu.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 dn(this._lodPlanes[r],d),_=d.uniforms,E=this._sizeLods[s]-1,S=isFinite(a)?Math.PI/(2*E):2*Math.PI/(2*is-1),w=a/S,v=isFinite(a)?1+Math.floor(p*w):is;v>is&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${v} samples when the maximum is set to ${is}`);const g=[];let D=0;for(let N=0;N<is;++N){const F=N/w,I=Math.exp(-F*F/2);g.push(I),N===0?D+=I:N<v&&(D+=2*I)}for(let N=0;N<g.length;N++)g[N]=g[N]/D;_.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 A=this._sizeLods[r],U=3*A*(r>C-zs?r-C+zs:0),B=4*(this._cubeSize-A);Bo(e,U,B,3*A,2*A),u.setRenderTarget(e),u.render(m,rc)}}function EE(n){const t=[],e=[],s=[];let r=n;const a=n-zs+1+Pu.length;for(let l=0;l<a;l++){const h=Math.pow(2,r);e.push(h);let u=1/h;l>n-zs?u=Pu[l-n+zs-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,D=new Float32Array(w*S*E),C=new Float32Array(v*S*E),A=new Float32Array(g*S*E);for(let B=0;B<E;B++){const N=B%3*2/3-1,F=B>2?0:-1,I=[N,F,0,N+2/3,F,0,N+2/3,F+1,0,N,F,0,N+2/3,F+1,0,N,F+1,0];D.set(I,w*S*B),C.set(_,v*S*B);const M=[B,B,B,B,B,B];A.set(M,g*S*B)}const U=new Qn;U.setAttribute("position",new qn(D,w)),U.setAttribute("uv",new qn(C,v)),U.setAttribute("faceIndex",new qn(A,g)),t.push(U),r>zs&&r--}return{lodPlanes:t,sizeLods:e,sigmas:s}}function Du(n,t,e){const s=new Ci(n,t,e);return s.texture.mapping=ro,s.texture.name="PMREM.cubeUv",s.scissorTest=!0,s}function Bo(n,t,e,s,r){n.viewport.set(t,e,s,r),n.scissor.set(t,e,s,r)}function xE(n,t,e){const s=new Float32Array(is),r=new Y(0,1,0);return new pi({name:"SphericalGaussianBlur",defines:{n:is,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:hc(),fragmentShader:`
|
|
3597
3597
|
|
|
3598
3598
|
precision mediump float;
|
|
3599
3599
|
precision mediump int;
|
|
@@ -3653,7 +3653,7 @@ void main() {
|
|
|
3653
3653
|
}
|
|
3654
3654
|
|
|
3655
3655
|
}
|
|
3656
|
-
`,blending:Mi,depthTest:!1,depthWrite:!1})}function
|
|
3656
|
+
`,blending:Mi,depthTest:!1,depthWrite:!1})}function ku(){return new pi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:hc(),fragmentShader:`
|
|
3657
3657
|
|
|
3658
3658
|
precision mediump float;
|
|
3659
3659
|
precision mediump int;
|
|
@@ -3672,7 +3672,7 @@ void main() {
|
|
|
3672
3672
|
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
3673
3673
|
|
|
3674
3674
|
}
|
|
3675
|
-
`,blending:Mi,depthTest:!1,depthWrite:!1})}function
|
|
3675
|
+
`,blending:Mi,depthTest:!1,depthWrite:!1})}function Uu(){return new pi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:hc(),fragmentShader:`
|
|
3676
3676
|
|
|
3677
3677
|
precision mediump float;
|
|
3678
3678
|
precision mediump int;
|
|
@@ -3688,7 +3688,7 @@ void main() {
|
|
|
3688
3688
|
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
|
3689
3689
|
|
|
3690
3690
|
}
|
|
3691
|
-
`,blending:Mi,depthTest:!1,depthWrite:!1})}function
|
|
3691
|
+
`,blending:Mi,depthTest:!1,depthWrite:!1})}function hc(){return`
|
|
3692
3692
|
|
|
3693
3693
|
precision mediump float;
|
|
3694
3694
|
precision mediump int;
|
|
@@ -3743,17 +3743,17 @@ void main() {
|
|
|
3743
3743
|
gl_Position = vec4( position, 1.0 );
|
|
3744
3744
|
|
|
3745
3745
|
}
|
|
3746
|
-
`}function vE(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===Wa||u===Za,p=u===gs||u===_s;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 Pu(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 Pu(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 yE(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&&ws("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function EE(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 D=E.array;w=E.version;for(let C=0,A=D.length;C<A;C+=3){const U=D[C+0],B=D[C+1],N=D[C+2];_.push(U,B,B,N,N,U)}}else if(S!==void 0){const D=S.array;w=S.version;for(let C=0,A=D.length/3-1;C<A;C+=3){const U=C+0,B=C+1,N=C+2;_.push(U,B,B,N,N,U)}}else return;const v=new(Xh(_)?au:ou)(_,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 xE(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 D=0;D<S;D++)g+=E[D]*w[D];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function wE(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 SE(n,t,e){const s=new WeakMap,r=new Fe;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 I=function(){N.dispose(),s.delete(h),h.removeEventListener("dispose",I)};_!==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||[],D=h.morphAttributes.color||[];let C=0;E===!0&&(C=1),S===!0&&(C=2),w===!0&&(C=3);let A=h.attributes.position.count*C,U=1;A>t.maxTextureSize&&(U=Math.ceil(A/t.maxTextureSize),A=t.maxTextureSize);const B=new Float32Array(A*U*4*m),N=new jh(B,A,U,m);N.type=ai,N.needsUpdate=!0;const F=C*4;for(let M=0;M<m;M++){const k=v[M],H=g[M],Z=D[M],Q=A*U*4*M;for(let at=0;at<k.count;at++){const $=at*F;E===!0&&(r.fromBufferAttribute(k,at),B[Q+$+0]=r.x,B[Q+$+1]=r.y,B[Q+$+2]=r.z,B[Q+$+3]=0),S===!0&&(r.fromBufferAttribute(H,at),B[Q+$+4]=r.x,B[Q+$+5]=r.y,B[Q+$+6]=r.z,B[Q+$+7]=0),w===!0&&(r.fromBufferAttribute(Z,at),B[Q+$+8]=r.x,B[Q+$+9]=r.y,B[Q+$+10]=r.z,B[Q+$+11]=Z.itemSize===4?r.w:1)}}_={count:m,texture:N,size:new be(A,U)},s.set(h,_),h.addEventListener("dispose",I)}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 ME(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 Du=new je,ku=new Eu(1,1),Uu=new jh,Ou=new Mv,Nu=new mu,Bu=[],Fu=[],zu=new Float32Array(16),Hu=new Float32Array(9),Vu=new Float32Array(4);function Vs(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=Bu[r];if(a===void 0&&(a=new Float32Array(r),Bu[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 Ge(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 We(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Fo(n,t){let e=Fu[t];e===void 0&&(e=new Int32Array(t),Fu[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function TE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function bE(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(Ge(e,t))return;n.uniform2fv(this.addr,t),We(e,t)}}function AE(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(Ge(e,t))return;n.uniform3fv(this.addr,t),We(e,t)}}function CE(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(Ge(e,t))return;n.uniform4fv(this.addr,t),We(e,t)}}function PE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;Vu.set(s),n.uniformMatrix2fv(this.addr,!1,Vu),We(e,s)}}function RE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;Hu.set(s),n.uniformMatrix3fv(this.addr,!1,Hu),We(e,s)}}function LE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;zu.set(s),n.uniformMatrix4fv(this.addr,!1,zu),We(e,s)}}function IE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function DE(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(Ge(e,t))return;n.uniform2iv(this.addr,t),We(e,t)}}function kE(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(Ge(e,t))return;n.uniform3iv(this.addr,t),We(e,t)}}function UE(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(Ge(e,t))return;n.uniform4iv(this.addr,t),We(e,t)}}function OE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function NE(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(Ge(e,t))return;n.uniform2uiv(this.addr,t),We(e,t)}}function BE(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(Ge(e,t))return;n.uniform3uiv(this.addr,t),We(e,t)}}function FE(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(Ge(e,t))return;n.uniform4uiv(this.addr,t),We(e,t)}}function zE(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?(ku.compareFunction=Hh,a=ku):a=Du,e.setTexture2D(t||a,r)}function HE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||Ou,r)}function VE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||Nu,r)}function GE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||Uu,r)}function WE(n){switch(n){case 5126:return TE;case 35664:return bE;case 35665:return AE;case 35666:return CE;case 35674:return PE;case 35675:return RE;case 35676:return LE;case 5124:case 35670:return IE;case 35667:case 35671:return DE;case 35668:case 35672:return kE;case 35669:case 35673:return UE;case 5125:return OE;case 36294:return NE;case 36295:return BE;case 36296:return FE;case 35678:case 36198:case 36298:case 36306:case 35682:return zE;case 35679:case 36299:case 36307:return HE;case 35680:case 36300:case 36308:case 36293:return VE;case 36289:case 36303:case 36311:case 36292:return GE}}function ZE(n,t){n.uniform1fv(this.addr,t)}function XE(n,t){const e=Vs(t,this.size,2);n.uniform2fv(this.addr,e)}function YE(n,t){const e=Vs(t,this.size,3);n.uniform3fv(this.addr,e)}function qE(n,t){const e=Vs(t,this.size,4);n.uniform4fv(this.addr,e)}function QE(n,t){const e=Vs(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function jE(n,t){const e=Vs(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function JE(n,t){const e=Vs(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function KE(n,t){n.uniform1iv(this.addr,t)}function $E(n,t){n.uniform2iv(this.addr,t)}function tx(n,t){n.uniform3iv(this.addr,t)}function ex(n,t){n.uniform4iv(this.addr,t)}function nx(n,t){n.uniform1uiv(this.addr,t)}function ix(n,t){n.uniform2uiv(this.addr,t)}function sx(n,t){n.uniform3uiv(this.addr,t)}function rx(n,t){n.uniform4uiv(this.addr,t)}function ox(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||Du,a[l])}function ax(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||Ou,a[l])}function lx(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||Nu,a[l])}function cx(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||Uu,a[l])}function hx(n){switch(n){case 5126:return ZE;case 35664:return XE;case 35665:return YE;case 35666:return qE;case 35674:return QE;case 35675:return jE;case 35676:return JE;case 5124:case 35670:return KE;case 35667:case 35671:return $E;case 35668:case 35672:return tx;case 35669:case 35673:return ex;case 5125:return nx;case 36294:return ix;case 36295:return sx;case 36296:return rx;case 35678:case 36198:case 36298:case 36306:case 35682:return ox;case 35679:case 36299:case 36307:return ax;case 35680:case 36300:case 36308:case 36293:return lx;case 36289:case 36303:case 36311:case 36292:return cx}}class ux{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=WE(e.type)}}class dx{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=hx(e.type)}}class fx{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 hc=/(\w+)(\])?(\[|\.)?/g;function Gu(n,t){n.seq.push(t),n.map[t.id]=t}function px(n,t,e){const s=n.name,r=s.length;for(hc.lastIndex=0;;){const a=hc.exec(s),l=hc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){Gu(e,d===void 0?new ux(h,n,t):new dx(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new fx(h),Gu(e,m)),e=m}}}class zo{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);px(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 Wu(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const mx=37297;let gx=0;function _x(n,t){const e=n.split(`
|
|
3746
|
+
`}function wE(n){let t=new WeakMap,e=null;function s(h){if(h&&h.isTexture){const u=h.mapping,d=u===Za||u===Xa,p=u===gs||u===_s;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 Iu(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 Iu(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 SE(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&&ws("THREE.WebGLRenderer: "+s+" extension not supported."),r}}}function ME(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 D=E.array;w=E.version;for(let C=0,A=D.length;C<A;C+=3){const U=D[C+0],B=D[C+1],N=D[C+2];_.push(U,B,B,N,N,U)}}else if(S!==void 0){const D=S.array;w=S.version;for(let C=0,A=D.length/3-1;C<A;C+=3){const U=C+0,B=C+1,N=C+2;_.push(U,B,B,N,N,U)}}else return;const v=new(Qh(_)?hu:cu)(_,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 TE(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 D=0;D<S;D++)g+=E[D]*w[D];e.update(g,s,1)}}this.setMode=r,this.setIndex=h,this.render=u,this.renderInstances=d,this.renderMultiDraw=p,this.renderMultiDrawInstances=m}function bE(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 AE(n,t,e){const s=new WeakMap,r=new Fe;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 I=function(){N.dispose(),s.delete(h),h.removeEventListener("dispose",I)};_!==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||[],D=h.morphAttributes.color||[];let C=0;E===!0&&(C=1),S===!0&&(C=2),w===!0&&(C=3);let A=h.attributes.position.count*C,U=1;A>t.maxTextureSize&&(U=Math.ceil(A/t.maxTextureSize),A=t.maxTextureSize);const B=new Float32Array(A*U*4*m),N=new $h(B,A,U,m);N.type=ai,N.needsUpdate=!0;const F=C*4;for(let M=0;M<m;M++){const k=v[M],H=g[M],Z=D[M],j=A*U*4*M;for(let at=0;at<k.count;at++){const $=at*F;E===!0&&(r.fromBufferAttribute(k,at),B[j+$+0]=r.x,B[j+$+1]=r.y,B[j+$+2]=r.z,B[j+$+3]=0),S===!0&&(r.fromBufferAttribute(H,at),B[j+$+4]=r.x,B[j+$+5]=r.y,B[j+$+6]=r.z,B[j+$+7]=0),w===!0&&(r.fromBufferAttribute(Z,at),B[j+$+8]=r.x,B[j+$+9]=r.y,B[j+$+10]=r.z,B[j+$+11]=Z.itemSize===4?r.w:1)}}_={count:m,texture:N,size:new be(A,U)},s.set(h,_),h.addEventListener("dispose",I)}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 CE(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 Ou=new je,Nu=new Su(1,1),Bu=new $h,Fu=new Cv,zu=new vu,Hu=[],Vu=[],Gu=new Float32Array(16),Wu=new Float32Array(9),Zu=new Float32Array(4);function Vs(n,t,e){const s=n[0];if(s<=0||s>0)return n;const r=t*e;let a=Hu[r];if(a===void 0&&(a=new Float32Array(r),Hu[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 Ge(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 We(n,t){for(let e=0,s=t.length;e<s;e++)n[e]=t[e]}function Fo(n,t){let e=Vu[t];e===void 0&&(e=new Int32Array(t),Vu[t]=e);for(let s=0;s!==t;++s)e[s]=n.allocateTextureUnit();return e}function PE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1f(this.addr,t),e[0]=t)}function RE(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(Ge(e,t))return;n.uniform2fv(this.addr,t),We(e,t)}}function LE(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(Ge(e,t))return;n.uniform3fv(this.addr,t),We(e,t)}}function IE(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(Ge(e,t))return;n.uniform4fv(this.addr,t),We(e,t)}}function DE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix2fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;Zu.set(s),n.uniformMatrix2fv(this.addr,!1,Zu),We(e,s)}}function kE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix3fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;Wu.set(s),n.uniformMatrix3fv(this.addr,!1,Wu),We(e,s)}}function UE(n,t){const e=this.cache,s=t.elements;if(s===void 0){if(Ge(e,t))return;n.uniformMatrix4fv(this.addr,!1,t),We(e,t)}else{if(Ge(e,s))return;Gu.set(s),n.uniformMatrix4fv(this.addr,!1,Gu),We(e,s)}}function OE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1i(this.addr,t),e[0]=t)}function NE(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(Ge(e,t))return;n.uniform2iv(this.addr,t),We(e,t)}}function BE(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(Ge(e,t))return;n.uniform3iv(this.addr,t),We(e,t)}}function FE(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(Ge(e,t))return;n.uniform4iv(this.addr,t),We(e,t)}}function zE(n,t){const e=this.cache;e[0]!==t&&(n.uniform1ui(this.addr,t),e[0]=t)}function HE(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(Ge(e,t))return;n.uniform2uiv(this.addr,t),We(e,t)}}function VE(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(Ge(e,t))return;n.uniform3uiv(this.addr,t),We(e,t)}}function GE(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(Ge(e,t))return;n.uniform4uiv(this.addr,t),We(e,t)}}function WE(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?(Nu.compareFunction=Wh,a=Nu):a=Ou,e.setTexture2D(t||a,r)}function ZE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture3D(t||Fu,r)}function XE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTextureCube(t||zu,r)}function YE(n,t,e){const s=this.cache,r=e.allocateTextureUnit();s[0]!==r&&(n.uniform1i(this.addr,r),s[0]=r),e.setTexture2DArray(t||Bu,r)}function qE(n){switch(n){case 5126:return PE;case 35664:return RE;case 35665:return LE;case 35666:return IE;case 35674:return DE;case 35675:return kE;case 35676:return UE;case 5124:case 35670:return OE;case 35667:case 35671:return NE;case 35668:case 35672:return BE;case 35669:case 35673:return FE;case 5125:return zE;case 36294:return HE;case 36295:return VE;case 36296:return GE;case 35678:case 36198:case 36298:case 36306:case 35682:return WE;case 35679:case 36299:case 36307:return ZE;case 35680:case 36300:case 36308:case 36293:return XE;case 36289:case 36303:case 36311:case 36292:return YE}}function QE(n,t){n.uniform1fv(this.addr,t)}function jE(n,t){const e=Vs(t,this.size,2);n.uniform2fv(this.addr,e)}function JE(n,t){const e=Vs(t,this.size,3);n.uniform3fv(this.addr,e)}function KE(n,t){const e=Vs(t,this.size,4);n.uniform4fv(this.addr,e)}function $E(n,t){const e=Vs(t,this.size,4);n.uniformMatrix2fv(this.addr,!1,e)}function tx(n,t){const e=Vs(t,this.size,9);n.uniformMatrix3fv(this.addr,!1,e)}function ex(n,t){const e=Vs(t,this.size,16);n.uniformMatrix4fv(this.addr,!1,e)}function nx(n,t){n.uniform1iv(this.addr,t)}function ix(n,t){n.uniform2iv(this.addr,t)}function sx(n,t){n.uniform3iv(this.addr,t)}function rx(n,t){n.uniform4iv(this.addr,t)}function ox(n,t){n.uniform1uiv(this.addr,t)}function ax(n,t){n.uniform2uiv(this.addr,t)}function lx(n,t){n.uniform3uiv(this.addr,t)}function cx(n,t){n.uniform4uiv(this.addr,t)}function hx(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture2D(t[l]||Ou,a[l])}function ux(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture3D(t[l]||Fu,a[l])}function dx(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTextureCube(t[l]||zu,a[l])}function fx(n,t,e){const s=this.cache,r=t.length,a=Fo(e,r);Ge(s,a)||(n.uniform1iv(this.addr,a),We(s,a));for(let l=0;l!==r;++l)e.setTexture2DArray(t[l]||Bu,a[l])}function px(n){switch(n){case 5126:return QE;case 35664:return jE;case 35665:return JE;case 35666:return KE;case 35674:return $E;case 35675:return tx;case 35676:return ex;case 5124:case 35670:return nx;case 35667:case 35671:return ix;case 35668:case 35672:return sx;case 35669:case 35673:return rx;case 5125:return ox;case 36294:return ax;case 36295:return lx;case 36296:return cx;case 35678:case 36198:case 36298:case 36306:case 35682:return hx;case 35679:case 36299:case 36307:return ux;case 35680:case 36300:case 36308:case 36293:return dx;case 36289:case 36303:case 36311:case 36292:return fx}}class mx{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.setValue=qE(e.type)}}class gx{constructor(t,e,s){this.id=t,this.addr=s,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=px(e.type)}}class _x{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 uc=/(\w+)(\])?(\[|\.)?/g;function Xu(n,t){n.seq.push(t),n.map[t.id]=t}function vx(n,t,e){const s=n.name,r=s.length;for(uc.lastIndex=0;;){const a=uc.exec(s),l=uc.lastIndex;let h=a[1];const u=a[2]==="]",d=a[3];if(u&&(h=h|0),d===void 0||d==="["&&l+2===r){Xu(e,d===void 0?new mx(h,n,t):new gx(h,n,t));break}else{let m=e.map[h];m===void 0&&(m=new _x(h),Xu(e,m)),e=m}}}class zo{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);vx(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 Yu(n,t,e){const s=n.createShader(t);return n.shaderSource(s,e),n.compileShader(s),s}const yx=37297;let Ex=0;function xx(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
|
|
3748
|
+
`)}const qu=new ue;function wx(n){we._getMatrix(qu,we.workingColorSpace,n);const t=`mat3( ${qu.elements.map(e=>e.toFixed(4))} )`;switch(we.getTransfer(n)){case fo:return[t,"LinearTransferOETF"];case Le:return[t,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",n),[t,"LinearTransferOETF"]}}function Qu(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
|
-
`+
|
|
3753
|
-
`)}function
|
|
3754
|
-
`)}function
|
|
3755
|
-
`)}function
|
|
3756
|
-
`)}function
|
|
3752
|
+
`+xx(n.getShaderSource(t),h)}else return a}function Sx(n,t){const e=wx(t);return[`vec4 ${n}( vec4 value ) {`,` return ${e[1]}( vec4( value.rgb * ${e[0]}, value.a ) );`,"}"].join(`
|
|
3753
|
+
`)}function Mx(n,t){let e;switch(t){case Dh:e="Linear";break;case H_:e="Reinhard";break;case V_:e="Cineon";break;case G_:e="ACESFilmic";break;case Z_:e="AgX";break;case X_:e="Neutral";break;case W_:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}const Ho=new Y;function Tx(){we.getLuminanceCoefficients(Ho);const n=Ho.x.toFixed(4),t=Ho.y.toFixed(4),e=Ho.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${n}, ${t}, ${e} );`," return dot( weights, rgb );","}"].join(`
|
|
3754
|
+
`)}function bx(n){return[n.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",n.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(xr).join(`
|
|
3755
|
+
`)}function Ax(n){const t=[];for(const e in n){const s=n[e];s!==!1&&t.push("#define "+e+" "+s)}return t.join(`
|
|
3756
|
+
`)}function Cx(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 xr(n){return n!==""}function ju(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 Ju(n,t){return n.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Px=/^[ \t]*#include +<([\w\d./]+)>/gm;function dc(n){return n.replace(Px,Lx)}const Rx=new Map;function Lx(n,t){let e=de[t];if(e===void 0){const s=Rx.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 dc(e)}const Ix=/#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 Ku(n){return n.replace(Ix,Dx)}function Dx(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 $u(n){let t=`precision ${n.precision} float;
|
|
3757
3757
|
precision ${n.precision} int;
|
|
3758
3758
|
precision ${n.precision} sampler2D;
|
|
3759
3759
|
precision ${n.precision} samplerCube;
|
|
@@ -3773,30 +3773,30 @@ 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
|
|
3776
|
+
#define LOW_PRECISION`),t}function kx(n){let t="SHADOWMAP_TYPE_BASIC";return n.shadowMapType===Ch?t="SHADOWMAP_TYPE_PCF":n.shadowMapType===E_?t="SHADOWMAP_TYPE_PCF_SOFT":n.shadowMapType===si&&(t="SHADOWMAP_TYPE_VSM"),t}function Ux(n){let t="ENVMAP_TYPE_CUBE";if(n.envMap)switch(n.envMapMode){case gs:case _s:t="ENVMAP_TYPE_CUBE";break;case ro:t="ENVMAP_TYPE_CUBE_UV";break}return t}function Ox(n){let t="ENVMAP_MODE_REFLECTION";if(n.envMap)switch(n.envMapMode){case _s:t="ENVMAP_MODE_REFRACTION";break}return t}function Nx(n){let t="ENVMAP_BLENDING_NONE";if(n.envMap)switch(n.combine){case Ih:t="ENVMAP_BLENDING_MULTIPLY";break;case F_:t="ENVMAP_BLENDING_MIX";break;case z_:t="ENVMAP_BLENDING_ADD";break}return t}function Bx(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 Fx(n,t,e,s){const r=n.getContext(),a=e.defines;let l=e.vertexShader,h=e.fragmentShader;const u=kx(e),d=Ux(e),p=Ox(e),m=Nx(e),_=Bx(e),E=bx(e),S=Ax(a),w=r.createProgram();let v,g,D=e.glslVersion?"#version "+e.glslVersion+`
|
|
3777
3777
|
`:"";e.isRawShaderMaterial?(v=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S].filter(xr).join(`
|
|
3778
3778
|
`),v.length>0&&(v+=`
|
|
3779
3779
|
`),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,S].filter(xr).join(`
|
|
3780
3780
|
`),g.length>0&&(g+=`
|
|
3781
|
-
`)):(v=[
|
|
3781
|
+
`)):(v=[$u(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",`
|
|
3782
3782
|
`].filter(xr).join(`
|
|
3783
|
-
`),g=[
|
|
3783
|
+
`),g=[$u(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!==Ti?"#define TONE_MAPPING":"",e.toneMapping!==Ti?de.tonemapping_pars_fragment:"",e.toneMapping!==Ti?Mx("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",de.colorspace_pars_fragment,Sx("linearToOutputTexel",e.outputColorSpace),Tx(),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
|
|
3784
3784
|
`].filter(xr).join(`
|
|
3785
|
-
`)),l=
|
|
3785
|
+
`)),l=dc(l),l=ju(l,e),l=Ju(l,e),h=dc(h),h=ju(h,e),h=Ju(h,e),l=Ku(l),h=Ku(h),e.isRawShaderMaterial!==!0&&(D=`#version 300 es
|
|
3786
3786
|
`,v=[E,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3787
3787
|
`)+`
|
|
3788
|
-
`+v,g=["#define varying in",e.glslVersion===
|
|
3788
|
+
`+v,g=["#define varying in",e.glslVersion===Xh?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===Xh?"":"#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=D+v+l,A=D+g+h,U=
|
|
3790
|
+
`+g);const C=D+v+l,A=D+g+h,U=Yu(r,r.VERTEX_SHADER,C),B=Yu(r,r.FRAGMENT_SHADER,A);r.attachShader(w,U),r.attachShader(w,B),e.index0AttributeName!==void 0?r.bindAttribLocation(w,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(w,0,"position"),r.linkProgram(w);function N(k){if(n.debug.checkShaderErrors){const H=r.getProgramInfoLog(w)||"",Z=r.getShaderInfoLog(U)||"",j=r.getShaderInfoLog(B)||"",at=H.trim(),$=Z.trim(),dt=j.trim();let G=!0,it=!0;if(r.getProgramParameter(w,r.LINK_STATUS)===!1)if(G=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,w,U,B);else{const tt=Qu(r,U,"vertex"),gt=Qu(r,B,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(w,r.VALIDATE_STATUS)+`
|
|
3791
3791
|
|
|
3792
3792
|
Material Name: `+k.name+`
|
|
3793
3793
|
Material Type: `+k.type+`
|
|
3794
3794
|
|
|
3795
3795
|
Program Info Log: `+at+`
|
|
3796
3796
|
`+tt+`
|
|
3797
|
-
`+gt)}else at!==""?console.warn("THREE.WebGLProgram: Program Info Log:",at):($===""||dt==="")&&(it=!1);it&&(k.diagnostics={runnable:G,programLog:at,vertexShader:{log:$,prefix:v},fragmentShader:{log:dt,prefix:g}})}r.deleteShader(U),r.deleteShader(B),F=new zo(r,w),I=Mx(r,w)}let F;this.getUniforms=function(){return F===void 0&&N(this),F};let I;this.getAttributes=function(){return I===void 0&&N(this),I};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(w,mx)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=gx++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=U,this.fragmentShader=B,this}let Ox=0;class Nx{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 Bx(t),e.set(t,s)),s}}class Bx{constructor(t){this.id=Ox++,this.code=t,this.usedTimes=0}}function Fx(n,t,e,s,r,a,l){const h=new Fl,u=new Nx,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(I){return d.add(I),I===0?"uv":`uv${I}`}function v(I,M,k,H,Z){const Q=H.fog,at=Z.geometry,$=I.isMeshStandardMaterial?H.environment:null,dt=(I.isMeshStandardMaterial?e:t).get(I.envMap||$),G=dt&&dt.mapping===ro?dt.image.height:null,it=S[I.type];I.precision!==null&&(E=r.getMaxPrecision(I.precision),E!==I.precision&&console.warn("THREE.WebGLProgram.getParameters:",I.precision,"not supported, using",E,"instead."));const tt=at.morphAttributes.position||at.morphAttributes.normal||at.morphAttributes.color,gt=tt!==void 0?tt.length:0;let It=0;at.morphAttributes.position!==void 0&&(It=1),at.morphAttributes.normal!==void 0&&(It=2),at.morphAttributes.color!==void 0&&(It=3);let ee,Yt,J,ct;if(it){const Me=jn[it];ee=Me.vertexShader,Yt=Me.fragmentShader}else ee=I.vertexShader,Yt=I.fragmentShader,u.update(I),J=u.getVertexShaderID(I),ct=u.getFragmentShaderID(I);const pt=n.getRenderTarget(),Nt=n.state.buffers.depth.getReversed(),st=Z.isInstancedMesh===!0,lt=Z.isBatchedMesh===!0,Dt=!!I.map,Bt=!!I.matcap,R=!!dt,ht=!!I.aoMap,ft=!!I.lightMap,At=!!I.bumpMap,vt=!!I.normalMap,qt=!!I.displacementMap,Mt=!!I.emissiveMap,Gt=!!I.metalnessMap,Se=!!I.roughnessMap,Ae=I.anisotropy>0,O=I.clearcoat>0,b=I.dispersion>0,j=I.iridescence>0,ot=I.sheen>0,_t=I.transmission>0,rt=Ae&&!!I.anisotropyMap,Vt=O&&!!I.clearcoatMap,St=O&&!!I.clearcoatNormalMap,Ft=O&&!!I.clearcoatRoughnessMap,Wt=j&&!!I.iridescenceMap,xt=j&&!!I.iridescenceThicknessMap,Rt=ot&&!!I.sheenColorMap,se=ot&&!!I.sheenRoughnessMap,Zt=!!I.specularMap,Ct=!!I.specularColorMap,ce=!!I.specularIntensityMap,V=_t&&!!I.transmissionMap,wt=_t&&!!I.thicknessMap,bt=!!I.gradientMap,Ot=!!I.alphaMap,yt=I.alphaTest>0,ut=!!I.alphaHash,Ht=!!I.extensions;let le=Ti;I.toneMapped&&(pt===null||pt.isXRRenderTarget===!0)&&(le=n.toneMapping);const Ie={shaderID:it,shaderType:I.type,shaderName:I.name,vertexShader:ee,fragmentShader:Yt,defines:I.defines,customVertexShaderID:J,customFragmentShaderID:ct,isRawShaderMaterial:I.isRawShaderMaterial===!0,glslVersion:I.glslVersion,precision:E,batching:lt,batchingColor:lt&&Z._colorsTexture!==null,instancing:st,instancingColor:st&&Z.instanceColor!==null,instancingMorph:st&&Z.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:pt===null?n.outputColorSpace:pt.isXRRenderTarget===!0?pt.texture.colorSpace:Qi,alphaToCoverage:!!I.alphaToCoverage,map:Dt,matcap:Bt,envMap:R,envMapMode:R&&dt.mapping,envMapCubeUVHeight:G,aoMap:ht,lightMap:ft,bumpMap:At,normalMap:vt,displacementMap:_&&qt,emissiveMap:Mt,normalMapObjectSpace:vt&&I.normalMapType===Y_,normalMapTangentSpace:vt&&I.normalMapType===X_,metalnessMap:Gt,roughnessMap:Se,anisotropy:Ae,anisotropyMap:rt,clearcoat:O,clearcoatMap:Vt,clearcoatNormalMap:St,clearcoatRoughnessMap:Ft,dispersion:b,iridescence:j,iridescenceMap:Wt,iridescenceThicknessMap:xt,sheen:ot,sheenColorMap:Rt,sheenRoughnessMap:se,specularMap:Zt,specularColorMap:Ct,specularIntensityMap:ce,transmission:_t,transmissionMap:V,thicknessMap:wt,gradientMap:bt,opaque:I.transparent===!1&&I.blending===ps&&I.alphaToCoverage===!1,alphaMap:Ot,alphaTest:yt,alphaHash:ut,combine:I.combine,mapUv:Dt&&w(I.map.channel),aoMapUv:ht&&w(I.aoMap.channel),lightMapUv:ft&&w(I.lightMap.channel),bumpMapUv:At&&w(I.bumpMap.channel),normalMapUv:vt&&w(I.normalMap.channel),displacementMapUv:qt&&w(I.displacementMap.channel),emissiveMapUv:Mt&&w(I.emissiveMap.channel),metalnessMapUv:Gt&&w(I.metalnessMap.channel),roughnessMapUv:Se&&w(I.roughnessMap.channel),anisotropyMapUv:rt&&w(I.anisotropyMap.channel),clearcoatMapUv:Vt&&w(I.clearcoatMap.channel),clearcoatNormalMapUv:St&&w(I.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ft&&w(I.clearcoatRoughnessMap.channel),iridescenceMapUv:Wt&&w(I.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&w(I.iridescenceThicknessMap.channel),sheenColorMapUv:Rt&&w(I.sheenColorMap.channel),sheenRoughnessMapUv:se&&w(I.sheenRoughnessMap.channel),specularMapUv:Zt&&w(I.specularMap.channel),specularColorMapUv:Ct&&w(I.specularColorMap.channel),specularIntensityMapUv:ce&&w(I.specularIntensityMap.channel),transmissionMapUv:V&&w(I.transmissionMap.channel),thicknessMapUv:wt&&w(I.thicknessMap.channel),alphaMapUv:Ot&&w(I.alphaMap.channel),vertexTangents:!!at.attributes.tangent&&(vt||Ae),vertexColors:I.vertexColors,vertexAlphas:I.vertexColors===!0&&!!at.attributes.color&&at.attributes.color.itemSize===4,pointsUvs:Z.isPoints===!0&&!!at.attributes.uv&&(Dt||Ot),fog:!!Q,useFog:I.fog===!0,fogExp2:!!Q&&Q.isFogExp2,flatShading:I.flatShading===!0&&I.wireframe===!1,sizeAttenuation:I.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Nt,skinning:Z.isSkinnedMesh===!0,morphTargets:at.morphAttributes.position!==void 0,morphNormals:at.morphAttributes.normal!==void 0,morphColors:at.morphAttributes.color!==void 0,morphTargetsCount:gt,morphTextureStride:It,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:I.dithering,shadowMapEnabled:n.shadowMap.enabled&&k.length>0,shadowMapType:n.shadowMap.type,toneMapping:le,decodeVideoTexture:Dt&&I.map.isVideoTexture===!0&&we.getTransfer(I.map.colorSpace)===Le,decodeVideoTextureEmissive:Mt&&I.emissiveMap.isVideoTexture===!0&&we.getTransfer(I.emissiveMap.colorSpace)===Le,premultipliedAlpha:I.premultipliedAlpha,doubleSided:I.side===ri,flipSided:I.side===un,useDepthPacking:I.depthPacking>=0,depthPacking:I.depthPacking||0,index0AttributeName:I.index0AttributeName,extensionClipCullDistance:Ht&&I.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Ht&&I.extensions.multiDraw===!0||lt)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:I.customProgramCacheKey()};return Ie.vertexUv1s=d.has(1),Ie.vertexUv2s=d.has(2),Ie.vertexUv3s=d.has(3),d.clear(),Ie}function g(I){const M=[];if(I.shaderID?M.push(I.shaderID):(M.push(I.customVertexShaderID),M.push(I.customFragmentShaderID)),I.defines!==void 0)for(const k in I.defines)M.push(k),M.push(I.defines[k]);return I.isRawShaderMaterial===!1&&(D(M,I),C(M,I),M.push(n.outputColorSpace)),M.push(I.customProgramCacheKey),M.join()}function D(I,M){I.push(M.precision),I.push(M.outputColorSpace),I.push(M.envMapMode),I.push(M.envMapCubeUVHeight),I.push(M.mapUv),I.push(M.alphaMapUv),I.push(M.lightMapUv),I.push(M.aoMapUv),I.push(M.bumpMapUv),I.push(M.normalMapUv),I.push(M.displacementMapUv),I.push(M.emissiveMapUv),I.push(M.metalnessMapUv),I.push(M.roughnessMapUv),I.push(M.anisotropyMapUv),I.push(M.clearcoatMapUv),I.push(M.clearcoatNormalMapUv),I.push(M.clearcoatRoughnessMapUv),I.push(M.iridescenceMapUv),I.push(M.iridescenceThicknessMapUv),I.push(M.sheenColorMapUv),I.push(M.sheenRoughnessMapUv),I.push(M.specularMapUv),I.push(M.specularColorMapUv),I.push(M.specularIntensityMapUv),I.push(M.transmissionMapUv),I.push(M.thicknessMapUv),I.push(M.combine),I.push(M.fogExp2),I.push(M.sizeAttenuation),I.push(M.morphTargetsCount),I.push(M.morphAttributeCount),I.push(M.numDirLights),I.push(M.numPointLights),I.push(M.numSpotLights),I.push(M.numSpotLightMaps),I.push(M.numHemiLights),I.push(M.numRectAreaLights),I.push(M.numDirLightShadows),I.push(M.numPointLightShadows),I.push(M.numSpotLightShadows),I.push(M.numSpotLightShadowsWithMaps),I.push(M.numLightProbes),I.push(M.shadowMapType),I.push(M.toneMapping),I.push(M.numClippingPlanes),I.push(M.numClipIntersection),I.push(M.depthPacking)}function C(I,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),I.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),I.push(h.mask)}function A(I){const M=S[I.type];let k;if(M){const H=jn[M];k=Nv.clone(H.uniforms)}else k=I.uniforms;return k}function U(I,M){let k;for(let H=0,Z=p.length;H<Z;H++){const Q=p[H];if(Q.cacheKey===M){k=Q,++k.usedTimes;break}}return k===void 0&&(k=new Ux(n,M,I,a),p.push(k)),k}function B(I){if(--I.usedTimes===0){const M=p.indexOf(I);p[M]=p[p.length-1],p.pop(),I.destroy()}}function N(I){u.remove(I)}function F(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:A,acquireProgram:U,releaseProgram:B,releaseShaderCache:N,programs:p,dispose:F}}function zx(){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 Hx(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 Ju(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 Ku(){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||Hx),s.length>1&&s.sort(_||Ju),r.length>1&&r.sort(_||Ju)}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 Vx(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new Ku,n.set(s,[l])):r>=a.length?(l=new Ku,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Gx(){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 Y,color:new Ce};break;case"SpotLight":e={position:new Y,direction:new Y,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new Y,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new Y,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":e={color:new Ce,position:new Y,halfWidth:new Y,halfHeight:new Y};break}return n[t.id]=e,e}}}function Wx(){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 Zx=0;function Xx(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Yx(n){const t=new Gx,e=Wx(),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 Y);const r=new Y,a=new Ue,l=new Ue;function h(d){let p=0,m=0,_=0;for(let I=0;I<9;I++)s.probe[I].set(0,0,0);let E=0,S=0,w=0,v=0,g=0,D=0,C=0,A=0,U=0,B=0,N=0;d.sort(Xx);for(let I=0,M=d.length;I<M;I++){const k=d[I],H=k.color,Z=k.intensity,Q=k.distance,at=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)p+=H.r*Z,m+=H.g*Z,_+=H.b*Z;else if(k.isLightProbe){for(let $=0;$<9;$++)s.probe[$].addScaledVector(k.sh.coefficients[$],Z);N++}else if(k.isDirectionalLight){const $=t.get(k);if($.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const dt=k.shadow,G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,s.directionalShadow[E]=G,s.directionalShadowMap[E]=at,s.directionalShadowMatrix[E]=k.shadow.matrix,D++}s.directional[E]=$,E++}else if(k.isSpotLight){const $=t.get(k);$.position.setFromMatrixPosition(k.matrixWorld),$.color.copy(H).multiplyScalar(Z),$.distance=Q,$.coneCos=Math.cos(k.angle),$.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),$.decay=k.decay,s.spot[w]=$;const dt=k.shadow;if(k.map&&(s.spotLightMap[U]=k.map,U++,dt.updateMatrices(k),k.castShadow&&B++),s.spotLightMatrix[w]=dt.matrix,k.castShadow){const G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,s.spotShadow[w]=G,s.spotShadowMap[w]=at,A++}w++}else if(k.isRectAreaLight){const $=t.get(k);$.color.copy(H).multiplyScalar(Z),$.halfWidth.set(k.width*.5,0,0),$.halfHeight.set(0,k.height*.5,0),s.rectArea[v]=$,v++}else if(k.isPointLight){const $=t.get(k);if($.color.copy(k.color).multiplyScalar(k.intensity),$.distance=k.distance,$.decay=k.decay,k.castShadow){const dt=k.shadow,G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,G.shadowCameraNear=dt.camera.near,G.shadowCameraFar=dt.camera.far,s.pointShadow[S]=G,s.pointShadowMap[S]=at,s.pointShadowMatrix[S]=k.shadow.matrix,C++}s.point[S]=$,S++}else if(k.isHemisphereLight){const $=t.get(k);$.skyColor.copy(k.color).multiplyScalar(Z),$.groundColor.copy(k.groundColor).multiplyScalar(Z),s.hemi[g]=$,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 F=s.hash;(F.directionalLength!==E||F.pointLength!==S||F.spotLength!==w||F.rectAreaLength!==v||F.hemiLength!==g||F.numDirectionalShadows!==D||F.numPointShadows!==C||F.numSpotShadows!==A||F.numSpotMaps!==U||F.numLightProbes!==N)&&(s.directional.length=E,s.spot.length=w,s.rectArea.length=v,s.point.length=S,s.hemi.length=g,s.directionalShadow.length=D,s.directionalShadowMap.length=D,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=A,s.spotShadowMap.length=A,s.directionalShadowMatrix.length=D,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=A+U-B,s.spotLightMap.length=U,s.numSpotLightShadowsWithMaps=B,s.numLightProbes=N,F.directionalLength=E,F.pointLength=S,F.spotLength=w,F.rectAreaLength=v,F.hemiLength=g,F.numDirectionalShadows=D,F.numPointShadows=C,F.numSpotShadows=A,F.numSpotMaps=U,F.numLightProbes=N,s.version=Zx++)}function u(d,p){let m=0,_=0,E=0,S=0,w=0;const v=p.matrixWorldInverse;for(let g=0,D=d.length;g<D;g++){const C=d[g];if(C.isDirectionalLight){const A=s.directional[m];A.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),m++}else if(C.isSpotLight){const A=s.spot[E];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),A.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),E++}else if(C.isRectAreaLight){const A=s.rectArea[S];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),l.identity(),a.copy(C.matrixWorld),a.premultiply(v),l.extractRotation(a),A.halfWidth.set(C.width*.5,0,0),A.halfHeight.set(0,C.height*.5,0),A.halfWidth.applyMatrix4(l),A.halfHeight.applyMatrix4(l),S++}else if(C.isPointLight){const A=s.point[_];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),_++}else if(C.isHemisphereLight){const A=s.hemi[w];A.direction.setFromMatrixPosition(C.matrixWorld),A.direction.transformDirection(v),w++}}}return{setup:h,setupView:u,state:s}}function $u(n){const t=new Yx(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 qx(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new $u(n),t.set(r,[h])):a>=l.length?(h=new $u(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const Qx=`void main() {
|
|
3797
|
+
`+gt)}else at!==""?console.warn("THREE.WebGLProgram: Program Info Log:",at):($===""||dt==="")&&(it=!1);it&&(k.diagnostics={runnable:G,programLog:at,vertexShader:{log:$,prefix:v},fragmentShader:{log:dt,prefix:g}})}r.deleteShader(U),r.deleteShader(B),F=new zo(r,w),I=Cx(r,w)}let F;this.getUniforms=function(){return F===void 0&&N(this),F};let I;this.getAttributes=function(){return I===void 0&&N(this),I};let M=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=r.getProgramParameter(w,yx)),M},this.destroy=function(){s.releaseStatesOfProgram(this),r.deleteProgram(w),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Ex++,this.cacheKey=t,this.usedTimes=1,this.program=w,this.vertexShader=U,this.fragmentShader=B,this}let zx=0;class Hx{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 Vx(t),e.set(t,s)),s}}class Vx{constructor(t){this.id=zx++,this.code=t,this.usedTimes=0}}function Gx(n,t,e,s,r,a,l){const h=new zl,u=new Hx,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(I){return d.add(I),I===0?"uv":`uv${I}`}function v(I,M,k,H,Z){const j=H.fog,at=Z.geometry,$=I.isMeshStandardMaterial?H.environment:null,dt=(I.isMeshStandardMaterial?e:t).get(I.envMap||$),G=dt&&dt.mapping===ro?dt.image.height:null,it=S[I.type];I.precision!==null&&(E=r.getMaxPrecision(I.precision),E!==I.precision&&console.warn("THREE.WebGLProgram.getParameters:",I.precision,"not supported, using",E,"instead."));const tt=at.morphAttributes.position||at.morphAttributes.normal||at.morphAttributes.color,gt=tt!==void 0?tt.length:0;let At=0;at.morphAttributes.position!==void 0&&(At=1),at.morphAttributes.normal!==void 0&&(At=2),at.morphAttributes.color!==void 0&&(At=3);let Jt,Ft,Q,lt;if(it){const Me=jn[it];Jt=Me.vertexShader,Ft=Me.fragmentShader}else Jt=I.vertexShader,Ft=I.fragmentShader,u.update(I),Q=u.getVertexShaderID(I),lt=u.getFragmentShaderID(I);const pt=n.getRenderTarget(),Nt=n.state.buffers.depth.getReversed(),st=Z.isInstancedMesh===!0,ct=Z.isBatchedMesh===!0,Dt=!!I.map,Bt=!!I.matcap,R=!!dt,ht=!!I.aoMap,ft=!!I.lightMap,Ct=!!I.bumpMap,vt=!!I.normalMap,qt=!!I.displacementMap,Mt=!!I.emissiveMap,Wt=!!I.metalnessMap,Se=!!I.roughnessMap,Ae=I.anisotropy>0,O=I.clearcoat>0,b=I.dispersion>0,J=I.iridescence>0,ot=I.sheen>0,_t=I.transmission>0,rt=Ae&&!!I.anisotropyMap,Gt=O&&!!I.clearcoatMap,St=O&&!!I.clearcoatNormalMap,zt=O&&!!I.clearcoatRoughnessMap,Zt=J&&!!I.iridescenceMap,xt=J&&!!I.iridescenceThicknessMap,Lt=ot&&!!I.sheenColorMap,se=ot&&!!I.sheenRoughnessMap,Xt=!!I.specularMap,Pt=!!I.specularColorMap,ce=!!I.specularIntensityMap,V=_t&&!!I.transmissionMap,wt=_t&&!!I.thicknessMap,bt=!!I.gradientMap,Ot=!!I.alphaMap,yt=I.alphaTest>0,ut=!!I.alphaHash,Vt=!!I.extensions;let le=Ti;I.toneMapped&&(pt===null||pt.isXRRenderTarget===!0)&&(le=n.toneMapping);const Ie={shaderID:it,shaderType:I.type,shaderName:I.name,vertexShader:Jt,fragmentShader:Ft,defines:I.defines,customVertexShaderID:Q,customFragmentShaderID:lt,isRawShaderMaterial:I.isRawShaderMaterial===!0,glslVersion:I.glslVersion,precision:E,batching:ct,batchingColor:ct&&Z._colorsTexture!==null,instancing:st,instancingColor:st&&Z.instanceColor!==null,instancingMorph:st&&Z.morphTexture!==null,supportsVertexTextures:_,outputColorSpace:pt===null?n.outputColorSpace:pt.isXRRenderTarget===!0?pt.texture.colorSpace:Qi,alphaToCoverage:!!I.alphaToCoverage,map:Dt,matcap:Bt,envMap:R,envMapMode:R&&dt.mapping,envMapCubeUVHeight:G,aoMap:ht,lightMap:ft,bumpMap:Ct,normalMap:vt,displacementMap:_&&qt,emissiveMap:Mt,normalMapObjectSpace:vt&&I.normalMapType===J_,normalMapTangentSpace:vt&&I.normalMapType===j_,metalnessMap:Wt,roughnessMap:Se,anisotropy:Ae,anisotropyMap:rt,clearcoat:O,clearcoatMap:Gt,clearcoatNormalMap:St,clearcoatRoughnessMap:zt,dispersion:b,iridescence:J,iridescenceMap:Zt,iridescenceThicknessMap:xt,sheen:ot,sheenColorMap:Lt,sheenRoughnessMap:se,specularMap:Xt,specularColorMap:Pt,specularIntensityMap:ce,transmission:_t,transmissionMap:V,thicknessMap:wt,gradientMap:bt,opaque:I.transparent===!1&&I.blending===ps&&I.alphaToCoverage===!1,alphaMap:Ot,alphaTest:yt,alphaHash:ut,combine:I.combine,mapUv:Dt&&w(I.map.channel),aoMapUv:ht&&w(I.aoMap.channel),lightMapUv:ft&&w(I.lightMap.channel),bumpMapUv:Ct&&w(I.bumpMap.channel),normalMapUv:vt&&w(I.normalMap.channel),displacementMapUv:qt&&w(I.displacementMap.channel),emissiveMapUv:Mt&&w(I.emissiveMap.channel),metalnessMapUv:Wt&&w(I.metalnessMap.channel),roughnessMapUv:Se&&w(I.roughnessMap.channel),anisotropyMapUv:rt&&w(I.anisotropyMap.channel),clearcoatMapUv:Gt&&w(I.clearcoatMap.channel),clearcoatNormalMapUv:St&&w(I.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:zt&&w(I.clearcoatRoughnessMap.channel),iridescenceMapUv:Zt&&w(I.iridescenceMap.channel),iridescenceThicknessMapUv:xt&&w(I.iridescenceThicknessMap.channel),sheenColorMapUv:Lt&&w(I.sheenColorMap.channel),sheenRoughnessMapUv:se&&w(I.sheenRoughnessMap.channel),specularMapUv:Xt&&w(I.specularMap.channel),specularColorMapUv:Pt&&w(I.specularColorMap.channel),specularIntensityMapUv:ce&&w(I.specularIntensityMap.channel),transmissionMapUv:V&&w(I.transmissionMap.channel),thicknessMapUv:wt&&w(I.thicknessMap.channel),alphaMapUv:Ot&&w(I.alphaMap.channel),vertexTangents:!!at.attributes.tangent&&(vt||Ae),vertexColors:I.vertexColors,vertexAlphas:I.vertexColors===!0&&!!at.attributes.color&&at.attributes.color.itemSize===4,pointsUvs:Z.isPoints===!0&&!!at.attributes.uv&&(Dt||Ot),fog:!!j,useFog:I.fog===!0,fogExp2:!!j&&j.isFogExp2,flatShading:I.flatShading===!0&&I.wireframe===!1,sizeAttenuation:I.sizeAttenuation===!0,logarithmicDepthBuffer:m,reversedDepthBuffer:Nt,skinning:Z.isSkinnedMesh===!0,morphTargets:at.morphAttributes.position!==void 0,morphNormals:at.morphAttributes.normal!==void 0,morphColors:at.morphAttributes.color!==void 0,morphTargetsCount:gt,morphTextureStride:At,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:I.dithering,shadowMapEnabled:n.shadowMap.enabled&&k.length>0,shadowMapType:n.shadowMap.type,toneMapping:le,decodeVideoTexture:Dt&&I.map.isVideoTexture===!0&&we.getTransfer(I.map.colorSpace)===Le,decodeVideoTextureEmissive:Mt&&I.emissiveMap.isVideoTexture===!0&&we.getTransfer(I.emissiveMap.colorSpace)===Le,premultipliedAlpha:I.premultipliedAlpha,doubleSided:I.side===ri,flipSided:I.side===un,useDepthPacking:I.depthPacking>=0,depthPacking:I.depthPacking||0,index0AttributeName:I.index0AttributeName,extensionClipCullDistance:Vt&&I.extensions.clipCullDistance===!0&&s.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Vt&&I.extensions.multiDraw===!0||ct)&&s.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:s.has("KHR_parallel_shader_compile"),customProgramCacheKey:I.customProgramCacheKey()};return Ie.vertexUv1s=d.has(1),Ie.vertexUv2s=d.has(2),Ie.vertexUv3s=d.has(3),d.clear(),Ie}function g(I){const M=[];if(I.shaderID?M.push(I.shaderID):(M.push(I.customVertexShaderID),M.push(I.customFragmentShaderID)),I.defines!==void 0)for(const k in I.defines)M.push(k),M.push(I.defines[k]);return I.isRawShaderMaterial===!1&&(D(M,I),C(M,I),M.push(n.outputColorSpace)),M.push(I.customProgramCacheKey),M.join()}function D(I,M){I.push(M.precision),I.push(M.outputColorSpace),I.push(M.envMapMode),I.push(M.envMapCubeUVHeight),I.push(M.mapUv),I.push(M.alphaMapUv),I.push(M.lightMapUv),I.push(M.aoMapUv),I.push(M.bumpMapUv),I.push(M.normalMapUv),I.push(M.displacementMapUv),I.push(M.emissiveMapUv),I.push(M.metalnessMapUv),I.push(M.roughnessMapUv),I.push(M.anisotropyMapUv),I.push(M.clearcoatMapUv),I.push(M.clearcoatNormalMapUv),I.push(M.clearcoatRoughnessMapUv),I.push(M.iridescenceMapUv),I.push(M.iridescenceThicknessMapUv),I.push(M.sheenColorMapUv),I.push(M.sheenRoughnessMapUv),I.push(M.specularMapUv),I.push(M.specularColorMapUv),I.push(M.specularIntensityMapUv),I.push(M.transmissionMapUv),I.push(M.thicknessMapUv),I.push(M.combine),I.push(M.fogExp2),I.push(M.sizeAttenuation),I.push(M.morphTargetsCount),I.push(M.morphAttributeCount),I.push(M.numDirLights),I.push(M.numPointLights),I.push(M.numSpotLights),I.push(M.numSpotLightMaps),I.push(M.numHemiLights),I.push(M.numRectAreaLights),I.push(M.numDirLightShadows),I.push(M.numPointLightShadows),I.push(M.numSpotLightShadows),I.push(M.numSpotLightShadowsWithMaps),I.push(M.numLightProbes),I.push(M.shadowMapType),I.push(M.toneMapping),I.push(M.numClippingPlanes),I.push(M.numClipIntersection),I.push(M.depthPacking)}function C(I,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),I.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),I.push(h.mask)}function A(I){const M=S[I.type];let k;if(M){const H=jn[M];k=Hv.clone(H.uniforms)}else k=I.uniforms;return k}function U(I,M){let k;for(let H=0,Z=p.length;H<Z;H++){const j=p[H];if(j.cacheKey===M){k=j,++k.usedTimes;break}}return k===void 0&&(k=new Fx(n,M,I,a),p.push(k)),k}function B(I){if(--I.usedTimes===0){const M=p.indexOf(I);p[M]=p[p.length-1],p.pop(),I.destroy()}}function N(I){u.remove(I)}function F(){u.dispose()}return{getParameters:v,getProgramCacheKey:g,getUniforms:A,acquireProgram:U,releaseProgram:B,releaseShaderCache:N,programs:p,dispose:F}}function Wx(){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 Zx(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 td(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 ed(){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||Zx),s.length>1&&s.sort(_||td),r.length>1&&r.sort(_||td)}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 Xx(){let n=new WeakMap;function t(s,r){const a=n.get(s);let l;return a===void 0?(l=new ed,n.set(s,[l])):r>=a.length?(l=new ed,a.push(l)):l=a[r],l}function e(){n=new WeakMap}return{get:t,dispose:e}}function Yx(){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 Y,color:new Ce};break;case"SpotLight":e={position:new Y,direction:new Y,color:new Ce,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new Y,color:new Ce,distance:0,decay:0};break;case"HemisphereLight":e={direction:new Y,skyColor:new Ce,groundColor:new Ce};break;case"RectAreaLight":e={color:new Ce,position:new Y,halfWidth:new Y,halfHeight:new Y};break}return n[t.id]=e,e}}}function qx(){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 Qx=0;function jx(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function Jx(n){const t=new Yx,e=qx(),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 Y);const r=new Y,a=new Oe,l=new Oe;function h(d){let p=0,m=0,_=0;for(let I=0;I<9;I++)s.probe[I].set(0,0,0);let E=0,S=0,w=0,v=0,g=0,D=0,C=0,A=0,U=0,B=0,N=0;d.sort(jx);for(let I=0,M=d.length;I<M;I++){const k=d[I],H=k.color,Z=k.intensity,j=k.distance,at=k.shadow&&k.shadow.map?k.shadow.map.texture:null;if(k.isAmbientLight)p+=H.r*Z,m+=H.g*Z,_+=H.b*Z;else if(k.isLightProbe){for(let $=0;$<9;$++)s.probe[$].addScaledVector(k.sh.coefficients[$],Z);N++}else if(k.isDirectionalLight){const $=t.get(k);if($.color.copy(k.color).multiplyScalar(k.intensity),k.castShadow){const dt=k.shadow,G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,s.directionalShadow[E]=G,s.directionalShadowMap[E]=at,s.directionalShadowMatrix[E]=k.shadow.matrix,D++}s.directional[E]=$,E++}else if(k.isSpotLight){const $=t.get(k);$.position.setFromMatrixPosition(k.matrixWorld),$.color.copy(H).multiplyScalar(Z),$.distance=j,$.coneCos=Math.cos(k.angle),$.penumbraCos=Math.cos(k.angle*(1-k.penumbra)),$.decay=k.decay,s.spot[w]=$;const dt=k.shadow;if(k.map&&(s.spotLightMap[U]=k.map,U++,dt.updateMatrices(k),k.castShadow&&B++),s.spotLightMatrix[w]=dt.matrix,k.castShadow){const G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,s.spotShadow[w]=G,s.spotShadowMap[w]=at,A++}w++}else if(k.isRectAreaLight){const $=t.get(k);$.color.copy(H).multiplyScalar(Z),$.halfWidth.set(k.width*.5,0,0),$.halfHeight.set(0,k.height*.5,0),s.rectArea[v]=$,v++}else if(k.isPointLight){const $=t.get(k);if($.color.copy(k.color).multiplyScalar(k.intensity),$.distance=k.distance,$.decay=k.decay,k.castShadow){const dt=k.shadow,G=e.get(k);G.shadowIntensity=dt.intensity,G.shadowBias=dt.bias,G.shadowNormalBias=dt.normalBias,G.shadowRadius=dt.radius,G.shadowMapSize=dt.mapSize,G.shadowCameraNear=dt.camera.near,G.shadowCameraFar=dt.camera.far,s.pointShadow[S]=G,s.pointShadowMap[S]=at,s.pointShadowMatrix[S]=k.shadow.matrix,C++}s.point[S]=$,S++}else if(k.isHemisphereLight){const $=t.get(k);$.skyColor.copy(k.color).multiplyScalar(Z),$.groundColor.copy(k.groundColor).multiplyScalar(Z),s.hemi[g]=$,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 F=s.hash;(F.directionalLength!==E||F.pointLength!==S||F.spotLength!==w||F.rectAreaLength!==v||F.hemiLength!==g||F.numDirectionalShadows!==D||F.numPointShadows!==C||F.numSpotShadows!==A||F.numSpotMaps!==U||F.numLightProbes!==N)&&(s.directional.length=E,s.spot.length=w,s.rectArea.length=v,s.point.length=S,s.hemi.length=g,s.directionalShadow.length=D,s.directionalShadowMap.length=D,s.pointShadow.length=C,s.pointShadowMap.length=C,s.spotShadow.length=A,s.spotShadowMap.length=A,s.directionalShadowMatrix.length=D,s.pointShadowMatrix.length=C,s.spotLightMatrix.length=A+U-B,s.spotLightMap.length=U,s.numSpotLightShadowsWithMaps=B,s.numLightProbes=N,F.directionalLength=E,F.pointLength=S,F.spotLength=w,F.rectAreaLength=v,F.hemiLength=g,F.numDirectionalShadows=D,F.numPointShadows=C,F.numSpotShadows=A,F.numSpotMaps=U,F.numLightProbes=N,s.version=Qx++)}function u(d,p){let m=0,_=0,E=0,S=0,w=0;const v=p.matrixWorldInverse;for(let g=0,D=d.length;g<D;g++){const C=d[g];if(C.isDirectionalLight){const A=s.directional[m];A.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),m++}else if(C.isSpotLight){const A=s.spot[E];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),A.direction.setFromMatrixPosition(C.matrixWorld),r.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(r),A.direction.transformDirection(v),E++}else if(C.isRectAreaLight){const A=s.rectArea[S];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),l.identity(),a.copy(C.matrixWorld),a.premultiply(v),l.extractRotation(a),A.halfWidth.set(C.width*.5,0,0),A.halfHeight.set(0,C.height*.5,0),A.halfWidth.applyMatrix4(l),A.halfHeight.applyMatrix4(l),S++}else if(C.isPointLight){const A=s.point[_];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(v),_++}else if(C.isHemisphereLight){const A=s.hemi[w];A.direction.setFromMatrixPosition(C.matrixWorld),A.direction.transformDirection(v),w++}}}return{setup:h,setupView:u,state:s}}function nd(n){const t=new Jx(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 Kx(n){let t=new WeakMap;function e(r,a=0){const l=t.get(r);let h;return l===void 0?(h=new nd(n),t.set(r,[h])):a>=l.length?(h=new nd(n),l.push(h)):h=l[a],h}function s(){t=new WeakMap}return{get:e,dispose:s}}const $x=`void main() {
|
|
3798
3798
|
gl_Position = vec4( position, 1.0 );
|
|
3799
|
-
}`,
|
|
3799
|
+
}`,tw=`uniform sampler2D shadow_pass;
|
|
3800
3800
|
uniform vec2 resolution;
|
|
3801
3801
|
uniform float radius;
|
|
3802
3802
|
#include <packing>
|
|
@@ -3822,12 +3822,12 @@ 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 Jx(n,t,e){let s=new tc;const r=new be,a=new be,l=new Fe,h=new Jv({depthPacking:Z_}),u=new Kv,d={},p=e.maxTextureSize,m={[Si]:un,[un]:Si,[ri]:ri},_=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:Qx,fragmentShader:jx}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const S=new Qn;S.setAttribute("position",new qn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new dn(S,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Th;let g=this.type;this.render=function(B,N,F){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||B.length===0)return;const I=n.getRenderTarget(),M=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),H=n.state;H.setBlending(Mi),H.buffers.depth.getReversed()?H.buffers.color.setClear(0,0,0,0):H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const Z=g!==si&&this.type===si,Q=g===si&&this.type!==si;for(let at=0,$=B.length;at<$;at++){const dt=B[at],G=dt.shadow;if(G===void 0){console.warn("THREE.WebGLShadowMap:",dt,"has no shadow.");continue}if(G.autoUpdate===!1&&G.needsUpdate===!1)continue;r.copy(G.mapSize);const it=G.getFrameExtents();if(r.multiply(it),a.copy(G.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/it.x),r.x=a.x*it.x,G.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/it.y),r.y=a.y*it.y,G.mapSize.y=a.y)),G.map===null||Z===!0||Q===!0){const gt=this.type!==si?{minFilter:Un,magFilter:Un}:{};G.map!==null&&G.map.dispose(),G.map=new Ci(r.x,r.y,gt),G.map.texture.name=dt.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const tt=G.getViewportCount();for(let gt=0;gt<tt;gt++){const It=G.getViewport(gt);l.set(a.x*It.x,a.y*It.y,a.x*It.z,a.y*It.w),H.viewport(l),G.updateMatrices(dt,gt),s=G.getFrustum(),A(N,F,G.camera,dt,this.type)}G.isPointLightShadow!==!0&&this.type===si&&D(G,F),G.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(I,M,k)};function D(B,N){const F=t.update(w);_.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 Ci(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,F,_,w,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,F,E,w,null)}function C(B,N,F,I){let M=null;const k=F.isPointLight===!0?B.customDistanceMaterial:B.customDepthMaterial;if(k!==void 0)M=k;else if(M=F.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 H=M.uuid,Z=N.uuid;let Q=d[H];Q===void 0&&(Q={},d[H]=Q);let at=Q[Z];at===void 0&&(at=M.clone(),Q[Z]=at,N.addEventListener("dispose",U)),M=at}if(M.visible=N.visible,M.wireframe=N.wireframe,I===si?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,F.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const H=n.properties.get(M);H.light=F}return M}function A(B,N,F,I,M){if(B.visible===!1)return;if(B.layers.test(N.layers)&&(B.isMesh||B.isLine||B.isPoints)&&(B.castShadow||B.receiveShadow&&M===si)&&(!B.frustumCulled||s.intersectsObject(B))){B.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,B.matrixWorld);const Z=t.update(B),Q=B.material;if(Array.isArray(Q)){const at=Z.groups;for(let $=0,dt=at.length;$<dt;$++){const G=at[$],it=Q[G.materialIndex];if(it&&it.visible){const tt=C(B,it,I,M);B.onBeforeShadow(n,B,N,F,Z,tt,G),n.renderBufferDirect(F,null,Z,tt,B,G),B.onAfterShadow(n,B,N,F,Z,tt,G)}}}else if(Q.visible){const at=C(B,Q,I,M);B.onBeforeShadow(n,B,N,F,Z,at,null),n.renderBufferDirect(F,null,Z,at,B,null),B.onAfterShadow(n,B,N,F,Z,at,null)}}const H=B.children;for(let Z=0,Q=H.length;Z<Q;Z++)A(H[Z],N,F,I,M)}function U(B){B.target.removeEventListener("dispose",U);for(const F in d){const I=d[F],M=B.target.uuid;M in I&&(I[M].dispose(),delete I[M])}}}const Kx={[Na]:Ba,[Fa]:Va,[za]:Ga,[ms]:Ha,[Ba]:Na,[Va]:Fa,[Ga]:za,[Ha]:ms};function $x(n,t){function e(){let V=!1;const wt=new Fe;let bt=null;const Ot=new Fe(0,0,0,0);return{setMask:function(yt){bt!==yt&&!V&&(n.colorMask(yt,yt,yt,yt),bt=yt)},setLocked:function(yt){V=yt},setClear:function(yt,ut,Ht,le,Ie){Ie===!0&&(yt*=le,ut*=le,Ht*=le),wt.set(yt,ut,Ht,le),Ot.equals(wt)===!1&&(n.clearColor(yt,ut,Ht,le),Ot.copy(wt))},reset:function(){V=!1,bt=null,Ot.set(-1,0,0,0)}}}function s(){let V=!1,wt=!1,bt=null,Ot=null,yt=null;return{setReversed:function(ut){if(wt!==ut){const Ht=t.get("EXT_clip_control");ut?Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.ZERO_TO_ONE_EXT):Ht.clipControlEXT(Ht.LOWER_LEFT_EXT,Ht.NEGATIVE_ONE_TO_ONE_EXT),wt=ut;const le=yt;yt=null,this.setClear(le)}},getReversed:function(){return wt},setTest:function(ut){ut?pt(n.DEPTH_TEST):Nt(n.DEPTH_TEST)},setMask:function(ut){bt!==ut&&!V&&(n.depthMask(ut),bt=ut)},setFunc:function(ut){if(wt&&(ut=Kx[ut]),Ot!==ut){switch(ut){case Na:n.depthFunc(n.NEVER);break;case Ba:n.depthFunc(n.ALWAYS);break;case Fa:n.depthFunc(n.LESS);break;case ms:n.depthFunc(n.LEQUAL);break;case za:n.depthFunc(n.EQUAL);break;case Ha:n.depthFunc(n.GEQUAL);break;case Va:n.depthFunc(n.GREATER);break;case Ga:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ot=ut}},setLocked:function(ut){V=ut},setClear:function(ut){yt!==ut&&(wt&&(ut=1-ut),n.clearDepth(ut),yt=ut)},reset:function(){V=!1,bt=null,Ot=null,yt=null,wt=!1}}}function r(){let V=!1,wt=null,bt=null,Ot=null,yt=null,ut=null,Ht=null,le=null,Ie=null;return{setTest:function(Me){V||(Me?pt(n.STENCIL_TEST):Nt(n.STENCIL_TEST))},setMask:function(Me){wt!==Me&&!V&&(n.stencilMask(Me),wt=Me)},setFunc:function(Me,Sn,In){(bt!==Me||Ot!==Sn||yt!==In)&&(n.stencilFunc(Me,Sn,In),bt=Me,Ot=Sn,yt=In)},setOp:function(Me,Sn,In){(ut!==Me||Ht!==Sn||le!==In)&&(n.stencilOp(Me,Sn,In),ut=Me,Ht=Sn,le=In)},setLocked:function(Me){V=Me},setClear:function(Me){Ie!==Me&&(n.clearStencil(Me),Ie=Me)},reset:function(){V=!1,wt=null,bt=null,Ot=null,yt=null,ut=null,Ht=null,le=null,Ie=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,D=null,C=null,A=null,U=null,B=null,N=new Ce(0,0,0),F=0,I=!1,M=null,k=null,H=null,Z=null,Q=null;const at=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let $=!1,dt=0;const G=n.getParameter(n.VERSION);G.indexOf("WebGL")!==-1?(dt=parseFloat(/^WebGL (\d)/.exec(G)[1]),$=dt>=1):G.indexOf("OpenGL ES")!==-1&&(dt=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),$=dt>=2);let it=null,tt={};const gt=n.getParameter(n.SCISSOR_BOX),It=n.getParameter(n.VIEWPORT),ee=new Fe().fromArray(gt),Yt=new Fe().fromArray(It);function J(V,wt,bt,Ot){const yt=new Uint8Array(4),ut=n.createTexture();n.bindTexture(V,ut),n.texParameteri(V,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(V,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ht=0;Ht<bt;Ht++)V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY?n.texImage3D(wt,0,n.RGBA,1,1,Ot,0,n.RGBA,n.UNSIGNED_BYTE,yt):n.texImage2D(wt+Ht,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,yt);return ut}const ct={};ct[n.TEXTURE_2D]=J(n.TEXTURE_2D,n.TEXTURE_2D,1),ct[n.TEXTURE_CUBE_MAP]=J(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),ct[n.TEXTURE_2D_ARRAY]=J(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),ct[n.TEXTURE_3D]=J(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),pt(n.DEPTH_TEST),l.setFunc(ms),At(!1),vt(Mh),pt(n.CULL_FACE),ht(Mi);function pt(V){p[V]!==!0&&(n.enable(V),p[V]=!0)}function Nt(V){p[V]!==!1&&(n.disable(V),p[V]=!1)}function st(V,wt){return m[V]!==wt?(n.bindFramebuffer(V,wt),m[V]=wt,V===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=wt),V===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=wt),!0):!1}function lt(V,wt){let bt=E,Ot=!1;if(V){bt=_.get(wt),bt===void 0&&(bt=[],_.set(wt,bt));const yt=V.textures;if(bt.length!==yt.length||bt[0]!==n.COLOR_ATTACHMENT0){for(let ut=0,Ht=yt.length;ut<Ht;ut++)bt[ut]=n.COLOR_ATTACHMENT0+ut;bt.length=yt.length,Ot=!0}}else bt[0]!==n.BACK&&(bt[0]=n.BACK,Ot=!0);Ot&&n.drawBuffers(bt)}function Dt(V){return S!==V?(n.useProgram(V),S=V,!0):!1}const Bt={[Xi]:n.FUNC_ADD,[v_]:n.FUNC_SUBTRACT,[y_]:n.FUNC_REVERSE_SUBTRACT};Bt[E_]=n.MIN,Bt[x_]=n.MAX;const R={[w_]:n.ZERO,[S_]:n.ONE,[M_]:n.SRC_COLOR,[Ua]:n.SRC_ALPHA,[R_]:n.SRC_ALPHA_SATURATE,[C_]:n.DST_COLOR,[b_]:n.DST_ALPHA,[T_]:n.ONE_MINUS_SRC_COLOR,[Oa]:n.ONE_MINUS_SRC_ALPHA,[P_]:n.ONE_MINUS_DST_COLOR,[A_]:n.ONE_MINUS_DST_ALPHA,[L_]:n.CONSTANT_COLOR,[I_]:n.ONE_MINUS_CONSTANT_COLOR,[D_]:n.CONSTANT_ALPHA,[k_]:n.ONE_MINUS_CONSTANT_ALPHA};function ht(V,wt,bt,Ot,yt,ut,Ht,le,Ie,Me){if(V===Mi){w===!0&&(Nt(n.BLEND),w=!1);return}if(w===!1&&(pt(n.BLEND),w=!0),V!==__){if(V!==v||Me!==I){if((g!==Xi||A!==Xi)&&(n.blendEquation(n.FUNC_ADD),g=Xi,A=Xi),Me)switch(V){case ps:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case bh:n.blendFunc(n.ONE,n.ONE);break;case Ah:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case Ch:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}else switch(V){case ps:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case bh:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case Ah:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case Ch:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}D=null,C=null,U=null,B=null,N.set(0,0,0),F=0,v=V,I=Me}return}yt=yt||wt,ut=ut||bt,Ht=Ht||Ot,(wt!==g||yt!==A)&&(n.blendEquationSeparate(Bt[wt],Bt[yt]),g=wt,A=yt),(bt!==D||Ot!==C||ut!==U||Ht!==B)&&(n.blendFuncSeparate(R[bt],R[Ot],R[ut],R[Ht]),D=bt,C=Ot,U=ut,B=Ht),(le.equals(N)===!1||Ie!==F)&&(n.blendColor(le.r,le.g,le.b,Ie),N.copy(le),F=Ie),v=V,I=!1}function ft(V,wt){V.side===ri?Nt(n.CULL_FACE):pt(n.CULL_FACE);let bt=V.side===un;wt&&(bt=!bt),At(bt),V.blending===ps&&V.transparent===!1?ht(Mi):ht(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.blendColor,V.blendAlpha,V.premultipliedAlpha),l.setFunc(V.depthFunc),l.setTest(V.depthTest),l.setMask(V.depthWrite),a.setMask(V.colorWrite);const Ot=V.stencilWrite;h.setTest(Ot),Ot&&(h.setMask(V.stencilWriteMask),h.setFunc(V.stencilFunc,V.stencilRef,V.stencilFuncMask),h.setOp(V.stencilFail,V.stencilZFail,V.stencilZPass)),Mt(V.polygonOffset,V.polygonOffsetFactor,V.polygonOffsetUnits),V.alphaToCoverage===!0?pt(n.SAMPLE_ALPHA_TO_COVERAGE):Nt(n.SAMPLE_ALPHA_TO_COVERAGE)}function At(V){M!==V&&(V?n.frontFace(n.CW):n.frontFace(n.CCW),M=V)}function vt(V){V!==p_?(pt(n.CULL_FACE),V!==k&&(V===Mh?n.cullFace(n.BACK):V===m_?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Nt(n.CULL_FACE),k=V}function qt(V){V!==H&&($&&n.lineWidth(V),H=V)}function Mt(V,wt,bt){V?(pt(n.POLYGON_OFFSET_FILL),(Z!==wt||Q!==bt)&&(n.polygonOffset(wt,bt),Z=wt,Q=bt)):Nt(n.POLYGON_OFFSET_FILL)}function Gt(V){V?pt(n.SCISSOR_TEST):Nt(n.SCISSOR_TEST)}function Se(V){V===void 0&&(V=n.TEXTURE0+at-1),it!==V&&(n.activeTexture(V),it=V)}function Ae(V,wt,bt){bt===void 0&&(it===null?bt=n.TEXTURE0+at-1:bt=it);let Ot=tt[bt];Ot===void 0&&(Ot={type:void 0,texture:void 0},tt[bt]=Ot),(Ot.type!==V||Ot.texture!==wt)&&(it!==bt&&(n.activeTexture(bt),it=bt),n.bindTexture(V,wt||ct[V]),Ot.type=V,Ot.texture=wt)}function O(){const V=tt[it];V!==void 0&&V.type!==void 0&&(n.bindTexture(V.type,null),V.type=void 0,V.texture=void 0)}function b(){try{n.compressedTexImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function j(){try{n.compressedTexImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function ot(){try{n.texSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function _t(){try{n.texSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function rt(){try{n.compressedTexSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Vt(){try{n.compressedTexSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function St(){try{n.texStorage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Ft(){try{n.texStorage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Wt(){try{n.texImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function xt(){try{n.texImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Rt(V){ee.equals(V)===!1&&(n.scissor(V.x,V.y,V.z,V.w),ee.copy(V))}function se(V){Yt.equals(V)===!1&&(n.viewport(V.x,V.y,V.z,V.w),Yt.copy(V))}function Zt(V,wt){let bt=d.get(wt);bt===void 0&&(bt=new WeakMap,d.set(wt,bt));let Ot=bt.get(V);Ot===void 0&&(Ot=n.getUniformBlockIndex(wt,V.name),bt.set(V,Ot))}function Ct(V,wt){const Ot=d.get(wt).get(V);u.get(wt)!==Ot&&(n.uniformBlockBinding(wt,Ot,V.__bindingPointIndex),u.set(wt,Ot))}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={},it=null,tt={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,D=null,C=null,A=null,U=null,B=null,N=new Ce(0,0,0),F=0,I=!1,M=null,k=null,H=null,Z=null,Q=null,ee.set(0,0,n.canvas.width,n.canvas.height),Yt.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:pt,disable:Nt,bindFramebuffer:st,drawBuffers:lt,useProgram:Dt,setBlending:ht,setMaterial:ft,setFlipSided:At,setCullFace:vt,setLineWidth:qt,setPolygonOffset:Mt,setScissorTest:Gt,activeTexture:Se,bindTexture:Ae,unbindTexture:O,compressedTexImage2D:b,compressedTexImage3D:j,texImage2D:Wt,texImage3D:xt,updateUBOMapping:Zt,uniformBlockBinding:Ct,texStorage2D:St,texStorage3D:Ft,texSubImage2D:ot,texSubImage3D:_t,compressedTexSubImage2D:rt,compressedTexSubImage3D:Vt,scissor:Rt,viewport:se,reset:ce}}function tw(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,b){return E?new OffscreenCanvas(O,b):dr("canvas")}function w(O,b,j){let ot=1;const _t=Ae(O);if((_t.width>j||_t.height>j)&&(ot=j/Math.max(_t.width,_t.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*_t.width),Vt=Math.floor(ot*_t.height);m===void 0&&(m=S(rt,Vt));const St=b?S(rt,Vt):m;return St.width=rt,St.height=Vt,St.getContext("2d").drawImage(O,0,0,rt,Vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+_t.width+"x"+_t.height+") to ("+rt+"x"+Vt+")."),St}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 D(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,b,j,ot,_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 rt=b;if(b===n.RED&&(j===n.FLOAT&&(rt=n.R32F),j===n.HALF_FLOAT&&(rt=n.R16F),j===n.UNSIGNED_BYTE&&(rt=n.R8)),b===n.RED_INTEGER&&(j===n.UNSIGNED_BYTE&&(rt=n.R8UI),j===n.UNSIGNED_SHORT&&(rt=n.R16UI),j===n.UNSIGNED_INT&&(rt=n.R32UI),j===n.BYTE&&(rt=n.R8I),j===n.SHORT&&(rt=n.R16I),j===n.INT&&(rt=n.R32I)),b===n.RG&&(j===n.FLOAT&&(rt=n.RG32F),j===n.HALF_FLOAT&&(rt=n.RG16F),j===n.UNSIGNED_BYTE&&(rt=n.RG8)),b===n.RG_INTEGER&&(j===n.UNSIGNED_BYTE&&(rt=n.RG8UI),j===n.UNSIGNED_SHORT&&(rt=n.RG16UI),j===n.UNSIGNED_INT&&(rt=n.RG32UI),j===n.BYTE&&(rt=n.RG8I),j===n.SHORT&&(rt=n.RG16I),j===n.INT&&(rt=n.RG32I)),b===n.RGB_INTEGER&&(j===n.UNSIGNED_BYTE&&(rt=n.RGB8UI),j===n.UNSIGNED_SHORT&&(rt=n.RGB16UI),j===n.UNSIGNED_INT&&(rt=n.RGB32UI),j===n.BYTE&&(rt=n.RGB8I),j===n.SHORT&&(rt=n.RGB16I),j===n.INT&&(rt=n.RGB32I)),b===n.RGBA_INTEGER&&(j===n.UNSIGNED_BYTE&&(rt=n.RGBA8UI),j===n.UNSIGNED_SHORT&&(rt=n.RGBA16UI),j===n.UNSIGNED_INT&&(rt=n.RGBA32UI),j===n.BYTE&&(rt=n.RGBA8I),j===n.SHORT&&(rt=n.RGBA16I),j===n.INT&&(rt=n.RGBA32I)),b===n.RGB&&j===n.UNSIGNED_INT_5_9_9_9_REV&&(rt=n.RGB9_E5),b===n.RGBA){const Vt=_t?fo:we.getTransfer(ot);j===n.FLOAT&&(rt=n.RGBA32F),j===n.HALF_FLOAT&&(rt=n.RGBA16F),j===n.UNSIGNED_BYTE&&(rt=Vt===Le?n.SRGB8_ALPHA8:n.RGBA8),j===n.UNSIGNED_SHORT_4_4_4_4&&(rt=n.RGBA4),j===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 A(O,b){let j;return O?b===null||b===qi||b===or?j=n.DEPTH24_STENCIL8:b===ai?j=n.DEPTH32F_STENCIL8:b===sr&&(j=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===qi||b===or?j=n.DEPTH_COMPONENT24:b===ai?j=n.DEPTH_COMPONENT32F:b===sr&&(j=n.DEPTH_COMPONENT16),j}function U(O,b){return v(O)===!0||O.isFramebufferTexture&&O.minFilter!==Un&&O.minFilter!==vn?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),F(b),b.isVideoTexture&&p.delete(b)}function N(O){const b=O.target;b.removeEventListener("dispose",N),M(b)}function F(O){const b=s.get(O);if(b.__webglInit===void 0)return;const j=O.source,ot=_.get(j);if(ot){const _t=ot[b.__cacheKey];_t.usedTimes--,_t.usedTimes===0&&I(O),Object.keys(ot).length===0&&_.delete(j)}s.remove(O)}function I(O){const b=s.get(O);n.deleteTexture(b.__webglTexture);const j=O.source,ot=_.get(j);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 _t=0;_t<b.__webglFramebuffer[ot].length;_t++)n.deleteFramebuffer(b.__webglFramebuffer[ot][_t]);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 j=O.textures;for(let ot=0,_t=j.length;ot<_t;ot++){const rt=s.get(j[ot]);rt.__webglTexture&&(n.deleteTexture(rt.__webglTexture),l.memory.textures--),s.remove(j[ot])}s.remove(O)}let k=0;function H(){k=0}function Z(){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 Q(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 at(O,b){const j=s.get(O);if(O.isVideoTexture&&Gt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&j.__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{ct(j,O,b);return}}else O.isExternalTexture&&(j.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,j.__webglTexture,n.TEXTURE0+b)}function $(O,b){const j=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&j.__version!==O.version){ct(j,O,b);return}e.bindTexture(n.TEXTURE_2D_ARRAY,j.__webglTexture,n.TEXTURE0+b)}function dt(O,b){const j=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&j.__version!==O.version){ct(j,O,b);return}e.bindTexture(n.TEXTURE_3D,j.__webglTexture,n.TEXTURE0+b)}function G(O,b){const j=s.get(O);if(O.version>0&&j.__version!==O.version){pt(j,O,b);return}e.bindTexture(n.TEXTURE_CUBE_MAP,j.__webglTexture,n.TEXTURE0+b)}const it={[Xa]:n.REPEAT,[Yi]:n.CLAMP_TO_EDGE,[Ya]:n.MIRRORED_REPEAT},tt={[Un]:n.NEAREST,[G_]:n.NEAREST_MIPMAP_NEAREST,[oo]:n.NEAREST_MIPMAP_LINEAR,[vn]:n.LINEAR,[qa]:n.LINEAR_MIPMAP_NEAREST,[bi]:n.LINEAR_MIPMAP_LINEAR},gt={[q_]:n.NEVER,[tv]:n.ALWAYS,[Q_]:n.LESS,[Hh]:n.LEQUAL,[j_]:n.EQUAL,[$_]:n.GEQUAL,[J_]:n.GREATER,[K_]:n.NOTEQUAL};function It(O,b){if(b.type===ai&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===vn||b.magFilter===qa||b.magFilter===oo||b.magFilter===bi||b.minFilter===vn||b.minFilter===qa||b.minFilter===oo||b.minFilter===bi)&&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,it[b.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,it[b.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,it[b.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,tt[b.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,tt[b.minFilter]),b.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,gt[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Un||b.minFilter!==oo&&b.minFilter!==bi||b.type===ai&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const j=t.get("EXT_texture_filter_anisotropic");n.texParameterf(O,j.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function ee(O,b){let j=!1;O.__webglInit===void 0&&(O.__webglInit=!0,b.addEventListener("dispose",B));const ot=b.source;let _t=_.get(ot);_t===void 0&&(_t={},_.set(ot,_t));const rt=Q(b);if(rt!==O.__cacheKey){_t[rt]===void 0&&(_t[rt]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,j=!0),_t[rt].usedTimes++;const Vt=_t[O.__cacheKey];Vt!==void 0&&(_t[O.__cacheKey].usedTimes--,Vt.usedTimes===0&&I(b)),O.__cacheKey=rt,O.__webglTexture=_t[rt].texture}return j}function Yt(O,b,j){return Math.floor(Math.floor(O/j)/b)}function J(O,b,j,ot){const rt=O.updateRanges;if(rt.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,b.width,b.height,j,ot,b.data);else{rt.sort((xt,Rt)=>xt.start-Rt.start);let Vt=0;for(let xt=1;xt<rt.length;xt++){const Rt=rt[Vt],se=rt[xt],Zt=Rt.start+Rt.count,Ct=Yt(se.start,b.width,4),ce=Yt(Rt.start,b.width,4);se.start<=Zt+1&&Ct===ce&&Yt(se.start+se.count-1,b.width,4)===Ct?Rt.count=Math.max(Rt.count,se.start+se.count-Rt.start):(++Vt,rt[Vt]=se)}rt.length=Vt+1;const St=n.getParameter(n.UNPACK_ROW_LENGTH),Ft=n.getParameter(n.UNPACK_SKIP_PIXELS),Wt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,b.width);for(let xt=0,Rt=rt.length;xt<Rt;xt++){const se=rt[xt],Zt=Math.floor(se.start/4),Ct=Math.ceil(se.count/4),ce=Zt%b.width,V=Math.floor(Zt/b.width),wt=Ct,bt=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,V),e.texSubImage2D(n.TEXTURE_2D,0,ce,V,wt,bt,j,ot,b.data)}O.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,St),n.pixelStorei(n.UNPACK_SKIP_PIXELS,Ft),n.pixelStorei(n.UNPACK_SKIP_ROWS,Wt)}}function ct(O,b,j){let ot=n.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(ot=n.TEXTURE_2D_ARRAY),b.isData3DTexture&&(ot=n.TEXTURE_3D);const _t=ee(O,b),rt=b.source;e.bindTexture(ot,O.__webglTexture,n.TEXTURE0+j);const Vt=s.get(rt);if(rt.version!==Vt.__version||_t===!0){e.activeTexture(n.TEXTURE0+j);const St=we.getPrimaries(we.workingColorSpace),Ft=b.colorSpace===Ai?null:we.getPrimaries(b.colorSpace),Wt=b.colorSpace===Ai||St===Ft?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,Wt);let xt=w(b.image,!1,r.maxTextureSize);xt=Se(b,xt);const Rt=a.convert(b.format,b.colorSpace),se=a.convert(b.type);let Zt=C(b.internalFormat,Rt,se,b.colorSpace,b.isVideoTexture);It(ot,b);let Ct;const ce=b.mipmaps,V=b.isVideoTexture!==!0,wt=Vt.__version===void 0||_t===!0,bt=rt.dataReady,Ot=U(b,xt);if(b.isDepthTexture)Zt=A(b.format===lr,b.type),wt&&(V?e.texStorage2D(n.TEXTURE_2D,1,Zt,xt.width,xt.height):e.texImage2D(n.TEXTURE_2D,0,Zt,xt.width,xt.height,0,Rt,se,null));else if(b.isDataTexture)if(ce.length>0){V&&wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Zt,ce[0].width,ce[0].height);for(let yt=0,ut=ce.length;yt<ut;yt++)Ct=ce[yt],V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Ct.width,Ct.height,Rt,se,Ct.data):e.texImage2D(n.TEXTURE_2D,yt,Zt,Ct.width,Ct.height,0,Rt,se,Ct.data);b.generateMipmaps=!1}else V?(wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Zt,xt.width,xt.height),bt&&J(b,xt,Rt,se)):e.texImage2D(n.TEXTURE_2D,0,Zt,xt.width,xt.height,0,Rt,se,xt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){V&&wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ot,Zt,ce[0].width,ce[0].height,xt.depth);for(let yt=0,ut=ce.length;yt<ut;yt++)if(Ct=ce[yt],b.format!==On)if(Rt!==null)if(V){if(bt)if(b.layerUpdates.size>0){const Ht=Mu(Ct.width,Ct.height,b.format,b.type);for(const le of b.layerUpdates){const Ie=Ct.data.subarray(le*Ht/Ct.data.BYTES_PER_ELEMENT,(le+1)*Ht/Ct.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,le,Ct.width,Ct.height,1,Rt,Ie)}b.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Ct.width,Ct.height,xt.depth,Rt,Ct.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,yt,Zt,Ct.width,Ct.height,xt.depth,0,Ct.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else V?bt&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Ct.width,Ct.height,xt.depth,Rt,se,Ct.data):e.texImage3D(n.TEXTURE_2D_ARRAY,yt,Zt,Ct.width,Ct.height,xt.depth,0,Rt,se,Ct.data)}else{V&&wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Zt,ce[0].width,ce[0].height);for(let yt=0,ut=ce.length;yt<ut;yt++)Ct=ce[yt],b.format!==On?Rt!==null?V?bt&&e.compressedTexSubImage2D(n.TEXTURE_2D,yt,0,0,Ct.width,Ct.height,Rt,Ct.data):e.compressedTexImage2D(n.TEXTURE_2D,yt,Zt,Ct.width,Ct.height,0,Ct.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Ct.width,Ct.height,Rt,se,Ct.data):e.texImage2D(n.TEXTURE_2D,yt,Zt,Ct.width,Ct.height,0,Rt,se,Ct.data)}else if(b.isDataArrayTexture)if(V){if(wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ot,Zt,xt.width,xt.height,xt.depth),bt)if(b.layerUpdates.size>0){const yt=Mu(xt.width,xt.height,b.format,b.type);for(const ut of b.layerUpdates){const Ht=xt.data.subarray(ut*yt/xt.data.BYTES_PER_ELEMENT,(ut+1)*yt/xt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ut,xt.width,xt.height,1,Rt,se,Ht)}b.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,Rt,se,xt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Zt,xt.width,xt.height,xt.depth,0,Rt,se,xt.data);else if(b.isData3DTexture)V?(wt&&e.texStorage3D(n.TEXTURE_3D,Ot,Zt,xt.width,xt.height,xt.depth),bt&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,Rt,se,xt.data)):e.texImage3D(n.TEXTURE_3D,0,Zt,xt.width,xt.height,xt.depth,0,Rt,se,xt.data);else if(b.isFramebufferTexture){if(wt)if(V)e.texStorage2D(n.TEXTURE_2D,Ot,Zt,xt.width,xt.height);else{let yt=xt.width,ut=xt.height;for(let Ht=0;Ht<Ot;Ht++)e.texImage2D(n.TEXTURE_2D,Ht,Zt,yt,ut,0,Rt,se,null),yt>>=1,ut>>=1}}else if(ce.length>0){if(V&&wt){const yt=Ae(ce[0]);e.texStorage2D(n.TEXTURE_2D,Ot,Zt,yt.width,yt.height)}for(let yt=0,ut=ce.length;yt<ut;yt++)Ct=ce[yt],V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Rt,se,Ct):e.texImage2D(n.TEXTURE_2D,yt,Zt,Rt,se,Ct);b.generateMipmaps=!1}else if(V){if(wt){const yt=Ae(xt);e.texStorage2D(n.TEXTURE_2D,Ot,Zt,yt.width,yt.height)}bt&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,Rt,se,xt)}else e.texImage2D(n.TEXTURE_2D,0,Zt,Rt,se,xt);v(b)&&g(ot),Vt.__version=rt.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function pt(O,b,j){if(b.image.length!==6)return;const ot=ee(O,b),_t=b.source;e.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+j);const rt=s.get(_t);if(_t.version!==rt.__version||ot===!0){e.activeTexture(n.TEXTURE0+j);const Vt=we.getPrimaries(we.workingColorSpace),St=b.colorSpace===Ai?null:we.getPrimaries(b.colorSpace),Ft=b.colorSpace===Ai||Vt===St?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,Ft);const Wt=b.isCompressedTexture||b.image[0].isCompressedTexture,xt=b.image[0]&&b.image[0].isDataTexture,Rt=[];for(let ut=0;ut<6;ut++)!Wt&&!xt?Rt[ut]=w(b.image[ut],!0,r.maxCubemapSize):Rt[ut]=xt?b.image[ut].image:b.image[ut],Rt[ut]=Se(b,Rt[ut]);const se=Rt[0],Zt=a.convert(b.format,b.colorSpace),Ct=a.convert(b.type),ce=C(b.internalFormat,Zt,Ct,b.colorSpace),V=b.isVideoTexture!==!0,wt=rt.__version===void 0||ot===!0,bt=_t.dataReady;let Ot=U(b,se);It(n.TEXTURE_CUBE_MAP,b);let yt;if(Wt){V&&wt&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,ce,se.width,se.height);for(let ut=0;ut<6;ut++){yt=Rt[ut].mipmaps;for(let Ht=0;Ht<yt.length;Ht++){const le=yt[Ht];b.format!==On?Zt!==null?V?bt&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht,0,0,le.width,le.height,Zt,le.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht,ce,le.width,le.height,0,le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht,0,0,le.width,le.height,Zt,Ct,le.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht,ce,le.width,le.height,0,Zt,Ct,le.data)}}}else{if(yt=b.mipmaps,V&&wt){yt.length>0&&Ot++;const ut=Ae(Rt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,ce,ut.width,ut.height)}for(let ut=0;ut<6;ut++)if(xt){V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,Rt[ut].width,Rt[ut].height,Zt,Ct,Rt[ut].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,ce,Rt[ut].width,Rt[ut].height,0,Zt,Ct,Rt[ut].data);for(let Ht=0;Ht<yt.length;Ht++){const Ie=yt[Ht].image[ut].image;V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht+1,0,0,Ie.width,Ie.height,Zt,Ct,Ie.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht+1,ce,Ie.width,Ie.height,0,Zt,Ct,Ie.data)}}else{V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,Zt,Ct,Rt[ut]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,ce,Zt,Ct,Rt[ut]);for(let Ht=0;Ht<yt.length;Ht++){const le=yt[Ht];V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht+1,0,0,Zt,Ct,le.image[ut]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Ht+1,ce,Zt,Ct,le.image[ut])}}}v(b)&&g(n.TEXTURE_CUBE_MAP),rt.__version=_t.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function Nt(O,b,j,ot,_t,rt){const Vt=a.convert(j.format,j.colorSpace),St=a.convert(j.type),Ft=C(j.internalFormat,Vt,St,j.colorSpace),Wt=s.get(b),xt=s.get(j);if(xt.__renderTarget=b,!Wt.__hasExternalTextures){const Rt=Math.max(1,b.width>>rt),se=Math.max(1,b.height>>rt);_t===n.TEXTURE_3D||_t===n.TEXTURE_2D_ARRAY?e.texImage3D(_t,rt,Ft,Rt,se,b.depth,0,Vt,St,null):e.texImage2D(_t,rt,Ft,Rt,se,0,Vt,St,null)}e.bindFramebuffer(n.FRAMEBUFFER,O),Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ot,_t,xt.__webglTexture,0,qt(b)):(_t===n.TEXTURE_2D||_t>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_t<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ot,_t,xt.__webglTexture,rt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function st(O,b,j){if(n.bindRenderbuffer(n.RENDERBUFFER,O),b.depthBuffer){const ot=b.depthTexture,_t=ot&&ot.isDepthTexture?ot.type:null,rt=A(b.stencilBuffer,_t),Vt=b.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,St=qt(b);Mt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,St,rt,b.width,b.height):j?n.renderbufferStorageMultisample(n.RENDERBUFFER,St,rt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,rt,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Vt,n.RENDERBUFFER,O)}else{const ot=b.textures;for(let _t=0;_t<ot.length;_t++){const rt=ot[_t],Vt=a.convert(rt.format,rt.colorSpace),St=a.convert(rt.type),Ft=C(rt.internalFormat,Vt,St,rt.colorSpace),Wt=qt(b);j&&Mt(b)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Wt,Ft,b.width,b.height):Mt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Wt,Ft,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,Ft,b.width,b.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function lt(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),at(b.depthTexture,0);const _t=ot.__webglTexture,rt=qt(b);if(b.depthTexture.format===ar)Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0);else if(b.depthTexture.format===lr)Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0);else throw new Error("Unknown depthTexture format")}function Dt(O){const b=s.get(O),j=O.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==O.depthTexture){const ot=O.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),ot){const _t=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,ot.removeEventListener("dispose",_t)};ot.addEventListener("dispose",_t),b.__depthDisposeCallback=_t}b.__boundDepthTexture=ot}if(O.depthTexture&&!b.__autoAllocateDepthBuffer){if(j)throw new Error("target.depthTexture not supported in Cube render targets");const ot=O.texture.mipmaps;ot&&ot.length>0?lt(b.__webglFramebuffer[0],O):lt(b.__webglFramebuffer,O)}else if(j){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(),st(b.__webglDepthbuffer[ot],O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer[ot];n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,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(),st(b.__webglDepthbuffer,O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,rt)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function Bt(O,b,j){const ot=s.get(O);b!==void 0&&Nt(ot.__webglFramebuffer,O,O.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),j!==void 0&&Dt(O)}function R(O){const b=O.texture,j=s.get(O),ot=s.get(b);O.addEventListener("dispose",N);const _t=O.textures,rt=O.isWebGLCubeRenderTarget===!0,Vt=_t.length>1;if(Vt||(ot.__webglTexture===void 0&&(ot.__webglTexture=n.createTexture()),ot.__version=b.version,l.memory.textures++),rt){j.__webglFramebuffer=[];for(let St=0;St<6;St++)if(b.mipmaps&&b.mipmaps.length>0){j.__webglFramebuffer[St]=[];for(let Ft=0;Ft<b.mipmaps.length;Ft++)j.__webglFramebuffer[St][Ft]=n.createFramebuffer()}else j.__webglFramebuffer[St]=n.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){j.__webglFramebuffer=[];for(let St=0;St<b.mipmaps.length;St++)j.__webglFramebuffer[St]=n.createFramebuffer()}else j.__webglFramebuffer=n.createFramebuffer();if(Vt)for(let St=0,Ft=_t.length;St<Ft;St++){const Wt=s.get(_t[St]);Wt.__webglTexture===void 0&&(Wt.__webglTexture=n.createTexture(),l.memory.textures++)}if(O.samples>0&&Mt(O)===!1){j.__webglMultisampledFramebuffer=n.createFramebuffer(),j.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,j.__webglMultisampledFramebuffer);for(let St=0;St<_t.length;St++){const Ft=_t[St];j.__webglColorRenderbuffer[St]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,j.__webglColorRenderbuffer[St]);const Wt=a.convert(Ft.format,Ft.colorSpace),xt=a.convert(Ft.type),Rt=C(Ft.internalFormat,Wt,xt,Ft.colorSpace,O.isXRRenderTarget===!0),se=qt(O);n.renderbufferStorageMultisample(n.RENDERBUFFER,se,Rt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+St,n.RENDERBUFFER,j.__webglColorRenderbuffer[St])}n.bindRenderbuffer(n.RENDERBUFFER,null),O.depthBuffer&&(j.__webglDepthRenderbuffer=n.createRenderbuffer(),st(j.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(rt){e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture),It(n.TEXTURE_CUBE_MAP,b);for(let St=0;St<6;St++)if(b.mipmaps&&b.mipmaps.length>0)for(let Ft=0;Ft<b.mipmaps.length;Ft++)Nt(j.__webglFramebuffer[St][Ft],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+St,Ft);else Nt(j.__webglFramebuffer[St],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+St,0);v(b)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Vt){for(let St=0,Ft=_t.length;St<Ft;St++){const Wt=_t[St],xt=s.get(Wt);let Rt=n.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Rt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(Rt,xt.__webglTexture),It(Rt,Wt),Nt(j.__webglFramebuffer,O,Wt,n.COLOR_ATTACHMENT0+St,Rt,0),v(Wt)&&g(Rt)}e.unbindTexture()}else{let St=n.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(St=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(St,ot.__webglTexture),It(St,b),b.mipmaps&&b.mipmaps.length>0)for(let Ft=0;Ft<b.mipmaps.length;Ft++)Nt(j.__webglFramebuffer[Ft],O,b,n.COLOR_ATTACHMENT0,St,Ft);else Nt(j.__webglFramebuffer,O,b,n.COLOR_ATTACHMENT0,St,0);v(b)&&g(St),e.unbindTexture()}O.depthBuffer&&Dt(O)}function ht(O){const b=O.textures;for(let j=0,ot=b.length;j<ot;j++){const _t=b[j];if(v(_t)){const rt=D(O),Vt=s.get(_t).__webglTexture;e.bindTexture(rt,Vt),g(rt),e.unbindTexture()}}}const ft=[],At=[];function vt(O){if(O.samples>0){if(Mt(O)===!1){const b=O.textures,j=O.width,ot=O.height;let _t=n.COLOR_BUFFER_BIT;const rt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Vt=s.get(O),St=b.length>1;if(St)for(let Wt=0;Wt<b.length;Wt++)e.bindFramebuffer(n.FRAMEBUFFER,Vt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Wt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Vt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Wt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Vt.__webglMultisampledFramebuffer);const Ft=O.texture.mipmaps;Ft&&Ft.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Vt.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Vt.__webglFramebuffer);for(let Wt=0;Wt<b.length;Wt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(_t|=n.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(_t|=n.STENCIL_BUFFER_BIT)),St){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Vt.__webglColorRenderbuffer[Wt]);const xt=s.get(b[Wt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,xt,0)}n.blitFramebuffer(0,0,j,ot,0,0,j,ot,_t,n.NEAREST),u===!0&&(ft.length=0,At.length=0,ft.push(n.COLOR_ATTACHMENT0+Wt),O.depthBuffer&&O.resolveDepthBuffer===!1&&(ft.push(rt),At.push(rt),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,At)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,ft))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),St)for(let Wt=0;Wt<b.length;Wt++){e.bindFramebuffer(n.FRAMEBUFFER,Vt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Wt,n.RENDERBUFFER,Vt.__webglColorRenderbuffer[Wt]);const xt=s.get(b[Wt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Vt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Wt,n.TEXTURE_2D,xt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Vt.__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 qt(O){return Math.min(r.maxSamples,O.samples)}function Mt(O){const b=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Gt(O){const b=l.render.frame;p.get(O)!==b&&(p.set(O,b),O.update())}function Se(O,b){const j=O.colorSpace,ot=O.format,_t=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||j!==Qi&&j!==Ai&&(we.getTransfer(j)===Le?(ot!==On||_t!==oi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",j)),b}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=Z,this.resetTextureUnits=H,this.setTexture2D=at,this.setTexture2DArray=$,this.setTexture3D=dt,this.setTextureCube=G,this.rebindTextures=Bt,this.setupRenderTarget=R,this.updateRenderTargetMipmap=ht,this.updateMultisampleRenderTarget=vt,this.setupDepthRenderbuffer=Dt,this.setupFrameBufferTexture=Nt,this.useMultisampledRTT=Mt}function ew(n,t){function e(s,r=Ai){let a;const l=we.getTransfer(r);if(s===oi)return n.UNSIGNED_BYTE;if(s===ja)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Ja)return n.UNSIGNED_SHORT_5_5_5_1;if(s===kh)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===Ih)return n.BYTE;if(s===Dh)return n.SHORT;if(s===sr)return n.UNSIGNED_SHORT;if(s===Qa)return n.INT;if(s===qi)return n.UNSIGNED_INT;if(s===ai)return n.FLOAT;if(s===rr)return n.HALF_FLOAT;if(s===Uh)return n.ALPHA;if(s===Oh)return n.RGB;if(s===On)return n.RGBA;if(s===ar)return n.DEPTH_COMPONENT;if(s===lr)return n.DEPTH_STENCIL;if(s===Nh)return n.RED;if(s===Ka)return n.RED_INTEGER;if(s===Bh)return n.RG;if(s===$a)return n.RG_INTEGER;if(s===tl)return n.RGBA_INTEGER;if(s===ao||s===lo||s===co||s===ho)if(l===Le)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===ao)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===lo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===co)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===ho)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===ao)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===lo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===co)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===ho)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===el||s===nl||s===il||s===sl)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===el)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===nl)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===il)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===sl)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===rl||s===ol||s===al)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===rl||s===ol)return l===Le?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===al)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===ll||s===cl||s===hl||s===ul||s===dl||s===fl||s===pl||s===ml||s===gl||s===_l||s===vl||s===yl||s===El||s===xl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===ll)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===cl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===hl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===ul)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===dl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===fl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===pl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===ml)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===gl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===_l)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===vl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===yl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===El)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===xl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===uo||s===wl||s===Sl)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===uo)return l===Le?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===wl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Sl)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Fh||s===Ml||s===Tl||s===bl)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===uo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Ml)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Tl)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===bl)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===or?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class td extends je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const nw=`
|
|
3825
|
+
}`;function ew(n,t,e){let s=new ec;const r=new be,a=new be,l=new Fe,h=new e0({depthPacking:Q_}),u=new n0,d={},p=e.maxTextureSize,m={[Si]:un,[un]:Si,[ri]:ri},_=new pi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new be},radius:{value:4}},vertexShader:$x,fragmentShader:tw}),E=_.clone();E.defines.HORIZONTAL_PASS=1;const S=new Qn;S.setAttribute("position",new qn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new dn(S,_),v=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ch;let g=this.type;this.render=function(B,N,F){if(v.enabled===!1||v.autoUpdate===!1&&v.needsUpdate===!1||B.length===0)return;const I=n.getRenderTarget(),M=n.getActiveCubeFace(),k=n.getActiveMipmapLevel(),H=n.state;H.setBlending(Mi),H.buffers.depth.getReversed()?H.buffers.color.setClear(0,0,0,0):H.buffers.color.setClear(1,1,1,1),H.buffers.depth.setTest(!0),H.setScissorTest(!1);const Z=g!==si&&this.type===si,j=g===si&&this.type!==si;for(let at=0,$=B.length;at<$;at++){const dt=B[at],G=dt.shadow;if(G===void 0){console.warn("THREE.WebGLShadowMap:",dt,"has no shadow.");continue}if(G.autoUpdate===!1&&G.needsUpdate===!1)continue;r.copy(G.mapSize);const it=G.getFrameExtents();if(r.multiply(it),a.copy(G.mapSize),(r.x>p||r.y>p)&&(r.x>p&&(a.x=Math.floor(p/it.x),r.x=a.x*it.x,G.mapSize.x=a.x),r.y>p&&(a.y=Math.floor(p/it.y),r.y=a.y*it.y,G.mapSize.y=a.y)),G.map===null||Z===!0||j===!0){const gt=this.type!==si?{minFilter:Un,magFilter:Un}:{};G.map!==null&&G.map.dispose(),G.map=new Ci(r.x,r.y,gt),G.map.texture.name=dt.name+".shadowMap",G.camera.updateProjectionMatrix()}n.setRenderTarget(G.map),n.clear();const tt=G.getViewportCount();for(let gt=0;gt<tt;gt++){const At=G.getViewport(gt);l.set(a.x*At.x,a.y*At.y,a.x*At.z,a.y*At.w),H.viewport(l),G.updateMatrices(dt,gt),s=G.getFrustum(),A(N,F,G.camera,dt,this.type)}G.isPointLightShadow!==!0&&this.type===si&&D(G,F),G.needsUpdate=!1}g=this.type,v.needsUpdate=!1,n.setRenderTarget(I,M,k)};function D(B,N){const F=t.update(w);_.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 Ci(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,F,_,w,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,F,E,w,null)}function C(B,N,F,I){let M=null;const k=F.isPointLight===!0?B.customDistanceMaterial:B.customDepthMaterial;if(k!==void 0)M=k;else if(M=F.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 H=M.uuid,Z=N.uuid;let j=d[H];j===void 0&&(j={},d[H]=j);let at=j[Z];at===void 0&&(at=M.clone(),j[Z]=at,N.addEventListener("dispose",U)),M=at}if(M.visible=N.visible,M.wireframe=N.wireframe,I===si?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,F.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const H=n.properties.get(M);H.light=F}return M}function A(B,N,F,I,M){if(B.visible===!1)return;if(B.layers.test(N.layers)&&(B.isMesh||B.isLine||B.isPoints)&&(B.castShadow||B.receiveShadow&&M===si)&&(!B.frustumCulled||s.intersectsObject(B))){B.modelViewMatrix.multiplyMatrices(F.matrixWorldInverse,B.matrixWorld);const Z=t.update(B),j=B.material;if(Array.isArray(j)){const at=Z.groups;for(let $=0,dt=at.length;$<dt;$++){const G=at[$],it=j[G.materialIndex];if(it&&it.visible){const tt=C(B,it,I,M);B.onBeforeShadow(n,B,N,F,Z,tt,G),n.renderBufferDirect(F,null,Z,tt,B,G),B.onAfterShadow(n,B,N,F,Z,tt,G)}}}else if(j.visible){const at=C(B,j,I,M);B.onBeforeShadow(n,B,N,F,Z,at,null),n.renderBufferDirect(F,null,Z,at,B,null),B.onAfterShadow(n,B,N,F,Z,at,null)}}const H=B.children;for(let Z=0,j=H.length;Z<j;Z++)A(H[Z],N,F,I,M)}function U(B){B.target.removeEventListener("dispose",U);for(const F in d){const I=d[F],M=B.target.uuid;M in I&&(I[M].dispose(),delete I[M])}}}const nw={[Ba]:Fa,[za]:Ga,[Ha]:Wa,[ms]:Va,[Fa]:Ba,[Ga]:za,[Wa]:Ha,[Va]:ms};function iw(n,t){function e(){let V=!1;const wt=new Fe;let bt=null;const Ot=new Fe(0,0,0,0);return{setMask:function(yt){bt!==yt&&!V&&(n.colorMask(yt,yt,yt,yt),bt=yt)},setLocked:function(yt){V=yt},setClear:function(yt,ut,Vt,le,Ie){Ie===!0&&(yt*=le,ut*=le,Vt*=le),wt.set(yt,ut,Vt,le),Ot.equals(wt)===!1&&(n.clearColor(yt,ut,Vt,le),Ot.copy(wt))},reset:function(){V=!1,bt=null,Ot.set(-1,0,0,0)}}}function s(){let V=!1,wt=!1,bt=null,Ot=null,yt=null;return{setReversed:function(ut){if(wt!==ut){const Vt=t.get("EXT_clip_control");ut?Vt.clipControlEXT(Vt.LOWER_LEFT_EXT,Vt.ZERO_TO_ONE_EXT):Vt.clipControlEXT(Vt.LOWER_LEFT_EXT,Vt.NEGATIVE_ONE_TO_ONE_EXT),wt=ut;const le=yt;yt=null,this.setClear(le)}},getReversed:function(){return wt},setTest:function(ut){ut?pt(n.DEPTH_TEST):Nt(n.DEPTH_TEST)},setMask:function(ut){bt!==ut&&!V&&(n.depthMask(ut),bt=ut)},setFunc:function(ut){if(wt&&(ut=nw[ut]),Ot!==ut){switch(ut){case Ba:n.depthFunc(n.NEVER);break;case Fa:n.depthFunc(n.ALWAYS);break;case za:n.depthFunc(n.LESS);break;case ms:n.depthFunc(n.LEQUAL);break;case Ha:n.depthFunc(n.EQUAL);break;case Va:n.depthFunc(n.GEQUAL);break;case Ga:n.depthFunc(n.GREATER);break;case Wa:n.depthFunc(n.NOTEQUAL);break;default:n.depthFunc(n.LEQUAL)}Ot=ut}},setLocked:function(ut){V=ut},setClear:function(ut){yt!==ut&&(wt&&(ut=1-ut),n.clearDepth(ut),yt=ut)},reset:function(){V=!1,bt=null,Ot=null,yt=null,wt=!1}}}function r(){let V=!1,wt=null,bt=null,Ot=null,yt=null,ut=null,Vt=null,le=null,Ie=null;return{setTest:function(Me){V||(Me?pt(n.STENCIL_TEST):Nt(n.STENCIL_TEST))},setMask:function(Me){wt!==Me&&!V&&(n.stencilMask(Me),wt=Me)},setFunc:function(Me,Sn,In){(bt!==Me||Ot!==Sn||yt!==In)&&(n.stencilFunc(Me,Sn,In),bt=Me,Ot=Sn,yt=In)},setOp:function(Me,Sn,In){(ut!==Me||Vt!==Sn||le!==In)&&(n.stencilOp(Me,Sn,In),ut=Me,Vt=Sn,le=In)},setLocked:function(Me){V=Me},setClear:function(Me){Ie!==Me&&(n.clearStencil(Me),Ie=Me)},reset:function(){V=!1,wt=null,bt=null,Ot=null,yt=null,ut=null,Vt=null,le=null,Ie=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,D=null,C=null,A=null,U=null,B=null,N=new Ce(0,0,0),F=0,I=!1,M=null,k=null,H=null,Z=null,j=null;const at=n.getParameter(n.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let $=!1,dt=0;const G=n.getParameter(n.VERSION);G.indexOf("WebGL")!==-1?(dt=parseFloat(/^WebGL (\d)/.exec(G)[1]),$=dt>=1):G.indexOf("OpenGL ES")!==-1&&(dt=parseFloat(/^OpenGL ES (\d)/.exec(G)[1]),$=dt>=2);let it=null,tt={};const gt=n.getParameter(n.SCISSOR_BOX),At=n.getParameter(n.VIEWPORT),Jt=new Fe().fromArray(gt),Ft=new Fe().fromArray(At);function Q(V,wt,bt,Ot){const yt=new Uint8Array(4),ut=n.createTexture();n.bindTexture(V,ut),n.texParameteri(V,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(V,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Vt=0;Vt<bt;Vt++)V===n.TEXTURE_3D||V===n.TEXTURE_2D_ARRAY?n.texImage3D(wt,0,n.RGBA,1,1,Ot,0,n.RGBA,n.UNSIGNED_BYTE,yt):n.texImage2D(wt+Vt,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,yt);return ut}const lt={};lt[n.TEXTURE_2D]=Q(n.TEXTURE_2D,n.TEXTURE_2D,1),lt[n.TEXTURE_CUBE_MAP]=Q(n.TEXTURE_CUBE_MAP,n.TEXTURE_CUBE_MAP_POSITIVE_X,6),lt[n.TEXTURE_2D_ARRAY]=Q(n.TEXTURE_2D_ARRAY,n.TEXTURE_2D_ARRAY,1,1),lt[n.TEXTURE_3D]=Q(n.TEXTURE_3D,n.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),h.setClear(0),pt(n.DEPTH_TEST),l.setFunc(ms),Ct(!1),vt(Ah),pt(n.CULL_FACE),ht(Mi);function pt(V){p[V]!==!0&&(n.enable(V),p[V]=!0)}function Nt(V){p[V]!==!1&&(n.disable(V),p[V]=!1)}function st(V,wt){return m[V]!==wt?(n.bindFramebuffer(V,wt),m[V]=wt,V===n.DRAW_FRAMEBUFFER&&(m[n.FRAMEBUFFER]=wt),V===n.FRAMEBUFFER&&(m[n.DRAW_FRAMEBUFFER]=wt),!0):!1}function ct(V,wt){let bt=E,Ot=!1;if(V){bt=_.get(wt),bt===void 0&&(bt=[],_.set(wt,bt));const yt=V.textures;if(bt.length!==yt.length||bt[0]!==n.COLOR_ATTACHMENT0){for(let ut=0,Vt=yt.length;ut<Vt;ut++)bt[ut]=n.COLOR_ATTACHMENT0+ut;bt.length=yt.length,Ot=!0}}else bt[0]!==n.BACK&&(bt[0]=n.BACK,Ot=!0);Ot&&n.drawBuffers(bt)}function Dt(V){return S!==V?(n.useProgram(V),S=V,!0):!1}const Bt={[Xi]:n.FUNC_ADD,[w_]:n.FUNC_SUBTRACT,[S_]:n.FUNC_REVERSE_SUBTRACT};Bt[M_]=n.MIN,Bt[T_]=n.MAX;const R={[b_]:n.ZERO,[A_]:n.ONE,[C_]:n.SRC_COLOR,[Oa]:n.SRC_ALPHA,[k_]:n.SRC_ALPHA_SATURATE,[I_]:n.DST_COLOR,[R_]:n.DST_ALPHA,[P_]:n.ONE_MINUS_SRC_COLOR,[Na]:n.ONE_MINUS_SRC_ALPHA,[D_]:n.ONE_MINUS_DST_COLOR,[L_]:n.ONE_MINUS_DST_ALPHA,[U_]:n.CONSTANT_COLOR,[O_]:n.ONE_MINUS_CONSTANT_COLOR,[N_]:n.CONSTANT_ALPHA,[B_]:n.ONE_MINUS_CONSTANT_ALPHA};function ht(V,wt,bt,Ot,yt,ut,Vt,le,Ie,Me){if(V===Mi){w===!0&&(Nt(n.BLEND),w=!1);return}if(w===!1&&(pt(n.BLEND),w=!0),V!==x_){if(V!==v||Me!==I){if((g!==Xi||A!==Xi)&&(n.blendEquation(n.FUNC_ADD),g=Xi,A=Xi),Me)switch(V){case ps:n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Ph:n.blendFunc(n.ONE,n.ONE);break;case Rh:n.blendFuncSeparate(n.ZERO,n.ONE_MINUS_SRC_COLOR,n.ZERO,n.ONE);break;case Lh:n.blendFuncSeparate(n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ZERO,n.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}else switch(V){case ps:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA);break;case Ph:n.blendFuncSeparate(n.SRC_ALPHA,n.ONE,n.ONE,n.ONE);break;case Rh:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case Lh:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",V);break}D=null,C=null,U=null,B=null,N.set(0,0,0),F=0,v=V,I=Me}return}yt=yt||wt,ut=ut||bt,Vt=Vt||Ot,(wt!==g||yt!==A)&&(n.blendEquationSeparate(Bt[wt],Bt[yt]),g=wt,A=yt),(bt!==D||Ot!==C||ut!==U||Vt!==B)&&(n.blendFuncSeparate(R[bt],R[Ot],R[ut],R[Vt]),D=bt,C=Ot,U=ut,B=Vt),(le.equals(N)===!1||Ie!==F)&&(n.blendColor(le.r,le.g,le.b,Ie),N.copy(le),F=Ie),v=V,I=!1}function ft(V,wt){V.side===ri?Nt(n.CULL_FACE):pt(n.CULL_FACE);let bt=V.side===un;wt&&(bt=!bt),Ct(bt),V.blending===ps&&V.transparent===!1?ht(Mi):ht(V.blending,V.blendEquation,V.blendSrc,V.blendDst,V.blendEquationAlpha,V.blendSrcAlpha,V.blendDstAlpha,V.blendColor,V.blendAlpha,V.premultipliedAlpha),l.setFunc(V.depthFunc),l.setTest(V.depthTest),l.setMask(V.depthWrite),a.setMask(V.colorWrite);const Ot=V.stencilWrite;h.setTest(Ot),Ot&&(h.setMask(V.stencilWriteMask),h.setFunc(V.stencilFunc,V.stencilRef,V.stencilFuncMask),h.setOp(V.stencilFail,V.stencilZFail,V.stencilZPass)),Mt(V.polygonOffset,V.polygonOffsetFactor,V.polygonOffsetUnits),V.alphaToCoverage===!0?pt(n.SAMPLE_ALPHA_TO_COVERAGE):Nt(n.SAMPLE_ALPHA_TO_COVERAGE)}function Ct(V){M!==V&&(V?n.frontFace(n.CW):n.frontFace(n.CCW),M=V)}function vt(V){V!==v_?(pt(n.CULL_FACE),V!==k&&(V===Ah?n.cullFace(n.BACK):V===y_?n.cullFace(n.FRONT):n.cullFace(n.FRONT_AND_BACK))):Nt(n.CULL_FACE),k=V}function qt(V){V!==H&&($&&n.lineWidth(V),H=V)}function Mt(V,wt,bt){V?(pt(n.POLYGON_OFFSET_FILL),(Z!==wt||j!==bt)&&(n.polygonOffset(wt,bt),Z=wt,j=bt)):Nt(n.POLYGON_OFFSET_FILL)}function Wt(V){V?pt(n.SCISSOR_TEST):Nt(n.SCISSOR_TEST)}function Se(V){V===void 0&&(V=n.TEXTURE0+at-1),it!==V&&(n.activeTexture(V),it=V)}function Ae(V,wt,bt){bt===void 0&&(it===null?bt=n.TEXTURE0+at-1:bt=it);let Ot=tt[bt];Ot===void 0&&(Ot={type:void 0,texture:void 0},tt[bt]=Ot),(Ot.type!==V||Ot.texture!==wt)&&(it!==bt&&(n.activeTexture(bt),it=bt),n.bindTexture(V,wt||lt[V]),Ot.type=V,Ot.texture=wt)}function O(){const V=tt[it];V!==void 0&&V.type!==void 0&&(n.bindTexture(V.type,null),V.type=void 0,V.texture=void 0)}function b(){try{n.compressedTexImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function J(){try{n.compressedTexImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function ot(){try{n.texSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function _t(){try{n.texSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function rt(){try{n.compressedTexSubImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Gt(){try{n.compressedTexSubImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function St(){try{n.texStorage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function zt(){try{n.texStorage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Zt(){try{n.texImage2D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function xt(){try{n.texImage3D(...arguments)}catch(V){console.error("THREE.WebGLState:",V)}}function Lt(V){Jt.equals(V)===!1&&(n.scissor(V.x,V.y,V.z,V.w),Jt.copy(V))}function se(V){Ft.equals(V)===!1&&(n.viewport(V.x,V.y,V.z,V.w),Ft.copy(V))}function Xt(V,wt){let bt=d.get(wt);bt===void 0&&(bt=new WeakMap,d.set(wt,bt));let Ot=bt.get(V);Ot===void 0&&(Ot=n.getUniformBlockIndex(wt,V.name),bt.set(V,Ot))}function Pt(V,wt){const Ot=d.get(wt).get(V);u.get(wt)!==Ot&&(n.uniformBlockBinding(wt,Ot,V.__bindingPointIndex),u.set(wt,Ot))}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={},it=null,tt={},m={},_=new WeakMap,E=[],S=null,w=!1,v=null,g=null,D=null,C=null,A=null,U=null,B=null,N=new Ce(0,0,0),F=0,I=!1,M=null,k=null,H=null,Z=null,j=null,Jt.set(0,0,n.canvas.width,n.canvas.height),Ft.set(0,0,n.canvas.width,n.canvas.height),a.reset(),l.reset(),h.reset()}return{buffers:{color:a,depth:l,stencil:h},enable:pt,disable:Nt,bindFramebuffer:st,drawBuffers:ct,useProgram:Dt,setBlending:ht,setMaterial:ft,setFlipSided:Ct,setCullFace:vt,setLineWidth:qt,setPolygonOffset:Mt,setScissorTest:Wt,activeTexture:Se,bindTexture:Ae,unbindTexture:O,compressedTexImage2D:b,compressedTexImage3D:J,texImage2D:Zt,texImage3D:xt,updateUBOMapping:Xt,uniformBlockBinding:Pt,texStorage2D:St,texStorage3D:zt,texSubImage2D:ot,texSubImage3D:_t,compressedTexSubImage2D:rt,compressedTexSubImage3D:Gt,scissor:Lt,viewport:se,reset:ce}}function sw(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,b){return E?new OffscreenCanvas(O,b):dr("canvas")}function w(O,b,J){let ot=1;const _t=Ae(O);if((_t.width>J||_t.height>J)&&(ot=J/Math.max(_t.width,_t.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*_t.width),Gt=Math.floor(ot*_t.height);m===void 0&&(m=S(rt,Gt));const St=b?S(rt,Gt):m;return St.width=rt,St.height=Gt,St.getContext("2d").drawImage(O,0,0,rt,Gt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+_t.width+"x"+_t.height+") to ("+rt+"x"+Gt+")."),St}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 D(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,b,J,ot,_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 rt=b;if(b===n.RED&&(J===n.FLOAT&&(rt=n.R32F),J===n.HALF_FLOAT&&(rt=n.R16F),J===n.UNSIGNED_BYTE&&(rt=n.R8)),b===n.RED_INTEGER&&(J===n.UNSIGNED_BYTE&&(rt=n.R8UI),J===n.UNSIGNED_SHORT&&(rt=n.R16UI),J===n.UNSIGNED_INT&&(rt=n.R32UI),J===n.BYTE&&(rt=n.R8I),J===n.SHORT&&(rt=n.R16I),J===n.INT&&(rt=n.R32I)),b===n.RG&&(J===n.FLOAT&&(rt=n.RG32F),J===n.HALF_FLOAT&&(rt=n.RG16F),J===n.UNSIGNED_BYTE&&(rt=n.RG8)),b===n.RG_INTEGER&&(J===n.UNSIGNED_BYTE&&(rt=n.RG8UI),J===n.UNSIGNED_SHORT&&(rt=n.RG16UI),J===n.UNSIGNED_INT&&(rt=n.RG32UI),J===n.BYTE&&(rt=n.RG8I),J===n.SHORT&&(rt=n.RG16I),J===n.INT&&(rt=n.RG32I)),b===n.RGB_INTEGER&&(J===n.UNSIGNED_BYTE&&(rt=n.RGB8UI),J===n.UNSIGNED_SHORT&&(rt=n.RGB16UI),J===n.UNSIGNED_INT&&(rt=n.RGB32UI),J===n.BYTE&&(rt=n.RGB8I),J===n.SHORT&&(rt=n.RGB16I),J===n.INT&&(rt=n.RGB32I)),b===n.RGBA_INTEGER&&(J===n.UNSIGNED_BYTE&&(rt=n.RGBA8UI),J===n.UNSIGNED_SHORT&&(rt=n.RGBA16UI),J===n.UNSIGNED_INT&&(rt=n.RGBA32UI),J===n.BYTE&&(rt=n.RGBA8I),J===n.SHORT&&(rt=n.RGBA16I),J===n.INT&&(rt=n.RGBA32I)),b===n.RGB&&J===n.UNSIGNED_INT_5_9_9_9_REV&&(rt=n.RGB9_E5),b===n.RGBA){const Gt=_t?fo:we.getTransfer(ot);J===n.FLOAT&&(rt=n.RGBA32F),J===n.HALF_FLOAT&&(rt=n.RGBA16F),J===n.UNSIGNED_BYTE&&(rt=Gt===Le?n.SRGB8_ALPHA8:n.RGBA8),J===n.UNSIGNED_SHORT_4_4_4_4&&(rt=n.RGBA4),J===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 A(O,b){let J;return O?b===null||b===qi||b===or?J=n.DEPTH24_STENCIL8:b===ai?J=n.DEPTH32F_STENCIL8:b===sr&&(J=n.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):b===null||b===qi||b===or?J=n.DEPTH_COMPONENT24:b===ai?J=n.DEPTH_COMPONENT32F:b===sr&&(J=n.DEPTH_COMPONENT16),J}function U(O,b){return v(O)===!0||O.isFramebufferTexture&&O.minFilter!==Un&&O.minFilter!==vn?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),F(b),b.isVideoTexture&&p.delete(b)}function N(O){const b=O.target;b.removeEventListener("dispose",N),M(b)}function F(O){const b=s.get(O);if(b.__webglInit===void 0)return;const J=O.source,ot=_.get(J);if(ot){const _t=ot[b.__cacheKey];_t.usedTimes--,_t.usedTimes===0&&I(O),Object.keys(ot).length===0&&_.delete(J)}s.remove(O)}function I(O){const b=s.get(O);n.deleteTexture(b.__webglTexture);const J=O.source,ot=_.get(J);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 _t=0;_t<b.__webglFramebuffer[ot].length;_t++)n.deleteFramebuffer(b.__webglFramebuffer[ot][_t]);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 J=O.textures;for(let ot=0,_t=J.length;ot<_t;ot++){const rt=s.get(J[ot]);rt.__webglTexture&&(n.deleteTexture(rt.__webglTexture),l.memory.textures--),s.remove(J[ot])}s.remove(O)}let k=0;function H(){k=0}function Z(){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 j(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 at(O,b){const J=s.get(O);if(O.isVideoTexture&&Wt(O),O.isRenderTargetTexture===!1&&O.isExternalTexture!==!0&&O.version>0&&J.__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{lt(J,O,b);return}}else O.isExternalTexture&&(J.__webglTexture=O.sourceTexture?O.sourceTexture:null);e.bindTexture(n.TEXTURE_2D,J.__webglTexture,n.TEXTURE0+b)}function $(O,b){const J=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&J.__version!==O.version){lt(J,O,b);return}e.bindTexture(n.TEXTURE_2D_ARRAY,J.__webglTexture,n.TEXTURE0+b)}function dt(O,b){const J=s.get(O);if(O.isRenderTargetTexture===!1&&O.version>0&&J.__version!==O.version){lt(J,O,b);return}e.bindTexture(n.TEXTURE_3D,J.__webglTexture,n.TEXTURE0+b)}function G(O,b){const J=s.get(O);if(O.version>0&&J.__version!==O.version){pt(J,O,b);return}e.bindTexture(n.TEXTURE_CUBE_MAP,J.__webglTexture,n.TEXTURE0+b)}const it={[Ya]:n.REPEAT,[Yi]:n.CLAMP_TO_EDGE,[qa]:n.MIRRORED_REPEAT},tt={[Un]:n.NEAREST,[Y_]:n.NEAREST_MIPMAP_NEAREST,[oo]:n.NEAREST_MIPMAP_LINEAR,[vn]:n.LINEAR,[Qa]:n.LINEAR_MIPMAP_NEAREST,[bi]:n.LINEAR_MIPMAP_LINEAR},gt={[K_]:n.NEVER,[sv]:n.ALWAYS,[$_]:n.LESS,[Wh]:n.LEQUAL,[tv]:n.EQUAL,[iv]:n.GEQUAL,[ev]:n.GREATER,[nv]:n.NOTEQUAL};function At(O,b){if(b.type===ai&&t.has("OES_texture_float_linear")===!1&&(b.magFilter===vn||b.magFilter===Qa||b.magFilter===oo||b.magFilter===bi||b.minFilter===vn||b.minFilter===Qa||b.minFilter===oo||b.minFilter===bi)&&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,it[b.wrapS]),n.texParameteri(O,n.TEXTURE_WRAP_T,it[b.wrapT]),(O===n.TEXTURE_3D||O===n.TEXTURE_2D_ARRAY)&&n.texParameteri(O,n.TEXTURE_WRAP_R,it[b.wrapR]),n.texParameteri(O,n.TEXTURE_MAG_FILTER,tt[b.magFilter]),n.texParameteri(O,n.TEXTURE_MIN_FILTER,tt[b.minFilter]),b.compareFunction&&(n.texParameteri(O,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(O,n.TEXTURE_COMPARE_FUNC,gt[b.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(b.magFilter===Un||b.minFilter!==oo&&b.minFilter!==bi||b.type===ai&&t.has("OES_texture_float_linear")===!1)return;if(b.anisotropy>1||s.get(b).__currentAnisotropy){const J=t.get("EXT_texture_filter_anisotropic");n.texParameterf(O,J.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,r.getMaxAnisotropy())),s.get(b).__currentAnisotropy=b.anisotropy}}}function Jt(O,b){let J=!1;O.__webglInit===void 0&&(O.__webglInit=!0,b.addEventListener("dispose",B));const ot=b.source;let _t=_.get(ot);_t===void 0&&(_t={},_.set(ot,_t));const rt=j(b);if(rt!==O.__cacheKey){_t[rt]===void 0&&(_t[rt]={texture:n.createTexture(),usedTimes:0},l.memory.textures++,J=!0),_t[rt].usedTimes++;const Gt=_t[O.__cacheKey];Gt!==void 0&&(_t[O.__cacheKey].usedTimes--,Gt.usedTimes===0&&I(b)),O.__cacheKey=rt,O.__webglTexture=_t[rt].texture}return J}function Ft(O,b,J){return Math.floor(Math.floor(O/J)/b)}function Q(O,b,J,ot){const rt=O.updateRanges;if(rt.length===0)e.texSubImage2D(n.TEXTURE_2D,0,0,0,b.width,b.height,J,ot,b.data);else{rt.sort((xt,Lt)=>xt.start-Lt.start);let Gt=0;for(let xt=1;xt<rt.length;xt++){const Lt=rt[Gt],se=rt[xt],Xt=Lt.start+Lt.count,Pt=Ft(se.start,b.width,4),ce=Ft(Lt.start,b.width,4);se.start<=Xt+1&&Pt===ce&&Ft(se.start+se.count-1,b.width,4)===Pt?Lt.count=Math.max(Lt.count,se.start+se.count-Lt.start):(++Gt,rt[Gt]=se)}rt.length=Gt+1;const St=n.getParameter(n.UNPACK_ROW_LENGTH),zt=n.getParameter(n.UNPACK_SKIP_PIXELS),Zt=n.getParameter(n.UNPACK_SKIP_ROWS);n.pixelStorei(n.UNPACK_ROW_LENGTH,b.width);for(let xt=0,Lt=rt.length;xt<Lt;xt++){const se=rt[xt],Xt=Math.floor(se.start/4),Pt=Math.ceil(se.count/4),ce=Xt%b.width,V=Math.floor(Xt/b.width),wt=Pt,bt=1;n.pixelStorei(n.UNPACK_SKIP_PIXELS,ce),n.pixelStorei(n.UNPACK_SKIP_ROWS,V),e.texSubImage2D(n.TEXTURE_2D,0,ce,V,wt,bt,J,ot,b.data)}O.clearUpdateRanges(),n.pixelStorei(n.UNPACK_ROW_LENGTH,St),n.pixelStorei(n.UNPACK_SKIP_PIXELS,zt),n.pixelStorei(n.UNPACK_SKIP_ROWS,Zt)}}function lt(O,b,J){let ot=n.TEXTURE_2D;(b.isDataArrayTexture||b.isCompressedArrayTexture)&&(ot=n.TEXTURE_2D_ARRAY),b.isData3DTexture&&(ot=n.TEXTURE_3D);const _t=Jt(O,b),rt=b.source;e.bindTexture(ot,O.__webglTexture,n.TEXTURE0+J);const Gt=s.get(rt);if(rt.version!==Gt.__version||_t===!0){e.activeTexture(n.TEXTURE0+J);const St=we.getPrimaries(we.workingColorSpace),zt=b.colorSpace===Ai?null:we.getPrimaries(b.colorSpace),Zt=b.colorSpace===Ai||St===zt?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,Zt);let xt=w(b.image,!1,r.maxTextureSize);xt=Se(b,xt);const Lt=a.convert(b.format,b.colorSpace),se=a.convert(b.type);let Xt=C(b.internalFormat,Lt,se,b.colorSpace,b.isVideoTexture);At(ot,b);let Pt;const ce=b.mipmaps,V=b.isVideoTexture!==!0,wt=Gt.__version===void 0||_t===!0,bt=rt.dataReady,Ot=U(b,xt);if(b.isDepthTexture)Xt=A(b.format===lr,b.type),wt&&(V?e.texStorage2D(n.TEXTURE_2D,1,Xt,xt.width,xt.height):e.texImage2D(n.TEXTURE_2D,0,Xt,xt.width,xt.height,0,Lt,se,null));else if(b.isDataTexture)if(ce.length>0){V&&wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Xt,ce[0].width,ce[0].height);for(let yt=0,ut=ce.length;yt<ut;yt++)Pt=ce[yt],V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,Lt,se,Pt.data):e.texImage2D(n.TEXTURE_2D,yt,Xt,Pt.width,Pt.height,0,Lt,se,Pt.data);b.generateMipmaps=!1}else V?(wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Xt,xt.width,xt.height),bt&&Q(b,xt,Lt,se)):e.texImage2D(n.TEXTURE_2D,0,Xt,xt.width,xt.height,0,Lt,se,xt.data);else if(b.isCompressedTexture)if(b.isCompressedArrayTexture){V&&wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ot,Xt,ce[0].width,ce[0].height,xt.depth);for(let yt=0,ut=ce.length;yt<ut;yt++)if(Pt=ce[yt],b.format!==On)if(Lt!==null)if(V){if(bt)if(b.layerUpdates.size>0){const Vt=Au(Pt.width,Pt.height,b.format,b.type);for(const le of b.layerUpdates){const Ie=Pt.data.subarray(le*Vt/Pt.data.BYTES_PER_ELEMENT,(le+1)*Vt/Pt.data.BYTES_PER_ELEMENT);e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,le,Pt.width,Pt.height,1,Lt,Ie)}b.clearLayerUpdates()}else e.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Pt.width,Pt.height,xt.depth,Lt,Pt.data)}else e.compressedTexImage3D(n.TEXTURE_2D_ARRAY,yt,Xt,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 V?bt&&e.texSubImage3D(n.TEXTURE_2D_ARRAY,yt,0,0,0,Pt.width,Pt.height,xt.depth,Lt,se,Pt.data):e.texImage3D(n.TEXTURE_2D_ARRAY,yt,Xt,Pt.width,Pt.height,xt.depth,0,Lt,se,Pt.data)}else{V&&wt&&e.texStorage2D(n.TEXTURE_2D,Ot,Xt,ce[0].width,ce[0].height);for(let yt=0,ut=ce.length;yt<ut;yt++)Pt=ce[yt],b.format!==On?Lt!==null?V?bt&&e.compressedTexSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,Lt,Pt.data):e.compressedTexImage2D(n.TEXTURE_2D,yt,Xt,Pt.width,Pt.height,0,Pt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Pt.width,Pt.height,Lt,se,Pt.data):e.texImage2D(n.TEXTURE_2D,yt,Xt,Pt.width,Pt.height,0,Lt,se,Pt.data)}else if(b.isDataArrayTexture)if(V){if(wt&&e.texStorage3D(n.TEXTURE_2D_ARRAY,Ot,Xt,xt.width,xt.height,xt.depth),bt)if(b.layerUpdates.size>0){const yt=Au(xt.width,xt.height,b.format,b.type);for(const ut of b.layerUpdates){const Vt=xt.data.subarray(ut*yt/xt.data.BYTES_PER_ELEMENT,(ut+1)*yt/xt.data.BYTES_PER_ELEMENT);e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,ut,xt.width,xt.height,1,Lt,se,Vt)}b.clearLayerUpdates()}else e.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,xt.width,xt.height,xt.depth,Lt,se,xt.data)}else e.texImage3D(n.TEXTURE_2D_ARRAY,0,Xt,xt.width,xt.height,xt.depth,0,Lt,se,xt.data);else if(b.isData3DTexture)V?(wt&&e.texStorage3D(n.TEXTURE_3D,Ot,Xt,xt.width,xt.height,xt.depth),bt&&e.texSubImage3D(n.TEXTURE_3D,0,0,0,0,xt.width,xt.height,xt.depth,Lt,se,xt.data)):e.texImage3D(n.TEXTURE_3D,0,Xt,xt.width,xt.height,xt.depth,0,Lt,se,xt.data);else if(b.isFramebufferTexture){if(wt)if(V)e.texStorage2D(n.TEXTURE_2D,Ot,Xt,xt.width,xt.height);else{let yt=xt.width,ut=xt.height;for(let Vt=0;Vt<Ot;Vt++)e.texImage2D(n.TEXTURE_2D,Vt,Xt,yt,ut,0,Lt,se,null),yt>>=1,ut>>=1}}else if(ce.length>0){if(V&&wt){const yt=Ae(ce[0]);e.texStorage2D(n.TEXTURE_2D,Ot,Xt,yt.width,yt.height)}for(let yt=0,ut=ce.length;yt<ut;yt++)Pt=ce[yt],V?bt&&e.texSubImage2D(n.TEXTURE_2D,yt,0,0,Lt,se,Pt):e.texImage2D(n.TEXTURE_2D,yt,Xt,Lt,se,Pt);b.generateMipmaps=!1}else if(V){if(wt){const yt=Ae(xt);e.texStorage2D(n.TEXTURE_2D,Ot,Xt,yt.width,yt.height)}bt&&e.texSubImage2D(n.TEXTURE_2D,0,0,0,Lt,se,xt)}else e.texImage2D(n.TEXTURE_2D,0,Xt,Lt,se,xt);v(b)&&g(ot),Gt.__version=rt.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function pt(O,b,J){if(b.image.length!==6)return;const ot=Jt(O,b),_t=b.source;e.bindTexture(n.TEXTURE_CUBE_MAP,O.__webglTexture,n.TEXTURE0+J);const rt=s.get(_t);if(_t.version!==rt.__version||ot===!0){e.activeTexture(n.TEXTURE0+J);const Gt=we.getPrimaries(we.workingColorSpace),St=b.colorSpace===Ai?null:we.getPrimaries(b.colorSpace),zt=b.colorSpace===Ai||Gt===St?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,zt);const Zt=b.isCompressedTexture||b.image[0].isCompressedTexture,xt=b.image[0]&&b.image[0].isDataTexture,Lt=[];for(let ut=0;ut<6;ut++)!Zt&&!xt?Lt[ut]=w(b.image[ut],!0,r.maxCubemapSize):Lt[ut]=xt?b.image[ut].image:b.image[ut],Lt[ut]=Se(b,Lt[ut]);const se=Lt[0],Xt=a.convert(b.format,b.colorSpace),Pt=a.convert(b.type),ce=C(b.internalFormat,Xt,Pt,b.colorSpace),V=b.isVideoTexture!==!0,wt=rt.__version===void 0||ot===!0,bt=_t.dataReady;let Ot=U(b,se);At(n.TEXTURE_CUBE_MAP,b);let yt;if(Zt){V&&wt&&e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,ce,se.width,se.height);for(let ut=0;ut<6;ut++){yt=Lt[ut].mipmaps;for(let Vt=0;Vt<yt.length;Vt++){const le=yt[Vt];b.format!==On?Xt!==null?V?bt&&e.compressedTexSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt,0,0,le.width,le.height,Xt,le.data):e.compressedTexImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt,ce,le.width,le.height,0,le.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt,0,0,le.width,le.height,Xt,Pt,le.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt,ce,le.width,le.height,0,Xt,Pt,le.data)}}}else{if(yt=b.mipmaps,V&&wt){yt.length>0&&Ot++;const ut=Ae(Lt[0]);e.texStorage2D(n.TEXTURE_CUBE_MAP,Ot,ce,ut.width,ut.height)}for(let ut=0;ut<6;ut++)if(xt){V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,Lt[ut].width,Lt[ut].height,Xt,Pt,Lt[ut].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,ce,Lt[ut].width,Lt[ut].height,0,Xt,Pt,Lt[ut].data);for(let Vt=0;Vt<yt.length;Vt++){const Ie=yt[Vt].image[ut].image;V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt+1,0,0,Ie.width,Ie.height,Xt,Pt,Ie.data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt+1,ce,Ie.width,Ie.height,0,Xt,Pt,Ie.data)}}else{V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,0,0,Xt,Pt,Lt[ut]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,0,ce,Xt,Pt,Lt[ut]);for(let Vt=0;Vt<yt.length;Vt++){const le=yt[Vt];V?bt&&e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt+1,0,0,Xt,Pt,le.image[ut]):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+ut,Vt+1,ce,Xt,Pt,le.image[ut])}}}v(b)&&g(n.TEXTURE_CUBE_MAP),rt.__version=_t.version,b.onUpdate&&b.onUpdate(b)}O.__version=b.version}function Nt(O,b,J,ot,_t,rt){const Gt=a.convert(J.format,J.colorSpace),St=a.convert(J.type),zt=C(J.internalFormat,Gt,St,J.colorSpace),Zt=s.get(b),xt=s.get(J);if(xt.__renderTarget=b,!Zt.__hasExternalTextures){const Lt=Math.max(1,b.width>>rt),se=Math.max(1,b.height>>rt);_t===n.TEXTURE_3D||_t===n.TEXTURE_2D_ARRAY?e.texImage3D(_t,rt,zt,Lt,se,b.depth,0,Gt,St,null):e.texImage2D(_t,rt,zt,Lt,se,0,Gt,St,null)}e.bindFramebuffer(n.FRAMEBUFFER,O),Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,ot,_t,xt.__webglTexture,0,qt(b)):(_t===n.TEXTURE_2D||_t>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&_t<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,ot,_t,xt.__webglTexture,rt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function st(O,b,J){if(n.bindRenderbuffer(n.RENDERBUFFER,O),b.depthBuffer){const ot=b.depthTexture,_t=ot&&ot.isDepthTexture?ot.type:null,rt=A(b.stencilBuffer,_t),Gt=b.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,St=qt(b);Mt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,St,rt,b.width,b.height):J?n.renderbufferStorageMultisample(n.RENDERBUFFER,St,rt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,rt,b.width,b.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,Gt,n.RENDERBUFFER,O)}else{const ot=b.textures;for(let _t=0;_t<ot.length;_t++){const rt=ot[_t],Gt=a.convert(rt.format,rt.colorSpace),St=a.convert(rt.type),zt=C(rt.internalFormat,Gt,St,rt.colorSpace),Zt=qt(b);J&&Mt(b)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,Zt,zt,b.width,b.height):Mt(b)?h.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Zt,zt,b.width,b.height):n.renderbufferStorage(n.RENDERBUFFER,zt,b.width,b.height)}}n.bindRenderbuffer(n.RENDERBUFFER,null)}function ct(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),at(b.depthTexture,0);const _t=ot.__webglTexture,rt=qt(b);if(b.depthTexture.format===ar)Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,_t,0);else if(b.depthTexture.format===lr)Mt(b)?h.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0,rt):n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.TEXTURE_2D,_t,0);else throw new Error("Unknown depthTexture format")}function Dt(O){const b=s.get(O),J=O.isWebGLCubeRenderTarget===!0;if(b.__boundDepthTexture!==O.depthTexture){const ot=O.depthTexture;if(b.__depthDisposeCallback&&b.__depthDisposeCallback(),ot){const _t=()=>{delete b.__boundDepthTexture,delete b.__depthDisposeCallback,ot.removeEventListener("dispose",_t)};ot.addEventListener("dispose",_t),b.__depthDisposeCallback=_t}b.__boundDepthTexture=ot}if(O.depthTexture&&!b.__autoAllocateDepthBuffer){if(J)throw new Error("target.depthTexture not supported in Cube render targets");const ot=O.texture.mipmaps;ot&&ot.length>0?ct(b.__webglFramebuffer[0],O):ct(b.__webglFramebuffer,O)}else if(J){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(),st(b.__webglDepthbuffer[ot],O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer[ot];n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,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(),st(b.__webglDepthbuffer,O,!1);else{const _t=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,rt=b.__webglDepthbuffer;n.bindRenderbuffer(n.RENDERBUFFER,rt),n.framebufferRenderbuffer(n.FRAMEBUFFER,_t,n.RENDERBUFFER,rt)}}e.bindFramebuffer(n.FRAMEBUFFER,null)}function Bt(O,b,J){const ot=s.get(O);b!==void 0&&Nt(ot.__webglFramebuffer,O,O.texture,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,0),J!==void 0&&Dt(O)}function R(O){const b=O.texture,J=s.get(O),ot=s.get(b);O.addEventListener("dispose",N);const _t=O.textures,rt=O.isWebGLCubeRenderTarget===!0,Gt=_t.length>1;if(Gt||(ot.__webglTexture===void 0&&(ot.__webglTexture=n.createTexture()),ot.__version=b.version,l.memory.textures++),rt){J.__webglFramebuffer=[];for(let St=0;St<6;St++)if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer[St]=[];for(let zt=0;zt<b.mipmaps.length;zt++)J.__webglFramebuffer[St][zt]=n.createFramebuffer()}else J.__webglFramebuffer[St]=n.createFramebuffer()}else{if(b.mipmaps&&b.mipmaps.length>0){J.__webglFramebuffer=[];for(let St=0;St<b.mipmaps.length;St++)J.__webglFramebuffer[St]=n.createFramebuffer()}else J.__webglFramebuffer=n.createFramebuffer();if(Gt)for(let St=0,zt=_t.length;St<zt;St++){const Zt=s.get(_t[St]);Zt.__webglTexture===void 0&&(Zt.__webglTexture=n.createTexture(),l.memory.textures++)}if(O.samples>0&&Mt(O)===!1){J.__webglMultisampledFramebuffer=n.createFramebuffer(),J.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,J.__webglMultisampledFramebuffer);for(let St=0;St<_t.length;St++){const zt=_t[St];J.__webglColorRenderbuffer[St]=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,J.__webglColorRenderbuffer[St]);const Zt=a.convert(zt.format,zt.colorSpace),xt=a.convert(zt.type),Lt=C(zt.internalFormat,Zt,xt,zt.colorSpace,O.isXRRenderTarget===!0),se=qt(O);n.renderbufferStorageMultisample(n.RENDERBUFFER,se,Lt,O.width,O.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+St,n.RENDERBUFFER,J.__webglColorRenderbuffer[St])}n.bindRenderbuffer(n.RENDERBUFFER,null),O.depthBuffer&&(J.__webglDepthRenderbuffer=n.createRenderbuffer(),st(J.__webglDepthRenderbuffer,O,!0)),e.bindFramebuffer(n.FRAMEBUFFER,null)}}if(rt){e.bindTexture(n.TEXTURE_CUBE_MAP,ot.__webglTexture),At(n.TEXTURE_CUBE_MAP,b);for(let St=0;St<6;St++)if(b.mipmaps&&b.mipmaps.length>0)for(let zt=0;zt<b.mipmaps.length;zt++)Nt(J.__webglFramebuffer[St][zt],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+St,zt);else Nt(J.__webglFramebuffer[St],O,b,n.COLOR_ATTACHMENT0,n.TEXTURE_CUBE_MAP_POSITIVE_X+St,0);v(b)&&g(n.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(Gt){for(let St=0,zt=_t.length;St<zt;St++){const Zt=_t[St],xt=s.get(Zt);let Lt=n.TEXTURE_2D;(O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(Lt=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(Lt,xt.__webglTexture),At(Lt,Zt),Nt(J.__webglFramebuffer,O,Zt,n.COLOR_ATTACHMENT0+St,Lt,0),v(Zt)&&g(Lt)}e.unbindTexture()}else{let St=n.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(St=O.isWebGL3DRenderTarget?n.TEXTURE_3D:n.TEXTURE_2D_ARRAY),e.bindTexture(St,ot.__webglTexture),At(St,b),b.mipmaps&&b.mipmaps.length>0)for(let zt=0;zt<b.mipmaps.length;zt++)Nt(J.__webglFramebuffer[zt],O,b,n.COLOR_ATTACHMENT0,St,zt);else Nt(J.__webglFramebuffer,O,b,n.COLOR_ATTACHMENT0,St,0);v(b)&&g(St),e.unbindTexture()}O.depthBuffer&&Dt(O)}function ht(O){const b=O.textures;for(let J=0,ot=b.length;J<ot;J++){const _t=b[J];if(v(_t)){const rt=D(O),Gt=s.get(_t).__webglTexture;e.bindTexture(rt,Gt),g(rt),e.unbindTexture()}}}const ft=[],Ct=[];function vt(O){if(O.samples>0){if(Mt(O)===!1){const b=O.textures,J=O.width,ot=O.height;let _t=n.COLOR_BUFFER_BIT;const rt=O.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Gt=s.get(O),St=b.length>1;if(St)for(let Zt=0;Zt<b.length;Zt++)e.bindFramebuffer(n.FRAMEBUFFER,Gt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Zt,n.RENDERBUFFER,null),e.bindFramebuffer(n.FRAMEBUFFER,Gt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Zt,n.TEXTURE_2D,null,0);e.bindFramebuffer(n.READ_FRAMEBUFFER,Gt.__webglMultisampledFramebuffer);const zt=O.texture.mipmaps;zt&&zt.length>0?e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Gt.__webglFramebuffer[0]):e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Gt.__webglFramebuffer);for(let Zt=0;Zt<b.length;Zt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(_t|=n.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(_t|=n.STENCIL_BUFFER_BIT)),St){n.framebufferRenderbuffer(n.READ_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,Gt.__webglColorRenderbuffer[Zt]);const xt=s.get(b[Zt]).__webglTexture;n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,xt,0)}n.blitFramebuffer(0,0,J,ot,0,0,J,ot,_t,n.NEAREST),u===!0&&(ft.length=0,Ct.length=0,ft.push(n.COLOR_ATTACHMENT0+Zt),O.depthBuffer&&O.resolveDepthBuffer===!1&&(ft.push(rt),Ct.push(rt),n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER,Ct)),n.invalidateFramebuffer(n.READ_FRAMEBUFFER,ft))}if(e.bindFramebuffer(n.READ_FRAMEBUFFER,null),e.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),St)for(let Zt=0;Zt<b.length;Zt++){e.bindFramebuffer(n.FRAMEBUFFER,Gt.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+Zt,n.RENDERBUFFER,Gt.__webglColorRenderbuffer[Zt]);const xt=s.get(b[Zt]).__webglTexture;e.bindFramebuffer(n.FRAMEBUFFER,Gt.__webglFramebuffer),n.framebufferTexture2D(n.DRAW_FRAMEBUFFER,n.COLOR_ATTACHMENT0+Zt,n.TEXTURE_2D,xt,0)}e.bindFramebuffer(n.DRAW_FRAMEBUFFER,Gt.__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 qt(O){return Math.min(r.maxSamples,O.samples)}function Mt(O){const b=s.get(O);return O.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&b.__useRenderToTexture!==!1}function Wt(O){const b=l.render.frame;p.get(O)!==b&&(p.set(O,b),O.update())}function Se(O,b){const J=O.colorSpace,ot=O.format,_t=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||J!==Qi&&J!==Ai&&(we.getTransfer(J)===Le?(ot!==On||_t!==oi)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",J)),b}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=Z,this.resetTextureUnits=H,this.setTexture2D=at,this.setTexture2DArray=$,this.setTexture3D=dt,this.setTextureCube=G,this.rebindTextures=Bt,this.setupRenderTarget=R,this.updateRenderTargetMipmap=ht,this.updateMultisampleRenderTarget=vt,this.setupDepthRenderbuffer=Dt,this.setupFrameBufferTexture=Nt,this.useMultisampledRTT=Mt}function rw(n,t){function e(s,r=Ai){let a;const l=we.getTransfer(r);if(s===oi)return n.UNSIGNED_BYTE;if(s===Ja)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Ka)return n.UNSIGNED_SHORT_5_5_5_1;if(s===Nh)return n.UNSIGNED_INT_5_9_9_9_REV;if(s===Uh)return n.BYTE;if(s===Oh)return n.SHORT;if(s===sr)return n.UNSIGNED_SHORT;if(s===ja)return n.INT;if(s===qi)return n.UNSIGNED_INT;if(s===ai)return n.FLOAT;if(s===rr)return n.HALF_FLOAT;if(s===Bh)return n.ALPHA;if(s===Fh)return n.RGB;if(s===On)return n.RGBA;if(s===ar)return n.DEPTH_COMPONENT;if(s===lr)return n.DEPTH_STENCIL;if(s===zh)return n.RED;if(s===$a)return n.RED_INTEGER;if(s===Hh)return n.RG;if(s===tl)return n.RG_INTEGER;if(s===el)return n.RGBA_INTEGER;if(s===ao||s===lo||s===co||s===ho)if(l===Le)if(a=t.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===ao)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===lo)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===co)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===ho)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=t.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===ao)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===lo)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===co)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===ho)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===nl||s===il||s===sl||s===rl)if(a=t.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===nl)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===il)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===sl)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===rl)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===ol||s===al||s===ll)if(a=t.get("WEBGL_compressed_texture_etc"),a!==null){if(s===ol||s===al)return l===Le?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===ll)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===cl||s===hl||s===ul||s===dl||s===fl||s===pl||s===ml||s===gl||s===_l||s===vl||s===yl||s===El||s===xl||s===wl)if(a=t.get("WEBGL_compressed_texture_astc"),a!==null){if(s===cl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===hl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===ul)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===dl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===fl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===pl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===ml)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===gl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===_l)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===vl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===yl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===El)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===xl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===wl)return l===Le?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===uo||s===Sl||s===Ml)if(a=t.get("EXT_texture_compression_bptc"),a!==null){if(s===uo)return l===Le?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===Sl)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===Ml)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===Vh||s===Tl||s===bl||s===Al)if(a=t.get("EXT_texture_compression_rgtc"),a!==null){if(s===uo)return a.COMPRESSED_RED_RGTC1_EXT;if(s===Tl)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===bl)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===Al)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===or?n.UNSIGNED_INT_24_8:n[s]!==void 0?n[s]:null}return{convert:e}}class id extends je{constructor(t=null){super(),this.sourceTexture=t,this.isExternalTexture=!0}}const ow=`
|
|
3826
3826
|
void main() {
|
|
3827
3827
|
|
|
3828
3828
|
gl_Position = vec4( position, 1.0 );
|
|
3829
3829
|
|
|
3830
|
-
}`,
|
|
3830
|
+
}`,aw=`
|
|
3831
3831
|
uniform sampler2DArray depthColor;
|
|
3832
3832
|
uniform float depthWidth;
|
|
3833
3833
|
uniform float depthHeight;
|
|
@@ -3846,20 +3846,20 @@ void main() {
|
|
|
3846
3846
|
|
|
3847
3847
|
}
|
|
3848
3848
|
|
|
3849
|
-
}`;class sw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new td(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 pi({vertexShader:nw,fragmentShader:iw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new dn(new Er(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class rw extends ys{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 sw,v={},g=e.getContextAttributes();let D=null,C=null;const A=[],U=[],B=new be;let N=null;const F=new Pn;F.viewport=new Fe;const I=new Pn;I.viewport=new Fe;const M=[F,I],k=new r0;let H=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(J){let ct=A[J];return ct===void 0&&(ct=new Jl,A[J]=ct),ct.getTargetRaySpace()},this.getControllerGrip=function(J){let ct=A[J];return ct===void 0&&(ct=new Jl,A[J]=ct),ct.getGripSpace()},this.getHand=function(J){let ct=A[J];return ct===void 0&&(ct=new Jl,A[J]=ct),ct.getHandSpace()};function Q(J){const ct=U.indexOf(J.inputSource);if(ct===-1)return;const pt=A[ct];pt!==void 0&&(pt.update(J.inputSource,J.frame,d||l),pt.dispatchEvent({type:J.type,data:J.inputSource}))}function at(){r.removeEventListener("select",Q),r.removeEventListener("selectstart",Q),r.removeEventListener("selectend",Q),r.removeEventListener("squeeze",Q),r.removeEventListener("squeezestart",Q),r.removeEventListener("squeezeend",Q),r.removeEventListener("end",at),r.removeEventListener("inputsourceschange",$);for(let J=0;J<A.length;J++){const ct=U[J];ct!==null&&(U[J]=null,A[J].disconnect(ct))}H=null,Z=null,w.reset();for(const J in v)delete v[J];t.setRenderTarget(D),E=null,_=null,m=null,r=null,C=null,Yt.stop(),s.isPresenting=!1,t.setPixelRatio(N),t.setSize(B.width,B.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(J){a=J,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(J){h=J,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(J){d=J},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(J){if(r=J,r!==null){if(D=t.getRenderTarget(),r.addEventListener("select",Q),r.addEventListener("selectstart",Q),r.addEventListener("selectend",Q),r.addEventListener("squeeze",Q),r.addEventListener("squeezestart",Q),r.addEventListener("squeezeend",Q),r.addEventListener("end",at),r.addEventListener("inputsourceschange",$),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 pt=null,Nt=null,st=null;g.depth&&(st=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,pt=g.stencil?lr:ar,Nt=g.stencil?or:qi);const lt={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:a};_=m.createProjectionLayer(lt),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),C=new Ci(_.textureWidth,_.textureHeight,{format:On,type:oi,depthTexture:new Eu(_.textureWidth,_.textureHeight,Nt,void 0,void 0,void 0,void 0,void 0,void 0,pt),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const pt={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,pt),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),C=new Ci(E.framebufferWidth,E.framebufferHeight,{format:On,type:oi,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),Yt.setContext(r),Yt.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return w.getDepthTexture()};function $(J){for(let ct=0;ct<J.removed.length;ct++){const pt=J.removed[ct],Nt=U.indexOf(pt);Nt>=0&&(U[Nt]=null,A[Nt].disconnect(pt))}for(let ct=0;ct<J.added.length;ct++){const pt=J.added[ct];let Nt=U.indexOf(pt);if(Nt===-1){for(let lt=0;lt<A.length;lt++)if(lt>=U.length){U.push(pt),Nt=lt;break}else if(U[lt]===null){U[lt]=pt,Nt=lt;break}if(Nt===-1)break}const st=A[Nt];st&&st.connect(pt)}}const dt=new Y,G=new Y;function it(J,ct,pt){dt.setFromMatrixPosition(ct.matrixWorld),G.setFromMatrixPosition(pt.matrixWorld);const Nt=dt.distanceTo(G),st=ct.projectionMatrix.elements,lt=pt.projectionMatrix.elements,Dt=st[14]/(st[10]-1),Bt=st[14]/(st[10]+1),R=(st[9]+1)/st[5],ht=(st[9]-1)/st[5],ft=(st[8]-1)/st[0],At=(lt[8]+1)/lt[0],vt=Dt*ft,qt=Dt*At,Mt=Nt/(-ft+At),Gt=Mt*-ft;if(ct.matrixWorld.decompose(J.position,J.quaternion,J.scale),J.translateX(Gt),J.translateZ(Mt),J.matrixWorld.compose(J.position,J.quaternion,J.scale),J.matrixWorldInverse.copy(J.matrixWorld).invert(),st[10]===-1)J.projectionMatrix.copy(ct.projectionMatrix),J.projectionMatrixInverse.copy(ct.projectionMatrixInverse);else{const Se=Dt+Mt,Ae=Bt+Mt,O=vt-Gt,b=qt+(Nt-Gt),j=R*Bt/Ae*Se,ot=ht*Bt/Ae*Se;J.projectionMatrix.makePerspective(O,b,j,ot,Se,Ae),J.projectionMatrixInverse.copy(J.projectionMatrix).invert()}}function tt(J,ct){ct===null?J.matrixWorld.copy(J.matrix):J.matrixWorld.multiplyMatrices(ct.matrixWorld,J.matrix),J.matrixWorldInverse.copy(J.matrixWorld).invert()}this.updateCamera=function(J){if(r===null)return;let ct=J.near,pt=J.far;w.texture!==null&&(w.depthNear>0&&(ct=w.depthNear),w.depthFar>0&&(pt=w.depthFar)),k.near=I.near=F.near=ct,k.far=I.far=F.far=pt,(H!==k.near||Z!==k.far)&&(r.updateRenderState({depthNear:k.near,depthFar:k.far}),H=k.near,Z=k.far),k.layers.mask=J.layers.mask|6,F.layers.mask=k.layers.mask&3,I.layers.mask=k.layers.mask&5;const Nt=J.parent,st=k.cameras;tt(k,Nt);for(let lt=0;lt<st.length;lt++)tt(st[lt],Nt);st.length===2?it(k,F,I):k.projectionMatrix.copy(F.projectionMatrix),gt(J,k,Nt)};function gt(J,ct,pt){pt===null?J.matrix.copy(ct.matrixWorld):(J.matrix.copy(pt.matrixWorld),J.matrix.invert(),J.matrix.multiply(ct.matrixWorld)),J.matrix.decompose(J.position,J.quaternion,J.scale),J.updateMatrixWorld(!0),J.projectionMatrix.copy(ct.projectionMatrix),J.projectionMatrixInverse.copy(ct.projectionMatrixInverse),J.isPerspectiveCamera&&(J.fov=hr*2*Math.atan(1/J.projectionMatrix.elements[5]),J.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(J){u=J,_!==null&&(_.fixedFoveation=J),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=J)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(k)},this.getCameraTexture=function(J){return v[J]};let It=null;function ee(J,ct){if(p=ct.getViewerPose(d||l),S=ct,p!==null){const pt=p.views;E!==null&&(t.setRenderTargetFramebuffer(C,E.framebuffer),t.setRenderTarget(C));let Nt=!1;pt.length!==k.cameras.length&&(k.cameras.length=0,Nt=!0);for(let Bt=0;Bt<pt.length;Bt++){const R=pt[Bt];let ht=null;if(E!==null)ht=E.getViewport(R);else{const At=m.getViewSubImage(_,R);ht=At.viewport,Bt===0&&(t.setRenderTargetTextures(C,At.colorTexture,At.depthStencilTexture),t.setRenderTarget(C))}let ft=M[Bt];ft===void 0&&(ft=new Pn,ft.layers.enable(Bt),ft.viewport=new Fe,M[Bt]=ft),ft.matrix.fromArray(R.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(R.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(ht.x,ht.y,ht.width,ht.height),Bt===0&&(k.matrix.copy(ft.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),Nt===!0&&k.cameras.push(ft)}const st=r.enabledFeatures;if(st&&st.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const Bt=m.getDepthInformation(pt[0]);Bt&&Bt.isValid&&Bt.texture&&w.init(Bt,r.renderState)}if(st&&st.includes("camera-access")&&(t.state.unbindTexture(),m))for(let Bt=0;Bt<pt.length;Bt++){const R=pt[Bt].camera;if(R){let ht=v[R];ht||(ht=new td,v[R]=ht);const ft=m.getCameraImage(R);ht.sourceTexture=ft}}}for(let pt=0;pt<A.length;pt++){const Nt=U[pt],st=A[pt];Nt!==null&&st!==void 0&&st.update(Nt,ct,d||l)}It&&It(J,ct),ct.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:ct}),S=null}const Yt=new Tu;Yt.setAnimationLoop(ee),this.setAnimationLoop=function(J){It=J},this.dispose=function(){}}}const rs=new Yn,ow=new Ue;function aw(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,uu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,D,C,A){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,A)):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,D,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===un&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===un&&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 D=t.get(g),C=D.envMap,A=D.envMapRotation;C&&(v.envMap.value=C,rs.copy(A),rs.x*=-1,rs.y*=-1,rs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(rs.y*=-1,rs.z*=-1),v.envMapRotation.value.setFromMatrix4(ow.makeRotationFromEuler(rs)),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,D,C){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*D,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,D){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===un&&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=D.texture,v.transmissionSamplerSize.value.set(D.width,D.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 D=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(D.matrixWorld),v.nearDistance.value=D.shadow.camera.near,v.farDistance.value=D.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function lw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(D,C){const A=C.program;s.uniformBlockBinding(D,A)}function d(D,C){let A=r[D.id];A===void 0&&(S(D),A=p(D),r[D.id]=A,D.addEventListener("dispose",v));const U=C.program;s.updateUBOMapping(D,U);const B=t.render.frame;a[D.id]!==B&&(_(D),a[D.id]=B)}function p(D){const C=m();D.__bindingPointIndex=C;const A=n.createBuffer(),U=D.__size,B=D.usage;return n.bindBuffer(n.UNIFORM_BUFFER,A),n.bufferData(n.UNIFORM_BUFFER,U,B),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,A),A}function m(){for(let D=0;D<h;D++)if(l.indexOf(D)===-1)return l.push(D),D;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(D){const C=r[D.id],A=D.uniforms,U=D.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let B=0,N=A.length;B<N;B++){const F=Array.isArray(A[B])?A[B]:[A[B]];for(let I=0,M=F.length;I<M;I++){const k=F[I];if(E(k,B,I,U)===!0){const H=k.__offset,Z=Array.isArray(k.value)?k.value:[k.value];let Q=0;for(let at=0;at<Z.length;at++){const $=Z[at],dt=w($);typeof $=="number"||typeof $=="boolean"?(k.__data[0]=$,n.bufferSubData(n.UNIFORM_BUFFER,H+Q,k.__data)):$.isMatrix3?(k.__data[0]=$.elements[0],k.__data[1]=$.elements[1],k.__data[2]=$.elements[2],k.__data[3]=0,k.__data[4]=$.elements[3],k.__data[5]=$.elements[4],k.__data[6]=$.elements[5],k.__data[7]=0,k.__data[8]=$.elements[6],k.__data[9]=$.elements[7],k.__data[10]=$.elements[8],k.__data[11]=0):($.toArray(k.__data,Q),Q+=dt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,H,k.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(D,C,A,U){const B=D.value,N=C+"_"+A;if(U[N]===void 0)return typeof B=="number"||typeof B=="boolean"?U[N]=B:U[N]=B.clone(),!0;{const F=U[N];if(typeof B=="number"||typeof B=="boolean"){if(F!==B)return U[N]=B,!0}else if(F.equals(B)===!1)return F.copy(B),!0}return!1}function S(D){const C=D.uniforms;let A=0;const U=16;for(let N=0,F=C.length;N<F;N++){const I=Array.isArray(C[N])?C[N]:[C[N]];for(let M=0,k=I.length;M<k;M++){const H=I[M],Z=Array.isArray(H.value)?H.value:[H.value];for(let Q=0,at=Z.length;Q<at;Q++){const $=Z[Q],dt=w($),G=A%U,it=G%dt.boundary,tt=G+it;A+=it,tt!==0&&U-tt<dt.storage&&(A+=U-tt),H.__data=new Float32Array(dt.storage/Float32Array.BYTES_PER_ELEMENT),H.__offset=A,A+=dt.storage}}}const B=A%U;return B>0&&(A+=U-B),D.__size=A,D.__cache={},this}function w(D){const C={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(C.boundary=4,C.storage=4):D.isVector2?(C.boundary=8,C.storage=8):D.isVector3||D.isColor?(C.boundary=16,C.storage=12):D.isVector4?(C.boundary=16,C.storage=16):D.isMatrix3?(C.boundary=48,C.storage=48):D.isMatrix4?(C.boundary=64,C.storage=64):D.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",D),C}function v(D){const C=D.target;C.removeEventListener("dispose",v);const A=l.indexOf(C.__bindingPointIndex);l.splice(A,1),n.deleteBuffer(r[C.id]),delete r[C.id],delete a[C.id]}function g(){for(const D in r)n.deleteBuffer(r[D]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class cw{constructor(t={}){const{canvas:e=_v(),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 D=[],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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let U=!1;this._outputColorSpace=An;let B=0,N=0,F=null,I=-1,M=null;const k=new Fe,H=new Fe;let Z=null;const Q=new Ce(0);let at=0,$=e.width,dt=e.height,G=1,it=null,tt=null;const gt=new Fe(0,0,$,dt),It=new Fe(0,0,$,dt);let ee=!1;const Yt=new tc;let J=!1,ct=!1;const pt=new Ue,Nt=new Y,st=new Fe,lt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Dt=!1;function Bt(){return F===null?G:1}let R=s;function ht(P,W){return e.getContext(P,W)}try{const P={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${ka}`),e.addEventListener("webglcontextlost",bt,!1),e.addEventListener("webglcontextrestored",Ot,!1),e.addEventListener("webglcontextcreationerror",yt,!1),R===null){const W="webgl2";if(R=ht(W,P),R===null)throw ht(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(P){throw console.error("THREE.WebGLRenderer: "+P.message),P}let ft,At,vt,qt,Mt,Gt,Se,Ae,O,b,j,ot,_t,rt,Vt,St,Ft,Wt,xt,Rt,se,Zt,Ct,ce;function V(){ft=new yE(R),ft.init(),Zt=new ew(R,ft),At=new dE(R,ft,t,Zt),vt=new $x(R,ft),At.reversedDepthBuffer&&_&&vt.buffers.depth.setReversed(!0),qt=new wE(R),Mt=new zx,Gt=new tw(R,ft,vt,Mt,At,Zt,qt),Se=new pE(A),Ae=new vE(A),O=new l0(R),Ct=new hE(R,O),b=new EE(R,O,qt,Ct),j=new ME(R,b,O,qt),xt=new SE(R,At,Gt),St=new fE(Mt),ot=new Fx(A,Se,Ae,ft,At,Ct,St),_t=new aw(A,Mt),rt=new Vx,Vt=new qx(ft),Wt=new cE(A,Se,Ae,vt,j,E,u),Ft=new Jx(A,j,At),ce=new lw(R,qt,At,vt),Rt=new uE(R,ft,qt),se=new xE(R,ft,qt),qt.programs=ot.programs,A.capabilities=At,A.extensions=ft,A.properties=Mt,A.renderLists=rt,A.shadowMap=Ft,A.state=vt,A.info=qt}V();const wt=new rw(A,R);this.xr=wt,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const P=ft.get("WEBGL_lose_context");P&&P.loseContext()},this.forceContextRestore=function(){const P=ft.get("WEBGL_lose_context");P&&P.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(P){P!==void 0&&(G=P,this.setSize($,dt,!1))},this.getSize=function(P){return P.set($,dt)},this.setSize=function(P,W,et=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=P,dt=W,e.width=Math.floor(P*G),e.height=Math.floor(W*G),et===!0&&(e.style.width=P+"px",e.style.height=W+"px"),this.setViewport(0,0,P,W)},this.getDrawingBufferSize=function(P){return P.set($*G,dt*G).floor()},this.setDrawingBufferSize=function(P,W,et){$=P,dt=W,G=et,e.width=Math.floor(P*et),e.height=Math.floor(W*et),this.setViewport(0,0,P,W)},this.getCurrentViewport=function(P){return P.copy(k)},this.getViewport=function(P){return P.copy(gt)},this.setViewport=function(P,W,et,K){P.isVector4?gt.set(P.x,P.y,P.z,P.w):gt.set(P,W,et,K),vt.viewport(k.copy(gt).multiplyScalar(G).round())},this.getScissor=function(P){return P.copy(It)},this.setScissor=function(P,W,et,K){P.isVector4?It.set(P.x,P.y,P.z,P.w):It.set(P,W,et,K),vt.scissor(H.copy(It).multiplyScalar(G).round())},this.getScissorTest=function(){return ee},this.setScissorTest=function(P){vt.setScissorTest(ee=P)},this.setOpaqueSort=function(P){it=P},this.setTransparentSort=function(P){tt=P},this.getClearColor=function(P){return P.copy(Wt.getClearColor())},this.setClearColor=function(){Wt.setClearColor(...arguments)},this.getClearAlpha=function(){return Wt.getClearAlpha()},this.setClearAlpha=function(){Wt.setClearAlpha(...arguments)},this.clear=function(P=!0,W=!0,et=!0){let K=0;if(P){let X=!1;if(F!==null){const Et=F.texture.format;X=Et===tl||Et===$a||Et===Ka}if(X){const Et=F.texture.type,Lt=Et===oi||Et===qi||Et===sr||Et===or||Et===ja||Et===Ja,zt=Wt.getClearColor(),Ut=Wt.getClearAlpha(),ne=zt.r,ie=zt.g,Jt=zt.b;Lt?(S[0]=ne,S[1]=ie,S[2]=Jt,S[3]=Ut,R.clearBufferuiv(R.COLOR,0,S)):(w[0]=ne,w[1]=ie,w[2]=Jt,w[3]=Ut,R.clearBufferiv(R.COLOR,0,w))}else K|=R.COLOR_BUFFER_BIT}W&&(K|=R.DEPTH_BUFFER_BIT),et&&(K|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(K)},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",bt,!1),e.removeEventListener("webglcontextrestored",Ot,!1),e.removeEventListener("webglcontextcreationerror",yt,!1),Wt.dispose(),rt.dispose(),Vt.dispose(),Mt.dispose(),Se.dispose(),Ae.dispose(),j.dispose(),Ct.dispose(),ce.dispose(),ot.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",In),wt.removeEventListener("sessionend",ga),vi.stop()};function bt(P){P.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Ot(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const P=qt.autoReset,W=Ft.enabled,et=Ft.autoUpdate,K=Ft.needsUpdate,X=Ft.type;V(),qt.autoReset=P,Ft.enabled=W,Ft.autoUpdate=et,Ft.needsUpdate=K,Ft.type=X}function yt(P){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",P.statusMessage)}function ut(P){const W=P.target;W.removeEventListener("dispose",ut),Ht(W)}function Ht(P){le(P),Mt.remove(P)}function le(P){const W=Mt.get(P).programs;W!==void 0&&(W.forEach(function(et){ot.releaseProgram(et)}),P.isShaderMaterial&&ot.releaseShaderCache(P))}this.renderBufferDirect=function(P,W,et,K,X,Et){W===null&&(W=lt);const Lt=X.isMesh&&X.matrixWorld.determinant()<0,zt=_a(P,W,et,K,X);vt.setMaterial(K,Lt);let Ut=et.index,ne=1;if(K.wireframe===!0){if(Ut=b.getWireframeAttribute(et),Ut===void 0)return;ne=2}const ie=et.drawRange,Jt=et.attributes.position;let fe=ie.start*ne,ye=(ie.start+ie.count)*ne;Et!==null&&(fe=Math.max(fe,Et.start*ne),ye=Math.min(ye,(Et.start+Et.count)*ne)),Ut!==null?(fe=Math.max(fe,0),ye=Math.min(ye,Ut.count)):Jt!=null&&(fe=Math.max(fe,0),ye=Math.min(ye,Jt.count));const Kt=ye-fe;if(Kt<0||Kt===1/0)return;Ct.setup(X,K,zt,et,Ut);let re,Te=Rt;if(Ut!==null&&(re=O.get(Ut),Te=se,Te.setIndex(re)),X.isMesh)K.wireframe===!0?(vt.setLineWidth(K.wireframeLinewidth*Bt()),Te.setMode(R.LINES)):Te.setMode(R.TRIANGLES);else if(X.isLine){let Qt=K.linewidth;Qt===void 0&&(Qt=1),vt.setLineWidth(Qt*Bt()),X.isLineSegments?Te.setMode(R.LINES):X.isLineLoop?Te.setMode(R.LINE_LOOP):Te.setMode(R.LINE_STRIP)}else X.isPoints?Te.setMode(R.POINTS):X.isSprite&&Te.setMode(R.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)ws("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(ft.get("WEBGL_multi_draw"))Te.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const Qt=X._multiDrawStarts,Re=X._multiDrawCounts,ge=X._multiDrawCount,te=Ut?O.get(Ut).bytesPerElement:1,De=Mt.get(K).currentProgram.getUniforms();for(let $e=0;$e<ge;$e++)De.setValue(R,"_gl_DrawID",$e),Te.render(Qt[$e]/te,Re[$e])}else if(X.isInstancedMesh)Te.renderInstances(fe,Kt,X.count);else if(et.isInstancedBufferGeometry){const Qt=et._maxInstanceCount!==void 0?et._maxInstanceCount:1/0,Re=Math.min(et.instanceCount,Qt);Te.renderInstances(fe,Kt,Re)}else Te.render(fe,Kt)};function Ie(P,W,et){P.transparent===!0&&P.side===ri&&P.forceSinglePass===!1?(P.side=un,P.needsUpdate=!0,cs(P,W,et),P.side=Si,P.needsUpdate=!0,cs(P,W,et),P.side=ri):cs(P,W,et)}this.compile=function(P,W,et=null){et===null&&(et=P),g=Vt.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))}),P!==et&&P.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),g.setupLights();const K=new Set;return P.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 Lt=0;Lt<Et.length;Lt++){const zt=Et[Lt];Ie(zt,et,X),K.add(zt)}else Ie(Et,et,X),K.add(Et)}),g=C.pop(),K},this.compileAsync=function(P,W,et=null){const K=this.compile(P,W,et);return new Promise(X=>{function Et(){if(K.forEach(function(Lt){Mt.get(Lt).currentProgram.isReady()&&K.delete(Lt)}),K.size===0){X(P);return}setTimeout(Et,10)}ft.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let Me=null;function Sn(P){Me&&Me(P)}function In(){vi.stop()}function ga(){vi.start()}const vi=new Tu;vi.setAnimationLoop(Sn),typeof self<"u"&&vi.setContext(self),this.setAnimationLoop=function(P){Me=P,wt.setAnimationLoop(P),P===null?vi.stop():vi.start()},wt.addEventListener("sessionstart",In),wt.addEventListener("sessionend",ga),this.render=function(P,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(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(W),W=wt.getCamera()),P.isScene===!0&&P.onBeforeRender(A,P,W,F),g=Vt.get(P,C.length),g.init(W),C.push(g),pt.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Yt.setFromProjectionMatrix(pt,Xn,W.reversedDepth),ct=this.localClippingEnabled,J=St.init(this.clippingPlanes,ct),v=rt.get(P,D.length),v.init(),D.push(v),wt.enabled===!0&&wt.isPresenting===!0){const Et=A.xr.getDepthSensingMesh();Et!==null&&Zr(Et,W,-1/0,A.sortObjects)}Zr(P,W,0,A.sortObjects),v.finish(),A.sortObjects===!0&&v.sort(it,tt),Dt=wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1,Dt&&Wt.addToRenderList(v,P),this.info.render.frame++,J===!0&&St.beginShadows();const et=g.state.shadowsArray;Ft.render(et,P,W),J===!0&&St.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=v.opaque,X=v.transmissive;if(g.setupLights(),W.isArrayCamera){const Et=W.cameras;if(X.length>0)for(let Lt=0,zt=Et.length;Lt<zt;Lt++){const Ut=Et[Lt];Xt(K,X,P,Ut)}Dt&&Wt.render(P);for(let Lt=0,zt=Et.length;Lt<zt;Lt++){const Ut=Et[Lt];Mn(v,P,Ut,Ut.viewport)}}else X.length>0&&Xt(K,X,P,W),Dt&&Wt.render(P),Mn(v,P,W);F!==null&&N===0&&(Gt.updateMultisampleRenderTarget(F),Gt.updateRenderTargetMipmap(F)),P.isScene===!0&&P.onAfterRender(A,P,W),Ct.resetDefaultState(),I=-1,M=null,C.pop(),C.length>0?(g=C[C.length-1],J===!0&&St.setGlobalState(A.clippingPlanes,g.state.camera)):g=null,D.pop(),D.length>0?v=D[D.length-1]:v=null};function Zr(P,W,et,K){if(P.visible===!1)return;if(P.layers.test(W.layers)){if(P.isGroup)et=P.renderOrder;else if(P.isLOD)P.autoUpdate===!0&&P.update(W);else if(P.isLight)g.pushLight(P),P.castShadow&&g.pushShadow(P);else if(P.isSprite){if(!P.frustumCulled||Yt.intersectsSprite(P)){K&&st.setFromMatrixPosition(P.matrixWorld).applyMatrix4(pt);const Lt=j.update(P),zt=P.material;zt.visible&&v.push(P,Lt,zt,et,st.z,null)}}else if((P.isMesh||P.isLine||P.isPoints)&&(!P.frustumCulled||Yt.intersectsObject(P))){const Lt=j.update(P),zt=P.material;if(K&&(P.boundingSphere!==void 0?(P.boundingSphere===null&&P.computeBoundingSphere(),st.copy(P.boundingSphere.center)):(Lt.boundingSphere===null&&Lt.computeBoundingSphere(),st.copy(Lt.boundingSphere.center)),st.applyMatrix4(P.matrixWorld).applyMatrix4(pt)),Array.isArray(zt)){const Ut=Lt.groups;for(let ne=0,ie=Ut.length;ne<ie;ne++){const Jt=Ut[ne],fe=zt[Jt.materialIndex];fe&&fe.visible&&v.push(P,Lt,fe,et,st.z,Jt)}}else zt.visible&&v.push(P,Lt,zt,et,st.z,null)}}const Et=P.children;for(let Lt=0,zt=Et.length;Lt<zt;Lt++)Zr(Et[Lt],W,et,K)}function Mn(P,W,et,K){const X=P.opaque,Et=P.transmissive,Lt=P.transparent;g.setupLightsView(et),J===!0&&St.setGlobalState(A.clippingPlanes,et),K&&vt.viewport(k.copy(K)),X.length>0&&ls(X,W,et),Et.length>0&&ls(Et,W,et),Lt.length>0&&ls(Lt,W,et),vt.buffers.depth.setTest(!0),vt.buffers.depth.setMask(!0),vt.buffers.color.setMask(!0),vt.setPolygonOffset(!1)}function Xt(P,W,et,K){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[K.id]===void 0&&(g.state.transmissionRenderTarget[K.id]=new Ci(1,1,{generateMipmaps:!0,type:ft.has("EXT_color_buffer_half_float")||ft.has("EXT_color_buffer_float")?rr:oi,minFilter:bi,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:we.workingColorSpace}));const Et=g.state.transmissionRenderTarget[K.id],Lt=K.viewport||k;Et.setSize(Lt.z*A.transmissionResolutionScale,Lt.w*A.transmissionResolutionScale);const zt=A.getRenderTarget(),Ut=A.getActiveCubeFace(),ne=A.getActiveMipmapLevel();A.setRenderTarget(Et),A.getClearColor(Q),at=A.getClearAlpha(),at<1&&A.setClearColor(16777215,.5),A.clear(),Dt&&Wt.render(et);const ie=A.toneMapping;A.toneMapping=Ti;const Jt=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),g.setupLightsView(K),J===!0&&St.setGlobalState(A.clippingPlanes,K),ls(P,et,K),Gt.updateMultisampleRenderTarget(Et),Gt.updateRenderTargetMipmap(Et),ft.has("WEBGL_multisampled_render_to_texture")===!1){let fe=!1;for(let ye=0,Kt=W.length;ye<Kt;ye++){const re=W[ye],Te=re.object,Qt=re.geometry,Re=re.material,ge=re.group;if(Re.side===ri&&Te.layers.test(K.layers)){const te=Re.side;Re.side=un,Re.needsUpdate=!0,Xr(Te,et,K,Qt,Re,ge),Re.side=te,Re.needsUpdate=!0,fe=!0}}fe===!0&&(Gt.updateMultisampleRenderTarget(Et),Gt.updateRenderTargetMipmap(Et))}A.setRenderTarget(zt,Ut,ne),A.setClearColor(Q,at),Jt!==void 0&&(K.viewport=Jt),A.toneMapping=ie}function ls(P,W,et){const K=W.isScene===!0?W.overrideMaterial:null;for(let X=0,Et=P.length;X<Et;X++){const Lt=P[X],zt=Lt.object,Ut=Lt.geometry,ne=Lt.group;let ie=Lt.material;ie.allowOverride===!0&&K!==null&&(ie=K),zt.layers.test(et.layers)&&Xr(zt,W,et,Ut,ie,ne)}}function Xr(P,W,et,K,X,Et){P.onBeforeRender(A,W,et,K,X,Et),P.modelViewMatrix.multiplyMatrices(et.matrixWorldInverse,P.matrixWorld),P.normalMatrix.getNormalMatrix(P.modelViewMatrix),X.onBeforeRender(A,W,et,K,P,Et),X.transparent===!0&&X.side===ri&&X.forceSinglePass===!1?(X.side=un,X.needsUpdate=!0,A.renderBufferDirect(et,W,K,X,P,Et),X.side=Si,X.needsUpdate=!0,A.renderBufferDirect(et,W,K,X,P,Et),X.side=ri):A.renderBufferDirect(et,W,K,X,P,Et),P.onAfterRender(A,W,et,K,X,Et)}function cs(P,W,et){W.isScene!==!0&&(W=lt);const K=Mt.get(P),X=g.state.lights,Et=g.state.shadowsArray,Lt=X.state.version,zt=ot.getParameters(P,X.state,Et,W,et),Ut=ot.getProgramCacheKey(zt);let ne=K.programs;K.environment=P.isMeshStandardMaterial?W.environment:null,K.fog=W.fog,K.envMap=(P.isMeshStandardMaterial?Ae:Se).get(P.envMap||K.environment),K.envMapRotation=K.environment!==null&&P.envMap===null?W.environmentRotation:P.envMapRotation,ne===void 0&&(P.addEventListener("dispose",ut),ne=new Map,K.programs=ne);let ie=ne.get(Ut);if(ie!==void 0){if(K.currentProgram===ie&&K.lightsStateVersion===Lt)return js(P,zt),ie}else zt.uniforms=ot.getUniforms(P),P.onBeforeCompile(zt,A),ie=ot.acquireProgram(zt,Ut),ne.set(Ut,ie),K.uniforms=zt.uniforms;const Jt=K.uniforms;return(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(Jt.clippingPlanes=St.uniform),js(P,zt),K.needsLights=va(P),K.lightsStateVersion=Lt,K.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),K.currentProgram=ie,K.uniformsList=null,ie}function Yr(P){if(P.uniformsList===null){const W=P.currentProgram.getUniforms();P.uniformsList=zo.seqWithValue(W.seq,P.uniforms)}return P.uniformsList}function js(P,W){const et=Mt.get(P);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 _a(P,W,et,K,X){W.isScene!==!0&&(W=lt),Gt.resetTextureUnits();const Et=W.fog,Lt=K.isMeshStandardMaterial?W.environment:null,zt=F===null?A.outputColorSpace:F.isXRRenderTarget===!0?F.texture.colorSpace:Qi,Ut=(K.isMeshStandardMaterial?Ae:Se).get(K.envMap||Lt),ne=K.vertexColors===!0&&!!et.attributes.color&&et.attributes.color.itemSize===4,ie=!!et.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Jt=!!et.morphAttributes.position,fe=!!et.morphAttributes.normal,ye=!!et.morphAttributes.color;let Kt=Ti;K.toneMapped&&(F===null||F.isXRRenderTarget===!0)&&(Kt=A.toneMapping);const re=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,Te=re!==void 0?re.length:0,Qt=Mt.get(K),Re=g.state.lights;if(J===!0&&(ct===!0||P!==M)){const Ne=P===M&&K.id===I;St.setState(K,P,Ne)}let ge=!1;K.version===Qt.__version?(Qt.needsLights&&Qt.lightsStateVersion!==Re.state.version||Qt.outputColorSpace!==zt||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!==Ut||K.fog===!0&&Qt.fog!==Et||Qt.numClippingPlanes!==void 0&&(Qt.numClippingPlanes!==St.numPlanes||Qt.numIntersection!==St.numIntersection)||Qt.vertexAlphas!==ne||Qt.vertexTangents!==ie||Qt.morphTargets!==Jt||Qt.morphNormals!==fe||Qt.morphColors!==ye||Qt.toneMapping!==Kt||Qt.morphTargetsCount!==Te)&&(ge=!0):(ge=!0,Qt.__version=K.version);let te=Qt.currentProgram;ge===!0&&(te=cs(K,W,X));let De=!1,$e=!1,ti=!1;const _e=te.getUniforms(),mn=Qt.uniforms;if(vt.useProgram(te.program)&&(De=!0,$e=!0,ti=!0),K.id!==I&&(I=K.id,$e=!0),De||M!==P){vt.buffers.depth.getReversed()&&P.reversedDepth!==!0&&(P._reversedDepth=!0,P.updateProjectionMatrix()),_e.setValue(R,"projectionMatrix",P.projectionMatrix),_e.setValue(R,"viewMatrix",P.matrixWorldInverse);const ve=_e.map.cameraPosition;ve!==void 0&&ve.setValue(R,Nt.setFromMatrixPosition(P.matrixWorld)),At.logarithmicDepthBuffer&&_e.setValue(R,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&_e.setValue(R,"isOrthographic",P.isOrthographicCamera===!0),M!==P&&(M=P,$e=!0,ti=!0)}if(X.isSkinnedMesh){_e.setOptional(R,X,"bindMatrix"),_e.setOptional(R,X,"bindMatrixInverse");const Ne=X.skeleton;Ne&&(Ne.boneTexture===null&&Ne.computeBoneTexture(),_e.setValue(R,"boneTexture",Ne.boneTexture,Gt))}X.isBatchedMesh&&(_e.setOptional(R,X,"batchingTexture"),_e.setValue(R,"batchingTexture",X._matricesTexture,Gt),_e.setOptional(R,X,"batchingIdTexture"),_e.setValue(R,"batchingIdTexture",X._indirectTexture,Gt),_e.setOptional(R,X,"batchingColorTexture"),X._colorsTexture!==null&&_e.setValue(R,"batchingColorTexture",X._colorsTexture,Gt));const tn=et.morphAttributes;if((tn.position!==void 0||tn.normal!==void 0||tn.color!==void 0)&&xt.update(X,et,te),($e||Qt.receiveShadow!==X.receiveShadow)&&(Qt.receiveShadow=X.receiveShadow,_e.setValue(R,"receiveShadow",X.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(mn.envMap.value=Ut,mn.flipEnvMap.value=Ut.isCubeTexture&&Ut.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&W.environment!==null&&(mn.envMapIntensity.value=W.environmentIntensity),$e&&(_e.setValue(R,"toneMappingExposure",A.toneMappingExposure),Qt.needsLights&&Gi(mn,ti),Et&&K.fog===!0&&_t.refreshFogUniforms(mn,Et),_t.refreshMaterialUniforms(mn,K,G,dt,g.state.transmissionRenderTarget[P.id]),zo.upload(R,Yr(Qt),mn,Gt)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(zo.upload(R,Yr(Qt),mn,Gt),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&_e.setValue(R,"center",X.center),_e.setValue(R,"modelViewMatrix",X.modelViewMatrix),_e.setValue(R,"normalMatrix",X.normalMatrix),_e.setValue(R,"modelMatrix",X.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Ne=K.uniformsGroups;for(let ve=0,Gn=Ne.length;ve<Gn;ve++){const Tn=Ne[ve];ce.update(Tn,te),ce.bind(Tn,te)}}return te}function Gi(P,W){P.ambientLightColor.needsUpdate=W,P.lightProbe.needsUpdate=W,P.directionalLights.needsUpdate=W,P.directionalLightShadows.needsUpdate=W,P.pointLights.needsUpdate=W,P.pointLightShadows.needsUpdate=W,P.spotLights.needsUpdate=W,P.spotLightShadows.needsUpdate=W,P.rectAreaLights.needsUpdate=W,P.hemisphereLights.needsUpdate=W}function va(P){return P.isMeshLambertMaterial||P.isMeshToonMaterial||P.isMeshPhongMaterial||P.isMeshStandardMaterial||P.isShadowMaterial||P.isShaderMaterial&&P.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return F},this.setRenderTargetTextures=function(P,W,et){const K=Mt.get(P);K.__autoAllocateDepthBuffer=P.resolveDepthBuffer===!1,K.__autoAllocateDepthBuffer===!1&&(K.__useRenderToTexture=!1),Mt.get(P.texture).__webglTexture=W,Mt.get(P.depthTexture).__webglTexture=K.__autoAllocateDepthBuffer?void 0:et,K.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(P,W){const et=Mt.get(P);et.__webglFramebuffer=W,et.__useDefaultFramebuffer=W===void 0};const Wc=R.createFramebuffer();this.setRenderTarget=function(P,W=0,et=0){F=P,B=W,N=et;let K=!0,X=null,Et=!1,Lt=!1;if(P){const Ut=Mt.get(P);if(Ut.__useDefaultFramebuffer!==void 0)vt.bindFramebuffer(R.FRAMEBUFFER,null),K=!1;else if(Ut.__webglFramebuffer===void 0)Gt.setupRenderTarget(P);else if(Ut.__hasExternalTextures)Gt.rebindTextures(P,Mt.get(P.texture).__webglTexture,Mt.get(P.depthTexture).__webglTexture);else if(P.depthBuffer){const Jt=P.depthTexture;if(Ut.__boundDepthTexture!==Jt){if(Jt!==null&&Mt.has(Jt)&&(P.width!==Jt.image.width||P.height!==Jt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Gt.setupDepthRenderbuffer(P)}}const ne=P.texture;(ne.isData3DTexture||ne.isDataArrayTexture||ne.isCompressedArrayTexture)&&(Lt=!0);const ie=Mt.get(P).__webglFramebuffer;P.isWebGLCubeRenderTarget?(Array.isArray(ie[W])?X=ie[W][et]:X=ie[W],Et=!0):P.samples>0&&Gt.useMultisampledRTT(P)===!1?X=Mt.get(P).__webglMultisampledFramebuffer:Array.isArray(ie)?X=ie[et]:X=ie,k.copy(P.viewport),H.copy(P.scissor),Z=P.scissorTest}else k.copy(gt).multiplyScalar(G).floor(),H.copy(It).multiplyScalar(G).floor(),Z=ee;if(et!==0&&(X=Wc),vt.bindFramebuffer(R.FRAMEBUFFER,X)&&K&&vt.drawBuffers(P,X),vt.viewport(k),vt.scissor(H),vt.setScissorTest(Z),Et){const Ut=Mt.get(P.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+W,Ut.__webglTexture,et)}else if(Lt){const Ut=W;for(let ne=0;ne<P.textures.length;ne++){const ie=Mt.get(P.textures[ne]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+ne,ie.__webglTexture,et,Ut)}}else if(P!==null&&et!==0){const Ut=Mt.get(P.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Ut.__webglTexture,et)}I=-1},this.readRenderTargetPixels=function(P,W,et,K,X,Et,Lt,zt=0){if(!(P&&P.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ut=Mt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&Lt!==void 0&&(Ut=Ut[Lt]),Ut){vt.bindFramebuffer(R.FRAMEBUFFER,Ut);try{const ne=P.textures[zt],ie=ne.format,Jt=ne.type;if(!At.textureFormatReadable(ie)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!At.textureTypeReadable(Jt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=P.width-K&&et>=0&&et<=P.height-X&&(P.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+zt),R.readPixels(W,et,K,X,Zt.convert(ie),Zt.convert(Jt),Et))}finally{const ne=F!==null?Mt.get(F).__webglFramebuffer:null;vt.bindFramebuffer(R.FRAMEBUFFER,ne)}}},this.readRenderTargetPixelsAsync=async function(P,W,et,K,X,Et,Lt,zt=0){if(!(P&&P.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ut=Mt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&Lt!==void 0&&(Ut=Ut[Lt]),Ut)if(W>=0&&W<=P.width-K&&et>=0&&et<=P.height-X){vt.bindFramebuffer(R.FRAMEBUFFER,Ut);const ne=P.textures[zt],ie=ne.format,Jt=ne.type;if(!At.textureFormatReadable(ie))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!At.textureTypeReadable(Jt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,fe),R.bufferData(R.PIXEL_PACK_BUFFER,Et.byteLength,R.STREAM_READ),P.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+zt),R.readPixels(W,et,K,X,Zt.convert(ie),Zt.convert(Jt),0);const ye=F!==null?Mt.get(F).__webglFramebuffer:null;vt.bindFramebuffer(R.FRAMEBUFFER,ye);const Kt=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await vv(R,Kt,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,fe),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,Et),R.deleteBuffer(fe),R.deleteSync(Kt),Et}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(P,W=null,et=0){const K=Math.pow(2,-et),X=Math.floor(P.image.width*K),Et=Math.floor(P.image.height*K),Lt=W!==null?W.x:0,zt=W!==null?W.y:0;Gt.setTexture2D(P,0),R.copyTexSubImage2D(R.TEXTURE_2D,et,0,0,Lt,zt,X,Et),vt.unbindTexture()};const Zc=R.createFramebuffer(),Xc=R.createFramebuffer();this.copyTextureToTexture=function(P,W,et=null,K=null,X=0,Et=null){Et===null&&(X!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Et=X,X=0):Et=0);let Lt,zt,Ut,ne,ie,Jt,fe,ye,Kt;const re=P.isCompressedTexture?P.mipmaps[Et]:P.image;if(et!==null)Lt=et.max.x-et.min.x,zt=et.max.y-et.min.y,Ut=et.isBox3?et.max.z-et.min.z:1,ne=et.min.x,ie=et.min.y,Jt=et.isBox3?et.min.z:0;else{const tn=Math.pow(2,-X);Lt=Math.floor(re.width*tn),zt=Math.floor(re.height*tn),P.isDataArrayTexture?Ut=re.depth:P.isData3DTexture?Ut=Math.floor(re.depth*tn):Ut=1,ne=0,ie=0,Jt=0}K!==null?(fe=K.x,ye=K.y,Kt=K.z):(fe=0,ye=0,Kt=0);const Te=Zt.convert(W.format),Qt=Zt.convert(W.type);let Re;W.isData3DTexture?(Gt.setTexture3D(W,0),Re=R.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(Gt.setTexture2DArray(W,0),Re=R.TEXTURE_2D_ARRAY):(Gt.setTexture2D(W,0),Re=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,W.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,W.unpackAlignment);const ge=R.getParameter(R.UNPACK_ROW_LENGTH),te=R.getParameter(R.UNPACK_IMAGE_HEIGHT),De=R.getParameter(R.UNPACK_SKIP_PIXELS),$e=R.getParameter(R.UNPACK_SKIP_ROWS),ti=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,re.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,re.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,ne),R.pixelStorei(R.UNPACK_SKIP_ROWS,ie),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Jt);const _e=P.isDataArrayTexture||P.isData3DTexture,mn=W.isDataArrayTexture||W.isData3DTexture;if(P.isDepthTexture){const tn=Mt.get(P),Ne=Mt.get(W),ve=Mt.get(tn.__renderTarget),Gn=Mt.get(Ne.__renderTarget);vt.bindFramebuffer(R.READ_FRAMEBUFFER,ve.__webglFramebuffer),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,Gn.__webglFramebuffer);for(let Tn=0;Tn<Ut;Tn++)_e&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Mt.get(P).__webglTexture,X,Jt+Tn),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Mt.get(W).__webglTexture,Et,Kt+Tn)),R.blitFramebuffer(ne,ie,Lt,zt,fe,ye,Lt,zt,R.DEPTH_BUFFER_BIT,R.NEAREST);vt.bindFramebuffer(R.READ_FRAMEBUFFER,null),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(X!==0||P.isRenderTargetTexture||Mt.has(P)){const tn=Mt.get(P),Ne=Mt.get(W);vt.bindFramebuffer(R.READ_FRAMEBUFFER,Zc),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,Xc);for(let ve=0;ve<Ut;ve++)_e?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,tn.__webglTexture,X,Jt+ve):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,tn.__webglTexture,X),mn?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Ne.__webglTexture,Et,Kt+ve):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Ne.__webglTexture,Et),X!==0?R.blitFramebuffer(ne,ie,Lt,zt,fe,ye,Lt,zt,R.COLOR_BUFFER_BIT,R.NEAREST):mn?R.copyTexSubImage3D(Re,Et,fe,ye,Kt+ve,ne,ie,Lt,zt):R.copyTexSubImage2D(Re,Et,fe,ye,ne,ie,Lt,zt);vt.bindFramebuffer(R.READ_FRAMEBUFFER,null),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else mn?P.isDataTexture||P.isData3DTexture?R.texSubImage3D(Re,Et,fe,ye,Kt,Lt,zt,Ut,Te,Qt,re.data):W.isCompressedArrayTexture?R.compressedTexSubImage3D(Re,Et,fe,ye,Kt,Lt,zt,Ut,Te,re.data):R.texSubImage3D(Re,Et,fe,ye,Kt,Lt,zt,Ut,Te,Qt,re):P.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,Et,fe,ye,Lt,zt,Te,Qt,re.data):P.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,Et,fe,ye,re.width,re.height,Te,re.data):R.texSubImage2D(R.TEXTURE_2D,Et,fe,ye,Lt,zt,Te,Qt,re);R.pixelStorei(R.UNPACK_ROW_LENGTH,ge),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,te),R.pixelStorei(R.UNPACK_SKIP_PIXELS,De),R.pixelStorei(R.UNPACK_SKIP_ROWS,$e),R.pixelStorei(R.UNPACK_SKIP_IMAGES,ti),Et===0&&W.generateMipmaps&&R.generateMipmap(Re),vt.unbindTexture()},this.copyTextureToTexture3D=function(P,W,et=null,K=null,X=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(P,W,et,K,X)},this.initRenderTarget=function(P){Mt.get(P).__webglFramebuffer===void 0&&Gt.setupRenderTarget(P)},this.initTexture=function(P){P.isCubeTexture?Gt.setTextureCube(P,0):P.isData3DTexture?Gt.setTexture3D(P,0):P.isDataArrayTexture||P.isCompressedArrayTexture?Gt.setTexture2DArray(P,0):Gt.setTexture2D(P,0),vt.unbindTexture()},this.resetState=function(){B=0,N=0,F=null,vt.reset(),Ct.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Xn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=we._getDrawingBufferColorSpace(t),e.unpackColorSpace=we._getUnpackColorSpace()}}/*!
|
|
3849
|
+
}`;class lw{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e){if(this.texture===null){const s=new id(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 pi({vertexShader:ow,fragmentShader:aw,uniforms:{depthColor:{value:this.texture},depthWidth:{value:e.z},depthHeight:{value:e.w}}});this.mesh=new dn(new Er(20,20),s)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class cw extends ys{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 lw,v={},g=e.getContextAttributes();let D=null,C=null;const A=[],U=[],B=new be;let N=null;const F=new Pn;F.viewport=new Fe;const I=new Pn;I.viewport=new Fe;const M=[F,I],k=new c0;let H=null,Z=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Q){let lt=A[Q];return lt===void 0&&(lt=new Kl,A[Q]=lt),lt.getTargetRaySpace()},this.getControllerGrip=function(Q){let lt=A[Q];return lt===void 0&&(lt=new Kl,A[Q]=lt),lt.getGripSpace()},this.getHand=function(Q){let lt=A[Q];return lt===void 0&&(lt=new Kl,A[Q]=lt),lt.getHandSpace()};function j(Q){const lt=U.indexOf(Q.inputSource);if(lt===-1)return;const pt=A[lt];pt!==void 0&&(pt.update(Q.inputSource,Q.frame,d||l),pt.dispatchEvent({type:Q.type,data:Q.inputSource}))}function at(){r.removeEventListener("select",j),r.removeEventListener("selectstart",j),r.removeEventListener("selectend",j),r.removeEventListener("squeeze",j),r.removeEventListener("squeezestart",j),r.removeEventListener("squeezeend",j),r.removeEventListener("end",at),r.removeEventListener("inputsourceschange",$);for(let Q=0;Q<A.length;Q++){const lt=U[Q];lt!==null&&(U[Q]=null,A[Q].disconnect(lt))}H=null,Z=null,w.reset();for(const Q in v)delete v[Q];t.setRenderTarget(D),E=null,_=null,m=null,r=null,C=null,Ft.stop(),s.isPresenting=!1,t.setPixelRatio(N),t.setSize(B.width,B.height,!1),s.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(Q){a=Q,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(Q){h=Q,s.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d||l},this.setReferenceSpace=function(Q){d=Q},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(Q){if(r=Q,r!==null){if(D=t.getRenderTarget(),r.addEventListener("select",j),r.addEventListener("selectstart",j),r.addEventListener("selectend",j),r.addEventListener("squeeze",j),r.addEventListener("squeezestart",j),r.addEventListener("squeezeend",j),r.addEventListener("end",at),r.addEventListener("inputsourceschange",$),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 pt=null,Nt=null,st=null;g.depth&&(st=g.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,pt=g.stencil?lr:ar,Nt=g.stencil?or:qi);const ct={colorFormat:e.RGBA8,depthFormat:st,scaleFactor:a};_=m.createProjectionLayer(ct),r.updateRenderState({layers:[_]}),t.setPixelRatio(1),t.setSize(_.textureWidth,_.textureHeight,!1),C=new Ci(_.textureWidth,_.textureHeight,{format:On,type:oi,depthTexture:new Su(_.textureWidth,_.textureHeight,Nt,void 0,void 0,void 0,void 0,void 0,void 0,pt),stencilBuffer:g.stencil,colorSpace:t.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}else{const pt={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:a};E=new XRWebGLLayer(r,e,pt),r.updateRenderState({baseLayer:E}),t.setPixelRatio(1),t.setSize(E.framebufferWidth,E.framebufferHeight,!1),C=new Ci(E.framebufferWidth,E.framebufferHeight,{format:On,type:oi,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),Ft.setContext(r),Ft.start(),s.isPresenting=!0,s.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return w.getDepthTexture()};function $(Q){for(let lt=0;lt<Q.removed.length;lt++){const pt=Q.removed[lt],Nt=U.indexOf(pt);Nt>=0&&(U[Nt]=null,A[Nt].disconnect(pt))}for(let lt=0;lt<Q.added.length;lt++){const pt=Q.added[lt];let Nt=U.indexOf(pt);if(Nt===-1){for(let ct=0;ct<A.length;ct++)if(ct>=U.length){U.push(pt),Nt=ct;break}else if(U[ct]===null){U[ct]=pt,Nt=ct;break}if(Nt===-1)break}const st=A[Nt];st&&st.connect(pt)}}const dt=new Y,G=new Y;function it(Q,lt,pt){dt.setFromMatrixPosition(lt.matrixWorld),G.setFromMatrixPosition(pt.matrixWorld);const Nt=dt.distanceTo(G),st=lt.projectionMatrix.elements,ct=pt.projectionMatrix.elements,Dt=st[14]/(st[10]-1),Bt=st[14]/(st[10]+1),R=(st[9]+1)/st[5],ht=(st[9]-1)/st[5],ft=(st[8]-1)/st[0],Ct=(ct[8]+1)/ct[0],vt=Dt*ft,qt=Dt*Ct,Mt=Nt/(-ft+Ct),Wt=Mt*-ft;if(lt.matrixWorld.decompose(Q.position,Q.quaternion,Q.scale),Q.translateX(Wt),Q.translateZ(Mt),Q.matrixWorld.compose(Q.position,Q.quaternion,Q.scale),Q.matrixWorldInverse.copy(Q.matrixWorld).invert(),st[10]===-1)Q.projectionMatrix.copy(lt.projectionMatrix),Q.projectionMatrixInverse.copy(lt.projectionMatrixInverse);else{const Se=Dt+Mt,Ae=Bt+Mt,O=vt-Wt,b=qt+(Nt-Wt),J=R*Bt/Ae*Se,ot=ht*Bt/Ae*Se;Q.projectionMatrix.makePerspective(O,b,J,ot,Se,Ae),Q.projectionMatrixInverse.copy(Q.projectionMatrix).invert()}}function tt(Q,lt){lt===null?Q.matrixWorld.copy(Q.matrix):Q.matrixWorld.multiplyMatrices(lt.matrixWorld,Q.matrix),Q.matrixWorldInverse.copy(Q.matrixWorld).invert()}this.updateCamera=function(Q){if(r===null)return;let lt=Q.near,pt=Q.far;w.texture!==null&&(w.depthNear>0&&(lt=w.depthNear),w.depthFar>0&&(pt=w.depthFar)),k.near=I.near=F.near=lt,k.far=I.far=F.far=pt,(H!==k.near||Z!==k.far)&&(r.updateRenderState({depthNear:k.near,depthFar:k.far}),H=k.near,Z=k.far),k.layers.mask=Q.layers.mask|6,F.layers.mask=k.layers.mask&3,I.layers.mask=k.layers.mask&5;const Nt=Q.parent,st=k.cameras;tt(k,Nt);for(let ct=0;ct<st.length;ct++)tt(st[ct],Nt);st.length===2?it(k,F,I):k.projectionMatrix.copy(F.projectionMatrix),gt(Q,k,Nt)};function gt(Q,lt,pt){pt===null?Q.matrix.copy(lt.matrixWorld):(Q.matrix.copy(pt.matrixWorld),Q.matrix.invert(),Q.matrix.multiply(lt.matrixWorld)),Q.matrix.decompose(Q.position,Q.quaternion,Q.scale),Q.updateMatrixWorld(!0),Q.projectionMatrix.copy(lt.projectionMatrix),Q.projectionMatrixInverse.copy(lt.projectionMatrixInverse),Q.isPerspectiveCamera&&(Q.fov=hr*2*Math.atan(1/Q.projectionMatrix.elements[5]),Q.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(_===null&&E===null))return u},this.setFoveation=function(Q){u=Q,_!==null&&(_.fixedFoveation=Q),E!==null&&E.fixedFoveation!==void 0&&(E.fixedFoveation=Q)},this.hasDepthSensing=function(){return w.texture!==null},this.getDepthSensingMesh=function(){return w.getMesh(k)},this.getCameraTexture=function(Q){return v[Q]};let At=null;function Jt(Q,lt){if(p=lt.getViewerPose(d||l),S=lt,p!==null){const pt=p.views;E!==null&&(t.setRenderTargetFramebuffer(C,E.framebuffer),t.setRenderTarget(C));let Nt=!1;pt.length!==k.cameras.length&&(k.cameras.length=0,Nt=!0);for(let Bt=0;Bt<pt.length;Bt++){const R=pt[Bt];let ht=null;if(E!==null)ht=E.getViewport(R);else{const Ct=m.getViewSubImage(_,R);ht=Ct.viewport,Bt===0&&(t.setRenderTargetTextures(C,Ct.colorTexture,Ct.depthStencilTexture),t.setRenderTarget(C))}let ft=M[Bt];ft===void 0&&(ft=new Pn,ft.layers.enable(Bt),ft.viewport=new Fe,M[Bt]=ft),ft.matrix.fromArray(R.transform.matrix),ft.matrix.decompose(ft.position,ft.quaternion,ft.scale),ft.projectionMatrix.fromArray(R.projectionMatrix),ft.projectionMatrixInverse.copy(ft.projectionMatrix).invert(),ft.viewport.set(ht.x,ht.y,ht.width,ht.height),Bt===0&&(k.matrix.copy(ft.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),Nt===!0&&k.cameras.push(ft)}const st=r.enabledFeatures;if(st&&st.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&m){const Bt=m.getDepthInformation(pt[0]);Bt&&Bt.isValid&&Bt.texture&&w.init(Bt,r.renderState)}if(st&&st.includes("camera-access")&&(t.state.unbindTexture(),m))for(let Bt=0;Bt<pt.length;Bt++){const R=pt[Bt].camera;if(R){let ht=v[R];ht||(ht=new id,v[R]=ht);const ft=m.getCameraImage(R);ht.sourceTexture=ft}}}for(let pt=0;pt<A.length;pt++){const Nt=U[pt],st=A[pt];Nt!==null&&st!==void 0&&st.update(Nt,lt,d||l)}At&&At(Q,lt),lt.detectedPlanes&&s.dispatchEvent({type:"planesdetected",data:lt}),S=null}const Ft=new Cu;Ft.setAnimationLoop(Jt),this.setAnimationLoop=function(Q){At=Q},this.dispose=function(){}}}const rs=new Yn,hw=new Oe;function uw(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,pu(n)),g.isFog?(v.fogNear.value=g.near,v.fogFar.value=g.far):g.isFogExp2&&(v.fogDensity.value=g.density)}function r(v,g,D,C,A){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,A)):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,D,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===un&&(v.bumpScale.value*=-1)),g.normalMap&&(v.normalMap.value=g.normalMap,e(g.normalMap,v.normalMapTransform),v.normalScale.value.copy(g.normalScale),g.side===un&&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 D=t.get(g),C=D.envMap,A=D.envMapRotation;C&&(v.envMap.value=C,rs.copy(A),rs.x*=-1,rs.y*=-1,rs.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(rs.y*=-1,rs.z*=-1),v.envMapRotation.value.setFromMatrix4(hw.makeRotationFromEuler(rs)),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,D,C){v.diffuse.value.copy(g.color),v.opacity.value=g.opacity,v.size.value=g.size*D,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,D){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===un&&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=D.texture,v.transmissionSamplerSize.value.set(D.width,D.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 D=t.get(g).light;v.referencePosition.value.setFromMatrixPosition(D.matrixWorld),v.nearDistance.value=D.shadow.camera.near,v.farDistance.value=D.shadow.camera.far}return{refreshFogUniforms:s,refreshMaterialUniforms:r}}function dw(n,t,e,s){let r={},a={},l=[];const h=n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS);function u(D,C){const A=C.program;s.uniformBlockBinding(D,A)}function d(D,C){let A=r[D.id];A===void 0&&(S(D),A=p(D),r[D.id]=A,D.addEventListener("dispose",v));const U=C.program;s.updateUBOMapping(D,U);const B=t.render.frame;a[D.id]!==B&&(_(D),a[D.id]=B)}function p(D){const C=m();D.__bindingPointIndex=C;const A=n.createBuffer(),U=D.__size,B=D.usage;return n.bindBuffer(n.UNIFORM_BUFFER,A),n.bufferData(n.UNIFORM_BUFFER,U,B),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,C,A),A}function m(){for(let D=0;D<h;D++)if(l.indexOf(D)===-1)return l.push(D),D;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function _(D){const C=r[D.id],A=D.uniforms,U=D.__cache;n.bindBuffer(n.UNIFORM_BUFFER,C);for(let B=0,N=A.length;B<N;B++){const F=Array.isArray(A[B])?A[B]:[A[B]];for(let I=0,M=F.length;I<M;I++){const k=F[I];if(E(k,B,I,U)===!0){const H=k.__offset,Z=Array.isArray(k.value)?k.value:[k.value];let j=0;for(let at=0;at<Z.length;at++){const $=Z[at],dt=w($);typeof $=="number"||typeof $=="boolean"?(k.__data[0]=$,n.bufferSubData(n.UNIFORM_BUFFER,H+j,k.__data)):$.isMatrix3?(k.__data[0]=$.elements[0],k.__data[1]=$.elements[1],k.__data[2]=$.elements[2],k.__data[3]=0,k.__data[4]=$.elements[3],k.__data[5]=$.elements[4],k.__data[6]=$.elements[5],k.__data[7]=0,k.__data[8]=$.elements[6],k.__data[9]=$.elements[7],k.__data[10]=$.elements[8],k.__data[11]=0):($.toArray(k.__data,j),j+=dt.storage/Float32Array.BYTES_PER_ELEMENT)}n.bufferSubData(n.UNIFORM_BUFFER,H,k.__data)}}}n.bindBuffer(n.UNIFORM_BUFFER,null)}function E(D,C,A,U){const B=D.value,N=C+"_"+A;if(U[N]===void 0)return typeof B=="number"||typeof B=="boolean"?U[N]=B:U[N]=B.clone(),!0;{const F=U[N];if(typeof B=="number"||typeof B=="boolean"){if(F!==B)return U[N]=B,!0}else if(F.equals(B)===!1)return F.copy(B),!0}return!1}function S(D){const C=D.uniforms;let A=0;const U=16;for(let N=0,F=C.length;N<F;N++){const I=Array.isArray(C[N])?C[N]:[C[N]];for(let M=0,k=I.length;M<k;M++){const H=I[M],Z=Array.isArray(H.value)?H.value:[H.value];for(let j=0,at=Z.length;j<at;j++){const $=Z[j],dt=w($),G=A%U,it=G%dt.boundary,tt=G+it;A+=it,tt!==0&&U-tt<dt.storage&&(A+=U-tt),H.__data=new Float32Array(dt.storage/Float32Array.BYTES_PER_ELEMENT),H.__offset=A,A+=dt.storage}}}const B=A%U;return B>0&&(A+=U-B),D.__size=A,D.__cache={},this}function w(D){const C={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(C.boundary=4,C.storage=4):D.isVector2?(C.boundary=8,C.storage=8):D.isVector3||D.isColor?(C.boundary=16,C.storage=12):D.isVector4?(C.boundary=16,C.storage=16):D.isMatrix3?(C.boundary=48,C.storage=48):D.isMatrix4?(C.boundary=64,C.storage=64):D.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",D),C}function v(D){const C=D.target;C.removeEventListener("dispose",v);const A=l.indexOf(C.__bindingPointIndex);l.splice(A,1),n.deleteBuffer(r[C.id]),delete r[C.id],delete a[C.id]}function g(){for(const D in r)n.deleteBuffer(r[D]);l=[],r={},a={}}return{bind:u,update:d,dispose:g}}class fw{constructor(t={}){const{canvas:e=xv(),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 D=[],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=Ti,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let U=!1;this._outputColorSpace=An;let B=0,N=0,F=null,I=-1,M=null;const k=new Fe,H=new Fe;let Z=null;const j=new Ce(0);let at=0,$=e.width,dt=e.height,G=1,it=null,tt=null;const gt=new Fe(0,0,$,dt),At=new Fe(0,0,$,dt);let Jt=!1;const Ft=new ec;let Q=!1,lt=!1;const pt=new Oe,Nt=new Y,st=new Fe,ct={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Dt=!1;function Bt(){return F===null?G:1}let R=s;function ht(P,W){return e.getContext(P,W)}try{const P={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${Ua}`),e.addEventListener("webglcontextlost",bt,!1),e.addEventListener("webglcontextrestored",Ot,!1),e.addEventListener("webglcontextcreationerror",yt,!1),R===null){const W="webgl2";if(R=ht(W,P),R===null)throw ht(W)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(P){throw console.error("THREE.WebGLRenderer: "+P.message),P}let ft,Ct,vt,qt,Mt,Wt,Se,Ae,O,b,J,ot,_t,rt,Gt,St,zt,Zt,xt,Lt,se,Xt,Pt,ce;function V(){ft=new SE(R),ft.init(),Xt=new rw(R,ft),Ct=new gE(R,ft,t,Xt),vt=new iw(R,ft),Ct.reversedDepthBuffer&&_&&vt.buffers.depth.setReversed(!0),qt=new bE(R),Mt=new Wx,Wt=new sw(R,ft,vt,Mt,Ct,Xt,qt),Se=new vE(A),Ae=new wE(A),O=new d0(R),Pt=new pE(R,O),b=new ME(R,O,qt,Pt),J=new CE(R,b,O,qt),xt=new AE(R,Ct,Wt),St=new _E(Mt),ot=new Gx(A,Se,Ae,ft,Ct,Pt,St),_t=new uw(A,Mt),rt=new Xx,Gt=new Kx(ft),Zt=new fE(A,Se,Ae,vt,J,E,u),zt=new ew(A,J,Ct),ce=new dw(R,qt,Ct,vt),Lt=new mE(R,ft,qt),se=new TE(R,ft,qt),qt.programs=ot.programs,A.capabilities=Ct,A.extensions=ft,A.properties=Mt,A.renderLists=rt,A.shadowMap=zt,A.state=vt,A.info=qt}V();const wt=new cw(A,R);this.xr=wt,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){const P=ft.get("WEBGL_lose_context");P&&P.loseContext()},this.forceContextRestore=function(){const P=ft.get("WEBGL_lose_context");P&&P.restoreContext()},this.getPixelRatio=function(){return G},this.setPixelRatio=function(P){P!==void 0&&(G=P,this.setSize($,dt,!1))},this.getSize=function(P){return P.set($,dt)},this.setSize=function(P,W,et=!0){if(wt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=P,dt=W,e.width=Math.floor(P*G),e.height=Math.floor(W*G),et===!0&&(e.style.width=P+"px",e.style.height=W+"px"),this.setViewport(0,0,P,W)},this.getDrawingBufferSize=function(P){return P.set($*G,dt*G).floor()},this.setDrawingBufferSize=function(P,W,et){$=P,dt=W,G=et,e.width=Math.floor(P*et),e.height=Math.floor(W*et),this.setViewport(0,0,P,W)},this.getCurrentViewport=function(P){return P.copy(k)},this.getViewport=function(P){return P.copy(gt)},this.setViewport=function(P,W,et,K){P.isVector4?gt.set(P.x,P.y,P.z,P.w):gt.set(P,W,et,K),vt.viewport(k.copy(gt).multiplyScalar(G).round())},this.getScissor=function(P){return P.copy(At)},this.setScissor=function(P,W,et,K){P.isVector4?At.set(P.x,P.y,P.z,P.w):At.set(P,W,et,K),vt.scissor(H.copy(At).multiplyScalar(G).round())},this.getScissorTest=function(){return Jt},this.setScissorTest=function(P){vt.setScissorTest(Jt=P)},this.setOpaqueSort=function(P){it=P},this.setTransparentSort=function(P){tt=P},this.getClearColor=function(P){return P.copy(Zt.getClearColor())},this.setClearColor=function(){Zt.setClearColor(...arguments)},this.getClearAlpha=function(){return Zt.getClearAlpha()},this.setClearAlpha=function(){Zt.setClearAlpha(...arguments)},this.clear=function(P=!0,W=!0,et=!0){let K=0;if(P){let X=!1;if(F!==null){const Et=F.texture.format;X=Et===el||Et===tl||Et===$a}if(X){const Et=F.texture.type,It=Et===oi||Et===qi||Et===sr||Et===or||Et===Ja||Et===Ka,Ht=Zt.getClearColor(),Ut=Zt.getClearAlpha(),ne=Ht.r,ie=Ht.g,Kt=Ht.b;It?(S[0]=ne,S[1]=ie,S[2]=Kt,S[3]=Ut,R.clearBufferuiv(R.COLOR,0,S)):(w[0]=ne,w[1]=ie,w[2]=Kt,w[3]=Ut,R.clearBufferiv(R.COLOR,0,w))}else K|=R.COLOR_BUFFER_BIT}W&&(K|=R.DEPTH_BUFFER_BIT),et&&(K|=R.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),R.clear(K)},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",bt,!1),e.removeEventListener("webglcontextrestored",Ot,!1),e.removeEventListener("webglcontextcreationerror",yt,!1),Zt.dispose(),rt.dispose(),Gt.dispose(),Mt.dispose(),Se.dispose(),Ae.dispose(),J.dispose(),Pt.dispose(),ce.dispose(),ot.dispose(),wt.dispose(),wt.removeEventListener("sessionstart",In),wt.removeEventListener("sessionend",ga),vi.stop()};function bt(P){P.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function Ot(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const P=qt.autoReset,W=zt.enabled,et=zt.autoUpdate,K=zt.needsUpdate,X=zt.type;V(),qt.autoReset=P,zt.enabled=W,zt.autoUpdate=et,zt.needsUpdate=K,zt.type=X}function yt(P){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",P.statusMessage)}function ut(P){const W=P.target;W.removeEventListener("dispose",ut),Vt(W)}function Vt(P){le(P),Mt.remove(P)}function le(P){const W=Mt.get(P).programs;W!==void 0&&(W.forEach(function(et){ot.releaseProgram(et)}),P.isShaderMaterial&&ot.releaseShaderCache(P))}this.renderBufferDirect=function(P,W,et,K,X,Et){W===null&&(W=ct);const It=X.isMesh&&X.matrixWorld.determinant()<0,Ht=_a(P,W,et,K,X);vt.setMaterial(K,It);let Ut=et.index,ne=1;if(K.wireframe===!0){if(Ut=b.getWireframeAttribute(et),Ut===void 0)return;ne=2}const ie=et.drawRange,Kt=et.attributes.position;let fe=ie.start*ne,ye=(ie.start+ie.count)*ne;Et!==null&&(fe=Math.max(fe,Et.start*ne),ye=Math.min(ye,(Et.start+Et.count)*ne)),Ut!==null?(fe=Math.max(fe,0),ye=Math.min(ye,Ut.count)):Kt!=null&&(fe=Math.max(fe,0),ye=Math.min(ye,Kt.count));const $t=ye-fe;if($t<0||$t===1/0)return;Pt.setup(X,K,Ht,et,Ut);let re,Te=Lt;if(Ut!==null&&(re=O.get(Ut),Te=se,Te.setIndex(re)),X.isMesh)K.wireframe===!0?(vt.setLineWidth(K.wireframeLinewidth*Bt()),Te.setMode(R.LINES)):Te.setMode(R.TRIANGLES);else if(X.isLine){let Qt=K.linewidth;Qt===void 0&&(Qt=1),vt.setLineWidth(Qt*Bt()),X.isLineSegments?Te.setMode(R.LINES):X.isLineLoop?Te.setMode(R.LINE_LOOP):Te.setMode(R.LINE_STRIP)}else X.isPoints?Te.setMode(R.POINTS):X.isSprite&&Te.setMode(R.TRIANGLES);if(X.isBatchedMesh)if(X._multiDrawInstances!==null)ws("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(ft.get("WEBGL_multi_draw"))Te.renderMultiDraw(X._multiDrawStarts,X._multiDrawCounts,X._multiDrawCount);else{const Qt=X._multiDrawStarts,Re=X._multiDrawCounts,ge=X._multiDrawCount,ee=Ut?O.get(Ut).bytesPerElement:1,De=Mt.get(K).currentProgram.getUniforms();for(let $e=0;$e<ge;$e++)De.setValue(R,"_gl_DrawID",$e),Te.render(Qt[$e]/ee,Re[$e])}else if(X.isInstancedMesh)Te.renderInstances(fe,$t,X.count);else if(et.isInstancedBufferGeometry){const Qt=et._maxInstanceCount!==void 0?et._maxInstanceCount:1/0,Re=Math.min(et.instanceCount,Qt);Te.renderInstances(fe,$t,Re)}else Te.render(fe,$t)};function Ie(P,W,et){P.transparent===!0&&P.side===ri&&P.forceSinglePass===!1?(P.side=un,P.needsUpdate=!0,cs(P,W,et),P.side=Si,P.needsUpdate=!0,cs(P,W,et),P.side=ri):cs(P,W,et)}this.compile=function(P,W,et=null){et===null&&(et=P),g=Gt.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))}),P!==et&&P.traverseVisible(function(X){X.isLight&&X.layers.test(W.layers)&&(g.pushLight(X),X.castShadow&&g.pushShadow(X))}),g.setupLights();const K=new Set;return P.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 Ht=Et[It];Ie(Ht,et,X),K.add(Ht)}else Ie(Et,et,X),K.add(Et)}),g=C.pop(),K},this.compileAsync=function(P,W,et=null){const K=this.compile(P,W,et);return new Promise(X=>{function Et(){if(K.forEach(function(It){Mt.get(It).currentProgram.isReady()&&K.delete(It)}),K.size===0){X(P);return}setTimeout(Et,10)}ft.get("KHR_parallel_shader_compile")!==null?Et():setTimeout(Et,10)})};let Me=null;function Sn(P){Me&&Me(P)}function In(){vi.stop()}function ga(){vi.start()}const vi=new Cu;vi.setAnimationLoop(Sn),typeof self<"u"&&vi.setContext(self),this.setAnimationLoop=function(P){Me=P,wt.setAnimationLoop(P),P===null?vi.stop():vi.start()},wt.addEventListener("sessionstart",In),wt.addEventListener("sessionend",ga),this.render=function(P,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(P.matrixWorldAutoUpdate===!0&&P.updateMatrixWorld(),W.parent===null&&W.matrixWorldAutoUpdate===!0&&W.updateMatrixWorld(),wt.enabled===!0&&wt.isPresenting===!0&&(wt.cameraAutoUpdate===!0&&wt.updateCamera(W),W=wt.getCamera()),P.isScene===!0&&P.onBeforeRender(A,P,W,F),g=Gt.get(P,C.length),g.init(W),C.push(g),pt.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Ft.setFromProjectionMatrix(pt,Xn,W.reversedDepth),lt=this.localClippingEnabled,Q=St.init(this.clippingPlanes,lt),v=rt.get(P,D.length),v.init(),D.push(v),wt.enabled===!0&&wt.isPresenting===!0){const Et=A.xr.getDepthSensingMesh();Et!==null&&Zr(Et,W,-1/0,A.sortObjects)}Zr(P,W,0,A.sortObjects),v.finish(),A.sortObjects===!0&&v.sort(it,tt),Dt=wt.enabled===!1||wt.isPresenting===!1||wt.hasDepthSensing()===!1,Dt&&Zt.addToRenderList(v,P),this.info.render.frame++,Q===!0&&St.beginShadows();const et=g.state.shadowsArray;zt.render(et,P,W),Q===!0&&St.endShadows(),this.info.autoReset===!0&&this.info.reset();const K=v.opaque,X=v.transmissive;if(g.setupLights(),W.isArrayCamera){const Et=W.cameras;if(X.length>0)for(let It=0,Ht=Et.length;It<Ht;It++){const Ut=Et[It];Yt(K,X,P,Ut)}Dt&&Zt.render(P);for(let It=0,Ht=Et.length;It<Ht;It++){const Ut=Et[It];Mn(v,P,Ut,Ut.viewport)}}else X.length>0&&Yt(K,X,P,W),Dt&&Zt.render(P),Mn(v,P,W);F!==null&&N===0&&(Wt.updateMultisampleRenderTarget(F),Wt.updateRenderTargetMipmap(F)),P.isScene===!0&&P.onAfterRender(A,P,W),Pt.resetDefaultState(),I=-1,M=null,C.pop(),C.length>0?(g=C[C.length-1],Q===!0&&St.setGlobalState(A.clippingPlanes,g.state.camera)):g=null,D.pop(),D.length>0?v=D[D.length-1]:v=null};function Zr(P,W,et,K){if(P.visible===!1)return;if(P.layers.test(W.layers)){if(P.isGroup)et=P.renderOrder;else if(P.isLOD)P.autoUpdate===!0&&P.update(W);else if(P.isLight)g.pushLight(P),P.castShadow&&g.pushShadow(P);else if(P.isSprite){if(!P.frustumCulled||Ft.intersectsSprite(P)){K&&st.setFromMatrixPosition(P.matrixWorld).applyMatrix4(pt);const It=J.update(P),Ht=P.material;Ht.visible&&v.push(P,It,Ht,et,st.z,null)}}else if((P.isMesh||P.isLine||P.isPoints)&&(!P.frustumCulled||Ft.intersectsObject(P))){const It=J.update(P),Ht=P.material;if(K&&(P.boundingSphere!==void 0?(P.boundingSphere===null&&P.computeBoundingSphere(),st.copy(P.boundingSphere.center)):(It.boundingSphere===null&&It.computeBoundingSphere(),st.copy(It.boundingSphere.center)),st.applyMatrix4(P.matrixWorld).applyMatrix4(pt)),Array.isArray(Ht)){const Ut=It.groups;for(let ne=0,ie=Ut.length;ne<ie;ne++){const Kt=Ut[ne],fe=Ht[Kt.materialIndex];fe&&fe.visible&&v.push(P,It,fe,et,st.z,Kt)}}else Ht.visible&&v.push(P,It,Ht,et,st.z,null)}}const Et=P.children;for(let It=0,Ht=Et.length;It<Ht;It++)Zr(Et[It],W,et,K)}function Mn(P,W,et,K){const X=P.opaque,Et=P.transmissive,It=P.transparent;g.setupLightsView(et),Q===!0&&St.setGlobalState(A.clippingPlanes,et),K&&vt.viewport(k.copy(K)),X.length>0&&ls(X,W,et),Et.length>0&&ls(Et,W,et),It.length>0&&ls(It,W,et),vt.buffers.depth.setTest(!0),vt.buffers.depth.setMask(!0),vt.buffers.color.setMask(!0),vt.setPolygonOffset(!1)}function Yt(P,W,et,K){if((et.isScene===!0?et.overrideMaterial:null)!==null)return;g.state.transmissionRenderTarget[K.id]===void 0&&(g.state.transmissionRenderTarget[K.id]=new Ci(1,1,{generateMipmaps:!0,type:ft.has("EXT_color_buffer_half_float")||ft.has("EXT_color_buffer_float")?rr:oi,minFilter:bi,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:we.workingColorSpace}));const Et=g.state.transmissionRenderTarget[K.id],It=K.viewport||k;Et.setSize(It.z*A.transmissionResolutionScale,It.w*A.transmissionResolutionScale);const Ht=A.getRenderTarget(),Ut=A.getActiveCubeFace(),ne=A.getActiveMipmapLevel();A.setRenderTarget(Et),A.getClearColor(j),at=A.getClearAlpha(),at<1&&A.setClearColor(16777215,.5),A.clear(),Dt&&Zt.render(et);const ie=A.toneMapping;A.toneMapping=Ti;const Kt=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),g.setupLightsView(K),Q===!0&&St.setGlobalState(A.clippingPlanes,K),ls(P,et,K),Wt.updateMultisampleRenderTarget(Et),Wt.updateRenderTargetMipmap(Et),ft.has("WEBGL_multisampled_render_to_texture")===!1){let fe=!1;for(let ye=0,$t=W.length;ye<$t;ye++){const re=W[ye],Te=re.object,Qt=re.geometry,Re=re.material,ge=re.group;if(Re.side===ri&&Te.layers.test(K.layers)){const ee=Re.side;Re.side=un,Re.needsUpdate=!0,Xr(Te,et,K,Qt,Re,ge),Re.side=ee,Re.needsUpdate=!0,fe=!0}}fe===!0&&(Wt.updateMultisampleRenderTarget(Et),Wt.updateRenderTargetMipmap(Et))}A.setRenderTarget(Ht,Ut,ne),A.setClearColor(j,at),Kt!==void 0&&(K.viewport=Kt),A.toneMapping=ie}function ls(P,W,et){const K=W.isScene===!0?W.overrideMaterial:null;for(let X=0,Et=P.length;X<Et;X++){const It=P[X],Ht=It.object,Ut=It.geometry,ne=It.group;let ie=It.material;ie.allowOverride===!0&&K!==null&&(ie=K),Ht.layers.test(et.layers)&&Xr(Ht,W,et,Ut,ie,ne)}}function Xr(P,W,et,K,X,Et){P.onBeforeRender(A,W,et,K,X,Et),P.modelViewMatrix.multiplyMatrices(et.matrixWorldInverse,P.matrixWorld),P.normalMatrix.getNormalMatrix(P.modelViewMatrix),X.onBeforeRender(A,W,et,K,P,Et),X.transparent===!0&&X.side===ri&&X.forceSinglePass===!1?(X.side=un,X.needsUpdate=!0,A.renderBufferDirect(et,W,K,X,P,Et),X.side=Si,X.needsUpdate=!0,A.renderBufferDirect(et,W,K,X,P,Et),X.side=ri):A.renderBufferDirect(et,W,K,X,P,Et),P.onAfterRender(A,W,et,K,X,Et)}function cs(P,W,et){W.isScene!==!0&&(W=ct);const K=Mt.get(P),X=g.state.lights,Et=g.state.shadowsArray,It=X.state.version,Ht=ot.getParameters(P,X.state,Et,W,et),Ut=ot.getProgramCacheKey(Ht);let ne=K.programs;K.environment=P.isMeshStandardMaterial?W.environment:null,K.fog=W.fog,K.envMap=(P.isMeshStandardMaterial?Ae:Se).get(P.envMap||K.environment),K.envMapRotation=K.environment!==null&&P.envMap===null?W.environmentRotation:P.envMapRotation,ne===void 0&&(P.addEventListener("dispose",ut),ne=new Map,K.programs=ne);let ie=ne.get(Ut);if(ie!==void 0){if(K.currentProgram===ie&&K.lightsStateVersion===It)return js(P,Ht),ie}else Ht.uniforms=ot.getUniforms(P),P.onBeforeCompile(Ht,A),ie=ot.acquireProgram(Ht,Ut),ne.set(Ut,ie),K.uniforms=Ht.uniforms;const Kt=K.uniforms;return(!P.isShaderMaterial&&!P.isRawShaderMaterial||P.clipping===!0)&&(Kt.clippingPlanes=St.uniform),js(P,Ht),K.needsLights=va(P),K.lightsStateVersion=It,K.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),K.currentProgram=ie,K.uniformsList=null,ie}function Yr(P){if(P.uniformsList===null){const W=P.currentProgram.getUniforms();P.uniformsList=zo.seqWithValue(W.seq,P.uniforms)}return P.uniformsList}function js(P,W){const et=Mt.get(P);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 _a(P,W,et,K,X){W.isScene!==!0&&(W=ct),Wt.resetTextureUnits();const Et=W.fog,It=K.isMeshStandardMaterial?W.environment:null,Ht=F===null?A.outputColorSpace:F.isXRRenderTarget===!0?F.texture.colorSpace:Qi,Ut=(K.isMeshStandardMaterial?Ae:Se).get(K.envMap||It),ne=K.vertexColors===!0&&!!et.attributes.color&&et.attributes.color.itemSize===4,ie=!!et.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Kt=!!et.morphAttributes.position,fe=!!et.morphAttributes.normal,ye=!!et.morphAttributes.color;let $t=Ti;K.toneMapped&&(F===null||F.isXRRenderTarget===!0)&&($t=A.toneMapping);const re=et.morphAttributes.position||et.morphAttributes.normal||et.morphAttributes.color,Te=re!==void 0?re.length:0,Qt=Mt.get(K),Re=g.state.lights;if(Q===!0&&(lt===!0||P!==M)){const Be=P===M&&K.id===I;St.setState(K,P,Be)}let ge=!1;K.version===Qt.__version?(Qt.needsLights&&Qt.lightsStateVersion!==Re.state.version||Qt.outputColorSpace!==Ht||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!==Ut||K.fog===!0&&Qt.fog!==Et||Qt.numClippingPlanes!==void 0&&(Qt.numClippingPlanes!==St.numPlanes||Qt.numIntersection!==St.numIntersection)||Qt.vertexAlphas!==ne||Qt.vertexTangents!==ie||Qt.morphTargets!==Kt||Qt.morphNormals!==fe||Qt.morphColors!==ye||Qt.toneMapping!==$t||Qt.morphTargetsCount!==Te)&&(ge=!0):(ge=!0,Qt.__version=K.version);let ee=Qt.currentProgram;ge===!0&&(ee=cs(K,W,X));let De=!1,$e=!1,ti=!1;const _e=ee.getUniforms(),mn=Qt.uniforms;if(vt.useProgram(ee.program)&&(De=!0,$e=!0,ti=!0),K.id!==I&&(I=K.id,$e=!0),De||M!==P){vt.buffers.depth.getReversed()&&P.reversedDepth!==!0&&(P._reversedDepth=!0,P.updateProjectionMatrix()),_e.setValue(R,"projectionMatrix",P.projectionMatrix),_e.setValue(R,"viewMatrix",P.matrixWorldInverse);const ve=_e.map.cameraPosition;ve!==void 0&&ve.setValue(R,Nt.setFromMatrixPosition(P.matrixWorld)),Ct.logarithmicDepthBuffer&&_e.setValue(R,"logDepthBufFC",2/(Math.log(P.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&_e.setValue(R,"isOrthographic",P.isOrthographicCamera===!0),M!==P&&(M=P,$e=!0,ti=!0)}if(X.isSkinnedMesh){_e.setOptional(R,X,"bindMatrix"),_e.setOptional(R,X,"bindMatrixInverse");const Be=X.skeleton;Be&&(Be.boneTexture===null&&Be.computeBoneTexture(),_e.setValue(R,"boneTexture",Be.boneTexture,Wt))}X.isBatchedMesh&&(_e.setOptional(R,X,"batchingTexture"),_e.setValue(R,"batchingTexture",X._matricesTexture,Wt),_e.setOptional(R,X,"batchingIdTexture"),_e.setValue(R,"batchingIdTexture",X._indirectTexture,Wt),_e.setOptional(R,X,"batchingColorTexture"),X._colorsTexture!==null&&_e.setValue(R,"batchingColorTexture",X._colorsTexture,Wt));const tn=et.morphAttributes;if((tn.position!==void 0||tn.normal!==void 0||tn.color!==void 0)&&xt.update(X,et,ee),($e||Qt.receiveShadow!==X.receiveShadow)&&(Qt.receiveShadow=X.receiveShadow,_e.setValue(R,"receiveShadow",X.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(mn.envMap.value=Ut,mn.flipEnvMap.value=Ut.isCubeTexture&&Ut.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&W.environment!==null&&(mn.envMapIntensity.value=W.environmentIntensity),$e&&(_e.setValue(R,"toneMappingExposure",A.toneMappingExposure),Qt.needsLights&&Gi(mn,ti),Et&&K.fog===!0&&_t.refreshFogUniforms(mn,Et),_t.refreshMaterialUniforms(mn,K,G,dt,g.state.transmissionRenderTarget[P.id]),zo.upload(R,Yr(Qt),mn,Wt)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(zo.upload(R,Yr(Qt),mn,Wt),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&_e.setValue(R,"center",X.center),_e.setValue(R,"modelViewMatrix",X.modelViewMatrix),_e.setValue(R,"normalMatrix",X.normalMatrix),_e.setValue(R,"modelMatrix",X.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){const Be=K.uniformsGroups;for(let ve=0,Gn=Be.length;ve<Gn;ve++){const Tn=Be[ve];ce.update(Tn,ee),ce.bind(Tn,ee)}}return ee}function Gi(P,W){P.ambientLightColor.needsUpdate=W,P.lightProbe.needsUpdate=W,P.directionalLights.needsUpdate=W,P.directionalLightShadows.needsUpdate=W,P.pointLights.needsUpdate=W,P.pointLightShadows.needsUpdate=W,P.spotLights.needsUpdate=W,P.spotLightShadows.needsUpdate=W,P.rectAreaLights.needsUpdate=W,P.hemisphereLights.needsUpdate=W}function va(P){return P.isMeshLambertMaterial||P.isMeshToonMaterial||P.isMeshPhongMaterial||P.isMeshStandardMaterial||P.isShadowMaterial||P.isShaderMaterial&&P.lights===!0}this.getActiveCubeFace=function(){return B},this.getActiveMipmapLevel=function(){return N},this.getRenderTarget=function(){return F},this.setRenderTargetTextures=function(P,W,et){const K=Mt.get(P);K.__autoAllocateDepthBuffer=P.resolveDepthBuffer===!1,K.__autoAllocateDepthBuffer===!1&&(K.__useRenderToTexture=!1),Mt.get(P.texture).__webglTexture=W,Mt.get(P.depthTexture).__webglTexture=K.__autoAllocateDepthBuffer?void 0:et,K.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(P,W){const et=Mt.get(P);et.__webglFramebuffer=W,et.__useDefaultFramebuffer=W===void 0};const Zc=R.createFramebuffer();this.setRenderTarget=function(P,W=0,et=0){F=P,B=W,N=et;let K=!0,X=null,Et=!1,It=!1;if(P){const Ut=Mt.get(P);if(Ut.__useDefaultFramebuffer!==void 0)vt.bindFramebuffer(R.FRAMEBUFFER,null),K=!1;else if(Ut.__webglFramebuffer===void 0)Wt.setupRenderTarget(P);else if(Ut.__hasExternalTextures)Wt.rebindTextures(P,Mt.get(P.texture).__webglTexture,Mt.get(P.depthTexture).__webglTexture);else if(P.depthBuffer){const Kt=P.depthTexture;if(Ut.__boundDepthTexture!==Kt){if(Kt!==null&&Mt.has(Kt)&&(P.width!==Kt.image.width||P.height!==Kt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Wt.setupDepthRenderbuffer(P)}}const ne=P.texture;(ne.isData3DTexture||ne.isDataArrayTexture||ne.isCompressedArrayTexture)&&(It=!0);const ie=Mt.get(P).__webglFramebuffer;P.isWebGLCubeRenderTarget?(Array.isArray(ie[W])?X=ie[W][et]:X=ie[W],Et=!0):P.samples>0&&Wt.useMultisampledRTT(P)===!1?X=Mt.get(P).__webglMultisampledFramebuffer:Array.isArray(ie)?X=ie[et]:X=ie,k.copy(P.viewport),H.copy(P.scissor),Z=P.scissorTest}else k.copy(gt).multiplyScalar(G).floor(),H.copy(At).multiplyScalar(G).floor(),Z=Jt;if(et!==0&&(X=Zc),vt.bindFramebuffer(R.FRAMEBUFFER,X)&&K&&vt.drawBuffers(P,X),vt.viewport(k),vt.scissor(H),vt.setScissorTest(Z),Et){const Ut=Mt.get(P.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_CUBE_MAP_POSITIVE_X+W,Ut.__webglTexture,et)}else if(It){const Ut=W;for(let ne=0;ne<P.textures.length;ne++){const ie=Mt.get(P.textures[ne]);R.framebufferTextureLayer(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0+ne,ie.__webglTexture,et,Ut)}}else if(P!==null&&et!==0){const Ut=Mt.get(P.texture);R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Ut.__webglTexture,et)}I=-1},this.readRenderTargetPixels=function(P,W,et,K,X,Et,It,Ht=0){if(!(P&&P.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ut=Mt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&It!==void 0&&(Ut=Ut[It]),Ut){vt.bindFramebuffer(R.FRAMEBUFFER,Ut);try{const ne=P.textures[Ht],ie=ne.format,Kt=ne.type;if(!Ct.textureFormatReadable(ie)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ct.textureTypeReadable(Kt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}W>=0&&W<=P.width-K&&et>=0&&et<=P.height-X&&(P.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+Ht),R.readPixels(W,et,K,X,Xt.convert(ie),Xt.convert(Kt),Et))}finally{const ne=F!==null?Mt.get(F).__webglFramebuffer:null;vt.bindFramebuffer(R.FRAMEBUFFER,ne)}}},this.readRenderTargetPixelsAsync=async function(P,W,et,K,X,Et,It,Ht=0){if(!(P&&P.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ut=Mt.get(P).__webglFramebuffer;if(P.isWebGLCubeRenderTarget&&It!==void 0&&(Ut=Ut[It]),Ut)if(W>=0&&W<=P.width-K&&et>=0&&et<=P.height-X){vt.bindFramebuffer(R.FRAMEBUFFER,Ut);const ne=P.textures[Ht],ie=ne.format,Kt=ne.type;if(!Ct.textureFormatReadable(ie))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ct.textureTypeReadable(Kt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const fe=R.createBuffer();R.bindBuffer(R.PIXEL_PACK_BUFFER,fe),R.bufferData(R.PIXEL_PACK_BUFFER,Et.byteLength,R.STREAM_READ),P.textures.length>1&&R.readBuffer(R.COLOR_ATTACHMENT0+Ht),R.readPixels(W,et,K,X,Xt.convert(ie),Xt.convert(Kt),0);const ye=F!==null?Mt.get(F).__webglFramebuffer:null;vt.bindFramebuffer(R.FRAMEBUFFER,ye);const $t=R.fenceSync(R.SYNC_GPU_COMMANDS_COMPLETE,0);return R.flush(),await wv(R,$t,4),R.bindBuffer(R.PIXEL_PACK_BUFFER,fe),R.getBufferSubData(R.PIXEL_PACK_BUFFER,0,Et),R.deleteBuffer(fe),R.deleteSync($t),Et}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(P,W=null,et=0){const K=Math.pow(2,-et),X=Math.floor(P.image.width*K),Et=Math.floor(P.image.height*K),It=W!==null?W.x:0,Ht=W!==null?W.y:0;Wt.setTexture2D(P,0),R.copyTexSubImage2D(R.TEXTURE_2D,et,0,0,It,Ht,X,Et),vt.unbindTexture()};const Xc=R.createFramebuffer(),Yc=R.createFramebuffer();this.copyTextureToTexture=function(P,W,et=null,K=null,X=0,Et=null){Et===null&&(X!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Et=X,X=0):Et=0);let It,Ht,Ut,ne,ie,Kt,fe,ye,$t;const re=P.isCompressedTexture?P.mipmaps[Et]:P.image;if(et!==null)It=et.max.x-et.min.x,Ht=et.max.y-et.min.y,Ut=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 tn=Math.pow(2,-X);It=Math.floor(re.width*tn),Ht=Math.floor(re.height*tn),P.isDataArrayTexture?Ut=re.depth:P.isData3DTexture?Ut=Math.floor(re.depth*tn):Ut=1,ne=0,ie=0,Kt=0}K!==null?(fe=K.x,ye=K.y,$t=K.z):(fe=0,ye=0,$t=0);const Te=Xt.convert(W.format),Qt=Xt.convert(W.type);let Re;W.isData3DTexture?(Wt.setTexture3D(W,0),Re=R.TEXTURE_3D):W.isDataArrayTexture||W.isCompressedArrayTexture?(Wt.setTexture2DArray(W,0),Re=R.TEXTURE_2D_ARRAY):(Wt.setTexture2D(W,0),Re=R.TEXTURE_2D),R.pixelStorei(R.UNPACK_FLIP_Y_WEBGL,W.flipY),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,W.premultiplyAlpha),R.pixelStorei(R.UNPACK_ALIGNMENT,W.unpackAlignment);const ge=R.getParameter(R.UNPACK_ROW_LENGTH),ee=R.getParameter(R.UNPACK_IMAGE_HEIGHT),De=R.getParameter(R.UNPACK_SKIP_PIXELS),$e=R.getParameter(R.UNPACK_SKIP_ROWS),ti=R.getParameter(R.UNPACK_SKIP_IMAGES);R.pixelStorei(R.UNPACK_ROW_LENGTH,re.width),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,re.height),R.pixelStorei(R.UNPACK_SKIP_PIXELS,ne),R.pixelStorei(R.UNPACK_SKIP_ROWS,ie),R.pixelStorei(R.UNPACK_SKIP_IMAGES,Kt);const _e=P.isDataArrayTexture||P.isData3DTexture,mn=W.isDataArrayTexture||W.isData3DTexture;if(P.isDepthTexture){const tn=Mt.get(P),Be=Mt.get(W),ve=Mt.get(tn.__renderTarget),Gn=Mt.get(Be.__renderTarget);vt.bindFramebuffer(R.READ_FRAMEBUFFER,ve.__webglFramebuffer),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,Gn.__webglFramebuffer);for(let Tn=0;Tn<Ut;Tn++)_e&&(R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Mt.get(P).__webglTexture,X,Kt+Tn),R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Mt.get(W).__webglTexture,Et,$t+Tn)),R.blitFramebuffer(ne,ie,It,Ht,fe,ye,It,Ht,R.DEPTH_BUFFER_BIT,R.NEAREST);vt.bindFramebuffer(R.READ_FRAMEBUFFER,null),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else if(X!==0||P.isRenderTargetTexture||Mt.has(P)){const tn=Mt.get(P),Be=Mt.get(W);vt.bindFramebuffer(R.READ_FRAMEBUFFER,Xc),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,Yc);for(let ve=0;ve<Ut;ve++)_e?R.framebufferTextureLayer(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,tn.__webglTexture,X,Kt+ve):R.framebufferTexture2D(R.READ_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,tn.__webglTexture,X),mn?R.framebufferTextureLayer(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,Be.__webglTexture,Et,$t+ve):R.framebufferTexture2D(R.DRAW_FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,Be.__webglTexture,Et),X!==0?R.blitFramebuffer(ne,ie,It,Ht,fe,ye,It,Ht,R.COLOR_BUFFER_BIT,R.NEAREST):mn?R.copyTexSubImage3D(Re,Et,fe,ye,$t+ve,ne,ie,It,Ht):R.copyTexSubImage2D(Re,Et,fe,ye,ne,ie,It,Ht);vt.bindFramebuffer(R.READ_FRAMEBUFFER,null),vt.bindFramebuffer(R.DRAW_FRAMEBUFFER,null)}else mn?P.isDataTexture||P.isData3DTexture?R.texSubImage3D(Re,Et,fe,ye,$t,It,Ht,Ut,Te,Qt,re.data):W.isCompressedArrayTexture?R.compressedTexSubImage3D(Re,Et,fe,ye,$t,It,Ht,Ut,Te,re.data):R.texSubImage3D(Re,Et,fe,ye,$t,It,Ht,Ut,Te,Qt,re):P.isDataTexture?R.texSubImage2D(R.TEXTURE_2D,Et,fe,ye,It,Ht,Te,Qt,re.data):P.isCompressedTexture?R.compressedTexSubImage2D(R.TEXTURE_2D,Et,fe,ye,re.width,re.height,Te,re.data):R.texSubImage2D(R.TEXTURE_2D,Et,fe,ye,It,Ht,Te,Qt,re);R.pixelStorei(R.UNPACK_ROW_LENGTH,ge),R.pixelStorei(R.UNPACK_IMAGE_HEIGHT,ee),R.pixelStorei(R.UNPACK_SKIP_PIXELS,De),R.pixelStorei(R.UNPACK_SKIP_ROWS,$e),R.pixelStorei(R.UNPACK_SKIP_IMAGES,ti),Et===0&&W.generateMipmaps&&R.generateMipmap(Re),vt.unbindTexture()},this.copyTextureToTexture3D=function(P,W,et=null,K=null,X=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(P,W,et,K,X)},this.initRenderTarget=function(P){Mt.get(P).__webglFramebuffer===void 0&&Wt.setupRenderTarget(P)},this.initTexture=function(P){P.isCubeTexture?Wt.setTextureCube(P,0):P.isData3DTexture?Wt.setTexture3D(P,0):P.isDataArrayTexture||P.isCompressedArrayTexture?Wt.setTexture2DArray(P,0):Wt.setTexture2D(P,0),vt.unbindTexture()},this.resetState=function(){B=0,N=0,F=null,vt.reset(),Pt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Xn}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=we._getDrawingBufferColorSpace(t),e.unpackColorSpace=we._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
|
|
3853
3853
|
* @licence MIT (https://opensource.org/licenses/MIT)
|
|
3854
|
-
*/var
|
|
3855
|
-
`,
|
|
3856
|
-
`,
|
|
3857
|
-
`,
|
|
3858
|
-
`,
|
|
3859
|
-
`,
|
|
3860
|
-
`,
|
|
3861
|
-
`,
|
|
3862
|
-
`,fc=500,ed=4,nd=300,id=500,sd=100,rd=2e3,os=10,Bi="photoSphereViewer",wr="psv--capture-event",od=(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))(od||{}),Je={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},Ye={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},Hn={arrow:uw,close:dw,download:fw,fullscreenIn:pw,fullscreenOut:mw,info:gw,menu:_w,zoomIn:vw,zoomOut:yw},Vo={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={};dc(ae,{Animation:()=>Jo,Dynamic:()=>Mr,MultiDynamic:()=>Id,PressHandler:()=>Ko,Slider:()=>kd,SliderDirection:()=>Dd,addClasses:()=>pc,angle:()=>ld,applyEulerInverse:()=>Mc,checkClosedShadowDom:()=>Rd,checkStylesheet:()=>Pd,checkVersion:()=>Tc,cleanCssPosition:()=>bd,clone:()=>Xo,createTexture:()=>Sc,cssPositionIsOrdered:()=>xc,dasherize:()=>Mw,deepEqual:()=>xd,deepmerge:()=>yd,distance:()=>ad,exitFullscreen:()=>_d,firstNonNull:()=>Fi,getAbortError:()=>yc,getAngle:()=>hd,getClosest:()=>dd,getConfigParser:()=>jo,getElement:()=>ud,getEventTarget:()=>Wo,getMatchingTarget:()=>fd,getPosition:()=>pd,getShortestArc:()=>cd,getStyleProperty:()=>Jn,getTouchData:()=>mc,getXMPValue:()=>wn,greatArcDistance:()=>xw,hasParent:()=>Sw,invertResolvableBoolean:()=>Yo,isAbortError:()=>Sd,isEmpty:()=>Ed,isExtendedPosition:()=>Ec,isFullscreenEnabled:()=>md,isNil:()=>qe,isPlainObject:()=>_c,keyPressMatch:()=>gc,logWarn:()=>Ke,mergePanoData:()=>Ld,parseAngle:()=>Kn,parsePoint:()=>Tw,parseSpeed:()=>Ad,removeClasses:()=>ww,requestFullscreen:()=>gd,resolveBoolean:()=>vc,speedToDuration:()=>wc,sum:()=>Ew,throttle:()=>vd,toggleClass:()=>Go,wrap:()=>Sr});function Sr(n,t){let e=n%t;return e<0&&(e+=t),e}function Ew(n){return n.reduce((t,e)=>t+e,0)}function ad(n,t){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function ld(n,t){return Math.atan2(t.y-n.y,t.x-n.x)}function cd(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 hd(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 xw([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 ud(n){return typeof n=="string"?n.match(/^[a-z]/i)?document.getElementById(n):document.querySelector(n):n}function Go(n,t,e){e===void 0?n.classList.toggle(t):e?n.classList.add(t):e||n.classList.remove(t)}function pc(n,t){n.classList.add(...t.split(" ").filter(e=>!!e))}function ww(n,t){n.classList.remove(...t.split(" ").filter(e=>!!e))}function Sw(n,t){let e=n;do{if(e===t)return!0;e=e.parentElement}while(e);return!1}function dd(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 Wo(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 pd(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 Jn(n,t){return window.getComputedStyle(n).getPropertyValue(t)}function mc(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:ad(t,e),angle:ld(t,e),center:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}var Zo;function md(n,t=!1){return t?n===Zo:document.fullscreenElement===n}function gd(n,t=!1){t?(Zo=n,n.classList.add("psv-fullscreen-emulation"),document.dispatchEvent(new Event("fullscreenchange"))):n.requestFullscreen()}function _d(n=!1){n?(Zo.classList.remove("psv-fullscreen-emulation"),Zo=null,document.dispatchEvent(new Event("fullscreenchange"))):document.exitFullscreen()}function gc(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 Mw(n){return n.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function vd(n,t){let e=!1;return function(...s){e||(e=!0,setTimeout(()=>{n.apply(this,s),e=!1},t))}}function _c(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 yd(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]||!_c(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 Xo(n){return yd(null,n)}function Ed(n){return!n||Object.keys(n).length===0&&n.constructor===Object}function qe(n){return n==null}function Fi(...n){for(const t of n)if(!qe(t))return t;return null}function xd(n,t){if(n===t)return!0;if(wd(n)&&wd(t)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e of Object.keys(n))if(!xd(n[e],t[e]))return!1;return!0}else return!1}function wd(n){return typeof n=="object"&&n!==null}var $t=class _m extends Error{constructor(t,e){super(e&&e instanceof Error?`${t}: ${e.message}`:t),this.name="PSVError",Error.captureStackTrace?.(this,_m)}};function vc(n,t){_c(n)?(t(n.initial,!0),n.promise.then(e=>t(e,!1))):t(n,!0)}function Yo(n){return{initial:!n.initial,promise:n.promise.then(t=>!t)}}function yc(){const n=new Error("Loading was aborted.");return n.name="AbortError",n}function Sd(n){return n?.name==="AbortError"}function Ke(n){console.warn(`PhotoSphereViewer: ${n}`)}function Ec(n){return!n||Array.isArray(n)?!1:[["textureX","textureY"],["yaw","pitch"]].some(([t,e])=>n[t]!==void 0&&n[e]!==void 0)}function wn(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 Md={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},qo=["left","center","right"],Qo=["top","center","bottom"],Td=[...qo,...Qo],Rn="center";function Tw(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&&(Md[t[0]]?t=[t[0],Rn]:t=[t[0],t[0]]);const e=t[1]!=="left"&&t[1]!=="right"&&t[0]!=="top"&&t[0]!=="bottom";t=t.map(r=>Md[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 bd(n,{allowCenter:t,cssOrder:e}={allowCenter:!0,cssOrder:!0}){return n?(typeof n=="string"&&(n=n.split(" ")),n.length===1&&(n[0]===Rn?n=[Rn,Rn]:qo.indexOf(n[0])!==-1?n=[Rn,n[0]]:Qo.indexOf(n[0])!==-1&&(n=[n[0],Rn])),n.length!==2||Td.indexOf(n[0])===-1||Td.indexOf(n[1])===-1?(Ke(`Unparsable position ${n}`),null):!t&&n[0]===Rn&&n[1]===Rn?(Ke("Invalid position center center"),null):(e&&!xc(n)&&(n=[n[1],n[0]]),n[1]===Rn&&qo.indexOf(n[0])!==-1&&(n=[Rn,n[0]]),n[0]===Rn&&Qo.indexOf(n[1])!==-1&&(n=[n[1],Rn]),n)):null}function xc(n){return Qo.indexOf(n[0])!==-1&&qo.indexOf(n[1])!==-1}function Ad(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=xe.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 wc(n,t){if(typeof n!="number"){const e=Ad(n);return t/Math.abs(e)*1e3}else return Math.abs(n)}function Kn(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=xe.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=Sr(t?s+Math.PI:s,Math.PI*2),t?xe.clamp(s-Math.PI,-Math.PI/(e?2:1),Math.PI/(e?2:1)):s}function Sc(n,t=!1){const e=new je(n);return e.needsUpdate=!0,e.minFilter=t?bi:vn,e.generateMipmaps=t,e.anisotropy=t?2:1,e}var Cd=new ji;function Mc(n,t){Cd.setFromEuler(t).invert(),n.applyQuaternion(Cd)}function jo(n,t){const e=function(s){const r=Xo({...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)){Ke(`Unknown option ${l}`);continue}a[l]=h}return a};return e.defaults=n,e.parsers=t||{},e}function Pd(n,t){Jn(n,`--psv-${t}-loaded`)!=="true"&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${t}/index.css" is not loaded`)}function Tc(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 Rd(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 Ld(n,t,e,s){const r={isEquirectangular:!0,fullWidth:Fi(e?.fullWidth,s?.fullWidth),fullHeight:Fi(e?.fullHeight,s?.fullHeight),croppedWidth:n,croppedHeight:t,croppedX:Fi(e?.croppedX,s?.croppedX),croppedY:Fi(e?.croppedY,s?.croppedY),poseHeading:Fi(e?.poseHeading,s?.poseHeading,0),posePitch:Fi(e?.posePitch,s?.posePitch,0),poseRoll:Fi(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&&(Ke("Invalid panoData, fullWidth should be twice fullHeight"),r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX+r.croppedWidth>r.fullWidth&&(Ke("Invalid panoData, croppedX + croppedWidth > fullWidth"),r.croppedX=r.fullWidth-r.croppedWidth),r.croppedY+r.croppedHeight>r.fullHeight&&(Ke("Invalid panoData, croppedY + croppedHeight > fullHeight"),r.croppedY=r.fullHeight-r.croppedHeight),r.croppedX<0&&(Ke("Invalid panoData, croppedX < 0"),r.croppedX=0),r.croppedY<0&&(Ke("Invalid panoData, croppedY < 0"),r.croppedY=0),r}var Jo=class{constructor(n){this.easing=Vo.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=n,n?(n.easing&&(this.easing=typeof n.easing=="function"?n.easing:Vo[n.easing]||Vo.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))}},Mr=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?Sr(n,this.max):xe.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?Sr(n,this.max):xe.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?Sr(e,this.max):xe.clamp(e,this.min,this.max),e!==this.current)?(this.current=e,this.fn&&this.fn(this.current),!0):!1}},Id=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}},Ko=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)}},Dd=(n=>(n.VERTICAL="VERTICAL",n.HORIZONTAL="HORIZONTAL",n))(Dd||{}),kd=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=xe.clamp((s.bottom-t)/s.height,0,1):r=xe.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={};dc(jt,{BeforeAnimateEvent:()=>bc,BeforeRenderEvent:()=>Tr,BeforeRotateEvent:()=>zd,ClickEvent:()=>Vd,ConfigChangedEvent:()=>fn,DoubleClickEvent:()=>Zd,FullscreenEvent:()=>br,HideNotificationEvent:()=>Ar,HideOverlayEvent:()=>Qd,HidePanelEvent:()=>zi,HideTooltipEvent:()=>Kd,KeypressEvent:()=>Hi,LoadProgressEvent:()=>ef,ObjectEnterEvent:()=>Tf,ObjectEvent:()=>$o,ObjectHoverEvent:()=>Cf,ObjectLeaveEvent:()=>Ac,PanoramaErrorEvent:()=>af,PanoramaLoadEvent:()=>sf,PanoramaLoadedEvent:()=>Ws,PositionUpdatedEvent:()=>Cr,ReadyEvent:()=>Rr,RenderEvent:()=>pf,RollUpdatedEvent:()=>Pr,ShowNotificationEvent:()=>Lr,ShowOverlayEvent:()=>_f,ShowPanelEvent:()=>Vi,ShowTooltipEvent:()=>Ef,SizeUpdatedEvent:()=>Ir,StopAllEvent:()=>Dr,TransitionDoneEvent:()=>cf,ViewerEvent:()=>Pe,ZoomUpdatedEvent:()=>gi});var Ud=class extends Event{constructor(n,t=!1){super(n,{cancelable:t})}},Od=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)}},Pe=class extends Ud{},Nd=class vm extends Pe{constructor(t,e){super(vm.type,!0),this.position=t,this.zoomLevel=e}};Nd.type="before-animate";var bc=Nd,Bd=class ym extends Pe{constructor(t,e){super(ym.type),this.timestamp=t,this.elapsed=e}};Bd.type="before-render";var Tr=Bd,Fd=class Em extends Pe{constructor(t){super(Em.type,!0),this.position=t}};Fd.type="before-rotate";var zd=Fd,Hd=class xm extends Pe{constructor(t){super(xm.type),this.data=t}};Hd.type="click";var Vd=Hd,Gd=class wm extends Pe{constructor(t){super(wm.type),this.options=t}containsOptions(...t){return t.some(e=>this.options.includes(e))}};Gd.type="config-changed";var fn=Gd,Wd=class Sm extends Pe{constructor(t){super(Sm.type),this.data=t}};Wd.type="dblclick";var Zd=Wd,Xd=class Mm extends Pe{constructor(t){super(Mm.type),this.fullscreenEnabled=t}};Xd.type="fullscreen";var br=Xd,Yd=class Tm extends Pe{constructor(t){super(Tm.type),this.notificationId=t}};Yd.type="hide-notification";var Ar=Yd,qd=class bm extends Pe{constructor(t){super(bm.type),this.overlayId=t}};qd.type="hide-overlay";var Qd=qd,jd=class Am extends Pe{constructor(t){super(Am.type),this.panelId=t}};jd.type="hide-panel";var zi=jd,Jd=class Cm extends Pe{constructor(t){super(Cm.type),this.tooltipData=t}};Jd.type="hide-tooltip";var Kd=Jd,$d=class Pm extends Pe{constructor(t,e){super(Pm.type,!0),this.key=t,this.originalEvent=e}matches(t){return gc(this.originalEvent,t)}};$d.type="key-press";var Hi=$d,tf=class Rm extends Pe{constructor(t){super(Rm.type),this.progress=t}};tf.type="load-progress";var ef=tf,nf=class Lm extends Pe{constructor(t){super(Lm.type),this.panorama=t}};nf.type="panorama-load";var sf=nf,rf=class Im extends Pe{constructor(t){super(Im.type),this.data=t}};rf.type="panorama-loaded";var Ws=rf,of=class Dm extends Pe{constructor(t,e){super(Dm.type),this.panorama=t,this.error=e}};of.type="panorama-error";var af=of,lf=class km extends Pe{constructor(t){super(km.type),this.completed=t}};lf.type="transition-done";var cf=lf,hf=class Um extends Pe{constructor(t){super(Um.type),this.position=t}};hf.type="position-updated";var Cr=hf,uf=class Om extends Pe{constructor(t){super(Om.type),this.roll=t}};uf.type="roll-updated";var Pr=uf,df=class Nm extends Pe{constructor(){super(Nm.type)}};df.type="ready";var Rr=df,ff=class Bm extends Pe{constructor(){super(Bm.type)}};ff.type="render";var pf=ff,mf=class Fm extends Pe{constructor(t){super(Fm.type),this.notificationId=t}};mf.type="show-notification";var Lr=mf,gf=class zm extends Pe{constructor(t){super(zm.type),this.overlayId=t}};gf.type="show-overlay";var _f=gf,vf=class Hm extends Pe{constructor(t){super(Hm.type),this.panelId=t}};vf.type="show-panel";var Vi=vf,yf=class Vm extends Pe{constructor(t,e){super(Vm.type),this.tooltip=t,this.tooltipData=e}};yf.type="show-tooltip";var Ef=yf,xf=class Gm extends Pe{constructor(t){super(Gm.type),this.size=t}};xf.type="size-updated";var Ir=xf,wf=class Wm extends Pe{constructor(){super(Wm.type)}};wf.type="stop-all";var Dr=wf,Sf=class Zm extends Pe{constructor(t){super(Zm.type),this.zoomLevel=t}};Sf.type="zoom-updated";var gi=Sf,$o=class extends Pe{constructor(n,t,e,s,r){super(n),this.originalEvent=t,this.object=e,this.viewerPoint=s,this.userDataKey=r}},Mf=class Xm extends $o{constructor(t,e,s,r){super(Xm.type,t,e,s,r)}};Mf.type="enter-object";var Tf=Mf,bf=class Ym extends $o{constructor(t,e,s,r){super(Ym.type,t,e,s,r)}};bf.type="leave-object";var Ac=bf,Af=class qm extends $o{constructor(t,e,s,r){super(qm.type,t,e,s,r)}};Af.type="hover-object";var Cf=Af,ta=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.")}};ta.supportsDownload=!1;function Pf(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof ta)return Tc(t.id,t.VERSION,"5.14.0"),t}return null}var kr=`${Bi}_touchSupport`,ln={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,__maxCanvasWidth:null,isIphone:!1,get maxCanvasWidth(){return this.__maxCanvasWidth===null&&(this.__maxCanvasWidth=Cw(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const n=bw();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=!!n,this.maxTextureWidth=n?n.getParameter(n.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=Aw(),this.isIphone=/iPhone/i.test(navigator.userAgent),this.loaded=!0}if(!ln.isWebGLSupported)throw new $t("WebGL 2 is not supported.");if(ln.maxTextureWidth===0)throw new $t("Unable to detect system capabilities")}};function bw(){try{return document.createElement("canvas").getContext("webgl2")}catch{return null}}function Aw(){let n="ontouchstart"in window||navigator.maxTouchPoints>0;kr in localStorage&&(n=localStorage[kr]==="true");const t=new Promise(e=>{const s=()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",a),clearTimeout(h)},r=()=>{s(),localStorage[kr]=!1,e(!1)},a=()=>{s(),localStorage[kr]=!0,e(!0)},l=()=>{s(),localStorage[kr]=n,e(n)};window.addEventListener("mousedown",r,!1),window.addEventListener("touchstart",a,!1);const h=setTimeout(l,1e4)});return{initial:n,promise:t}}function Cw(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 Pw=jo({resolution:64,useXmpData:!0,blur:!1},{resolution:n=>{if(!n||!xe.isPowerOfTwo(n))throw new $t("EquirectangularAdapter resolution must be power of two.");return n}}),ea=class Qm extends ta{static withConfig(t){return[Qm,t]}constructor(t,e){super(t),this.config=Pw(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=Ld(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:wn(a,"FullPanoWidthPixels"),fullHeight:wn(a,"FullPanoHeightPixels"),croppedWidth:wn(a,"CroppedAreaImageWidthPixels"),croppedHeight:wn(a,"CroppedAreaImageHeightPixels"),croppedX:wn(a,"CroppedAreaLeftPixels"),croppedY:wn(a,"CroppedAreaTopPixels"),poseHeading:wn(a,"PoseHeadingDegrees",!1),posePitch:wn(a,"PosePitchDegrees",!1),poseRoll:wn(a,"PoseRollDegrees",!1),initialHeading:wn(a,"InitialViewHeadingDegrees",!1),initialPitch:wn(a,"InitialViewPitchDegrees",!1),initialFov:wn(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>ln.maxTextureWidth){const e=Math.min(1,ln.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),Sc(s)}return Sc(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 Bs(os,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 ki({depthTest:!1,depthWrite:!1});return new dn(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()}};ea.id="equirectangular",ea.VERSION="5.14.0",ea.supportsDownload=!0;var Cc=ea,Rf=class jm extends Cc{static withConfig(t){return[jm,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 Bs(os,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 ki({depthTest:!1,depthWrite:!1});return new dn(t,r)}};Rf.id="dual-fisheye",Rf.VERSION="5.14.0";var as=class Jm{constructor(t,e){this.parent=t,this.children=[],this.state={visible:!0},this.viewer=t instanceof Jm?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}},Rw=jo({id:null,tagName:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),cn=class extends as{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=Rw(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===Ye.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(){vc(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,Go(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,pc(this.container.querySelector("svg"),"psv-button-svg")}},Lw=class extends cn{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)}},Ur=class extends cn{constructor(n){super(n,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.info}),this.mode=0,this.viewer.addEventListener(Ar.type,this),this.viewer.addEventListener(Lr.type,this),this.viewer.addEventListener(zi.type,this),this.viewer.addEventListener(Vi.type,this),this.viewer.addEventListener(fn.type,this)}destroy(){this.viewer.removeEventListener(Ar.type,this),this.viewer.removeEventListener(Lr.type,this),this.viewer.removeEventListener(zi.type,this),this.viewer.removeEventListener(Vi.type,this),this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){if(n instanceof fn){n.containsOptions("description")&&this.autoSize(!0);return}if(!this.mode)return;let t=!1;n instanceof Ar?t=this.mode===1:n instanceof Lr?t=this.mode===1&&n.notificationId!==Je.DESCRIPTION:n instanceof zi?t=this.mode===2:n instanceof Vi&&(t=this.mode===2&&n.panelId!==Je.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(Je.DESCRIPTION);break;case 2:this.viewer.panel.hide(Je.DESCRIPTION);break}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:Je.DESCRIPTION,content:`${this.viewer.config.caption?`<p>${this.viewer.config.caption}</p>`:""}${this.viewer.config.description}`})):(this.mode=1,this.viewer.notification.show({id:Je.DESCRIPTION,content:this.viewer.config.caption}))}};Ur.id="description";var Lf=class extends cn{constructor(n){super(n,{tagName:"a",className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:Hn.download}),this.viewer.addEventListener(fn.type,this),this.viewer.addEventListener(Ws.type,this)}destroy(){this.viewer.removeEventListener(fn.type,this),this.viewer.removeEventListener(Ws.type,this),super.destroy()}handleEvent(n){n instanceof fn?(n.containsOptions("downloadUrl")&&this.checkSupported(),n.containsOptions("downloadUrl","downloadName")&&this.__update()):n instanceof Ws&&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()}};Lf.id="download";var If=class extends cn{constructor(n){super(n,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.fullscreenIn,iconActive:Hn.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()}};If.id="fullscreen";var Iw="psvButton",Dw=(n,t)=>`
|
|
3854
|
+
*/var pw=Object.defineProperty,fc=(n,t)=>{for(var e in t)pw(n,e,{get:t[e],enumerable:!0})},Gs={};fc(Gs,{ACTIONS:()=>cd,ANIMATION_MIN_DURATION:()=>pc,CAPTURE_EVENTS_CLASS:()=>wr,CTRLZOOM_TIMEOUT:()=>ld,DBLCLICK_DELAY:()=>rd,EASINGS:()=>Vo,ICONS:()=>Hn,IDS:()=>Je,KEY_CODES:()=>Ye,LONGTOUCH_DELAY:()=>od,MOVE_THRESHOLD:()=>sd,SPHERE_RADIUS:()=>os,TWOFINGERSOVERLAY_DELAY:()=>ad,VIEWER_DATA:()=>Bi});var mw=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="40 40 432 432"><g transform="rotate(0, 256, 256)"><path fill="currentColor" d="M425.23 210.55H227.39a5 5 0 01-3.53-8.53l56.56-56.57a45.5 45.5 0 000-64.28 45.15 45.15 0 00-32.13-13.3 45.15 45.15 0 00-32.14 13.3L41.32 256l174.83 174.83a45.15 45.15 0 0032.14 13.3 45.15 45.15 0 0032.13-13.3 45.5 45.5 0 000-64.28l-56.57-56.57a5 5 0 013.54-8.53h197.84c25.06 0 45.45-20.39 45.45-45.45s-20.4-45.45-45.45-45.45z"/></g><!-- Created by Flatart from the Noun Project --></svg>
|
|
3855
|
+
`,gw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g fill="currentColor" transform=" translate(50, 50) rotate(45)"><rect x="-5" y="-65" width="10" height="130"/><rect x="-65" y="-5" width="130" height="10"/></g></svg>',_w=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M83.3 35.6h-17V3H32.2v32.6H16.6l33.6 32.7 33-32.7z"/><path fill="currentColor" d="M83.3 64.2v16.3H16.6V64.2H-.1v32.6H100V64.2H83.3z"/><!--Created by Michael Zenaty from the Noun Project--></svg>
|
|
3856
|
+
`,vw=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M100 40H87.1V18.8h-21V6H100zM100 93.2H66V80.3h21.1v-21H100zM34 93.2H0v-34h12.9v21.1h21zM12.9 40H0V6h34v12.9H12.8z"/><!--Created by Garrett Knoll from the Noun Project--></svg>
|
|
3857
|
+
`,yw=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M66 7h13v21h21v13H66zM66 60.3h34v12.9H79v21H66zM0 60.3h34v34H21V73.1H0zM21 7h13v34H0V28h21z"/><!--Created by Garrett Knoll from the Noun Project--></svg>
|
|
3858
|
+
`,Ew=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="currentColor" d="M28.3 26.1c-1 2.6-1.9 4.8-2.6 7-2.5 7.4-5 14.7-7.2 22-1.3 4.4.5 7.2 4.3 7.8 1.3.2 2.8.2 4.2-.1 8.2-2 11.9-8.6 15.7-15.2l-2.2 2a18.8 18.8 0 0 1-7.4 5.2 2 2 0 0 1-1.6-.2c-.2-.1 0-1 0-1.4l.8-1.8L41.9 28c.5-1.4.9-3 .7-4.4-.2-2.6-3-4.4-6.3-4.4-8.8.2-15 4.5-19.5 11.8-.2.3-.2.6-.3 1.3 3.7-2.8 6.8-6.1 11.8-6.2z"/><circle fill="currentColor" cx="39.3" cy="9.2" r="8.2"/><!--Created by Arafat Uddin from the Noun Project--></svg>
|
|
3859
|
+
`,xw=`<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
|
+
`,ww=`<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
|
+
`,Sw=`<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
|
+
`,pc=500,sd=4,rd=300,od=500,ad=100,ld=2e3,os=10,Bi="photoSphereViewer",wr="psv--capture-event",cd=(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))(cd||{}),Je={MENU:"menu",TWO_FINGERS:"twoFingers",CTRL_ZOOM:"ctrlZoom",ERROR:"error",DESCRIPTION:"description"},Ye={Enter:"Enter",Control:"Control",Escape:"Escape",Space:" ",PageUp:"PageUp",PageDown:"PageDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Delete:"Delete",Plus:"+",Minus:"-"},Hn={arrow:mw,close:gw,download:_w,fullscreenIn:vw,fullscreenOut:yw,info:Ew,menu:xw,zoomIn:ww,zoomOut:Sw},Vo={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={};fc(ae,{Animation:()=>Jo,Dynamic:()=>Mr,MultiDynamic:()=>Ud,PressHandler:()=>Ko,Slider:()=>Nd,SliderDirection:()=>Od,addClasses:()=>mc,angle:()=>ud,applyEulerInverse:()=>Tc,checkClosedShadowDom:()=>Dd,checkStylesheet:()=>Id,checkVersion:()=>bc,cleanCssPosition:()=>Pd,clone:()=>Xo,createTexture:()=>Mc,cssPositionIsOrdered:()=>wc,dasherize:()=>Cw,deepEqual:()=>Md,deepmerge:()=>wd,distance:()=>hd,exitFullscreen:()=>Ed,firstNonNull:()=>Fi,getAbortError:()=>Ec,getAngle:()=>fd,getClosest:()=>md,getConfigParser:()=>jo,getElement:()=>pd,getEventTarget:()=>Wo,getMatchingTarget:()=>gd,getPosition:()=>_d,getShortestArc:()=>dd,getStyleProperty:()=>Jn,getTouchData:()=>gc,getXMPValue:()=>wn,greatArcDistance:()=>Tw,hasParent:()=>Aw,invertResolvableBoolean:()=>Yo,isAbortError:()=>bd,isEmpty:()=>Sd,isExtendedPosition:()=>xc,isFullscreenEnabled:()=>vd,isNil:()=>qe,isPlainObject:()=>vc,keyPressMatch:()=>_c,logWarn:()=>Ke,mergePanoData:()=>kd,parseAngle:()=>Kn,parsePoint:()=>Pw,parseSpeed:()=>Rd,removeClasses:()=>bw,requestFullscreen:()=>yd,resolveBoolean:()=>yc,speedToDuration:()=>Sc,sum:()=>Mw,throttle:()=>xd,toggleClass:()=>Go,wrap:()=>Sr});function Sr(n,t){let e=n%t;return e<0&&(e+=t),e}function Mw(n){return n.reduce((t,e)=>t+e,0)}function hd(n,t){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function ud(n,t){return Math.atan2(t.y-n.y,t.x-n.x)}function dd(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 fd(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 Tw([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 pd(n){return typeof n=="string"?n.match(/^[a-z]/i)?document.getElementById(n):document.querySelector(n):n}function Go(n,t,e){e===void 0?n.classList.toggle(t):e?n.classList.add(t):e||n.classList.remove(t)}function mc(n,t){n.classList.add(...t.split(" ").filter(e=>!!e))}function bw(n,t){n.classList.remove(...t.split(" ").filter(e=>!!e))}function Aw(n,t){let e=n;do{if(e===t)return!0;e=e.parentElement}while(e);return!1}function md(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 Wo(n){return n?.composedPath()[0]||null}function gd(n,t){return n?n.composedPath().find(e=>!(e instanceof HTMLElement)&&!(e instanceof SVGElement)?!1:e.matches(t)):null}function _d(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 Jn(n,t){return window.getComputedStyle(n).getPropertyValue(t)}function gc(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:hd(t,e),angle:ud(t,e),center:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}var Zo;function vd(n,t=!1){return t?n===Zo:document.fullscreenElement===n}function yd(n,t=!1){t?(Zo=n,n.classList.add("psv-fullscreen-emulation"),document.dispatchEvent(new Event("fullscreenchange"))):n.requestFullscreen()}function Ed(n=!1){n?(Zo.classList.remove("psv-fullscreen-emulation"),Zo=null,document.dispatchEvent(new Event("fullscreenchange"))):document.exitFullscreen()}function _c(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 Cw(n){return n.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}function xd(n,t){let e=!1;return function(...s){e||(e=!0,setTimeout(()=>{n.apply(this,s),e=!1},t))}}function vc(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 wd(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]||!vc(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 Xo(n){return wd(null,n)}function Sd(n){return!n||Object.keys(n).length===0&&n.constructor===Object}function qe(n){return n==null}function Fi(...n){for(const t of n)if(!qe(t))return t;return null}function Md(n,t){if(n===t)return!0;if(Td(n)&&Td(t)){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const e of Object.keys(n))if(!Md(n[e],t[e]))return!1;return!0}else return!1}function Td(n){return typeof n=="object"&&n!==null}var te=class Em extends Error{constructor(t,e){super(e&&e instanceof Error?`${t}: ${e.message}`:t),this.name="PSVError",Error.captureStackTrace?.(this,Em)}};function yc(n,t){vc(n)?(t(n.initial,!0),n.promise.then(e=>t(e,!1))):t(n,!0)}function Yo(n){return{initial:!n.initial,promise:n.promise.then(t=>!t)}}function Ec(){const n=new Error("Loading was aborted.");return n.name="AbortError",n}function bd(n){return n?.name==="AbortError"}function Ke(n){console.warn(`PhotoSphereViewer: ${n}`)}function xc(n){return!n||Array.isArray(n)?!1:[["textureX","textureY"],["yaw","pitch"]].some(([t,e])=>n[t]!==void 0&&n[e]!==void 0)}function wn(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 Ad={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},qo=["left","center","right"],Qo=["top","center","bottom"],Cd=[...qo,...Qo],Rn="center";function Pw(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&&(Ad[t[0]]?t=[t[0],Rn]:t=[t[0],t[0]]);const e=t[1]!=="left"&&t[1]!=="right"&&t[0]!=="top"&&t[0]!=="bottom";t=t.map(r=>Ad[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 Pd(n,{allowCenter:t,cssOrder:e}={allowCenter:!0,cssOrder:!0}){return n?(typeof n=="string"&&(n=n.split(" ")),n.length===1&&(n[0]===Rn?n=[Rn,Rn]:qo.indexOf(n[0])!==-1?n=[Rn,n[0]]:Qo.indexOf(n[0])!==-1&&(n=[n[0],Rn])),n.length!==2||Cd.indexOf(n[0])===-1||Cd.indexOf(n[1])===-1?(Ke(`Unparsable position ${n}`),null):!t&&n[0]===Rn&&n[1]===Rn?(Ke("Invalid position center center"),null):(e&&!wc(n)&&(n=[n[1],n[0]]),n[1]===Rn&&qo.indexOf(n[0])!==-1&&(n=[Rn,n[0]]),n[0]===Rn&&Qo.indexOf(n[1])!==-1&&(n=[n[1],Rn]),n)):null}function wc(n){return Qo.indexOf(n[0])!==-1&&qo.indexOf(n[1])!==-1}function Rd(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=xe.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 Sc(n,t){if(typeof n!="number"){const e=Rd(n);return t/Math.abs(e)*1e3}else return Math.abs(n)}function Kn(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=xe.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=Sr(t?s+Math.PI:s,Math.PI*2),t?xe.clamp(s-Math.PI,-Math.PI/(e?2:1),Math.PI/(e?2:1)):s}function Mc(n,t=!1){const e=new je(n);return e.needsUpdate=!0,e.minFilter=t?bi:vn,e.generateMipmaps=t,e.anisotropy=t?2:1,e}var Ld=new ji;function Tc(n,t){Ld.setFromEuler(t).invert(),n.applyQuaternion(Ld)}function jo(n,t){const e=function(s){const r=Xo({...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)){Ke(`Unknown option ${l}`);continue}a[l]=h}return a};return e.defaults=n,e.parsers=t||{},e}function Id(n,t){Jn(n,`--psv-${t}-loaded`)!=="true"&&console.error(`PhotoSphereViewer: stylesheet "@photo-sphere-viewer/${t}/index.css" is not loaded`)}function bc(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 Dd(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 kd(n,t,e,s){const r={isEquirectangular:!0,fullWidth:Fi(e?.fullWidth,s?.fullWidth),fullHeight:Fi(e?.fullHeight,s?.fullHeight),croppedWidth:n,croppedHeight:t,croppedX:Fi(e?.croppedX,s?.croppedX),croppedY:Fi(e?.croppedY,s?.croppedY),poseHeading:Fi(e?.poseHeading,s?.poseHeading,0),posePitch:Fi(e?.posePitch,s?.posePitch,0),poseRoll:Fi(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&&(Ke("Invalid panoData, fullWidth should be twice fullHeight"),r.fullHeight=Math.round(r.fullWidth/2)),r.croppedX+r.croppedWidth>r.fullWidth&&(Ke("Invalid panoData, croppedX + croppedWidth > fullWidth"),r.croppedX=r.fullWidth-r.croppedWidth),r.croppedY+r.croppedHeight>r.fullHeight&&(Ke("Invalid panoData, croppedY + croppedHeight > fullHeight"),r.croppedY=r.fullHeight-r.croppedHeight),r.croppedX<0&&(Ke("Invalid panoData, croppedX < 0"),r.croppedX=0),r.croppedY<0&&(Ke("Invalid panoData, croppedY < 0"),r.croppedY=0),r}var Jo=class{constructor(n){this.easing=Vo.linear,this.callbacks=[],this.resolved=!1,this.cancelled=!1,this.options=n,n?(n.easing&&(this.easing=typeof n.easing=="function"?n.easing:Vo[n.easing]||Vo.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))}},Mr=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?Sr(n,this.max):xe.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?Sr(n,this.max):xe.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?Sr(e,this.max):xe.clamp(e,this.min,this.max),e!==this.current)?(this.current=e,this.fn&&this.fn(this.current),!0):!1}},Ud=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}},Ko=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)}},Od=(n=>(n.VERTICAL="VERTICAL",n.HORIZONTAL="HORIZONTAL",n))(Od||{}),Nd=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=xe.clamp((s.bottom-t)/s.height,0,1):r=xe.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={};fc(jt,{BeforeAnimateEvent:()=>Ac,BeforeRenderEvent:()=>Tr,BeforeRotateEvent:()=>Gd,ClickEvent:()=>Zd,ConfigChangedEvent:()=>fn,DoubleClickEvent:()=>qd,FullscreenEvent:()=>br,HideNotificationEvent:()=>Ar,HideOverlayEvent:()=>Kd,HidePanelEvent:()=>zi,HideTooltipEvent:()=>ef,KeypressEvent:()=>Hi,LoadProgressEvent:()=>rf,ObjectEnterEvent:()=>Cf,ObjectEvent:()=>$o,ObjectHoverEvent:()=>Lf,ObjectLeaveEvent:()=>Cc,PanoramaErrorEvent:()=>hf,PanoramaLoadEvent:()=>af,PanoramaLoadedEvent:()=>Ws,PositionUpdatedEvent:()=>Cr,ReadyEvent:()=>Rr,RenderEvent:()=>_f,RollUpdatedEvent:()=>Pr,ShowNotificationEvent:()=>Lr,ShowOverlayEvent:()=>Ef,ShowPanelEvent:()=>Vi,ShowTooltipEvent:()=>Sf,SizeUpdatedEvent:()=>Ir,StopAllEvent:()=>Dr,TransitionDoneEvent:()=>df,ViewerEvent:()=>Pe,ZoomUpdatedEvent:()=>gi});var Bd=class extends Event{constructor(n,t=!1){super(n,{cancelable:t})}},Fd=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)}},Pe=class extends Bd{},zd=class xm extends Pe{constructor(t,e){super(xm.type,!0),this.position=t,this.zoomLevel=e}};zd.type="before-animate";var Ac=zd,Hd=class wm extends Pe{constructor(t,e){super(wm.type),this.timestamp=t,this.elapsed=e}};Hd.type="before-render";var Tr=Hd,Vd=class Sm extends Pe{constructor(t){super(Sm.type,!0),this.position=t}};Vd.type="before-rotate";var Gd=Vd,Wd=class Mm extends Pe{constructor(t){super(Mm.type),this.data=t}};Wd.type="click";var Zd=Wd,Xd=class Tm extends Pe{constructor(t){super(Tm.type),this.options=t}containsOptions(...t){return t.some(e=>this.options.includes(e))}};Xd.type="config-changed";var fn=Xd,Yd=class bm extends Pe{constructor(t){super(bm.type),this.data=t}};Yd.type="dblclick";var qd=Yd,Qd=class Am extends Pe{constructor(t){super(Am.type),this.fullscreenEnabled=t}};Qd.type="fullscreen";var br=Qd,jd=class Cm extends Pe{constructor(t){super(Cm.type),this.notificationId=t}};jd.type="hide-notification";var Ar=jd,Jd=class Pm extends Pe{constructor(t){super(Pm.type),this.overlayId=t}};Jd.type="hide-overlay";var Kd=Jd,$d=class Rm extends Pe{constructor(t){super(Rm.type),this.panelId=t}};$d.type="hide-panel";var zi=$d,tf=class Lm extends Pe{constructor(t){super(Lm.type),this.tooltipData=t}};tf.type="hide-tooltip";var ef=tf,nf=class Im extends Pe{constructor(t,e){super(Im.type,!0),this.key=t,this.originalEvent=e}matches(t){return _c(this.originalEvent,t)}};nf.type="key-press";var Hi=nf,sf=class Dm extends Pe{constructor(t){super(Dm.type),this.progress=t}};sf.type="load-progress";var rf=sf,of=class km extends Pe{constructor(t){super(km.type),this.panorama=t}};of.type="panorama-load";var af=of,lf=class Um extends Pe{constructor(t){super(Um.type),this.data=t}};lf.type="panorama-loaded";var Ws=lf,cf=class Om extends Pe{constructor(t,e){super(Om.type),this.panorama=t,this.error=e}};cf.type="panorama-error";var hf=cf,uf=class Nm extends Pe{constructor(t){super(Nm.type),this.completed=t}};uf.type="transition-done";var df=uf,ff=class Bm extends Pe{constructor(t){super(Bm.type),this.position=t}};ff.type="position-updated";var Cr=ff,pf=class Fm extends Pe{constructor(t){super(Fm.type),this.roll=t}};pf.type="roll-updated";var Pr=pf,mf=class zm extends Pe{constructor(){super(zm.type)}};mf.type="ready";var Rr=mf,gf=class Hm extends Pe{constructor(){super(Hm.type)}};gf.type="render";var _f=gf,vf=class Vm extends Pe{constructor(t){super(Vm.type),this.notificationId=t}};vf.type="show-notification";var Lr=vf,yf=class Gm extends Pe{constructor(t){super(Gm.type),this.overlayId=t}};yf.type="show-overlay";var Ef=yf,xf=class Wm extends Pe{constructor(t){super(Wm.type),this.panelId=t}};xf.type="show-panel";var Vi=xf,wf=class Zm extends Pe{constructor(t,e){super(Zm.type),this.tooltip=t,this.tooltipData=e}};wf.type="show-tooltip";var Sf=wf,Mf=class Xm extends Pe{constructor(t){super(Xm.type),this.size=t}};Mf.type="size-updated";var Ir=Mf,Tf=class Ym extends Pe{constructor(){super(Ym.type)}};Tf.type="stop-all";var Dr=Tf,bf=class qm extends Pe{constructor(t){super(qm.type),this.zoomLevel=t}};bf.type="zoom-updated";var gi=bf,$o=class extends Pe{constructor(n,t,e,s,r){super(n),this.originalEvent=t,this.object=e,this.viewerPoint=s,this.userDataKey=r}},Af=class Qm extends $o{constructor(t,e,s,r){super(Qm.type,t,e,s,r)}};Af.type="enter-object";var Cf=Af,Pf=class jm extends $o{constructor(t,e,s,r){super(jm.type,t,e,s,r)}};Pf.type="leave-object";var Cc=Pf,Rf=class Jm extends $o{constructor(t,e,s,r){super(Jm.type,t,e,s,r)}};Rf.type="hover-object";var Lf=Rf,ta=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.")}};ta.supportsDownload=!1;function If(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof ta)return bc(t.id,t.VERSION,"5.14.0"),t}return null}var kr=`${Bi}_touchSupport`,ln={loaded:!1,pixelRatio:1,isWebGLSupported:!1,maxTextureWidth:0,isTouchEnabled:null,__maxCanvasWidth:null,isIphone:!1,get maxCanvasWidth(){return this.__maxCanvasWidth===null&&(this.__maxCanvasWidth=Iw(this.maxTextureWidth)),this.__maxCanvasWidth},load(){if(!this.loaded){const n=Rw();this.pixelRatio=window.devicePixelRatio||1,this.isWebGLSupported=!!n,this.maxTextureWidth=n?n.getParameter(n.MAX_TEXTURE_SIZE):0,this.isTouchEnabled=Lw(),this.isIphone=/iPhone/i.test(navigator.userAgent),this.loaded=!0}if(!ln.isWebGLSupported)throw new te("WebGL 2 is not supported.");if(ln.maxTextureWidth===0)throw new te("Unable to detect system capabilities")}};function Rw(){try{return document.createElement("canvas").getContext("webgl2")}catch{return null}}function Lw(){let n="ontouchstart"in window||navigator.maxTouchPoints>0;kr in localStorage&&(n=localStorage[kr]==="true");const t=new Promise(e=>{const s=()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",a),clearTimeout(h)},r=()=>{s(),localStorage[kr]=!1,e(!1)},a=()=>{s(),localStorage[kr]=!0,e(!0)},l=()=>{s(),localStorage[kr]=n,e(n)};window.addEventListener("mousedown",r,!1),window.addEventListener("touchstart",a,!1);const h=setTimeout(l,1e4)});return{initial:n,promise:t}}function Iw(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 Dw=jo({resolution:64,useXmpData:!0,blur:!1},{resolution:n=>{if(!n||!xe.isPowerOfTwo(n))throw new te("EquirectangularAdapter resolution must be power of two.");return n}}),ea=class Km extends ta{static withConfig(t){return[Km,t]}constructor(t,e){super(t),this.config=Dw(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=kd(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:wn(a,"FullPanoWidthPixels"),fullHeight:wn(a,"FullPanoHeightPixels"),croppedWidth:wn(a,"CroppedAreaImageWidthPixels"),croppedHeight:wn(a,"CroppedAreaImageHeightPixels"),croppedX:wn(a,"CroppedAreaLeftPixels"),croppedY:wn(a,"CroppedAreaTopPixels"),poseHeading:wn(a,"PoseHeadingDegrees",!1),posePitch:wn(a,"PosePitchDegrees",!1),poseRoll:wn(a,"PoseRollDegrees",!1),initialHeading:wn(a,"InitialViewHeadingDegrees",!1),initialPitch:wn(a,"InitialViewPitchDegrees",!1),initialFov:wn(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>ln.maxTextureWidth){const e=Math.min(1,ln.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),Mc(s)}return Mc(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 Bs(os,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 ki({depthTest:!1,depthWrite:!1});return new dn(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()}};ea.id="equirectangular",ea.VERSION="5.14.0",ea.supportsDownload=!0;var Pc=ea,Df=class $m extends Pc{static withConfig(t){return[$m,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 Bs(os,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 ki({depthTest:!1,depthWrite:!1});return new dn(t,r)}};Df.id="dual-fisheye",Df.VERSION="5.14.0";var as=class tg{constructor(t,e){this.parent=t,this.children=[],this.state={visible:!0},this.viewer=t instanceof tg?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}},kw=jo({id:null,tagName:null,className:null,title:null,hoverScale:!1,collapsable:!1,tabbable:!0,icon:null,iconActive:null}),cn=class extends as{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=kw(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===Ye.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(){yc(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,Go(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,mc(this.container.querySelector("svg"),"psv-button-svg")}},Uw=class extends cn{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)}},Ur=class extends cn{constructor(n){super(n,{className:"psv-description-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.info}),this.mode=0,this.viewer.addEventListener(Ar.type,this),this.viewer.addEventListener(Lr.type,this),this.viewer.addEventListener(zi.type,this),this.viewer.addEventListener(Vi.type,this),this.viewer.addEventListener(fn.type,this)}destroy(){this.viewer.removeEventListener(Ar.type,this),this.viewer.removeEventListener(Lr.type,this),this.viewer.removeEventListener(zi.type,this),this.viewer.removeEventListener(Vi.type,this),this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){if(n instanceof fn){n.containsOptions("description")&&this.autoSize(!0);return}if(!this.mode)return;let t=!1;n instanceof Ar?t=this.mode===1:n instanceof Lr?t=this.mode===1&&n.notificationId!==Je.DESCRIPTION:n instanceof zi?t=this.mode===2:n instanceof Vi&&(t=this.mode===2&&n.panelId!==Je.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(Je.DESCRIPTION);break;case 2:this.viewer.panel.hide(Je.DESCRIPTION);break}}__open(){this.toggleActive(!0),this.viewer.config.description?(this.mode=2,this.viewer.panel.show({id:Je.DESCRIPTION,content:`${this.viewer.config.caption?`<p>${this.viewer.config.caption}</p>`:""}${this.viewer.config.description}`})):(this.mode=1,this.viewer.notification.show({id:Je.DESCRIPTION,content:this.viewer.config.caption}))}};Ur.id="description";var kf=class extends cn{constructor(n){super(n,{tagName:"a",className:"psv-download-button",hoverScale:!0,collapsable:!0,tabbable:!0,icon:Hn.download}),this.viewer.addEventListener(fn.type,this),this.viewer.addEventListener(Ws.type,this)}destroy(){this.viewer.removeEventListener(fn.type,this),this.viewer.removeEventListener(Ws.type,this),super.destroy()}handleEvent(n){n instanceof fn?(n.containsOptions("downloadUrl")&&this.checkSupported(),n.containsOptions("downloadUrl","downloadName")&&this.__update()):n instanceof Ws&&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()}};kf.id="download";var Uf=class extends cn{constructor(n){super(n,{className:"psv-fullscreen-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.fullscreenIn,iconActive:Hn.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()}};Uf.id="fullscreen";var Ow="psvButton",Nw=(n,t)=>`
|
|
3863
3863
|
<div class="psv-panel-menu psv-panel-menu--stripped">
|
|
3864
3864
|
<h1 class="psv-panel-menu-title">${Hn.menu} ${t}</h1>
|
|
3865
3865
|
<ul class="psv-panel-menu-list">
|
|
@@ -3871,36 +3871,36 @@ void main() {
|
|
|
3871
3871
|
`).join("")}
|
|
3872
3872
|
</ul>
|
|
3873
3873
|
</div>
|
|
3874
|
-
`,na=class extends cn{constructor(n){super(n,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.menu}),this.viewer.addEventListener(Vi.type,this),this.viewer.addEventListener(zi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Vi.type,this),this.viewer.removeEventListener(zi.type,this),super.destroy()}handleEvent(n){n instanceof Vi?this.toggleActive(n.panelId===Je.MENU):n instanceof zi&&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:Je.MENU,content:Dw(this.viewer.navbar.collapsed,this.viewer.config.lang.menu),noMargin:!0,clickHandler:n=>{const t=n?dd(n,".psv-panel-menu-item"):void 0,e=t?t.dataset[Iw]:void 0;e&&(this.viewer.navbar.getButton(e).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(Je.MENU)}};na.id="menu";function kw(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 Hn.arrow.replace("rotate(0",`rotate(${t}`)}var Or=class extends cn{constructor(n,t){super(n,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:kw(t)}),this.direction=t,this.handler=new Ko,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===Ye.Enter&&this.__onMouseDown();break;case"keyup":n.key===Ye.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return Yo(ln.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()})}};Or.groupId="move";var Df=class extends Or{constructor(n){super(n,1)}};Df.id="moveDown";var kf=class extends Or{constructor(n){super(n,2)}};kf.id="moveLeft";var Uf=class extends Or{constructor(n){super(n,3)}};Uf.id="moveRight";var Of=class extends Or{constructor(n){super(n,0)}};Of.id="moveUp";var Pc=class extends cn{constructor(n,t,e){super(n,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:t}),this.direction=e,this.handler=new Ko,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===Ye.Enter&&this.__onMouseDown();break;case"keyup":n.key===Ye.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return Yo(ln.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())}};Pc.groupId="zoom";var Nf=class extends Pc{constructor(n){super(n,Hn.zoomIn,0)}};Nf.id="zoomIn";var Bf=class extends Pc{constructor(n){super(n,Hn.zoomOut,1)}};Bf.id="zoomOut";var Rc=class extends cn{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 kd(this.container,"HORIZONTAL",t=>this.__onSliderUpdate(t)),this.mediaMinWidth=parseInt(Jn(this.container,"max-width"),10),this.viewer.addEventListener(gi.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(Rr.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(gi.type,this),this.viewer.removeEventListener(Rr.type,this),super.destroy()}handleEvent(n){n instanceof gi?this.__moveZoomValue(n.zoomLevel):n instanceof Rr&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return Yo(ln.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)}};Rc.id="zoomRange",Rc.groupId="zoom";var Ff=class extends Od{constructor(n){super(),this.viewer=n}init(){}destroy(){}},zf=class extends Ff{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)){Ke(`${a}: Unknown option "${l}"`);continue}if(r.includes(l)){Ke(`${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}}};zf.readonlyOptions=[];function Lc(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof Ff)return Tc(t.id,t.VERSION,"5.14.0"),t}return null}var _i={panorama:null,container:null,adapter:[Cc,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:{[Ye.ArrowUp]:"ROTATE_UP",[Ye.ArrowDown]:"ROTATE_DOWN",[Ye.ArrowRight]:"ROTATE_RIGHT",[Ye.ArrowLeft]:"ROTATE_LEFT",[Ye.PageUp]:"ZOOM_IN",[Ye.PageDown]:"ZOOM_OUT",[Ye.Plus]:"ZOOM_IN",[Ye.Minus]:"ZOOM_OUT"}},Hf={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"},Ic={container:n=>{if(!n)throw new $t("No value given for container.");return n},adapter:(n,{defValue:t})=>{if(n?Array.isArray(n)?n=[Pf(n[0]),n[1]]:n=[Pf(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=>Kn(n),defaultPitch:n=>Kn(n,!0),defaultZoomLvl:n=>xe.clamp(n,0,100),minFov:(n,{rawConfig:t})=>(t.maxFov<n&&(Ke("maxFov cannot be lower than minFov"),n=t.maxFov),xe.clamp(n,1,179)),maxFov:(n,{rawConfig:t})=>(n<t.minFov&&(n=t.minFov),xe.clamp(n,1,179)),moveInertia:(n,{defValue:t})=>n===!0?t:n===!1?0:n,lang:n=>({..._i.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=[Lc(t[0]),t[1]]:t=[Lc(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?Xo(_i.navbar):typeof n=="string"?n.split(/[ ,]/):n},Uw=jo(_i,Ic),Zs=class extends cn{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(Ur.id,!1)?.autoSize(!0)}};Zs.id="caption";var Dc={},ia={};function kc(n,t){if(!n.id)throw new $t("Button id is required");if(Dc[n.id]=n,n.groupId&&(ia[n.groupId]=ia[n.groupId]||[]).push(n),t){const e=_i.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)}}}}[Bf,Rc,Nf,Ur,Zs,Lf,If,kf,Uf,Of,Df].forEach(n=>kc(n));var Ow=class extends as{constructor(n){super(n,{className:`psv-navbar ${wr}`}),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(Zs.id)!==-1&&n.indexOf(Ur.id)===-1&&n.splice(n.indexOf(Zs.id),0,Ur.id),n.forEach(t=>{typeof t=="object"?new Lw(this,t):Dc[t]?new Dc[t](this):ia[t]?ia[t].forEach(e=>{new e(this)}):Ke(`Unknown button ${t}`)}),new na(this),this.children.forEach(t=>{t instanceof cn&&t.checkSupported()}),this.autoSize()}setCaption(n){this.children.some(t=>t instanceof Zs?(t.setCaption(n),!0):!1)}getButton(n,t=!0){const e=this.children.find(s=>s instanceof cn&&s.id===n);return!e&&t&&Ke(`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 cn&&s.autoSize()});const n=this.container.offsetWidth;let t=0;const e=[];this.children.forEach(s=>{s.isVisible()&&s instanceof cn&&(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(na.id).show(!1)):n>=t&&this.collapsed.length>0&&(this.collapsed.forEach(s=>s.uncollapse()),this.collapsed=[],this.getButton(na.id).hide(!1)),this.getButton(Zs.id,!1)?.autoSize())}};Ni.enabled=!1;var Xs={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){Ni.enabled&&(Ke("ThreeJS cache should be disabled"),Ni.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]})}},Nw=class extends as{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=Jn(this.loader,"color"),this.color=Jn(this.canvas,"color"),this.border=parseInt(Jn(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(Jn(this.loader,"--psv-loader-tickness"),10);const t=this.size/2;this.canvas.innerHTML=`
|
|
3874
|
+
`,na=class extends cn{constructor(n){super(n,{className:"psv-menu-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Hn.menu}),this.viewer.addEventListener(Vi.type,this),this.viewer.addEventListener(zi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Vi.type,this),this.viewer.removeEventListener(zi.type,this),super.destroy()}handleEvent(n){n instanceof Vi?this.toggleActive(n.panelId===Je.MENU):n instanceof zi&&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:Je.MENU,content:Nw(this.viewer.navbar.collapsed,this.viewer.config.lang.menu),noMargin:!0,clickHandler:n=>{const t=n?md(n,".psv-panel-menu-item"):void 0,e=t?t.dataset[Ow]:void 0;e&&(this.viewer.navbar.getButton(e).onClick(),this.__hideMenu())}})}__hideMenu(){this.viewer.panel.hide(Je.MENU)}};na.id="menu";function Bw(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 Hn.arrow.replace("rotate(0",`rotate(${t}`)}var Or=class extends cn{constructor(n,t){super(n,{className:"psv-move-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:Bw(t)}),this.direction=t,this.handler=new Ko,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===Ye.Enter&&this.__onMouseDown();break;case"keyup":n.key===Ye.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return Yo(ln.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()})}};Or.groupId="move";var Of=class extends Or{constructor(n){super(n,1)}};Of.id="moveDown";var Nf=class extends Or{constructor(n){super(n,2)}};Nf.id="moveLeft";var Bf=class extends Or{constructor(n){super(n,3)}};Bf.id="moveRight";var Ff=class extends Or{constructor(n){super(n,0)}};Ff.id="moveUp";var Rc=class extends cn{constructor(n,t,e){super(n,{className:"psv-zoom-button",hoverScale:!0,collapsable:!1,tabbable:!0,icon:t}),this.direction=e,this.handler=new Ko,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===Ye.Enter&&this.__onMouseDown();break;case"keyup":n.key===Ye.Enter&&this.__onMouseUp();break}}onClick(){}isSupported(){return Yo(ln.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())}};Rc.groupId="zoom";var zf=class extends Rc{constructor(n){super(n,Hn.zoomIn,0)}};zf.id="zoomIn";var Hf=class extends Rc{constructor(n){super(n,Hn.zoomOut,1)}};Hf.id="zoomOut";var Lc=class extends cn{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 Nd(this.container,"HORIZONTAL",t=>this.__onSliderUpdate(t)),this.mediaMinWidth=parseInt(Jn(this.container,"max-width"),10),this.viewer.addEventListener(gi.type,this),this.viewer.state.ready?this.__moveZoomValue(this.viewer.getZoomLevel()):this.viewer.addEventListener(Rr.type,this)}destroy(){this.slider.destroy(),this.viewer.removeEventListener(gi.type,this),this.viewer.removeEventListener(Rr.type,this),super.destroy()}handleEvent(n){n instanceof gi?this.__moveZoomValue(n.zoomLevel):n instanceof Rr&&this.__moveZoomValue(this.viewer.getZoomLevel())}onClick(){}isSupported(){return Yo(ln.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)}};Lc.id="zoomRange",Lc.groupId="zoom";var Vf=class extends Fd{constructor(n){super(),this.viewer=n}init(){}destroy(){}},Gf=class extends Vf{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)){Ke(`${a}: Unknown option "${l}"`);continue}if(r.includes(l)){Ke(`${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}}};Gf.readonlyOptions=[];function Ic(n){if(n){for(const[,t]of[["_",n],...Object.entries(n)])if(t.prototype instanceof Vf)return bc(t.id,t.VERSION,"5.14.0"),t}return null}var _i={panorama:null,container:null,adapter:[Pc,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:{[Ye.ArrowUp]:"ROTATE_UP",[Ye.ArrowDown]:"ROTATE_DOWN",[Ye.ArrowRight]:"ROTATE_RIGHT",[Ye.ArrowLeft]:"ROTATE_LEFT",[Ye.PageUp]:"ZOOM_IN",[Ye.PageDown]:"ZOOM_OUT",[Ye.Plus]:"ZOOM_IN",[Ye.Minus]:"ZOOM_OUT"}},Wf={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"},Dc={container:n=>{if(!n)throw new te("No value given for container.");return n},adapter:(n,{defValue:t})=>{if(n?Array.isArray(n)?n=[If(n[0]),n[1]]:n=[If(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=>Kn(n),defaultPitch:n=>Kn(n,!0),defaultZoomLvl:n=>xe.clamp(n,0,100),minFov:(n,{rawConfig:t})=>(t.maxFov<n&&(Ke("maxFov cannot be lower than minFov"),n=t.maxFov),xe.clamp(n,1,179)),maxFov:(n,{rawConfig:t})=>(n<t.minFov&&(n=t.minFov),xe.clamp(n,1,179)),moveInertia:(n,{defValue:t})=>n===!0?t:n===!1?0:n,lang:n=>({..._i.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=[Ic(t[0]),t[1]]:t=[Ic(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?Xo(_i.navbar):typeof n=="string"?n.split(/[ ,]/):n},Fw=jo(_i,Dc),Zs=class extends cn{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(Ur.id,!1)?.autoSize(!0)}};Zs.id="caption";var kc={},ia={};function Uc(n,t){if(!n.id)throw new te("Button id is required");if(kc[n.id]=n,n.groupId&&(ia[n.groupId]=ia[n.groupId]||[]).push(n),t){const e=_i.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)}}}}[Hf,Lc,zf,Ur,Zs,kf,Uf,Nf,Bf,Ff,Of].forEach(n=>Uc(n));var zw=class extends as{constructor(n){super(n,{className:`psv-navbar ${wr}`}),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(Zs.id)!==-1&&n.indexOf(Ur.id)===-1&&n.splice(n.indexOf(Zs.id),0,Ur.id),n.forEach(t=>{typeof t=="object"?new Uw(this,t):kc[t]?new kc[t](this):ia[t]?ia[t].forEach(e=>{new e(this)}):Ke(`Unknown button ${t}`)}),new na(this),this.children.forEach(t=>{t instanceof cn&&t.checkSupported()}),this.autoSize()}setCaption(n){this.children.some(t=>t instanceof Zs?(t.setCaption(n),!0):!1)}getButton(n,t=!0){const e=this.children.find(s=>s instanceof cn&&s.id===n);return!e&&t&&Ke(`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 cn&&s.autoSize()});const n=this.container.offsetWidth;let t=0;const e=[];this.children.forEach(s=>{s.isVisible()&&s instanceof cn&&(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(na.id).show(!1)):n>=t&&this.collapsed.length>0&&(this.collapsed.forEach(s=>s.uncollapse()),this.collapsed=[],this.getButton(na.id).hide(!1)),this.getButton(Zs.id,!1)?.autoSize())}};Ni.enabled=!1;var Xs={enabled:!0,maxItems:10,ttl:600,items:{},purgeInterval:null,init(){Ni.enabled&&(Ke("ThreeJS cache should be disabled"),Ni.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]})}},Hw=class extends as{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=Jn(this.loader,"color"),this.color=Jn(this.canvas,"color"),this.border=parseInt(Jn(this.loader,"--psv-loader-border"),10),this.thickness=parseInt(Jn(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(fn.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){n instanceof fn&&n.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(n){this.container.classList.remove("psv-loader--undefined");const t=xe.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)}}},Bw=class extends as{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 Lr(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 Ar(t))}}},Fw=class extends as{constructor(n){super(n,{className:`psv-overlay ${wr}`}),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(Hi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Hi.type,this),super.destroy()}handleEvent(n){n.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),n.stopPropagation()):n instanceof Hi&&this.isVisible()&&this.state.dismissible&&n.matches(Ye.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 _f(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new Qd(t))}}},zw=200,Uc="psv-panel-content--no-interaction",Hw=class extends as{constructor(n){super(n,{className:`psv-panel ${wr}`}),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=Hn.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(Hi.type,this)}destroy(){this.viewer.removeEventListener(Hi.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 Hi.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"),Go(this.content,"psv-panel-content--no-margin",n.noMargin===!0),n.clickHandler&&(this.state.clickHandler=e=>{n.clickHandler(Wo(e))},this.state.keyHandler=e=>{e.key===Ye.Enter&&n.clickHandler(Wo(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 Vi(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 zi(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(Uc))}__onTouchEnd(n){this.state.mousedown&&(n.stopPropagation(),n.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(Uc)))}__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(Ye.Escape)&&(this.hide(),n.preventDefault())}__startResize(n,t){this.state.mouseX=n,this.state.mouseY=t,this.state.mousedown=!0,this.content.classList.add(Uc)}__resize(n,t){const e=n,s=t,r=Math.max(zw,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}},Vw=class extends as{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&&pc(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 Ef(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(Jn(this.arrow,"border-top-width"),10),this.state.border=parseInt(Jn(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:bd(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=xc(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 Kd(this.state.data));const n=parseFloat(Jn(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)}})}}},Gw=`<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
|
-
`,Nr=class{constructor(n){this.viewer=n,this.config=n.config,this.state=n.state}destroy(){}},Vn=new Y,sa=new Yn(0,0,0,"ZXY"),
|
|
3879
|
-
`,
|
|
3880
|
-
`,ra=class Km{constructor(){this.$=Km.IDLE}is(...t){return t.some(e=>this.$&e)}set(t){this.$=t}add(t){this.$|=t}remove(t){this.$&=~t}};ra.IDLE=0,ra.CLICK=1,ra.MOVING=2;var He=ra,Yw=class extends Nr{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 He,this.keyHandler=new Ko,this.resizeObserver=new ResizeObserver(vd(()=>this.viewer.autoSize(),50)),this.moveThreshold=ed*ln.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(Tr.type,this),this.viewer.addEventListener(Dr.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(Tr.type,this),this.viewer.removeEventListener(Dr.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 Tr.type:this.__applyMoveDelta();break;case Dr.type:this.__clearMoveDelta();break}if(!fd(n,"."+wr))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===Ye.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Je.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new Hi(n.key,n))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[t,e]of Object.entries(this.config.keyboardActions))if(gc(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(He.CLICK),this.data.startMouseX=n.clientX,this.data.startMouseY=n.clientY,this.config.mousemove&&n.preventDefault()}__onMouseUp(n){this.step.is(He.CLICK,He.MOVING)&&this.__stopMove(n.clientX,n.clientY,n,n.button===2)}__onMouseMove(n){this.config.mousemove&&this.step.is(He.CLICK,He.MOVING)&&(n.preventDefault(),this.__doMove(n.clientX,n.clientY)),this.__handleObjectsEvents(n)}__onTouchStart(n){n.touches.length===1?(this.step.add(He.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},id))):n.touches.length===2&&(this.step.set(He.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(n),n.preventDefault()))}__onTouchEnd(n){if(this.__cancelLongTouch(),this.step.is(He.CLICK,He.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(He.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Je.TWO_FINGERS,image:Zw,title:this.config.lang.twoFingers})},sd));else if(this.step.is(He.CLICK,He.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(Je.TWO_FINGERS))}__onMouseWheel(n){if(!this.config.mousewheel||!n.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Je.CTRL_ZOOM,image:Xw,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Je.CTRL_ZOOM),rd);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(He.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=mc(n);this.step.set(He.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(He.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[Bi]);if(u){const d=this.viewer.dataHelper.vector3ToSphericalCoords(u.point),p={rightclick:s,originalEvent:e,target:Wo(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[Bi])};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 Zd(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new Vd(p)),this.data.dblclickData=Xo(p),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},nd))}}__handleObjectsEvents(n){if(!Ed(this.state.objectsObservers)&&n.composedPath().includes(this.viewer.container)){const t=pd(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,Ac),this.state.objectsObservers[a]=null),l?r(h.object,a,Cf):(this.state.objectsObservers[a]=h.object,r(h.object,a,Tf))):l&&(r(l,a,Ac),this.state.objectsObservers[a]=null)}}}__doMove(n,t){if(this.step.is(He.CLICK)&&this.__moveThresholdReached(n,t))this.viewer.stopAll(),this.__resetMove(),this.step.set(He.MOVING),this.data.mouseX=n,this.data.mouseY=t,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(He.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)*xe.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(s/this.state.size.height)*xe.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(He.MOVING)){n.preventDefault();const t=mc(n);this.__doMove(t.center.x,t.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((t.distance-this.data.pinchDist)/ln.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}};we.enabled=!1;var oa=new be,Vf=new Ue,Gf=new Ts,qw=class extends Nr{constructor(n){super(n),this.frustumNeedsUpdate=!0,this.renderer=new cw(this.config.rendererParameters),this.renderer.setPixelRatio(ln.pixelRatio),this.renderer.outputColorSpace=Qi,this.renderer.toneMapping=Rh,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Kl,this.camera=new Pn(50,16/9,.1,2*os),this.camera.matrixAutoUpdate=!1;const t=new dn(new Bs(os).scale(-1,1,1),new ki({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));t.userData={[Bi]:!0},this.scene.add(t),this.raycaster=new o0,this.frustum=new tc,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(Ir.type,this),this.viewer.addEventListener(gi.type,this),this.viewer.addEventListener(Cr.type,this),this.viewer.addEventListener(Pr.type,this),this.viewer.addEventListener(fn.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(Ir.type,this),this.viewer.removeEventListener(gi.type,this),this.viewer.removeEventListener(Cr.type,this),this.viewer.removeEventListener(Pr.type,this),this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){switch(n.type){case Ir.type:this.__onSizeUpdated();break;case gi.type:this.__onZoomUpdated();break;case Cr.type:this.__onPositionUpdated();break;case Pr.type:this.__onPositionUpdated();break;case fn.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 Tr(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 pf))}setTexture(n){this.meshContainer||(this.meshContainer=new Oi,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 bc(r?this.viewer.dataHelper.cleanPosition(t.position):void 0,t.zoom);this.viewer.dispatchEvent(l);const h=new Oi,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 Y(0,1,0);h.rotateOnWorldAxis(E,l.position.yaw-_.yaw);const S=new Y(0,1,0).cross(this.camera.getWorldDirection(new Y)).normalize();h.rotateOnWorldAxis(S,l.position.pitch-_.pitch)}h.add(u),this.scene.add(h),this.renderer.setRenderTarget(new Ci),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 Jo({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"?xe.mapLinear(_.opacity,0,.5,1,0):xe.mapLinear(_.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=e.effect==="black"?xe.mapLinear(_.opacity,.5,1,0,1):xe.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){oa.x=2*n.x/this.state.size.width-1,oa.y=-2*n.y/this.state.size.height+1,this.raycaster.setFromCamera(oa,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,oa)),t}isObjectVisible(n){if(!n)return!1;if(this.frustumNeedsUpdate&&(Vf.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Vf),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(),Gf.copy(t.geometry.boundingBox).applyMatrix4(t.matrixWorld),this.frustum.intersectsBox(Gf)}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 Kl||e.dispose?.(),e!==n&&this.cleanScene(e)})}},Qw=class extends i0{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}},jw=class extends Nr{constructor(n){super(n),this.fileLoader=new n0,this.fileLoader.setResponseType("blob"),this.imageLoader=new Qw}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(n,t,e){const s=Xs.get(n,e);if(s){if(s instanceof Blob)return t?.(100),Promise.resolve(s);Xs.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),Xs.add(n,e,a),a))}loadImage(n,t,e){const s=Xs.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=>(Xs.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 ef(Math.round(n)))}},Jw=class extends Nr{constructor(n){super(n),this.zoom=new Mr(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 gi(t))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Id(t=>{this.viewer.dataHelper.sphericalCoordsToVector3(t,this.viewer.state.direction),this.viewer.dispatchEvent(new Cr(t))},{yaw:new Mr(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new Mr(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new Mr(t=>{this.viewer.state.roll=t,this.viewer.dispatchEvent(new Pr(t))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(xe.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(xe.degToRad(this.config.moveSpeed*50))}update(n){this.zoom.update(n),this.position.update(n),this.roll.update(n)}},Kw=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new Y(0,0,os),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}}},$w=class extends Od{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=ud(t.container),!this.parent)throw new $t('"container" element not found.');this.parent[Bi]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Rd(this.parent),Pd(this.container,"core"),this.state=new Kw,this.config=Uw(t),this.__setSize(this.config.size),this.overlay=new Fw(this);try{ln.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}Xs.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new qw(this),this.textureLoader=new jw(this),this.eventsHandler=new Yw(this),this.dataHelper=new Ww(this),this.dynamics=new Jw(this),this.adapter.init?.(),this.loader=new Nw(this),this.navbar=new Ow(this),this.panel=new Hw(this),this.notification=new Bw(this),this.autoSize(),this.setCursor(null),vc(ln.isTouchEnabled,e=>{Go(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[Bi]}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 Rr)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=Lc(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 md(this.parent,ln.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 Ir(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(Sd(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 af(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 sf(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),yc();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 Ws(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 Ws(l)),this.state.transitionAnimation=this.renderer.transition(l,h,s),this.state.transitionAnimation)).then(l=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new cf(l)),!l)throw yc()}).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 _i)){Ke(`Unknown option ${s}`);continue}if(s in Hf){Ke(Hf[s]);continue}switch(s in Ic&&(r=Ic[s](r,{rawConfig:e,defValue:_i[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 gi(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new fn(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Je.ERROR,image:Gw,title:t,dismissible:!1})}hideError(){this.overlay.hide(Je.ERROR)}rotate(t){const e=new zd(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=Ec(t),s=!qe(t.zoom),r=new bc(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 Jo({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 Jo(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()||gd(this.parent,ln.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&_d(ln.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new Vw(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 Dr),this.disableIdleTimer(),this.stopAnimation()}};/*!
|
|
3877
|
+
`,this.viewer.addEventListener(fn.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){n instanceof fn&&n.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(n){this.container.classList.remove("psv-loader--undefined");const t=xe.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)}}},Vw=class extends as{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 Lr(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 Ar(t))}}},Gw=class extends as{constructor(n){super(n,{className:`psv-overlay ${wr}`}),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(Hi.type,this),super.hide()}destroy(){this.viewer.removeEventListener(Hi.type,this),super.destroy()}handleEvent(n){n.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),n.stopPropagation()):n instanceof Hi&&this.isVisible()&&this.state.dismissible&&n.matches(Ye.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 Ef(this.state.contentId))}hide(n){if(this.isVisible(n)){const t=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new Kd(t))}}},Ww=200,Oc="psv-panel-content--no-interaction",Zw=class extends as{constructor(n){super(n,{className:`psv-panel ${wr}`}),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=Hn.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(Hi.type,this)}destroy(){this.viewer.removeEventListener(Hi.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 Hi.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"),Go(this.content,"psv-panel-content--no-margin",n.noMargin===!0),n.clickHandler&&(this.state.clickHandler=e=>{n.clickHandler(Wo(e))},this.state.keyHandler=e=>{e.key===Ye.Enter&&n.clickHandler(Wo(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 Vi(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 zi(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(Oc))}__onTouchEnd(n){this.state.mousedown&&(n.stopPropagation(),n.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(Oc)))}__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(Ye.Escape)&&(this.hide(),n.preventDefault())}__startResize(n,t){this.state.mouseX=n,this.state.mouseY=t,this.state.mousedown=!0,this.content.classList.add(Oc)}__resize(n,t){const e=n,s=t,r=Math.max(Ww,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}},Xw=class extends as{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&&mc(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 Sf(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(Jn(this.arrow,"border-top-width"),10),this.state.border=parseInt(Jn(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:Pd(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 ef(this.state.data));const n=parseFloat(Jn(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)}})}}},Yw=`<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
|
+
`,Nr=class{constructor(n){this.viewer=n,this.config=n.config,this.state=n.state}destroy(){}},Vn=new Y,sa=new Yn(0,0,0,"ZXY"),qw=class extends Nr{constructor(n){super(n)}fovToZoomLevel(n){const t=Math.round((n-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return xe.clamp(t-2*(t-50),0,100)}zoomLevelToFov(n){return this.config.maxFov+n/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(n){return xe.radToDeg(2*Math.atan(Math.tan(xe.degToRad(n)/2)*this.state.aspect))}hFovToVFov(n){return xe.radToDeg(2*Math.atan(Math.tan(xe.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=dd(h.yaw,t.yaw);a.yaw={start:h.yaw,end:h.yaw+u},a.pitch={start:h.pitch,end:t.pitch},l=Sc(n,fd(h,t))}if(r){const h=this.viewer.getZoomLevel(),u=Math.abs(e-h);a.zoom={start:h,end:e},l===null&&(l=Sc(n,Math.PI/4*u/100))}return l===null?typeof n=="number"?l=n:l=pc:l=Math.max(pc,l),{duration:l,properties:a}}getTransitionOptions(n){let t;const e=this.config.defaultTransition??_i.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!sa.equals(this.viewer.renderer.panoramaPose)||!sa.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(t,Vn),Vn.applyEuler(this.viewer.renderer.panoramaPose),Vn.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(Vn)):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(!sa.equals(this.viewer.renderer.panoramaPose)||!sa.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(n,Vn),Tc(Vn,this.viewer.renderer.sphereCorrection),Tc(Vn,this.viewer.renderer.panoramaPose),n=this.vector3ToSphericalCoords(Vn)),this.viewer.adapter.sphericalCoordsToTextureCoords(n,this.state.textureData.panoData)}sphericalCoordsToVector3(n,t,e=os){return t||(t=new Y),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[Bi]);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,Vn),this.vector3ToViewerCoords(Vn)}isPointVisible(n){let t,e;if(n instanceof Y)t=n,e=this.vector3ToViewerCoords(n);else if(xc(n))t=this.sphericalCoordsToVector3(n,Vn),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:Kn(n.yaw),pitch:Kn(n.pitch,!0)}}else return this.textureCoordsToSphericalCoords(n)}cleanSphereCorrection(n){return{pan:Kn(n?.pan||0),tilt:Kn(n?.tilt||0,!0),roll:Kn(n?.roll||0,!0,!1)}}cleanPanoramaPose(n){return{pan:xe.degToRad(n?.poseHeading||0),tilt:xe.degToRad(n?.posePitch||0),roll:xe.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:Kn(t.initialHeading),pitch:Kn(t.initialPitch,!0)}})),n}},Qw=`<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
|
+
`,jw=`<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
|
+
`,ra=class eg{constructor(){this.$=eg.IDLE}is(...t){return t.some(e=>this.$&e)}set(t){this.$=t}add(t){this.$|=t}remove(t){this.$&=~t}};ra.IDLE=0,ra.CLICK=1,ra.MOVING=2;var He=ra,Jw=class extends Nr{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 He,this.keyHandler=new Ko,this.resizeObserver=new ResizeObserver(xd(()=>this.viewer.autoSize(),50)),this.moveThreshold=sd*ln.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(Tr.type,this),this.viewer.addEventListener(Dr.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(Tr.type,this),this.viewer.removeEventListener(Dr.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 Tr.type:this.__applyMoveDelta();break;case Dr.type:this.__clearMoveDelta();break}if(!gd(n,"."+wr))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===Ye.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Je.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new Hi(n.key,n))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[t,e]of Object.entries(this.config.keyboardActions))if(_c(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(He.CLICK),this.data.startMouseX=n.clientX,this.data.startMouseY=n.clientY,this.config.mousemove&&n.preventDefault()}__onMouseUp(n){this.step.is(He.CLICK,He.MOVING)&&this.__stopMove(n.clientX,n.clientY,n,n.button===2)}__onMouseMove(n){this.config.mousemove&&this.step.is(He.CLICK,He.MOVING)&&(n.preventDefault(),this.__doMove(n.clientX,n.clientY)),this.__handleObjectsEvents(n)}__onTouchStart(n){n.touches.length===1?(this.step.add(He.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},od))):n.touches.length===2&&(this.step.set(He.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(n),n.preventDefault()))}__onTouchEnd(n){if(this.__cancelLongTouch(),this.step.is(He.CLICK,He.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(He.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Je.TWO_FINGERS,image:Qw,title:this.config.lang.twoFingers})},ad));else if(this.step.is(He.CLICK,He.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(Je.TWO_FINGERS))}__onMouseWheel(n){if(!this.config.mousewheel||!n.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Je.CTRL_ZOOM,image:jw,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Je.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(He.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=gc(n);this.step.set(He.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(He.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[Bi]);if(u){const d=this.viewer.dataHelper.vector3ToSphericalCoords(u.point),p={rightclick:s,originalEvent:e,target:Wo(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[Bi])};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 qd(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new Zd(p)),this.data.dblclickData=Xo(p),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},rd))}}__handleObjectsEvents(n){if(!Sd(this.state.objectsObservers)&&n.composedPath().includes(this.viewer.container)){const t=_d(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,Cc),this.state.objectsObservers[a]=null),l?r(h.object,a,Lf):(this.state.objectsObservers[a]=h.object,r(h.object,a,Cf))):l&&(r(l,a,Cc),this.state.objectsObservers[a]=null)}}}__doMove(n,t){if(this.step.is(He.CLICK)&&this.__moveThresholdReached(n,t))this.viewer.stopAll(),this.__resetMove(),this.step.set(He.MOVING),this.data.mouseX=n,this.data.mouseY=t,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(He.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)*xe.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(s/this.state.size.height)*xe.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(He.MOVING)){n.preventDefault();const t=gc(n);this.__doMove(t.center.x,t.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((t.distance-this.data.pinchDist)/ln.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}};we.enabled=!1;var oa=new be,Zf=new Oe,Xf=new Ts,Kw=class extends Nr{constructor(n){super(n),this.frustumNeedsUpdate=!0,this.renderer=new fw(this.config.rendererParameters),this.renderer.setPixelRatio(ln.pixelRatio),this.renderer.outputColorSpace=Qi,this.renderer.toneMapping=Dh,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new $l,this.camera=new Pn(50,16/9,.1,2*os),this.camera.matrixAutoUpdate=!1;const t=new dn(new Bs(os).scale(-1,1,1),new ki({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));t.userData={[Bi]:!0},this.scene.add(t),this.raycaster=new h0,this.frustum=new ec,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(Ir.type,this),this.viewer.addEventListener(gi.type,this),this.viewer.addEventListener(Cr.type,this),this.viewer.addEventListener(Pr.type,this),this.viewer.addEventListener(fn.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(Ir.type,this),this.viewer.removeEventListener(gi.type,this),this.viewer.removeEventListener(Cr.type,this),this.viewer.removeEventListener(Pr.type,this),this.viewer.removeEventListener(fn.type,this),super.destroy()}handleEvent(n){switch(n.type){case Ir.type:this.__onSizeUpdated();break;case gi.type:this.__onZoomUpdated();break;case Cr.type:this.__onPositionUpdated();break;case Pr.type:this.__onPositionUpdated();break;case fn.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 Tr(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 _f))}setTexture(n){this.meshContainer||(this.meshContainer=new Oi,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 Ac(r?this.viewer.dataHelper.cleanPosition(t.position):void 0,t.zoom);this.viewer.dispatchEvent(l);const h=new Oi,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 Y(0,1,0);h.rotateOnWorldAxis(E,l.position.yaw-_.yaw);const S=new Y(0,1,0).cross(this.camera.getWorldDirection(new Y)).normalize();h.rotateOnWorldAxis(S,l.position.pitch-_.pitch)}h.add(u),this.scene.add(h),this.renderer.setRenderTarget(new Ci),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 Jo({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"?xe.mapLinear(_.opacity,0,.5,1,0):xe.mapLinear(_.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=e.effect==="black"?xe.mapLinear(_.opacity,.5,1,0,1):xe.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){oa.x=2*n.x/this.state.size.width-1,oa.y=-2*n.y/this.state.size.height+1,this.raycaster.setFromCamera(oa,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,oa)),t}isObjectVisible(n){if(!n)return!1;if(this.frustumNeedsUpdate&&(Zf.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(Zf),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(),Xf.copy(t.geometry.boundingBox).applyMatrix4(t.matrixWorld),this.frustum.intersectsBox(Xf)}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 $l||e.dispose?.(),e!==n&&this.cleanScene(e)})}},$w=class extends a0{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}},tS=class extends Nr{constructor(n){super(n),this.fileLoader=new o0,this.fileLoader.setResponseType("blob"),this.imageLoader=new $w}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(n,t,e){const s=Xs.get(n,e);if(s){if(s instanceof Blob)return t?.(100),Promise.resolve(s);Xs.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),Xs.add(n,e,a),a))}loadImage(n,t,e){const s=Xs.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=>(Xs.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 rf(Math.round(n)))}},eS=class extends Nr{constructor(n){super(n),this.zoom=new Mr(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 gi(t))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Ud(t=>{this.viewer.dataHelper.sphericalCoordsToVector3(t,this.viewer.state.direction),this.viewer.dispatchEvent(new Cr(t))},{yaw:new Mr(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new Mr(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new Mr(t=>{this.viewer.state.roll=t,this.viewer.dispatchEvent(new Pr(t))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(xe.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(xe.degToRad(this.config.moveSpeed*50))}update(n){this.zoom.update(n),this.position.update(n),this.roll.update(n)}},nS=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new Y(0,0,os),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}}},iS=class extends Fd{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=pd(t.container),!this.parent)throw new te('"container" element not found.');this.parent[Bi]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Dd(this.parent),Id(this.container,"core"),this.state=new nS,this.config=Fw(t),this.__setSize(this.config.size),this.overlay=new Gw(this);try{ln.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}Xs.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new Kw(this),this.textureLoader=new tS(this),this.eventsHandler=new Jw(this),this.dataHelper=new qw(this),this.dynamics=new eS(this),this.adapter.init?.(),this.loader=new Hw(this),this.navbar=new zw(this),this.panel=new Zw(this),this.notification=new Vw(this),this.autoSize(),this.setCursor(null),yc(ln.isTouchEnabled,e=>{Go(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[Bi]}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 Rr)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=Ic(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 vd(this.parent,ln.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 Ir(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(bd(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 hf(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 af(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),Ec();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 Ws(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 Ws(l)),this.state.transitionAnimation=this.renderer.transition(l,h,s),this.state.transitionAnimation)).then(l=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new df(l)),!l)throw Ec()}).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 _i)){Ke(`Unknown option ${s}`);continue}if(s in Wf){Ke(Wf[s]);continue}switch(s in Dc&&(r=Dc[s](r,{rawConfig:e,defValue:_i[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 gi(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new fn(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Je.ERROR,image:Yw,title:t,dismissible:!1})}hideError(){this.overlay.hide(Je.ERROR)}rotate(t){const e=new Gd(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=xc(t),s=!qe(t.zoom),r=new Ac(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 Jo({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 Jo(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()||yd(this.parent,ln.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Ed(ln.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new Xw(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 Dr),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
|
|
3885
|
-
`).forEach((l,h)=>{r.fillText(l,n.width/2,n.height/2+a*(.3+h))}),s}function
|
|
3884
|
+
*/var sS=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}},rS=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 oS(){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 ki({map:ae.createTexture(n)})}function aS(n){const t=new t0(n),e=new Kv(t);return e.material.depthTest=!1,e.material.depthWrite=!1,e.material.opacity=.25,e.material.transparent=!0,e}var Yf=["dodgerblue","limegreen","indianred"];function lS(n,t,e){const s=document.createElement("canvas");s.width=n.width,s.height=n.height;const r=s.getContext("2d");r.fillStyle=Yf[t%Yf.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 Nc(n){return!!n.levels}function qf(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 Qf(n,t,e,s,r){let a,l;return Nc(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}),qf(a,l,r)}function cS(n,t,e){return!Nc(n)||!n.levels[t]?null:qf(n.levels[t],t,e)}function hS(n,t){if(typeof n!="object"||!n.tileUrl)throw new te("Invalid panorama configuration, are you using the right adapter?");Nc(n)?(n.levels.forEach(e=>{jf(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)):jf(n,t)}function jf(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(!xe.isPowerOfTwo(n.cols)||!xe.isPowerOfTwo(n.rows))throw new te("Panorama cols and rows must be powers of 2.")}function uS(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 Br=6,pn=3,dS="uv",fS="position",Jf=-1;function Bc(n){return`${n.col}x${n.row}/${n.config.level}`}function aa(n){return n.children}var pS=ae.getConfigParser({resolution:64,showErrorTile:!0,baseBlur:!0,antialias:!0,debug:!1,useXmpData:!1}),la=new Y,ca=class ng extends ta{constructor(t,e){super(t),this.state={tileConfig:null,tiles:{},faces:{},geom:null,materials:[],errorMaterial:null,inTransition:!1},this.queue=new rS,this.config=pS(e),this.adapter=new Pc(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*pn+(this.SPHERE_HORIZONTAL_SEGMENTS-2)*this.SPHERE_SEGMENTS*Br,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[ng,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){hS(t,this);const s=Qf(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:uS(t,s),texture:null}}createMesh(t){const e=this.adapter.createMesh(t.baseData??t),s=new Bs(Gs.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*pn;r+=pn)s.addGroup(r,pn,a++);for(;r<this.NB_VERTICES-this.SPHERE_SEGMENTS*pn;r+=Br)s.addGroup(r,Br,a++);for(;r<this.NB_VERTICES;r+=pn)s.addGroup(r,pn,a++);const l=[],h=new ki({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1});for(let p=0;p<this.NB_GROUPS;p++)l.push(h);const u=new dn(s,l);u.renderOrder=1;const d=new Oi;return d.add(e),d.add(u),d}setTexture(t,e,s){const[r]=aa(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]=aa(t);this.adapter.setTextureOpacity(s,e)}disposeTexture({texture:t}){t?.dispose()}disposeMesh(t){const[e,s]=aa(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=Qf(t,this.viewer.state.hFov,this.viewer.state.vFov,this.viewer.state.size,this),s=this.state.geom.getAttribute(fS),r={};for(let a=0;a<this.NB_VERTICES;a+=1)if(la.fromBufferAttribute(s,a),la.applyEuler(this.viewer.renderer.sphereCorrection),this.viewer.renderer.isObjectVisible(la)){let l;a<this.SPHERE_SEGMENTS*pn?l=Math.floor(a/3):a<this.NB_VERTICES-this.SPHERE_SEGMENTS*pn?l=Math.floor((a/3-this.SPHERE_SEGMENTS)/2)+this.SPHERE_SEGMENTS:l=Math.floor((a-this.NB_VERTICES-this.SPHERE_SEGMENTS*pn)/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 _=la.angleTo(this.viewer.state.direction);(p===0||p===d.rows-1)&&(_*=2);const E={row:p,col:m,angle:_,config:d,url:null},S=Bc(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=cS(t,d.level-1,this)}}this.state.tileConfig=e,this.__loadTiles(Object.values(r))}__loadTiles(t){this.queue.disableAllTasks(),t.forEach(e=>{const s=Bc(e);this.state.tiles[s]?this.queue.setPriority(s,e.angle):(this.state.tiles[s]=!0,this.queue.enqueue(new sS(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=lS(s,t.config.level,Bc(t)));const r=this.config.antialias&&t.config.level>0,a=new ki({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=oS()),this.__swapMaterial(t,this.state.errorMaterial,!0),this.viewer.needsUpdate())})}__swapMaterial(t,e,s){const r=this.state.geom.getAttribute(dS);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*pn:p?m=this.NB_VERTICES-this.SPHERE_SEGMENTS*pn+h*pn:m=this.SPHERE_SEGMENTS*pn+(u-1)*this.SPHERE_SEGMENTS*Br+h*Br,s&&this.state.faces[m]>Jf||this.state.faces[m]>t.config.level)continue;this.state.faces[m]=s?Jf: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]=aa(t);if(this.__cleanup(),this.state.materials=e.material,this.state.geom=e.geometry,this.config.debug){const s=aS(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}};ca.id="equirectangular-tiles",ca.VERSION="5.14.0",ca.supportsDownload=!1;var mS=ca;/*!
|
|
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
|
-
*/var
|
|
3890
|
-
`,Hr=class extends cn{constructor(n){super(n,{className:"psv-markers-button",icon:
|
|
3891
|
-
`,ha="http://www.w3.org/2000/svg",
|
|
3889
|
+
*/var gS=Object.defineProperty,_S=(n,t)=>{for(var e in t)gS(n,e,{get:t[e],enumerable:!0})},Kf={};_S(Kf,{EnterMarkerEvent:()=>rp,GotoMarkerDoneEvent:()=>Fc,HideMarkersEvent:()=>Fr,LeaveMarkerEvent:()=>ip,MarkerVisibilityEvent:()=>tp,MarkersPluginEvent:()=>Ln,RenderMarkersListEvent:()=>_p,SelectMarkerEvent:()=>ap,SelectMarkerListEvent:()=>cp,SetMarkersEvent:()=>pp,ShowMarkersEvent:()=>zr,UnselectMarkerEvent:()=>up});var Ln=class extends Bd{},$f=class ig extends Ln{constructor(t,e){super(ig.type),this.marker=t,this.visible=e}};$f.type="marker-visibility";var tp=$f,ep=class sg extends Ln{constructor(t){super(sg.type),this.marker=t}};ep.type="goto-marker-done";var Fc=ep,np=class rg extends Ln{constructor(t){super(rg.type),this.marker=t}};np.type="leave-marker";var ip=np,sp=class og extends Ln{constructor(t){super(og.type),this.marker=t}};sp.type="enter-marker";var rp=sp,op=class ag extends Ln{constructor(t,e,s){super(ag.type),this.marker=t,this.doubleClick=e,this.rightClick=s}};op.type="select-marker";var ap=op,lp=class lg extends Ln{constructor(t){super(lg.type),this.marker=t}};lp.type="select-marker-list";var cp=lp,hp=class cg extends Ln{constructor(t){super(cg.type),this.marker=t}};hp.type="unselect-marker";var up=hp,dp=class hg extends Ln{constructor(){super(hg.type)}};dp.type="hide-markers";var Fr=dp,fp=class ug extends Ln{constructor(t){super(ug.type),this.markers=t}};fp.type="set-markers";var pp=fp,mp=class dg extends Ln{constructor(){super(dg.type)}};mp.type="show-markers";var zr=mp,gp=class fg extends Ln{constructor(t){super(fg.type),this.markers=t}};gp.type="render-markers-list";var _p=gp,vS=`<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
|
+
`,Hr=class extends cn{constructor(n){super(n,{className:"psv-markers-button",icon:vS,hoverScale:!0,collapsable:!0,tabbable:!0}),this.plugin=this.viewer.getPlugin("markers"),this.plugin&&(this.plugin.addEventListener(zr.type,this),this.plugin.addEventListener(Fr.type,this),this.toggleActive(!0))}destroy(){this.plugin&&(this.plugin.removeEventListener(zr.type,this),this.plugin.removeEventListener(Fr.type,this)),super.destroy()}isSupported(){return!!this.plugin}handleEvent(n){n instanceof zr?this.toggleActive(!0):n instanceof Fr&&this.toggleActive(!1)}onClick(){this.plugin.toggleAllMarkers()}};Hr.id="markers";var vp=`<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
|
+
`,ha="http://www.w3.org/2000/svg",Ne="psvMarker",yS=ae.dasherize(Ne),Vr="marker",Ys="markersList",zc={amount:2,duration:100,easing:"linear"},ES=(n,t)=>`
|
|
3892
3892
|
<div class="psv-panel-menu psv-panel-menu--stripped">
|
|
3893
|
-
<h1 class="psv-panel-menu-title">${
|
|
3893
|
+
<h1 class="psv-panel-menu-title">${vp} ${t}</h1>
|
|
3894
3894
|
<ul class="psv-panel-menu-list">
|
|
3895
3895
|
${n.map(e=>`
|
|
3896
|
-
<li data-${
|
|
3896
|
+
<li data-${yS}="${e.id}" class="psv-panel-menu-item" tabindex="0">
|
|
3897
3897
|
${e.type==="image"?`<span class="psv-panel-menu-item-icon"><img src="${e.definition}"/></span>`:""}
|
|
3898
3898
|
<span class="psv-panel-menu-item-label">${e.getListContent()}</span>
|
|
3899
3899
|
</li>
|
|
3900
3900
|
`).join("")}
|
|
3901
3901
|
</ul>
|
|
3902
3902
|
</div>
|
|
3903
|
-
`,ua=class extends cn{constructor(n){super(n,{className:" psv-markers-list-button",icon:mp,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===Ys):n instanceof jt.HidePanelEvent&&this.toggleActive(!1)}onClick(){this.plugin.toggleMarkersList()}};ua.id="markersList";var gp=new Y,_S=new ji,_p=new Y,vS=class extends on{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}},$n=new Ue,yS=new Ue,ES=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 D,C;v.isOrthographicCamera&&(D=-(v.right+v.left)/2,C=(v.top+v.bottom)/2);const A=v.view&&v.view.enabled?v.view.height/v.view.fullHeight:1,U=v.isOrthographicCamera?`scale( ${A} )scale(`+g+")translate("+p(D)+"px,"+p(C)+"px)"+m(v.matrixWorldInverse):`scale( ${A} )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),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,D){if(w.visible===!1){E(w);return}if(w.isCSS3DObject){const C=w.layers.test(g.layers)===!0,A=w.element;if(A.style.display=C===!0?"":"none",C===!0){w.onBeforeRender(t,v,g);let U;w.isCSS3DSprite?($n.copy(g.matrixWorldInverse),$n.transpose(),w.rotation2D!==0&&$n.multiply(yS.makeRotationZ(w.rotation2D)),w.matrixWorld.decompose(gp,_S,_p),$n.setPosition(gp),$n.scale(_p),$n.elements[3]=0,$n.elements[7]=0,$n.elements[11]=0,$n.elements[15]=1,U=_($n)):U=_(w.matrixWorld);const B=l.objects.get(w);if(B===void 0||B.style!==U){A.style.transform=U;const N={style:U};l.objects.set(w,N)}A.parentNode!==d&&d.appendChild(A),w.onAfterRender(t,v,g)}}for(let C=0,A=w.children.length;C<A;C++)S(w.children[C],v,g)}}},xS=class{constructor(n){this.viewer=n,this.element=document.createElement("div"),this.element.className="psv-markers-css3d-container",this.renderer=new ES({element:this.element}),this.scene=new Kl,this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(e=>{const s=e.target[Oe];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)}},da=(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))(da||{});function zc(n,t=!1){const e=[];if(Object.keys(da).forEach(s=>{n[s]&&e.push(s)}),e.length===0&&!t)throw new $t(`missing marker content, either ${Object.keys(da).join(", ")}`);if(e.length>1)throw new $t(`multiple marker content, either ${Object.keys(da).join(", ")}`);return e[0]}var vp=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=zc(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=zc(n,!0);if(t!==void 0&&t!==this.type)throw new $t(`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)}},Hc=class extends vp{get domElement(){return this.element}constructor(n,t,e){super(n,t,e)}afterCreateElement(){this.element[Oe]=this}destroy(){delete this.element[Oe],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)}},fa=class extends Hc{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 $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||Fc: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?xe.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)*Gs.EASINGS.inQuad(n/100)}if(Array.isArray(this.config.scale.yaw)){const[r,a]=this.config.scale.yaw,l=xe.degToRad(this.viewer.state.hFov)/2,h=Math.abs(ae.getShortestArc(this.state.position.yaw,t.yaw));s*=a+(r-a)*Gs.EASINGS.outQuad(Math.max(0,(l-h)/l))}}e&&this.config.hoverScale&&(s*=this.config.hoverScale.amount),this.domElement.style.scale=`${s}`}},wS=`// https://www.8thwall.com/playground/chromakey-threejs
|
|
3903
|
+
`,ua=class extends cn{constructor(n){super(n,{className:" psv-markers-list-button",icon:vp,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===Ys):n instanceof jt.HidePanelEvent&&this.toggleActive(!1)}onClick(){this.plugin.toggleMarkersList()}};ua.id="markersList";var yp=new Y,xS=new ji,Ep=new Y,wS=class extends on{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}},$n=new Oe,SS=new Oe,MS=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 D,C;v.isOrthographicCamera&&(D=-(v.right+v.left)/2,C=(v.top+v.bottom)/2);const A=v.view&&v.view.enabled?v.view.height/v.view.fullHeight:1,U=v.isOrthographicCamera?`scale( ${A} )scale(`+g+")translate("+p(D)+"px,"+p(C)+"px)"+m(v.matrixWorldInverse):`scale( ${A} )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),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,D){if(w.visible===!1){E(w);return}if(w.isCSS3DObject){const C=w.layers.test(g.layers)===!0,A=w.element;if(A.style.display=C===!0?"":"none",C===!0){w.onBeforeRender(t,v,g);let U;w.isCSS3DSprite?($n.copy(g.matrixWorldInverse),$n.transpose(),w.rotation2D!==0&&$n.multiply(SS.makeRotationZ(w.rotation2D)),w.matrixWorld.decompose(yp,xS,Ep),$n.setPosition(yp),$n.scale(Ep),$n.elements[3]=0,$n.elements[7]=0,$n.elements[11]=0,$n.elements[15]=1,U=_($n)):U=_(w.matrixWorld);const B=l.objects.get(w);if(B===void 0||B.style!==U){A.style.transform=U;const N={style:U};l.objects.set(w,N)}A.parentNode!==d&&d.appendChild(A),w.onAfterRender(t,v,g)}}for(let C=0,A=w.children.length;C<A;C++)S(w.children[C],v,g)}}},TS=class{constructor(n){this.viewer=n,this.element=document.createElement("div"),this.element.className="psv-markers-css3d-container",this.renderer=new MS({element:this.element}),this.scene=new $l,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)}},da=(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))(da||{});function Hc(n,t=!1){const e=[];if(Object.keys(da).forEach(s=>{n[s]&&e.push(s)}),e.length===0&&!t)throw new te(`missing marker content, either ${Object.keys(da).join(", ")}`);if(e.length>1)throw new te(`multiple marker content, either ${Object.keys(da).join(", ")}`);return e[0]}var xp=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=Hc(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=Hc(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)}},Vc=class extends xp{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)}},fa=class extends Vc{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||zc: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?xe.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)*Gs.EASINGS.inQuad(n/100)}if(Array.isArray(this.config.scale.yaw)){const[r,a]=this.config.scale.yaw,l=xe.degToRad(this.viewer.state.hFov)/2,h=Math.abs(ae.getShortestArc(this.state.position.yaw,t.yaw));s*=a+(r-a)*Gs.EASINGS.outQuad(Math.max(0,(l-h)/l))}}e&&this.config.hoverScale&&(s*=this.config.hoverScale.amount),this.domElement.style.scale=`${s}`}},bS=`// https://www.8thwall.com/playground/chromakey-threejs
|
|
3904
3904
|
|
|
3905
3905
|
uniform sampler2D map;
|
|
3906
3906
|
uniform float alpha;
|
|
@@ -3936,7 +3936,7 @@ void main(void) {
|
|
|
3936
3936
|
gl_FragColor.a *= alpha;
|
|
3937
3937
|
}
|
|
3938
3938
|
}
|
|
3939
|
-
`,
|
|
3939
|
+
`,AS=`varying vec2 vUv;
|
|
3940
3940
|
uniform vec2 repeat;
|
|
3941
3941
|
uniform vec2 offset;
|
|
3942
3942
|
|
|
@@ -3944,4 +3944,4 @@ void main() {
|
|
|
3944
3944
|
vUv = uv * repeat + offset;
|
|
3945
3945
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3946
3946
|
}
|
|
3947
|
-
`,MS=class extends pi{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 Ce(65280)},similarity:{value:.2},smoothness:{value:.2},spill:{value:.1}},vertexShader:SS,fragmentShader:wS}),this.chromaKey=n?.chromaKey}};function TS({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 bS(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 AS(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 yp(n){return n.reduce((t,e)=>t.add(e),new Y).normalize()}function CS(n){const t=AS(n);let e=0;const s=[];for(let a=0;a<t.length-1;a++){const l=ae.greatArcDistance(t[a],t[a+1])*Gs.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 bS(t[a],t[a+1],l)}r+=s[a]}return t[Math.round(t.length/2)]}var pa=new Y,Ep=new Y,Vc=new Y,xp=new Y,wp=new Y,Sp=new Y;function PS(n,t,e){pa.copy(e).normalize(),Ep.crossVectors(n,t).normalize(),Vc.crossVectors(Ep,n).normalize(),xp.copy(n).multiplyScalar(-pa.dot(Vc)),wp.copy(Vc).multiplyScalar(pa.dot(n));const s=new Y().addVectors(xp,wp).normalize();return Sp.crossVectors(s,pa),s.applyAxisAngle(Sp,.01).multiplyScalar(Gs.SPHERE_RADIUS)}var RS=class extends vp{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 MS({alpha:0}),t=new Er(1,1),e=new dn(t,n);e.userData={[Oe]:this},Object.defineProperty(e,"visible",{enumerable:!0,get:function(){return this.userData[Oe].config.visible},set:function(s){this.userData[Oe].config.visible=s}}),this.element=new Oi().add(e),this.type==="videoLayer"&&this.viewer.needsContinuousUpdate(!0)}destroy(){delete this.threeMesh.userData[Oe],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 $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 Y;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=yp(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=TS({src:this.config.videoLayer,withCredentials:this.viewer.config.withCredentials(this.config.videoLayer),muted:!0,autoplay:this.config.autoplay??!0}),a=new Qv(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[Oe]={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[Oe]={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[Oe];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)}},LS=class extends Hc{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 vS(this.element),this.object.userData={[Oe]:this},Object.defineProperty(this.object,"visible",{enumerable:!0,get:function(){return this.userData[Oe].config.visible},set:function(n){this.userData[Oe].config.visible=n}}),this.afterCreateElement()}destroy(){delete this.object.userData[Oe],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 $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)}},IS=class extends fa{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}}},DS=class extends Hc{constructor(n,t,e){super(n,t,e)}createElement(){this.element=document.createElementNS(ha,"path"),this.element[Oe]=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 $t("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 $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=yp(this.positions3D[0]);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(e)}else{const e=CS(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:PS(r.visible,r.invisible,this.viewer.state.direction),visible:!0})}),e.filter(r=>r.visible).map(r=>this.viewer.dataHelper.vector3ToViewerCoords(r.vector))}},kS=class extends fa{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(ha,n);this.element=document.createElementNS(ha,"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)")}},US=ae.getConfigParser({clickEventOnMarker:!1,gotoMarkerSpeed:"8rpm",markers:null,defaultHoverScale:null},{defaultHoverScale(n){return n?(n===!0&&(n=Fc),typeof n=="number"&&(n={amount:n}),{...Fc,...n}):null}});function OS(n){switch(zc(n,!1)){case"image":case"html":case"element":return IS;case"imageLayer":case"videoLayer":return RS;case"elementLayer":return LS;case"polygon":case"polyline":case"polygonPixels":case"polylinePixels":return DS;case"square":case"rect":case"circle":case"ellipse":case"path":return kS;default:throw new $t("invalid marker type")}}var Gr=class ug extends zf{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(ha,"svg"),this.svgContainer.setAttribute("class","psv-markers-svg-container"),this.container.appendChild(this.svgContainer),this.css3DContainer=new xS(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[ug,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(Oe),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===Oe){const e=t.originalEvent,s=t.object.userData[Oe];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 zr)}hideAllMarkers(){this.state.allVisible=!1,Object.values(this.markers).forEach(t=>{t.config.visible=!1}),this.renderMarkers(),this.dispatchEvent(new Fr)}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(OS(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 Bc(s))}):(this.viewer.rotate(s.state.position),ae.isNil(s.config.zoomLvl)||this.viewer.zoom(s.config.zoomLvl),this.dispatchEvent(new Bc(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:Vr,content:e.config.content}):this.hideMarkerPanel()}hideMarkerPanel(){this.viewer.panel.hide(Vr)}toggleMarkersList(){this.viewer.panel.isVisible(Ys)?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 pp(t);this.dispatchEvent(e),t=e.markers,this.viewer.panel.show({id:Ys,content:gS(t,this.viewer.config.lang[Hr.id]),noMargin:!0,clickHandler:s=>{const r=ae.getClosest(s,".psv-panel-menu-item"),a=r?r.dataset[Oe]:void 0;if(a){const l=this.getMarker(a);this.dispatchEvent(new op(l)),this.gotoMarker(l.id),this.hideMarkersList()}}})}hideMarkersList(){this.viewer.panel.hide(Ys)}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 Jf(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[Oe]:void 0}else return Array.isArray(t)?t.map(s=>s.userData[Oe]).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 np(e)),e instanceof fa&&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 tp(t)),t instanceof fa&&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 lp(this.state.currentMarker)),this.viewer.panel.hide(Vr),!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 sp(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 up(this.getMarkers()))}__refreshUi(){const t=Object.values(this.markers).filter(e=>!e.config.hideList).length;t===0?(this.viewer.panel.hide(Vr),this.viewer.panel.hide(Ys)):this.viewer.panel.isVisible(Ys)?this.showMarkersList():this.viewer.panel.isVisible(Vr)&&(this.state.currentMarker?this.showMarkerPanel(this.state.currentMarker.id):this.viewer.panel.hide()),this.viewer.navbar.getButton(Hr.id,!1)?.toggle(t>0),this.viewer.navbar.getButton(ua.id,!1)?.toggle(t>0)}__checkObjectsObserver(){Object.values(this.markers).some(e=>e.is3d())?this.viewer.observeObjects(Oe):this.viewer.unobserveObjects(Oe)}};Gr.id="markers",Gr.VERSION="5.14.0",Gr.configParser=US,Gr.readonlyOptions=["markers"];var Mp=Gr;_i.lang[Hr.id]="Markers",_i.lang[ua.id]="Markers list",kc(Hr,"caption:left"),kc(ua,"caption:left");const{cloneDeep:Tp,deepMergeProps:NS,getDiffProps:BS}=Tt.utils;function FS(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(Tp(mh)),p=y.computed(()=>d.value);y.watch(()=>Tp(n.value?.viewer),m,{immediate:!0,deep:!0});function m(it,tt){const gt=BS(it,tt);E(gt)}function _(){return p.value}function E(it){it&&NS(d.value,it)}function S(){y.unref(e)?.container?.addEventListener("mousedown",g),y.unref(e)?.container?.addEventListener("touchstart",g),y.unref(e)?.container?.addEventListener("mouseover",D),y.unref(e)?.container?.addEventListener("mouseout",C),y.unref(e)?.addEventListener(jt.ReadyEvent.type,it=>{r("ready",it)}),y.unref(e)?.addEventListener(jt.SizeUpdatedEvent.type,it=>{r("size-updated",it)}),y.unref(e)?.addEventListener(jt.PanoramaLoadedEvent.type,it=>{r("panorama-loaded",it)}),y.unref(e)?.addEventListener(jt.PanoramaErrorEvent.type,it=>{r("panorama-error",it)}),y.unref(e)?.addEventListener(jt.ClickEvent.type,it=>{r("click",it)}),y.unref(e)?.addEventListener(jt.PositionUpdatedEvent.type,it=>{r("position-updated",it)}),y.unref(e)?.addEventListener(jt.ZoomUpdatedEvent.type,it=>{r("zoom-updated",it)})}function w(){}function v(it){r("panorama-complete",it)}function g(it){r("mousedown",it)}function D(it){Z(!0)}function C(it){Z(!1)}function A(it){const{yaw:tt=0,pitch:gt=0,zoomLevel:It=0}=it;E({defaultYaw:tt,defaultPitch:gt,defaultZoomLvl:It}),y.unref(e)?.rotate({yaw:tt,pitch:gt}),y.unref(e)?.zoom(It)}function U(it){if(Tt.utils.isObject(it)){let{panoramaOptions:tt}=y.unref(d)||{};tt={...tt,...it},E({panoramaOptions:tt})}}async function B(it,tt){if(l.value){a.value={path:it,options:tt};return}try{l.value=!0;const gt=N(tt);await e.value?.setPanorama(it,gt),await F(it)}catch(gt){console.error(gt)}finally{l.value=!1,I(),v(a.value)}}function N(it){const{panoramaOptions:tt}=p.value;let gt={};return(n.value?.playbar?.speed??0)<600&&(gt={transition:{speed:100}}),{showLoader:!1,transition:{speed:500},...tt,...it,...gt}}async function F(it){try{if(Tt.utils.isObject(it)){const tt=it.tileUrl(Math.floor(it.cols/2),0);if(tt){const gt=await fetch(tt);if(gt.ok)return await gt.blob()}}}catch{}}async function I(){if(await y.nextTick(),a.value){const{path:it,options:tt}=a.value;a.value=void 0,B(it,tt)}}async function M(){let{currentPoint:it,currentRecord:tt}=y.unref(t)||{};if(it&&tt){const gt=tt.getPreloadPoints(it);for(const It of gt)if(!h.value.has(It.id)&&!u.value.has(It.id)){u.value.add(It.id);const{panorama:ee}=It||{},Yt=[];if(Tt.utils.isObject(ee)){const J=ee.tileUrl(Math.floor(ee.cols/2),0);Yt.push(fetch(ee.baseUrl),fetch(J))}else Yt.push(fetch(ee));Promise.all(Yt).then(()=>{h.value.add(It.id)}).finally(()=>{u.value.delete(It.id)}).catch(J=>{console.error(J)})}}}function k(){H()}function H(){const{handleViolationMarkerFn:it,handlePathMarkerFn:tt}=y.unref(n)?.marker||{},{currentPoint:gt,currentRecord:It,currentMarker:ee}=y.unref(t)||{};if(gt&&It){const Yt=It?.getPathMarkers(gt)?.map(pt=>tt?.(pt)||pt),J=It?.getViolationMarkers(gt)?.map(pt=>it?.(pt)||pt),ct=[...Yt,...J];if(y.unref(s)?.setMarkers(ct),ee){const pt=J.find(Nt=>Nt.data.id===ee.id);if(!pt)return;y.unref(s)?.gotoMarker(pt.id,100)}}}function Z(it){E({moveover:it})}function Q(it){E({mousedown:it})}function at(){return y.unref(d)?.moveover??!1}function $(){return y.unref(d)?.mousedown??!1}function dt(){const{currentPoint:it}=y.unref(t)||{};it&&B(it?.panorama)}return{getProps:p,viewerAction:{getState:_,setState:E,isMouseover:at,isMousedown:$,setMousedown:Q,setMouseover:Z,setPanoramaPath:B,setPanoramaOptions:U,setVewerStatus:A,updateMarkers:H,preloadPanorama:M,loadMarkers:k,refresh:dt},handleViewerEvents:S,handleUninstallEvents:w}}var ma=(n=>(n[n.NUMBER=0]="NUMBER",n[n.DISTANCE=1]="DISTANCE",n))(ma||{}),Gc=(n=>(n.pin="pin",n))(Gc||{}),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))(Ze||{});const{cloneDeep:bp,deepMergeProps:zS,getDiffProps:HS}=Tt.utils;function VS(n,t,e,s,r){const a=y.ref(bp(_h)),l=y.computed(()=>a.value);y.watch(()=>bp(n.value?.marker),h,{immediate:!0,deep:!0});function h(_,E){const S=HS(_,E);u(S)}function u(_){_&&zS(a.value,_)}function d(){y.unref(s)?.addEventListener(Qf.SelectMarkerEvent.type,p)}async function p(_){const{id:E,data:S}=_.marker.config,{onPointChange:w,onMarkerChange:v}=l.value;S.markerType==Gc.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 GS={class:"vsleem-viewer"},Ap=bn(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}=FS(d,p,r,a,s),{handleMarkerEvents:S,markerAction:w}=VS(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(A),y.onBeforeUnmount(D);function v(U){U&&(g(),_(),S())}function g(){if(y.unref(r))return;const U=m.value,B=l.value,N=p.value?.currentPoint?.panorama??"",F=Tt.utils.isObject(N)?uS:void 0,I=new $w({...U,container:B,panorama:N,adapter:F,plugins:[[Mp,[]]]}),M=I.getPlugin(Mp);r.value=Object.assign(I,E),a.value=Object.assign(M,w)}function D(){r.value?.destroy()}function C(U,B){h.value=U,u.value=B}function A(){s("register",r,a,C)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(U,B)=>(y.openBlock(),y.createElementBlock("div",GS,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-b1c7fac3"]]);function WS(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 ZS(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 XS(n,t){return Tt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:Tt.RequestMethod.GET,params:n},t)}class qs{id="";img="";patrolId="";coordinate=new Tt.Coordinate;point=new Tt.Point;position;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=Tt.Point.toRadians(Number(m)||0),D=new Tt.Point({x:a,y:l,z:h,lon:u,lat:d,alt:p,yaw:g});return _&&(v.panorama=Gg(_,s,r)),(D.hasXYZ||D.hasXYZ)&&(v.point=D),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 qs(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 Wr{id="";pointId="";patrolId="";coordinateId=0;coordinate=new Tt.Coordinate;point=new Tt.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(r){const d=Tt.RelativeMap.toParse(r);u=new Tt.Coordinate({parent:u,type:Tt.CoordinateType.Data,relativeMap:d})}h.coordinate=u}return a&&(h.perspective=Tt.Position.toParse(a)),l&&(h.point=Tt.Point.toParse(l)),h}projection(t){if(!this.coordinate||!this.point)return;const e=this.coordinate.getDestRelativeMap(t);if(!e)return;const s=new Wr(this),r=s.point?.projection(e,s.coordinate,t);if(r)return s.point=r,s.coordinate=t,s}}class Qs{id="";coordinateId=0;coordinate=new Tt.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=Tt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(a){const S=Tt.RelativeMap.toParse(a);E=new Tt.Coordinate({parent:E,type:Tt.CoordinateType.Data,relativeMap:S})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await Wg(l?.[0]?.img,s);d.panoramaSize=E;const S=new Map;for(const w of l){const v=qs.parsedModel({...w,patrolId:p,color:_},m,E,s);v.id&&S.set(v.id,new qs(v))}d.trackPoints=S}if(h?.length&&e){const E=new Map;for(const S of h){const w=Wr.parsedModel({...S,patrolId:p},e);w.id&&E.set(w.id,new Wr(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}=s||{},E=new Map;let S;for(const v of a.values()){const g=v.projection(p,m);if(!g)continue;if(g.index=E.size,_<=0){E.set(g.id,g);continue}if(d.find(C=>C.pointId===g.id)){E.set(g.id,g),S=g;continue}if(!E.size){E.set(g.id,g),S=g;continue}g.position&&S?.position&&Tt.Point.distXY(g.position,S.position)>=_&&(E.set(g.id,g),S=g)}const w=new Qs(this);return w.trackPoints=E,w.coordinate=t,w.realseeSetting=s,w}getPathMarkers(t){const{pointType:e=ma.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===ma.NUMBER?l=this.getPointsByNumber(a,s):e===ma.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:Tt.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}=qs.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 Tt.Position({yaw:p,pitch:m}),data:{...h,markerType:Gc.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 Tt.Position({yaw:Tt.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)}}function YS(n,{setReferPoint:t}){const e=y.ref(),s=y.ref(),r=y.reactive(new Map),a=y.ref(!1),l=y.ref(!1),h=y.ref(),u=y.ref(),d=y.ref(),p=y.ref(),m=y.computed(()=>e.value?.findCsById(h.value)),_=y.computed(()=>m.value?.findParentSpace()),E=y.computed(()=>Tt.Coordinate.getCommonCoordinate(Array.from(r.values(),st=>st.coordinate))),S=y.computed(()=>r.get(u.value??"")),w=y.computed(()=>A.value.get(u.value??"")),v=y.computed(()=>S.value?.getPoint(d.value??"")),g=y.computed(()=>w.value?.getPoint(d.value??"")),D=y.computed(()=>w.value?.getMarker(p.value??"")),C=y.computed(()=>w.value?.getPointMarkers(g.value?.id??"")||[]),A=y.computed(()=>{const st=new Map;if(!m.value||!E.value)return st;for(const lt of r.values()){const Dt=lt.projection(m.value,E.value,n.value.realseeSetting);Dt&&st.set(Dt.id,Dt)}return st}),U=y.computed(()=>{const st=new Map;if(!A.value.size)return st;for(const lt of A.value.values()){const{trackMarkers:Dt}=lt;for(const Bt of Dt.values()){const R=lt.getPoint(Bt.pointId);if(R){const ht=st.get(R)??[];ht.push(Bt),ht.length===1&&st.set(R,ht)}}}return st});async function B(st){const{projectId:lt,patrolId:Dt}=st||{},Bt=Dt?Array.isArray(Dt)?Dt:[Dt]:[];try{if(!lt||!Bt.length)throw new Tt.AppError(Ze.StoreMissParams,"缺少必要的查询参数");if(a.value=!0,lt!=e.value?.projectId){const vt=await Tt.DataSource.getCoordinateTree(lt);if(!vt)throw new Tt.AppError(Ze.StoreNoCSTree,`未查询到项目ID为 ${lt} 的坐标系树`);e.value=vt}const[R,...ht]=Bt,ft=await N(R);if(!ft)return;const At=ft.coordinate.findChildModel([Tt.CoordinateModelType.CADModel,Tt.CoordinateModelType.GeoModel]);if(!At?.modelValue)throw new Tt.AppError(Ze.StroeNoModelValue,`没有找到当前坐标系${At?.id||""}的modelKey字段值`);s.value=At?.getMappedCsTree(),r.clear(),r.set(ft.id,ft),I({modelCsId:At?.id,...st}),tt(ht)}catch(R){console.error(R),n.value.fetchError?.(R)}finally{a.value=!1}}async function N(st){try{let lt=await XS({...n.value.fetchParams,id:st});if(lt=await n.value.handleResponseFn?.(lt)||lt,!lt)throw new Tt.AppError(Ze.StoreNoRecord,`未查询到ID为 ${st} 的巡检记录`);const Dt=ee();lt.color=lt.color||Dt;const{appSetting:Bt}=n.value,R=await Qs.parsedModel(lt,e.value,Bt);if(!R?.trackPoints?.size||!R.coordinate)throw new Tt.AppError(Ze.StoreInvRecord,`ID为 ${st} 是无效的巡检记录`);let ht;if(a.value?ht=e.value?.findCsById(R.coordinateId):s.value&&(ht=s.value.findCsById(R.coordinateId)),!ht)throw new Tt.AppError(Ze.StoreRecordOutCSTree,`ID为 ${st} 的巡检记录不在映射坐标系树内`);if(ht?.modelType===Tt.CoordinateModelType.GeoModel){const At=e.value?.findClosestModel(Tt.CoordinateModelType.GeoModel);if(At&&!At.relativeMap?.refPoint){const vt=Array.from(R.trackPoints.values()),qt=new Tt.GeoPoint(vt[0].point),Mt=new Tt.RelativeMap({refPoint:qt});At.setOptions({relativeMap:Mt})}}const ft=new Qs(R);return n.value.fetchSuccess?.(ft,e.value),ft}catch(lt){console.error(lt),n.value.fetchError?.(lt)}}function F(st=!1){l.value=st}function I(st){const{patrolId:lt,pointId:Dt,modelCsId:Bt}=st,R=lt?Array.isArray(lt)?lt:[lt]:[],ht=r.get(R[0]);if(ht){const ft=Array.from(ht.trackPoints.values());u.value=ht.id,d.value=Dt??ft[0]?.id}Bt&&(h.value=Bt)}function M(st){const{id:lt}=st;if(s.value?.findCsById(lt)?.type===Tt.CoordinateType.Model)h.value=lt;else throw new Tt.AppError(Ze.StoreNoCSByID,`ID为 ${lt} 的模型坐标系不在映射坐标系树内`)}function k(st){const lt=G(st.id??"");if(!lt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到ID为 ${st.id} 的巡检记录`);const Dt=Array.from(lt.trackPoints.values());u.value=lt.id,d.value=Dt[0]?.id}function H(st){const{patrolId:lt,id:Dt=""}=st,Bt=G(lt??"");if(!Bt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${lt} 的巡检记录`);if(!Bt?.hasPoint(Dt))throw new Tt.AppError(Ze.StoreSelectNoPoint,`未找到ID为 ${Dt} 的轨迹点`);u.value=Bt.id,d.value=Dt}function Z(st){if(st){const{patrolId:lt,id:Dt=""}=st,Bt=G(lt??"");if(!Bt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${lt} 的巡检记录`);if(!Bt?.hasMarker(Dt))throw new Tt.AppError(Ze.StoreSelectNoMarker,`未找到ID为 ${Dt} 的问题标记`);p.value=Dt}else p.value=void 0}function Q(st){const lt=r.get(st.patrolId);if(!lt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);lt.trackMarkers.set(st.id,st)}function at(st){const lt=r.get(st.patrolId??"");if(!lt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);lt.trackMarkers.delete(st.id??"")}function $(st){const lt=r.get(st.patrolId??"");if(!lt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);const Dt=lt.trackMarkers.get(st.id??"");if(!Dt)throw new Tt.AppError(Ze.StoreSelectNoMarker,`未找到ID为 ${st.id} 的问题标记`);Object.assign(Dt,st)}function dt(st){return A.value.has(st)}function G(st){return A.value.get(st)}async function it(st){if(!r.has(st)){const lt=await N(st);if(lt){const Dt=new Qs(lt);return r.set(Dt.id,Dt),Dt}}}async function tt(st){if(st.length)for(const lt of st)await it(lt)}function gt(st){if(w.value?.id===st)throw new Tt.AppError(Ze.StoreSelectedMarker,`ID为 ${st} 的巡检记录正在被使用,无法删除`);return r.delete(st)}async function It(st){const lt=r.get(st.id??"");if(!lt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到ID为 ${st.id} 的巡检记录`);Object.assign(lt,st)}function ee(){const st=a.value?[]:Array.from(r.values()).map(Dt=>Dt.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find(Dt=>!st.includes(Dt?.toUpperCase?.()))}function Yt(){return m.value?.findClosestModel(Tt.CoordinateModelType.BIMModel)}function J(st){let lt=1/0,Dt;if(st.position){for(const Bt of A.value.values())if(Bt.trackPoints?.size)for(const R of Bt.trackPoints.values()){if(!R.position)continue;const ht=Tt.Point.distXY(st.position,R.position);if(ht===0){lt=ht,Dt=R;break}ht<lt&&(lt=ht,Dt=R)}if(Dt)return Dt}}function ct(st){if(!m.value||!E.value||!st)return;const lt=e.value?.findCsById(st.coordinate.id);if(!lt)return;const Dt=lt?.getDestRelativeMap(m.value),Bt=lt?.getDestRelativeMap(E.value);if(!Dt||!Bt)return;const R={srcToDstRelativeMap:Dt,srcCoordinate:lt,dstCoordinate:m.value},ht={srcToDstRelativeMap:Bt,srcCoordinate:lt,dstCoordinate:E.value};return st.projection(R,ht)}function pt(){return Nt.value}const Nt=y.computed(()=>({ready:l.value,rawDataSource:r,coordinateTree:e.value,mappedCoordinateTree:s.value,dataSource:A.value,comCoordinate:E.value,currentModel:m.value,currentSpace:_.value,currentRawRecord:S.value,currentRecord:w.value,currentRawPoint:v.value,currentPoint:g.value,currentMarker:D.value,currentPointMarkers:C.value,groupedMarkers:U.value,reload:B,fetchRecord:N,selectModel:M,selectRecord:k,selectPoint:H,selectMarker:Z,setReferPoint:t,addMarker:Q,removeMarker:at,updateMarker:$,hasRecord:dt,getRecord:G,addRecord:it,batchAddRecords:tt,removeRecord:gt,updateRecord:It,findClosestBIMModel:Yt,findClosestPoint:J,normalizeToModelPoint:ct}));return{storeRef:Nt,getStore:pt,setReady:F}}function qS(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:Cp,deepMergeProps:QS,getDiffProps:jS}=Tt.utils;function Pp(n,t){const e=y.ref(Cp(vh)),s=y.computed(()=>e.value);y.watch(()=>Cp(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>A(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=YS(s,{setReferPoint:B}),{register:h,getViewer:u,getMarker:d}=qS(s,r),{register:p,getMap:m}=WS(s,r),{register:_,getPlaybar:E}=ZS(s,r);y.onMounted(S),y.onBeforeUnmount(w);async function S(){const{appSetting:N,immediate:F}=y.unref(s);N&&Tt.http.setRequestGlobalConfig(N),F&&(await A(!0),setTimeout(C,0))}function w(){t?.("destroy")}function v(N,F){const I=jS(N,F);D(I)}function g(){return s.value}function D(N){N&&QS(e.value,N)}function C(){l(!0),t?.("ready")}async function A(N){const{searchInfo:F}=s.value;N&&F&&(await r.value?.reload(F),t?.("reload"))}function U(){const N=Tt.utils.cloneDeep(s.value),F=a();if(F){const{currentModel:Z,currentRecord:Q,currentPoint:at}=F,{projectId:$=0,id:dt=""}=Q||{},G=at?.id,it=Z?.id;N.searchInfo={projectId:$,patrolId:dt,pointId:G,modelCsId:it}}const I=u();if(I){const Z=Tt.utils.cloneDeep(s.value.viewer),Q=I.getPosition(),at=I.getZoomLevel(),{yaw:$,pitch:dt}=Q||{};N.viewer={...Z,defaultZoomLvl:at,defaultYaw:$,defaultPitch:dt}}d()&&(N.marker=Tt.utils.cloneDeep(s.value.marker));const k=m();if(k){const{size:Z,radarAngle:Q,...at}=k.getState()||{};N.map={...at}}const H=E();if(H){const{showPlay:Z,showSpeed:Q,...at}=H.getState()||{};N.playbar={...at,showPlay:!1,showSpeed:!1}}return N}function B(N,F){const I=a();if(I){const M=I.normalizeToModelPoint(N);if(!M?.point)return;const k=I.findClosestPoint(M);if(!k?.point)return;I?.selectPoint?.(k);const{yaw:H=0,pitch:Z=0,zoomLevel:Q=0}=F||{},at=M.point.yaw-k.point.yaw+H;u()?.setVewerStatus({yaw:at,pitch:Z,zoomLevel:Q})}}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:D}}function JS(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:m,coordinateTree:_,mappedCoordinateTree:E,currentSpace:S,currentModel:w,currentRecord:v,currentPoint:g,currentMarker:D,currentPointMarkers:C}=n.value||{};return{dataSource:m,coordinateTree:_,mappedCoordinateTree:E,currentSpace:S,currentModel:w,currentRecord:v,currentPoint:g,currentPointMarkers:C,currentMarker:D}});y.watch(()=>n.value?.currentModel?.id,m=>{m&&h(n.value?.currentModel)},{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,m=>{m&&u(n.value?.currentRecord)},{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,m=>{m&&d(n.value?.currentPoint)},{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m=>{m&&p()},{immediate:!0});function h(m){r("change-model",m)}function u(m){r("change-record",m)}function d(m){t()?.refresh?.(),r("change-point",m)}function p(){const{currentRecord:m,currentRawPoint:_,selectPoint:E}=n.value;if(m?.id===_?.patrolId){const S=m?.getNearPoint(_?.rawIndex||0);S&&E?.(S)}}return{getShow:a,getBindValue:l}}function KS(n,t){function e(){t("map-ready")}function s(){t("map-resize")}function r(d){t("map-collapse",d)}function a(){t("map-dragger")}function l(d){t("map-angle-updated",d)}function h(d,p){t("map-select-point",d,p)}return{mapEvents:{ready:e,resize:s,collapse:r,dragger:a,angleUpdated:l,selectPoint:h}}}function $S(n,t){const{setState:e}=n;function s(){t("playbar-ready")}function r(E){t("playbar-backward",E)}function a(E){t("playbar-pause",E)}function l(E){t("playbar-play",E)}function h(E){t("playbar-forward",E)}function u(E){m(E),t("playbar-speed",E)}function d(E){t("playbar-slider",E)}function p(E){t("playbar-select-point",E)}function m(E){e({playbar:{speed:E}})}return{playbarEvents:{ready:s,backward:r,pause:a,play:l,forward:h,slider:d,speed:u,selectPoint:p}}}function tM(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(F){D(F),t("viewer-ready")}function h(F){t("viewer-click",F)}function u(F){C(),t("viewer-mousedown",F)}function d(F){D(F),t("viewer-size-updated",F)}function p(F){D(F),t("viewer-zoom-updated",F)}function m(F){g(F),t("viewer-position-updated",F,B(F))}function _(F){A(),t("viewer-panorama-loaded",F)}function E(F){t("viewer-panorama-error",F)}function S(F){U(F),t("viewer-panorama-complete")}function w(F){t("viewer-select-point",F)}function v(F){t("viewer-select-marker",F)}function g(F){e()?.setRadarYaw(F.position.yaw??0)}function D(F){e()?.setRadarHFov(F?.currentTarget?.state?.hFov??90)}function C(F){e()?.setCollapse(!0)}function A(F){const I=r();I&&(I.preloadPanorama(),I.loadMarkers())}function U(F){F||s()?.playNext()}function B(F){const{yaw:I,pitch:M}=F.position,{yaw:k,pitch:H}=y.unref(a);return a.value={yaw:I,pitch:M},{yaw:I-k,pitch:M-H}}return{viewerEvents:{ready:l,click:h,mousedown:u,sizeUpdated:d,zoomUpdated:p,positionUpdated:m,panoramaLoaded:_,panoramaError:E,panoramaComplete:S,selectPoint:w,selectMarker:v}}}const eM={class:"vsleem-realsee"},Rp=bn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>Da},viewer:{},marker:{},playbar:{default:()=>so},map:{default:()=>io},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}=Pp(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:S,getBindValue:w}=JS(p,m,_,E,r),{viewerEvents:v}=tM(d,r),{mapEvents:g}=KS(d,r),{playbarEvents:D}=$S(d,r);return t(d),(C,A)=>(y.openBlock(),y.createElementBlock("div",eM,[y.createVNode(Ap,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(xh,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(Sh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(D))),{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"]]);Be.MAP_CONFIG=io,Be.MARKER_CONFIG=_h,Be.Map=xh,Be.PLAYBAR_CONFIG=so,Be.Playbar=Sh,Be.REALSEE_CONFIG=vh,Be.REALSEE_SETTING=Da,Be.Realsee=Rp,Be.RealseePlugin=Rp,Be.TrackMarker=Wr,Be.TrackPoint=qs,Be.TrackRecord=Qs,Be.VIEWER_CONFIG=mh,Be.Viewer=Ap,Be.useRealsee=Pp,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})}));
|
|
3947
|
+
`,CS=class extends pi{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 Ce(65280)},similarity:{value:.2},smoothness:{value:.2},spill:{value:.1}},vertexShader:AS,fragmentShader:bS}),this.chromaKey=n?.chromaKey}};function PS({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 RS(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 LS(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 wp(n){return n.reduce((t,e)=>t.add(e),new Y).normalize()}function IS(n){const t=LS(n);let e=0;const s=[];for(let a=0;a<t.length-1;a++){const l=ae.greatArcDistance(t[a],t[a+1])*Gs.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 RS(t[a],t[a+1],l)}r+=s[a]}return t[Math.round(t.length/2)]}var pa=new Y,Sp=new Y,Gc=new Y,Mp=new Y,Tp=new Y,bp=new Y;function DS(n,t,e){pa.copy(e).normalize(),Sp.crossVectors(n,t).normalize(),Gc.crossVectors(Sp,n).normalize(),Mp.copy(n).multiplyScalar(-pa.dot(Gc)),Tp.copy(Gc).multiplyScalar(pa.dot(n));const s=new Y().addVectors(Mp,Tp).normalize();return bp.crossVectors(s,pa),s.applyAxisAngle(bp,.01).multiplyScalar(Gs.SPHERE_RADIUS)}var kS=class extends xp{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 CS({alpha:0}),t=new Er(1,1),e=new dn(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 Oi().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 Y;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=wp(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=PS({src:this.config.videoLayer,withCredentials:this.viewer.config.withCredentials(this.config.videoLayer),muted:!0,autoplay:this.config.autoplay??!0}),a=new $v(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)}},US=class extends Vc{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 wS(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)}},OS=class extends fa{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}}},NS=class extends Vc{constructor(n,t,e){super(n,t,e)}createElement(){this.element=document.createElementNS(ha,"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=wp(this.positions3D[0]);this.state.position=this.viewer.dataHelper.vector3ToSphericalCoords(e)}else{const e=IS(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:DS(r.visible,r.invisible,this.viewer.state.direction),visible:!0})}),e.filter(r=>r.visible).map(r=>this.viewer.dataHelper.vector3ToViewerCoords(r.vector))}},BS=class extends fa{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(ha,n);this.element=document.createElementNS(ha,"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)")}},FS=ae.getConfigParser({clickEventOnMarker:!1,gotoMarkerSpeed:"8rpm",markers:null,defaultHoverScale:null},{defaultHoverScale(n){return n?(n===!0&&(n=zc),typeof n=="number"&&(n={amount:n}),{...zc,...n}):null}});function zS(n){switch(Hc(n,!1)){case"image":case"html":case"element":return OS;case"imageLayer":case"videoLayer":return kS;case"elementLayer":return US;case"polygon":case"polyline":case"polygonPixels":case"polylinePixels":return NS;case"square":case"rect":case"circle":case"ellipse":case"path":return BS;default:throw new te("invalid marker type")}}var Gr=class pg extends Gf{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(ha,"svg"),this.svgContainer.setAttribute("class","psv-markers-svg-container"),this.container.appendChild(this.svgContainer),this.css3DContainer=new TS(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[pg,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 zr)}hideAllMarkers(){this.state.allVisible=!1,Object.values(this.markers).forEach(t=>{t.config.visible=!1}),this.renderMarkers(),this.dispatchEvent(new Fr)}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(zS(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 Fc(s))}):(this.viewer.rotate(s.state.position),ae.isNil(s.config.zoomLvl)||this.viewer.zoom(s.config.zoomLvl),this.dispatchEvent(new Fc(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:Vr,content:e.config.content}):this.hideMarkerPanel()}hideMarkerPanel(){this.viewer.panel.hide(Vr)}toggleMarkersList(){this.viewer.panel.isVisible(Ys)?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 _p(t);this.dispatchEvent(e),t=e.markers,this.viewer.panel.show({id:Ys,content:ES(t,this.viewer.config.lang[Hr.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 cp(l)),this.gotoMarker(l.id),this.hideMarkersList()}}})}hideMarkersList(){this.viewer.panel.hide(Ys)}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 tp(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 rp(e)),e instanceof fa&&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 ip(t)),t instanceof fa&&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 up(this.state.currentMarker)),this.viewer.panel.hide(Vr),!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 ap(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 pp(this.getMarkers()))}__refreshUi(){const t=Object.values(this.markers).filter(e=>!e.config.hideList).length;t===0?(this.viewer.panel.hide(Vr),this.viewer.panel.hide(Ys)):this.viewer.panel.isVisible(Ys)?this.showMarkersList():this.viewer.panel.isVisible(Vr)&&(this.state.currentMarker?this.showMarkerPanel(this.state.currentMarker.id):this.viewer.panel.hide()),this.viewer.navbar.getButton(Hr.id,!1)?.toggle(t>0),this.viewer.navbar.getButton(ua.id,!1)?.toggle(t>0)}__checkObjectsObserver(){Object.values(this.markers).some(e=>e.is3d())?this.viewer.observeObjects(Ne):this.viewer.unobserveObjects(Ne)}};Gr.id="markers",Gr.VERSION="5.14.0",Gr.configParser=FS,Gr.readonlyOptions=["markers"];var Ap=Gr;_i.lang[Hr.id]="Markers",_i.lang[ua.id]="Markers list",Uc(Hr,"caption:left"),Uc(ua,"caption:left");const{cloneDeep:Cp,deepMergeProps:HS,getDiffProps:VS}=Tt.utils;function GS(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(Cp(vh)),p=y.computed(()=>d.value);y.watch(()=>Cp(n.value?.viewer),m,{immediate:!0,deep:!0});function m(it,tt){const gt=VS(it,tt);E(gt)}function _(){return p.value}function E(it){it&&HS(d.value,it)}function S(){y.unref(e)?.container?.addEventListener("mousedown",g),y.unref(e)?.container?.addEventListener("touchstart",g),y.unref(e)?.container?.addEventListener("mouseover",D),y.unref(e)?.container?.addEventListener("mouseout",C),y.unref(e)?.addEventListener(jt.ReadyEvent.type,it=>{r("ready",it)}),y.unref(e)?.addEventListener(jt.SizeUpdatedEvent.type,it=>{r("size-updated",it)}),y.unref(e)?.addEventListener(jt.PanoramaLoadedEvent.type,it=>{r("panorama-loaded",it)}),y.unref(e)?.addEventListener(jt.PanoramaErrorEvent.type,it=>{r("panorama-error",it)}),y.unref(e)?.addEventListener(jt.ClickEvent.type,it=>{r("click",it)}),y.unref(e)?.addEventListener(jt.PositionUpdatedEvent.type,it=>{r("position-updated",it)}),y.unref(e)?.addEventListener(jt.ZoomUpdatedEvent.type,it=>{r("zoom-updated",it)})}function w(){}function v(it){r("panorama-complete",it)}function g(it){r("mousedown",it)}function D(it){Z(!0)}function C(it){Z(!1)}function A(it){const{yaw:tt=0,pitch:gt=0,zoomLevel:At=0}=it;E({defaultYaw:tt,defaultPitch:gt,defaultZoomLvl:At}),y.unref(e)?.rotate({yaw:tt,pitch:gt}),y.unref(e)?.zoom(At)}function U(it){if(Tt.utils.isObject(it)){let{panoramaOptions:tt}=y.unref(d)||{};tt={...tt,...it},E({panoramaOptions:tt})}}async function B(it,tt){if(l.value){a.value={currentPoint:it,options:tt};return}try{l.value=!0;const{playing:gt=!1}=p.value,{panorama:At,placeholderImg:Jt}=it,Ft=N(tt);Jt&&!gt?(await e.value?.setPanorama(Jt,Ft),await e.value?.setPanorama(At,{showLoader:!1})):await e.value?.setPanorama(At,Ft),await F(At)}catch(gt){console.error(gt)}finally{l.value=!1,I(),v(a.value)}}function N(it){const{panoramaOptions:tt}=p.value,{currentPoint:gt}=t.value||{};let At={};(n.value?.playbar?.speed??0)<600&&(At={transition:{speed:100}});const Ft=s.value?.getMarkers()?.find(Q=>Q.data.id===gt?.id);if(Ft){const{yaw:Q=0}=Ft.config.position||{};At.position={yaw:Q,pitch:0}}return{showLoader:!1,transition:{speed:500},...tt,...it,...At}}async function F(it){try{if(Tt.utils.isObject(it)){const tt=it.tileUrl(Math.floor(it.cols/2),0);if(tt){const gt=await fetch(tt);if(gt.ok)return await gt.blob()}}}catch{}}async function I(){if(await y.nextTick(),a.value){const{currentPoint:it,options:tt}=a.value;a.value=void 0,B(it,tt)}}async function M(){let{currentPoint:it,currentRecord:tt}=y.unref(t)||{};if(it&&tt){const gt=tt.getPreloadPoints(it);for(const At of gt)if(!h.value.has(At.id)&&!u.value.has(At.id)){u.value.add(At.id);const{panorama:Jt,placeholderImg:Ft}=At||{},Q=[];if(Tt.utils.isObject(Jt)){const lt=Jt.tileUrl(Math.floor(Jt.cols/2),0);Q.push(fetch(Jt.baseUrl),fetch(lt))}else Q.push(fetch(Jt)),Ft&&Q.push(fetch(Ft));Promise.all(Q).then(()=>{h.value.add(At.id)}).finally(()=>{u.value.delete(At.id)}).catch(lt=>{console.error(lt)})}}}function k(){H()}function H(){const{handleViolationMarkerFn:it,handlePathMarkerFn:tt}=y.unref(n)?.marker||{},{currentPoint:gt,currentRecord:At,currentMarker:Jt}=y.unref(t)||{};if(gt&&At){const Ft=At?.getPathMarkers(gt)?.map(pt=>tt?.(pt)||pt),Q=At?.getViolationMarkers(gt)?.map(pt=>it?.(pt)||pt),lt=[...Ft,...Q];if(y.unref(s)?.setMarkers(lt),Jt){const pt=Q.find(Nt=>Nt.data.id===Jt.id);if(!pt)return;y.unref(s)?.gotoMarker(pt.id,100)}}}function Z(it){E({moveover:it})}function j(it){E({mousedown:it})}function at(){return y.unref(d)?.moveover??!1}function $(){return y.unref(d)?.mousedown??!1}function dt(){const{currentPoint:it}=y.unref(t)||{};it&&B(it)}return{getProps:p,viewerAction:{getState:_,setState:E,isMouseover:at,isMousedown:$,setMousedown:j,setMouseover:Z,setPanoramaPath:B,setPanoramaOptions:U,setVewerStatus:A,updateMarkers:H,preloadPanorama:M,loadMarkers:k,refresh:dt},handleViewerEvents:S,handleUninstallEvents:w}}var ma=(n=>(n[n.NUMBER=0]="NUMBER",n[n.DISTANCE=1]="DISTANCE",n))(ma||{}),Wc=(n=>(n.pin="pin",n))(Wc||{}),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))(Ze||{});const{cloneDeep:Pp,deepMergeProps:WS,getDiffProps:ZS}=Tt.utils;function XS(n,t,e,s,r){const a=y.ref(Pp(Eh)),l=y.computed(()=>a.value);y.watch(()=>Pp(n.value?.marker),h,{immediate:!0,deep:!0});function h(_,E){const S=ZS(_,E);u(S)}function u(_){_&&WS(a.value,_)}function d(){y.unref(s)?.addEventListener(Kf.SelectMarkerEvent.type,p)}async function p(_){const{id:E,data:S}=_.marker.config,{onPointChange:w,onMarkerChange:v}=l.value;S.markerType==Wc.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 YS={class:"vsleem-viewer"},Rp=bn(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}=GS(d,p,r,a,s),{handleMarkerEvents:S,markerAction:w}=XS(d,p,r,a,s);y.watch(()=>y.unref(p)?.ready,v,{immediate:!0}),y.onMounted(A),y.onBeforeUnmount(D);function v(U){U&&(g(),_(),S())}function g(){if(y.unref(r))return;const U=m.value,B=l.value,N=p.value?.currentPoint?.panorama??"",F=Tt.utils.isObject(N)?mS:void 0,I=new iS({...U,container:B,panorama:N,adapter:F,plugins:[[Ap,[]]]}),M=I.getPlugin(Ap);r.value=Object.assign(I,E),a.value=Object.assign(M,w)}function D(){r.value?.destroy()}function C(U,B){h.value=U,u.value=B}function A(){s("register",r,a,C)}return t({getViewer:()=>y.unref(r),getMarker:()=>y.unref(a)}),(U,B)=>(y.openBlock(),y.createElementBlock("div",YS,[y.createElementVNode("div",{ref_key:"viewerElRef",ref:l},null,512)]))}}),[["__scopeId","data-v-b1c7fac3"]]);function qS(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 QS(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 jS(n,t){return Tt.http.request({url:"/project/jssdk/patrolRecord/detailNew",method:Tt.RequestMethod.GET,params:n},t)}class qs{id="";img="";patrolId="";coordinate=new Tt.Coordinate;point=new Tt.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=Tt.Point.toRadians(Number(m)||0),D=new Tt.Point({x:a,y:l,z:h,lon:u,lat:d,alt:p,yaw:g});return _&&(v.panorama=Yg(_,s,r)),(D.hasXYZ||D.hasXYZ)&&(v.point=D),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 qs(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 Wr{id="";pointId="";patrolId="";coordinateId=0;coordinate=new Tt.Coordinate;point=new Tt.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(r){const d=Tt.RelativeMap.toParse(r);u=new Tt.Coordinate({parent:u,type:Tt.CoordinateType.Data,relativeMap:d})}h.coordinate=u}return a&&(h.perspective=Tt.Position.toParse(a)),l&&(h.point=Tt.Point.toParse(l)),h}projection(t){if(!this.coordinate||!this.point)return;const e=this.coordinate.getDestRelativeMap(t);if(!e)return;const s=new Wr(this),r=s.point?.projection(e,s.coordinate,t);if(r)return s.point=r,s.coordinate=t,s}}class Qs{id="";coordinateId=0;coordinate=new Tt.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=Tt.utils.cloneDeep({...u,coordinateId:r,relativePosition:a});if(r&&e){let E=e?.findCsById(r);if(a){const S=Tt.RelativeMap.toParse(a);E=new Tt.Coordinate({parent:E,type:Tt.CoordinateType.Data,relativeMap:S})}d.coordinate=E}const{id:p,coordinate:m,color:_}=d;if(l?.length&&m&&s){const E=await qg(l?.[0]?.img,s);d.panoramaSize=E;const S=new Map;for(const w of l){const v=qs.parsedModel({...w,patrolId:p,color:_},m,E,s);v.id&&S.set(v.id,new qs(v))}d.trackPoints=S}if(h?.length&&e){const E=new Map;for(const S of h){const w=Wr.parsedModel({...S,patrolId:p},e);w.id&&E.set(w.id,new Wr(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}=s||{},E=new Map;let S;for(const v of a.values()){const g=v.projection(p,m);if(!g)continue;if(g.index=E.size,_<=0){E.set(g.id,g);continue}if(d.find(C=>C.pointId===g.id)){E.set(g.id,g),S=g;continue}if(!E.size){E.set(g.id,g),S=g;continue}g.position&&S?.position&&Tt.Point.distXY(g.position,S.position)>=_&&(E.set(g.id,g),S=g)}const w=new Qs(this);return w.trackPoints=E,w.coordinate=t,w.realseeSetting=s,w}getPathMarkers(t){const{pointType:e=ma.NUMBER,pointNumber:s=5,pointDistance:r=5}=this.realseeSetting||{},a=this.getPoint(t?.id??"");if(!a)return[];let l=[];return e===ma.NUMBER?l=this.getPointsByNumber(a,s):e===ma.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:Tt.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}=qs.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 Tt.Position({yaw:p,pitch:m}),data:{...h,markerType:Wc.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 Tt.Position({yaw:Tt.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)}}function JS(n,{setReferPoint:t}){const e=y.ref(),s=y.ref(),r=y.reactive(new Map),a=y.ref(!1),l=y.ref(!1),h=y.ref(),u=y.ref(),d=y.ref(),p=y.ref(),m=y.computed(()=>e.value?.findCsById(h.value)),_=y.computed(()=>m.value?.findParentSpace()),E=y.computed(()=>Tt.Coordinate.getCommonCoordinate(Array.from(r.values(),st=>st.coordinate))),S=y.computed(()=>r.get(u.value??"")),w=y.computed(()=>A.value.get(u.value??"")),v=y.computed(()=>S.value?.getPoint(d.value??"")),g=y.computed(()=>w.value?.getPoint(d.value??"")),D=y.computed(()=>w.value?.getMarker(p.value??"")),C=y.computed(()=>w.value?.getPointMarkers(g.value?.id??"")||[]),A=y.computed(()=>{const st=new Map;if(!m.value||!E.value)return st;for(const ct of r.values()){const Dt=ct.projection(m.value,E.value,n.value.realseeSetting);Dt&&st.set(Dt.id,Dt)}return st}),U=y.computed(()=>{const st=new Map;if(!A.value.size)return st;for(const ct of A.value.values()){const{trackMarkers:Dt}=ct;for(const Bt of Dt.values()){const R=ct.getPoint(Bt.pointId);if(R){const ht=st.get(R)??[];ht.push(Bt),ht.length===1&&st.set(R,ht)}}}return st});async function B(st){const{projectId:ct,patrolId:Dt}=st||{},Bt=Dt?Array.isArray(Dt)?Dt:[Dt]:[];try{if(!ct||!Bt.length)throw new Tt.AppError(Ze.StoreMissParams,"缺少必要的查询参数");if(a.value=!0,ct!=e.value?.projectId){const vt=await Tt.DataSource.getCoordinateTree(ct);if(!vt)throw new Tt.AppError(Ze.StoreNoCSTree,`未查询到项目ID为 ${ct} 的坐标系树`);e.value=vt}const[R,...ht]=Bt,ft=await N(R);if(!ft)return;const Ct=ft.coordinate.findChildModel([Tt.CoordinateModelType.CADModel,Tt.CoordinateModelType.GeoModel]);if(!Ct?.modelValue)throw new Tt.AppError(Ze.StroeNoModelValue,`没有找到当前坐标系${Ct?.id||""}的modelKey字段值`);s.value=Ct?.getMappedCsTree(),r.clear(),r.set(ft.id,ft),I({modelCsId:Ct?.id,...st}),tt(ht)}catch(R){console.error(R),n.value.fetchError?.(R)}finally{a.value=!1}}async function N(st){try{let ct=await jS({...n.value.fetchParams,id:st});if(ct=await n.value.handleResponseFn?.(ct)||ct,!ct)throw new Tt.AppError(Ze.StoreNoRecord,`未查询到ID为 ${st} 的巡检记录`);const Dt=Jt();ct.color=ct.color||Dt;const{appSetting:Bt}=n.value,R=await Qs.parsedModel(ct,e.value,Bt);if(!R?.trackPoints?.size||!R.coordinate)throw new Tt.AppError(Ze.StoreInvRecord,`ID为 ${st} 是无效的巡检记录`);let ht;if(a.value?ht=e.value?.findCsById(R.coordinateId):s.value&&(ht=s.value.findCsById(R.coordinateId)),!ht)throw new Tt.AppError(Ze.StoreRecordOutCSTree,`ID为 ${st} 的巡检记录不在映射坐标系树内`);if(ht?.modelType===Tt.CoordinateModelType.GeoModel){const Ct=e.value?.findClosestModel(Tt.CoordinateModelType.GeoModel);if(Ct&&!Ct.relativeMap?.refPoint){const vt=Array.from(R.trackPoints.values()),qt=new Tt.GeoPoint(vt[0].point),Mt=new Tt.RelativeMap({refPoint:qt});Ct.setOptions({relativeMap:Mt})}}const ft=new Qs(R);return n.value.fetchSuccess?.(ft,e.value),ft}catch(ct){console.error(ct),n.value.fetchError?.(ct)}}function F(st=!1){l.value=st}function I(st){const{patrolId:ct,pointId:Dt,modelCsId:Bt}=st,R=ct?Array.isArray(ct)?ct:[ct]:[],ht=r.get(R[0]);if(ht){const ft=Array.from(ht.trackPoints.values());u.value=ht.id,d.value=Dt??ft[0]?.id}Bt&&(h.value=Bt)}function M(st){const{id:ct}=st;if(s.value?.findCsById(ct)?.type===Tt.CoordinateType.Model)h.value=ct;else throw new Tt.AppError(Ze.StoreNoCSByID,`ID为 ${ct} 的模型坐标系不在映射坐标系树内`)}function k(st){const ct=G(st.id??"");if(!ct)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到ID为 ${st.id} 的巡检记录`);const Dt=Array.from(ct.trackPoints.values());u.value=ct.id,d.value=Dt[0]?.id}function H(st){const{patrolId:ct,id:Dt=""}=st,Bt=G(ct??"");if(!Bt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到轨迹点patrolId为 ${ct} 的巡检记录`);if(!Bt?.hasPoint(Dt))throw new Tt.AppError(Ze.StoreSelectNoPoint,`未找到ID为 ${Dt} 的轨迹点`);u.value=Bt.id,d.value=Dt}function Z(st){if(st){const{patrolId:ct,id:Dt=""}=st,Bt=G(ct??"");if(!Bt)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${ct} 的巡检记录`);if(!Bt?.hasMarker(Dt))throw new Tt.AppError(Ze.StoreSelectNoMarker,`未找到ID为 ${Dt} 的问题标记`);p.value=Dt}else p.value=void 0}function j(st){const ct=r.get(st.patrolId);if(!ct)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);ct.trackMarkers.set(st.id,st)}function at(st){const ct=r.get(st.patrolId??"");if(!ct)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);ct.trackMarkers.delete(st.id??"")}function $(st){const ct=r.get(st.patrolId??"");if(!ct)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到问题标记patrolId为 ${st.patrolId} 的巡检记录`);const Dt=ct.trackMarkers.get(st.id??"");if(!Dt)throw new Tt.AppError(Ze.StoreSelectNoMarker,`未找到ID为 ${st.id} 的问题标记`);Object.assign(Dt,st)}function dt(st){return A.value.has(st)}function G(st){return A.value.get(st)}async function it(st){if(!r.has(st)){const ct=await N(st);if(ct){const Dt=new Qs(ct);return r.set(Dt.id,Dt),Dt}}}async function tt(st){if(st.length)for(const ct of st)await it(ct)}function gt(st){if(w.value?.id===st)throw new Tt.AppError(Ze.StoreSelectedMarker,`ID为 ${st} 的巡检记录正在被使用,无法删除`);return r.delete(st)}async function At(st){const ct=r.get(st.id??"");if(!ct)throw new Tt.AppError(Ze.StoreSelectNoRecord,`未找到ID为 ${st.id} 的巡检记录`);Object.assign(ct,st)}function Jt(){const st=a.value?[]:Array.from(r.values()).map(Dt=>Dt.color?.toUpperCase?.());return(n.value.realseeSetting?.trackColorRange||[]).find(Dt=>!st.includes(Dt?.toUpperCase?.()))}function Ft(){return m.value?.findClosestModel(Tt.CoordinateModelType.BIMModel)}function Q(st){let ct=1/0,Dt;if(st.position){for(const Bt of A.value.values())if(Bt.trackPoints?.size)for(const R of Bt.trackPoints.values()){if(!R.position)continue;const ht=Tt.Point.distXY(st.position,R.position);if(ht===0){ct=ht,Dt=R;break}ht<ct&&(ct=ht,Dt=R)}if(Dt)return Dt}}function lt(st){if(!m.value||!E.value||!st)return;const ct=e.value?.findCsById(st.coordinate.id);if(!ct)return;const Dt=ct?.getDestRelativeMap(m.value),Bt=ct?.getDestRelativeMap(E.value);if(!Dt||!Bt)return;const R={srcToDstRelativeMap:Dt,srcCoordinate:ct,dstCoordinate:m.value},ht={srcToDstRelativeMap:Bt,srcCoordinate:ct,dstCoordinate:E.value};return st.projection(R,ht)}function pt(){return Nt.value}const Nt=y.computed(()=>({ready:l.value,rawDataSource:r,coordinateTree:e.value,mappedCoordinateTree:s.value,dataSource:A.value,comCoordinate:E.value,currentModel:m.value,currentSpace:_.value,currentRawRecord:S.value,currentRecord:w.value,currentRawPoint:v.value,currentPoint:g.value,currentMarker:D.value,currentPointMarkers:C.value,groupedMarkers:U.value,reload:B,fetchRecord:N,selectModel:M,selectRecord:k,selectPoint:H,selectMarker:Z,setReferPoint:t,addMarker:j,removeMarker:at,updateMarker:$,hasRecord:dt,getRecord:G,addRecord:it,batchAddRecords:tt,removeRecord:gt,updateRecord:At,findClosestBIMModel:Ft,findClosestPoint:Q,normalizeToModelPoint:lt}));return{storeRef:Nt,getStore:pt,setReady:F}}function KS(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:Lp,deepMergeProps:$S,getDiffProps:tM}=Tt.utils;function Ip(n,t){const e=y.ref(Lp(xh)),s=y.computed(()=>e.value);y.watch(()=>Lp(n),v,{immediate:!0,deep:!0}),y.watch(()=>s.value.searchInfo,()=>A(r.value.ready),{deep:!0});const{storeRef:r,getStore:a,setReady:l}=JS(s,{setReferPoint:B}),{register:h,getViewer:u,getMarker:d}=KS(s,r),{register:p,getMap:m}=qS(s,r),{register:_,getPlaybar:E}=QS(s,r);y.onMounted(S),y.onBeforeUnmount(w);async function S(){const{appSetting:N,immediate:F}=y.unref(s);N&&Tt.http.setRequestGlobalConfig(N),F&&(await A(!0),setTimeout(C,0))}function w(){t?.("destroy")}function v(N,F){const I=tM(N,F);D(I)}function g(){return s.value}function D(N){N&&$S(e.value,N)}function C(){l(!0),t?.("ready")}async function A(N){const{searchInfo:F}=s.value;N&&F&&(await r.value?.reload(F),t?.("reload"))}function U(){const N=Tt.utils.cloneDeep(s.value),F=a();if(F){const{currentModel:Z,currentRecord:j,currentPoint:at}=F,{projectId:$=0,id:dt=""}=j||{},G=at?.id,it=Z?.id;N.searchInfo={projectId:$,patrolId:dt,pointId:G,modelCsId:it}}const I=u();if(I){const Z=Tt.utils.cloneDeep(s.value.viewer),j=I.getPosition(),at=I.getZoomLevel(),{yaw:$,pitch:dt}=j||{};N.viewer={...Z,defaultZoomLvl:at,defaultYaw:$,defaultPitch:dt}}d()&&(N.marker=Tt.utils.cloneDeep(s.value.marker));const k=m();if(k){const{size:Z,radarAngle:j,...at}=k.getState()||{};N.map={...at}}const H=E();if(H){const{showPlay:Z,showSpeed:j,...at}=H.getState()||{};N.playbar={...at,showPlay:!1,showSpeed:!1}}return N}function B(N,F){const I=a();if(I){const M=I.normalizeToModelPoint(N);if(!M?.point)return;const k=I.findClosestPoint(M);if(!k?.point)return;I?.selectPoint?.(k);const{yaw:H=0,pitch:Z=0,zoomLevel:j=0}=F||{},at=M.point.yaw-k.point.yaw+H;u()?.setVewerStatus({yaw:at,pitch:Z,zoomLevel:j})}}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:D}}function eM(n,t,e,s,r){const a=y.computed(()=>n.value.ready&&!!n.value.currentRecord),l=y.computed(()=>{const{dataSource:m,coordinateTree:_,mappedCoordinateTree:E,currentSpace:S,currentModel:w,currentRecord:v,currentPoint:g,currentMarker:D,currentPointMarkers:C}=n.value||{};return{dataSource:m,coordinateTree:_,mappedCoordinateTree:E,currentSpace:S,currentModel:w,currentRecord:v,currentPoint:g,currentPointMarkers:C,currentMarker:D}});y.watch(()=>n.value?.currentModel?.id,m=>{m&&h(n.value?.currentModel)},{immediate:!0}),y.watch(()=>n.value?.currentRecord?.id,m=>{m&&u(n.value?.currentRecord)},{immediate:!0}),y.watch(()=>n.value?.currentPoint?.id,m=>{m&&d(n.value?.currentPoint)},{immediate:!0}),y.watch(()=>n.value?.currentRecord?.trackPoints.size,m=>{m&&p()},{immediate:!0});function h(m){r("change-model",m)}function u(m){r("change-record",m)}function d(m){t()?.refresh?.(),r("change-point",m)}function p(){const{currentRecord:m,currentRawPoint:_,selectPoint:E}=n.value;if(m?.id===_?.patrolId){const S=m?.getNearPoint(_?.rawIndex||0);S&&E?.(S)}}return{getShow:a,getBindValue:l}}function nM(n,t){function e(){t("map-ready")}function s(){t("map-resize")}function r(d){t("map-collapse",d)}function a(){t("map-dragger")}function l(d){t("map-angle-updated",d)}function h(d,p){t("map-select-point",d,p)}return{mapEvents:{ready:e,resize:s,collapse:r,dragger:a,angleUpdated:l,selectPoint:h}}}function iM(n,t){const{getViewer:e,setState:s}=n;function r(){t("playbar-ready")}function a(w){t("playbar-backward",w)}function l(w){E(!1),t("playbar-pause",w)}function h(w){E(!0),t("playbar-play",w)}function u(w){t("playbar-forward",w)}function d(w){_(w),t("playbar-speed",w)}function p(w){t("playbar-slider",w)}function m(w){t("playbar-select-point",w)}function _(w){s({playbar:{speed:w}})}function E(w){e()?.setState({playing:w})}return{playbarEvents:{ready:r,backward:a,pause:l,play:h,forward:u,slider:p,speed:d,selectPoint:m}}}function sM(n,t){const{getMap:e,getPlaybar:s,getViewer:r}=n,a=y.ref({yaw:0,pitch:0});function l(F){D(F),t("viewer-ready")}function h(F){t("viewer-click",F)}function u(F){C(),t("viewer-mousedown",F)}function d(F){D(F),t("viewer-size-updated",F)}function p(F){D(F),t("viewer-zoom-updated",F)}function m(F){g(F),t("viewer-position-updated",F,B(F))}function _(F){A(),t("viewer-panorama-loaded",F)}function E(F){t("viewer-panorama-error",F)}function S(F){U(F),t("viewer-panorama-complete")}function w(F){t("viewer-select-point",F)}function v(F){t("viewer-select-marker",F)}function g(F){e()?.setRadarYaw(F.position.yaw??0)}function D(F){e()?.setRadarHFov(F?.currentTarget?.state?.hFov??90)}function C(F){e()?.setCollapse(!0)}function A(F){const I=r();I&&(I.preloadPanorama(),I.loadMarkers())}function U(F){F||s()?.playNext()}function B(F){const{yaw:I,pitch:M}=F.position,{yaw:k,pitch:H}=y.unref(a);return a.value={yaw:I,pitch:M},{yaw:I-k,pitch:M-H}}return{viewerEvents:{ready:l,click:h,mousedown:u,sizeUpdated:d,zoomUpdated:p,positionUpdated:m,panoramaLoaded:_,panoramaError:E,panoramaComplete:S,selectPoint:w,selectMarker:v}}}const rM={class:"vsleem-realsee"},Dp=bn(y.defineComponent({name:"Realsee",__name:"Realsee",props:{appSetting:{},searchInfo:{},realseeSetting:{default:()=>Da},viewer:{},marker:{},playbar:{default:()=>so},map:{default:()=>io},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}=Ip(s,r),{storeRef:p,getViewer:m,getMap:_,getPlaybar:E}=d,{getShow:S,getBindValue:w}=eM(p,m,_,E,r),{viewerEvents:v}=sM(d,r),{mapEvents:g}=nM(d,r),{playbarEvents:D}=iM(d,r);return t(d),(C,A)=>(y.openBlock(),y.createElementBlock("div",rM,[y.createVNode(Rp,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(Mh,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(bh,y.mergeProps({key:1,onRegister:y.unref(h)},y.toHandlers(y.unref(D))),{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"]]);ke.APP_SETTING=gh,ke.MAP_CONFIG=io,ke.MAP_GEO_OPTIONS=yh,ke.MARKER_CONFIG=Eh,ke.Map=Mh,ke.PLAYBAR_CONFIG=so,ke.Playbar=bh,ke.REALSEE_CONFIG=xh,ke.REALSEE_SETTING=Da,ke.Realsee=Dp,ke.RealseePlugin=Dp,ke.TILE_LAYERS=ka,ke.TRACK_COLOR_LIST=_h,ke.TrackMarker=Wr,ke.TrackPoint=qs,ke.TrackRecord=Qs,ke.VIEWER_CONFIG=vh,ke.Viewer=Rp,ke.useRealsee=Ip,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));
|