@panoramax/web-viewer 3.2.2-develop-43f3ef36 → 3.2.2-develop-4ceb780a
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/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/zh_Hant.json +2 -1
package/build/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
!function(F,Da){"object"===typeof exports&&"object"===typeof module?module.exports=Da():"function"===typeof define&&define.amd?define("Panoramax",[],Da):"object"===typeof exports?exports.Panoramax=Da():F.Panoramax=Da()}(this,(()=>(()=>{var F={9555:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Editor});ll(980);var cl=ll(6803),hl=ll(1951),dl=ll(8489),pl=ll(7534),fl=ll(6810),Al=ll(5071),bl=ll(1300),kl=ll(1545);const Dl="sequence-headings";class Editor extends cl.A{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(F,Da,Object.assign(ll,{users:[]})),this._selectedSeqId||this._loader.dismiss({},"No sequence is selected"),this.psvContainer=document.createElement("div"),this.mapContainer=document.createElement("div"),this.container.appendChild(this.psvContainer),this.container.appendChild(this.mapContainer);try{this.psv=new dl.Ay(this,this.psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(cl){let F=kl.IJ.isWebGLSupported?this._t.gvs.error_psv:this._t.gvs.error_webgl;this._loader.dismiss(cl,F)}this._api.onceReady().then((()=>{try{this.map=new hl.A(this,this.mapContainer,{raster:ll.raster,background:ll.background,supplementaryStyle:this._createMapStyle()}),(0,Al.I0)(this),this._loadSequence(),this.map.once("load",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),ll.raster&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const F=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=Da=>(Da=void 0===this._lastRelHeading?Da:Da+this._lastRelHeading-this.psv.getPictureRelativeHeading(),F(Da))}catch(cl){this._loader.dismiss(cl,this._t.gvs.error_psv)}})),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"Editor"}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...bl.VM.SEQUENCES.layout},paint:{...bl.VM.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...bl.VM.PICTURES.layout},paint:{...bl.VM.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this._api.getSequenceItems(this._selectedSeqId).then((F=>{this._sequenceData=F.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this._selectedSeqId},geometry:{type:"LineString",coordinates:F.features.map((F=>F.geometry.coordinates))}},...F.features.map((F=>(F.properties.id=F.id,F.properties.sequences=[this._selectedSeqId],F)))]});const onMapLoad=()=>{if(this._selectedPicId){const Da=F.features.find((F=>F.id===this._selectedPicId));Da?(this.select(this._selectedSeqId,this._selectedPicId,!0),this.map.jumpTo({center:Da.geometry.coordinates,zoom:18})):console.log("Picture with ID",Da,"was not found")}else{const Da=[...F.features[0].geometry.coordinates,...F.features[0].geometry.coordinates];for(let ll=1;ll<F.features.length;ll++){const cl=F.features[ll].geometry.coordinates;cl[0]<Da[0]&&(Da[0]=cl[0]),cl[1]<Da[1]&&(Da[1]=cl[1]),cl[0]>Da[2]&&(Da[2]=cl[0]),cl[1]>Da[3]&&(Da[3]=cl[1])}this.map.fitBounds(Da,{animate:!1})}this._loader.dismiss()};this.map.loaded()?onMapLoad():this.map.once("load",onMapLoad)})).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api)))}_getNode(F){const Da=this._sequenceData.find((Da=>Da.properties.id===F)),ll=Da?(0,Al.rs)(Da,this._t,this._isInternetFast):null;return ll&&delete ll.links,ll}_addMapBackgroundWidget(){const F=document.createElement("div");F.id="gvs-map-bg",F.classList.add("gvs-panel","gvs-widget-bg","gvs-input-group");const onBgChange=F=>this.map.setBackground(F.target.value),Da=document.createElement("input");Da.id="gvs-map-bg-streets",Da.setAttribute("type","radio"),Da.setAttribute("name","gvs-map-bg"),Da.setAttribute("value","streets"),Da.addEventListener("change",onBgChange),F.appendChild(Da);const ll=document.createElement("label");ll.setAttribute("for",Da.id);const cl=document.createElement("img");cl.src=fl,cl.alt="",ll.appendChild(cl),ll.appendChild(document.createTextNode(this._t.gvs.map_background_streets)),F.appendChild(ll);const hl=document.createElement("input");hl.id="gvs-map-bg-aerial",hl.setAttribute("type","radio"),hl.setAttribute("name","gvs-map-bg"),hl.setAttribute("value","aerial"),hl.addEventListener("change",onBgChange),F.appendChild(hl);const dl=document.createElement("label");dl.setAttribute("for",hl.id);const Al=document.createElement("img");Al.src=pl,Al.alt="",dl.appendChild(Al),dl.appendChild(document.createTextNode(this._t.gvs.map_background_aerial)),F.appendChild(dl),this.mapContainer.appendChild(F);const onMapBgChange=F=>{"aerial"===F?hl.checked=!0:Da.checked=!0};this.addEventListener("map:background-changed",(F=>onMapBgChange(F.detail.background))),onMapBgChange(this.map.getBackground())}previewSequenceHeadingChange(F){const Da=void 0!==this.map.getLayer(Dl);if(this.map._picMarkerPreview.remove(),void 0===F)return delete this._lastRelHeading,Da&&this.map.setLayoutProperty(Dl,"visibility","none"),void(this._selectedPicId&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=F,Da||this.map.addLayer({id:Dl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"gvs-marker","icon-overlap":"always","icon-size":.8}});const ll=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Dl,"visibility","visible"),this.map.setLayoutProperty(Dl,"icon-rotate",["+",["get","view:azimuth"],ll,F]);const cl=[["==",["geometry-type"],"Point"]];this._selectedPicId&&cl.push(["!=",["get","id"],this._selectedPicId]),this.map.setFilter(Dl,["all",...cl]),this._selectedPicId&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}},7531:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>fl});var cl=ll(6803),hl=ll(1951),dl=ll(1300),pl=ll(927);class StandaloneMap extends cl.A{constructor(F,Da){super(F,Da,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.mapContainer=document.createElement("div"),this.container.appendChild(this.mapContainer),this._api.onceReady().then((()=>this._initMap())),this.addEventListener("map:picture-click",(F=>this.select(F.detail.seqId,F.detail.picId))),this.addEventListener("map:sequence-click",(F=>this.select(F.detail.seqId))),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"Map"}destroy(){super.destroy(),this.map.destroy(),delete this.map,this.mapContainer.remove(),this.container.innerHTML="",this.container.classList.remove(...[...this.container.classList].filter((F=>F.startsWith("gvs"))))}_initMap(){this._options.hash=!0;class MyMap extends hl.A{_getLayerStyleProperties(F){return"pictures_symbols"===F?{layout:{visibility:"none"}}:super._getLayerStyleProperties(F)}}this.map=new MyMap(this,this.mapContainer,this._options),this.map.addControl(new pl.NavigationControl({showCompass:!1})),this.map.on("load",(()=>{this.map.reloadLayersStyles(),this._loader.dismiss()}))}_onSelect(F){if(F.detail.picId||F.detail.seqId){const Da=F.detail.picId?"pictures":"sequences",ll=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((F=>(0,dl.IN)(F,Da))),filter:["==",["get","id"],F.detail.picId||F.detail.seqId]});ll.length>=0&&null!=ll[0]&&this.map._attachPreviewToPictures({features:ll},Da)}}}const fl=StandaloneMap},2968:(F,Da,ll)=>{"use strict";ll.d(Da,{$p:()=>Ql,Ay:()=>Viewer,LM:()=>Al.LM,Vf:()=>Al.Vf});ll(2101);var cl=ll(1545),hl=ll(490),dl=ll(9194),pl=ll(5071),fl=ll(6803),Al=ll(8489),bl=ll(1951),kl=ll(1300),Dl=ll(4683),Wl=ll(6627);const Ql=20,wc=Math.PI/6,Sc=100,eu="http://127.0.0.1:8111",iu={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"};class Viewer extends fl.A{constructor(F,Da){var ll;let pl,fl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(F,Da,fl),null==this._options.map&&(this._options.map={}),null==this._options.widgets&&(this._options.widgets={}),this._sequencePlaying=!1,this._prevSequence=null,this._mapTheme=(null===fl||void 0===fl||null===(ll=fl.map)||void 0===ll?void 0:ll.theme)||iu.DEFAULT,this._picNav=(null===fl||void 0===fl?void 0:fl.picturesNavigation)||"any",this._options.testing)return;if(!0===this._options.hash||void 0===this._options.hash){if(this._hash=new dl.A(this),pl=this._hash._getCurrentHash(),"none"===pl.map&&(this._options.map=!1),"object"===typeof this._options.map&&(this._options.map.hash=!1),this._options.map&&pl.focus&&(this._options.map.startWide="map"===pl.focus),this._options.map&&pl.background&&(this._options.map.background=pl.background),this._options.map&&pl.users&&(this._options.users=[...new Set(pl.users.split(","))]),pl.xyz){const F=this._hash.getXyzOptionsFromHashString(pl.xyz);this.addEventListener("psv:picture-loaded",(()=>{this.psv.setXYZ(F.x,F.y,F.z)}),{once:!0})}if(this._options.map&&"string"===typeof pl.map){const F=this._hash.getMapOptionsFromHashString(pl.map);F&&(this._options.map=Object.assign({},this._options.map,F))}if(this._options.map&&this.setFilters(this._hash.getMapFiltersFromHashVals(pl),!0),pl.pic){const F=pl.pic.split(";");F.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),this._options.selectedPicture=F[0]}"string"===typeof pl.speed&&(this._options.transition=parseInt(pl.speed)),pl.nav&&(this._picNav=pl.nav)}this._initContainerStructure();try{this.psv=new Al.Ay(this,this.psvContainer,{transitionDuration:this._options.transition,shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...cl.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this.toggleFocus(),7:()=>this.toggleFocus(),End:()=>this.toggleUnfocusedVisible(),1:()=>this.toggleUnfocusedVisible()," ":()=>this.toggleSequencePlaying(),0:()=>this.toggleSequencePlaying()}}),this.psv.addEventListener("dblclick",(()=>{this.map&&this.isMapWide()&&this.setFocus("pic")}))}catch(bl){let F=cl.IJ.isWebGLSupported?this._t.gvs.error_psv:this._t.gvs.error_webgl;this._loader.dismiss(bl,F)}const onceStuffReady=()=>{this._widgets=new hl.A(this,this._options.widgets),this.map&&this.isWidthSmall()&&this.setUnfocusedVisible(!1),this._options.selectedPicture?(this.select(null,this._options.selectedPicture,!0),this.addEventListener("psv:picture-loaded",(()=>{var F,Da,ll,cl,hl;!this._selectedSeqId&&null!==(F=this.psv)&&void 0!==F&&null!==(Da=F._myVTour)&&void 0!==Da&&null!==(ll=Da.getCurrentNode())&&void 0!==ll&&null!==(cl=ll.sequence)&&void 0!==cl&&cl.id&&this.select(this.psv._myVTour.getCurrentNode().sequence.id,this._options.selectedPicture),this.map&&this._options.map&&this.map.jumpTo(this._options.map),"meta"===(null===(hl=pl)||void 0===hl?void 0:hl.focus)&&this._widgets._showPictureMetadataPopup(),this._loader.dismiss()}),{once:!0})):this._loader.dismiss(),this._options.position&&this.goToPosition(...this._options.position).catch((F=>this._loader.dismiss(F,this._t.gvs.error_nopic))),this._hash&&this.map&&(this.map._attribution._container.classList.add("gvs-hidden"),this._hash.bindMapEvents(),this._mapFilters&&this.setFilters(this._mapFilters,!0),pl.users&&Promise.all(this.map.getVisibleUsers().filter((F=>"geovisio"!=F)).map((F=>this._api.getUserName(F)))).then((F=>{F=F.filter((F=>null!=F)).join(", ");const Da=document.getElementById("gvs-filter-search-user").querySelector("input");Da&&(Da.setItem(F),Da.parentNode.classList.add("gvs-filter-active"))})).catch((F=>console.warn("Error when looking up for user names",F)))),document.addEventListener("keyup",(F=>{"Escape"!==F.key||this.popupContainer.classList.contains("gvs-hidden")||this.setPopup(!1)}))};this._api.onceReady().then((()=>{this._options.map?(void 0===this._options.map.doubleClickZoom&&(this._options.map.doubleClickZoom=!1),this._initMap().then(onceStuffReady).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api_compatibility)))):onceStuffReady()}))}getClassName(){return"Viewer"}destroy(){super.destroy(),this._widgets.destroy(),delete this._widgets,this._hash.destroy(),delete this._hash,this.map.destroy(),delete this.map,delete this._mapFilters,this.psv.destroy(),delete this.psv,this.miniContainer.remove(),this.mainContainer.remove(),this.mapContainer.remove(),this.psvContainer.remove(),this.popupContainer.remove(),this.container.innerHTML="",this.container.classList.remove(...[...this.container.classList].filter((F=>F.startsWith("gvs"))))}_initContainerStructure(){this.miniContainer=document.createElement("div"),this.miniContainer.classList.add("gvs-mini"),this.mainContainer=document.createElement("div"),this.mainContainer.classList.add("gvs-main"),this.popupContainer=document.createElement("div"),this.popupContainer.classList.add("gvs-popup","gvs-hidden"),this.psvContainer=document.createElement("div"),this.mainContainer.appendChild(this.psvContainer),this.mapContainer=document.createElement("div"),this.miniContainer.appendChild(this.mapContainer),this.container.appendChild(this.mainContainer),this.container.appendChild(this.miniContainer),this.container.appendChild(this.popupContainer)}async _initMap(){await new Promise((F=>{this.map=new bl.A(this,this.mapContainer,this._options.map),this.map._getLayerColorStyle=this._getLayerColorStyle.bind(this),this.map._getLayerSortStyle=this._getLayerSortStyle.bind(this),this.addEventListener("map:users-changed",F,{once:!0}),this.container.classList.add("gvs-has-mini"),this.map.on("dblclick",(()=>{this.isMapWide()||this.setFocus("map")})),"object"===typeof this._options.map&&this._options.map.startWide?this.setFocus("map",!0):this.setFocus("pic",!0)})),this._initMapKeyboardHandler(),(0,pl.I0)(this)}_initMapKeyboardHandler(){const F=this;this.map.keyboard.keydown=function(Da){if(Da.altKey||Da.ctrlKey||Da.metaKey)return;switch(Da.key){case"*":case"5":return void F.moveCenter();case"PageUp":case"9":return void F.psv.goToNextPicture();case"PageDown":case"3":return void F.psv.goToPrevPicture();case"Home":case"7":return Da.stopPropagation(),void F.toggleFocus();case"End":case"1":return void F.toggleUnfocusedVisible();case" ":case"0":return void F.toggleSequencePlaying()}let ll=0,cl=0,hl=0,dl=0,pl=0;switch(Da.keyCode){case 61:case 107:case 171:case 187:ll=1;break;case 189:case 109:case 173:ll=-1;break;case 37:case 100:Da.shiftKey?cl=-1:(Da.preventDefault(),dl=-1);break;case 39:case 102:Da.shiftKey?cl=1:(Da.preventDefault(),dl=1);break;case 38:case 104:Da.shiftKey?hl=1:(Da.preventDefault(),pl=-1);break;case 40:case 98:Da.shiftKey?hl=-1:(Da.preventDefault(),pl=1);break;default:return}return this._rotationDisabled&&(cl=0,hl=0),{cameraAnimation:F=>{const fl=this._tr;F.easeTo({duration:300,easeId:"keyboardHandler",easing:F=>F*(2-F),zoom:ll?Math.round(fl.zoom)+ll*(Da.shiftKey?2:1):fl.zoom,bearing:fl.bearing+cl*this._bearingStep,pitch:fl.pitch+hl*this._pitchStep,offset:[-dl*this._panStep,-pl*this._panStep],center:fl.center},{originalEvent:Da})}}}.bind(this.map.keyboard)}_psvShouldGoFast(){return this._sequencePlaying&&this.psv.getTransitionDuration()<1e3||this.map&&this.isMapWide()}refreshPSV(){var F;const Da=this.psv._myVTour.getCurrentNode();if(Da&&Da.panorama.baseUrl!==(null===Da||void 0===Da||null===(F=Da.panorama)||void 0===F?void 0:F.origBaseUrl)){const F=this.psv.getZoomLevel(),ll=this.psv.getPosition();this.psv._myVTour.state.currentNode=null,this.psv._myVTour.setCurrentNode(Da.id,{zoomTo:F,rotateTo:ll,fadeIn:!1,speed:0,rotation:!1})}Da&&Da.panorama.rows>1&&this.psv.adapter.__refresh()}setPopup(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(F)if(Da){this.psv.stopKeyboardControl(),this.popupContainer.innerHTML="";const F=document.createElement("div");F.classList.add("gvs-popup-backdrop"),F.addEventListener("click",(()=>this.setPopup(!1)));const ll=document.createElement("div");ll.classList.add("gvs-widget-bg"),"string"===typeof Da?ll.innerHTML=Da:Array.isArray(Da)&&Da.forEach((F=>ll.appendChild(F)));const cl=document.createElement("button");cl.id="gvs-popup-btn-close",cl.classList.add("gvs-btn","gvs-widget-bg"),cl.appendChild((0,Dl.fa)(Wl.Jy)),cl.addEventListener("click",(()=>this.setPopup(!1))),ll.insertBefore(cl,ll.firstChild),this.popupContainer.appendChild(F),this.popupContainer.appendChild(ll),this.popupContainer.classList.remove("gvs-hidden"),(0,Dl.$c)(this.popupContainer,this._t)}else this.popupContainer.classList.remove("gvs-hidden");else this.popupContainer.classList.add("gvs-hidden"),this.psv.startKeyboardControl()}playSequence(){this._sequencePlaying=!0;const F=new Event("sequence-playing");this.dispatchEvent(F);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("psv:picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.psv.getTransitionDuration())}),{once:!0});try{this.psv.goToNextPicture()}catch(F){this.stopSequence()}}};this.psv.addEventListener("click",(()=>{this.stopSequence()})),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.refreshPSV();const F=new Event("sequence-stopped");this.dispatchEvent(F)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}moveCenter(){const F=this.psv.getPictureMetadata();F&&(this.map&&this.isMapWide()?this.map.flyTo({center:F.gps,zoom:20}):this._psvAnimate({speed:Al.LM,yaw:0,pitch:0,zoom:Al.cS}))}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(F){if(this.map&&this.isMapWide()){let Da;switch(F){case"up":Da=[0,-100];break;case"left":Da=[-100,0];break;case"down":Da=[0,Sc];break;case"right":Da=[Sc,0]}this.map.panBy(Da)}else{let Da=this.psv.getPosition();switch(F){case"up":Da.pitch+=wc;break;case"left":Da.yaw-=wc;break;case"down":Da.pitch-=wc;break;case"right":Da.yaw+=wc}this._psvAnimate({speed:Al.LM,...Da})}}_psvAnimate(F){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(F)}isMapWide(){if(!this.map)throw new Error("Map is not enabled");return this.mapContainer.parentNode==this.mainContainer}_getDatesForLayerColors(){const F=864e5,Da=Date.now();return[Da-30*F,Da-365*F,Da-730*F].map((F=>new Date(F).toISOString().split("T")[0]))}_getLayerColorStyle(F){var Da,ll,cl,hl,dl;const fl=["case",["==",["get","hidden"],!0],pl.lm.HIDDEN],Al=(null===(Da=this.psv._myVTour)||void 0===Da||null===(ll=Da.state)||void 0===ll?void 0:ll.loadingNode)||(null===(cl=this.psv._myVTour)||void 0===cl||null===(hl=cl.state)||void 0===hl||null===(dl=hl.currentNode)||void 0===dl?void 0:dl.id),bl=Al?this.psv._picturesSequences[Al]:null;if("sequences"==F&&bl?fl.push(["==",["get","id"],bl],pl.lm.SELECTED):"pictures"==F&&bl&&fl.push(["in",bl,["get","sequences"]],pl.lm.SELECTED),this._mapTheme==iu.AGE){const Da="sequences"==F?"date":"ts",ll=this._getDatesForLayerColors();fl.push(["!",["has",Da]],pl.lm.BASE,[">=",["get",Da],ll[0]],pl.lm.PALETTE_4,[">=",["get",Da],ll[1]],pl.lm.PALETTE_3,[">=",["get",Da],ll[2]],pl.lm.PALETTE_2,pl.lm.PALETTE_1)}else this._mapTheme==iu.TYPE?fl.push(["!",["has","type"]],pl.lm.BASE,["==",["get","type"],"equirectangular"],pl.lm.QUALI_1,pl.lm.QUALI_2):this._mapTheme==iu.SCORE?fl.push(["==",kl.d3,5],pl.fW[0].color,["==",kl.d3,4],pl.fW[1].color,["==",kl.d3,3],pl.fW[2].color,["==",kl.d3,2],pl.fW[3].color,pl.fW[4].color):fl.push(pl.lm.BASE);return fl}_getLayerSortStyle(F){var Da,ll,cl,hl,dl;const pl=["case",["==",["get","hidden"],!0],90],fl=(null===(Da=this.psv._myVTour)||void 0===Da||null===(ll=Da.state)||void 0===ll?void 0:ll.loadingNode)||(null===(cl=this.psv._myVTour)||void 0===cl||null===(hl=cl.state)||void 0===hl||null===(dl=hl.currentNode)||void 0===dl?void 0:dl.id),Al=fl?this.psv._picturesSequences[fl]:null;if("sequences"==F&&Al?pl.push(["==",["get","id"],Al],100):"pictures"==F&&Al&&pl.push(["in",Al,["get","sequences"]],100),this._mapTheme==iu.AGE){const Da="sequences"==F?"date":"ts",ll=this._getDatesForLayerColors();pl.push(["!",["has",Da]],0,[">=",["get",Da],ll[0]],50,[">=",["get",Da],ll[1]],49,[">=",["get",Da],ll[2]],48)}else this._mapTheme==iu.TYPE?pl.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapTheme==iu.SCORE&&pl.push(["==",kl.d3,5],80,["==",kl.d3,4],65,["==",kl.d3,3],50,["==",kl.d3,2],35,["==",kl.d3,1],20);return pl.push(10),pl}getPicturesNavigation(){return this._picNav}setPicturesNavigation(F){this._picNav=F;const Da=new CustomEvent("pictures-navigation-changed",{detail:{value:F}});this.dispatchEvent(Da)}_picturesNavFilter(F){switch(this._picNav){case"seq":return["next","prev"].includes(F.rel);case"pic":return!1;default:return!0}}toggleJOSMLive(F){if(F){const F=new CustomEvent("josm-live-enabled");return this.dispatchEvent(F),fetch(eu+"/version").catch((F=>{throw this.dispatchEvent(new CustomEvent("josm-live-disabled")),F})).then((()=>{const F=(0,pl.dK)(this.psv.getPictureMetadata());if(F){fetch(`${eu}/load_and_zoom?${F}`).catch((F=>{console.warn(F),this.toggleJOSMLive(!1)}))}this._josmListener=()=>{const F=(0,pl.dK)(this.psv.getPictureMetadata());if(F){fetch(`${eu}/zoom?${F}`).catch((F=>{console.warn(F),this.toggleJOSMLive(!1)}))}},this.addEventListener("psv:picture-loaded",this._josmListener),this.addEventListener("psv:picture-loading",this._josmListener)}))}{const F=new CustomEvent("josm-live-disabled");return this.dispatchEvent(F),this._josmListener&&(this.removeEventListener("picture-loading",this._josmListener),this.removeEventListener("picture-loaded",this._josmListener),delete this._josmListener),Promise.resolve()}}setFocus(F){var Da,ll,cl;let hl=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("map"===F&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(F))throw new Error("Invalid focus value (should be pic or map)");if(("map"!==F||!this.map||!this.isMapWide())&&("pic"!==F||this.map&&this.isMapWide())){var dl;if(null===(Da=this.mapContainer.parentElement)||void 0===Da||Da.removeChild(this.mapContainer),null===(ll=this.psvContainer.parentElement)||void 0===ll||ll.removeChild(this.psvContainer),"map"===F)this.psv.stopKeyboardControl(),this.map.keyboard.enable(),this.container.classList.add("gvs-focus-map"),this.mainContainer.appendChild(this.mapContainer),this.miniContainer.appendChild(this.psvContainer),this.map.getCanvas().focus();else null===this||void 0===this||null===(dl=this.map)||void 0===dl||dl.keyboard.disable(),this.psv.startKeyboardControl(),this.container.classList.remove("gvs-focus-map"),this.mainContainer.appendChild(this.psvContainer),this.miniContainer.appendChild(this.mapContainer),this.psvContainer.focus();if(null===this||void 0===this||null===(cl=this.map)||void 0===cl||cl.resize(),this.psv.autoSize(),this.refreshPSV(),!hl){const Da=new CustomEvent("focus-changed",{detail:{focus:F}});this.dispatchEvent(Da)}}}toggleFocus(){if(!this.map)throw new Error("Map is not enabled");this.setFocus(this.isMapWide()?"pic":"map")}setUnfocusedVisible(F){if(!this.map)throw new Error("Map is not enabled");F?this.container.classList.remove("gvs-mini-hidden"):this.container.classList.add("gvs-mini-hidden"),this.map.resize(),this.psv.autoSize()}toggleUnfocusedVisible(){if(!this.map)throw new Error("Map is not enabled");this.setUnfocusedVisible(this.container.classList.contains("gvs-mini-hidden"))}setFilters(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],cl=[],hl=[],dl=!1;if(this._mapFilters={},F.minDate&&""!==F.minDate&&(this._mapFilters.minDate=F.minDate,cl.push([">=",["get","date"],F.minDate]),hl.push([">=",["get","ts"],F.minDate])),F.maxDate&&""!==F.maxDate){this._mapFilters.maxDate=F.maxDate,cl.push(["<=",["get","date"],F.maxDate]);let Da=new Date(F.maxDate);Da.setDate(Da.getDate()+1),Da=Da.toISOString().split("T")[0],hl.push(["<=",["get","ts"],Da])}if(F.type&&""!==F.type&&(this._mapFilters.type=F.type,cl.push(["==",["get","type"],F.type]),hl.push(["==",["get","type"],F.type])),null!==(Da=this.map)&&void 0!==Da&&Da._hasGridStats()&&(dl=!0),F.camera&&""!==F.camera){this._mapFilters.camera=F.camera;const Da=F.camera.toLowerCase().trim()+" ",ll=F.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",dl=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];cl.push([">=",["get","model"],Da,dl]),cl.push(["<=",["get","model"],ll,dl]),hl.push([">=",["get","model"],Da,dl]),hl.push(["<=",["get","model"],ll,dl])}if(F.qualityscore&&F.qualityscore.length>0&&(this._mapFilters.qualityscore=F.qualityscore,cl.push(["in",kl.d3,["literal",this._mapFilters.qualityscore]]),hl.push(["in",kl.d3,["literal",this._mapFilters.qualityscore]])),F.theme&&Object.values(iu).includes(F.theme)&&(this._mapFilters.theme=F.theme,this.map&&(this._mapTheme=this._mapFilters.theme,dl=!0)),0==cl.length?cl=null:cl.unshift("all"),0==hl.length?hl=null:(hl.unshift("all"),hl=["step",["zoom"],!0,kl.oe,hl]),this.map){dl&&this.map.reloadLayersStyles();const F=this.map.getVisibleUsers().includes("geovisio");cl&&F&&(cl=["step",["zoom"],!0,7,cl]),this.map.filterUserLayersContent("sequences",cl),this.map.filterUserLayersContent("pictures",hl),!ll&&(null!==cl||null!==hl||null!==this._mapFilters.theme&&this._mapFilters.theme!==iu.DEFAULT)&&F&&this.map.getZoom()<7&&!this.map._hasGridStats()&&this.map.easeTo({zoom:7})}const pl=new CustomEvent("filters-changed",{detail:Object.assign({},this._mapFilters)});this.dispatchEvent(pl)}}},6803:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CoreView});ll(8946);var cl=ll(5254),hl=ll(6980),dl=ll(1300),pl=ll(5071),fl=ll(8330),Al=ll(2730);class CoreView extends EventTarget{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(),this._options=ll,null==this._options&&(this._options={}),this._options.users||(this._options.users=["geovisio"]),"string"===typeof this._options.users&&(this._options.users=[this._options.users]),this._options.style||(this._options.style=dl.AV),this._options.testing||console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${fl.rE} (43f3ef3)\n\n\ud83c\udd98 Issues can be reported at ${fl.Jk.O}`),this._t=(0,hl.$)(this._options.lang),this._isInternetFast=null,(0,pl.KF)().then((F=>this._isInternetFast=F)),this._selectedSeqId=this._options.selectedSequence||null,this._selectedPicId=this._options.selectedPicture||null,this.container="string"===typeof F?document.getElementById(F):F,!(this.container instanceof Element))throw new Error("Container is not a valid HTML element, does it exist in your page ?");this.container.classList.add("gvs",`gvs-${this.getClassName().toLocaleLowerCase()}`),(0,pl.GZ)()&&this.container.classList.add("gvs-iframed"),this.loaderContainer=document.createElement("div"),this.container.appendChild(this.loaderContainer),this._loader=new Al.A(this,this.loaderContainer),Da=(Da||"").replace("/api/search","/api");try{var bl;this._api=new cl.A(Da,{users:this._options.users,fetch:null===(bl=this._options)||void 0===bl?void 0:bl.fetchOptions,style:this._options.style}),this._api.onceReady().then((()=>{let F=this._api.getUnavailableFeatures(),Da=this._api.getAvailableFeatures();Da=0===F.length?"\u2705 All features available":"\u2705 Available features: "+Da.join(", "),F=0===F.length?"":"\ud83d\udeab Unavailable features: "+F.join(", "),console.info(`\ud83c\udf10 Connected to API "${this._api._metadata.name}" (${this._api._endpoint})\n\u2139\ufe0f API runs STAC ${this._api._metadata.stac_version} ${this._api._metadata.geovisio_version?"& GeoVisio "+this._api._metadata.geovisio_version:""}\n ${Da}\n ${F}\n`.trim())})).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api)))}catch(kl){this._loader.dismiss(kl,this._t.gvs.error_api)}}getClassName(){return"CoreView"}destroy(){delete this._options,delete this._t,delete this._api,delete this._loader,this.loaderContainer.remove(),delete this.loaderContainer}isWidthSmall(){var F;return(null===(F=this.container)||void 0===F?void 0:F.offsetWidth)<576}isHeightSmall(){var F;return(null===(F=this.container)||void 0===F?void 0:F.offsetHeight)<400}select(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const cl=this._selectedSeqId||null,hl=this._selectedPicId||null;(ll||hl!=Da||cl!=F)&&(this._selectedSeqId=F,this._selectedPicId=Da,this.dispatchEvent(new CustomEvent("select",{detail:{seqId:F,picId:Da,prevSeqId:cl,prevPicId:hl}})))}}},2730:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Loader});ll(737);var cl=ll(2305),hl=ll(6883);class Loader{constructor(F,Da){this._parent=F,this.container=Da,this.container.classList.add("gvs-loader","gvs-loader-visible");const ll=document.createElement("img");ll.src=hl,ll.alt="",ll.title=this._parent._t.map.loading,ll.classList.add("gvs-loader-img"),this.container.appendChild(ll);const cl=document.createElement("div"),dl=document.createElement("span"),nextLabelFun=()=>this._parent._t.gvs.loading_labels_fun[Math.floor(Math.random()*this._parent._t.gvs.loading_labels_fun.length)];dl.innerHTML=this._parent._t.gvs.loading_labels_serious[Math.floor(Math.random()*this._parent._t.gvs.loading_labels_serious.length)];const nextLabelFct=()=>setTimeout((()=>{dl.innerHTML=nextLabelFun(),this._loaderLabelChanger=nextLabelFct()}),500+1e3*Math.random());this._loaderLabelChanger=nextLabelFct(),cl.appendChild(dl),this.container.appendChild(cl)}isVisible(){return this.container.classList.contains("gvs-loader-visible")}dismiss(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(clearTimeout(this._loaderLabelChanger),F){!0!==F&&console.error(F),this.container.children[0].src=cl,this.container.children[0].style.width="200px",this.container.children[0].style.animation="unset";let hl=`<small>${ll?this._parent._t.gvs.error_click:this._parent._t.gvs.error_retry}</small>`;Da&&(hl=Da+"<br />"+hl),this.container.children[1].innerHTML=`${this._parent._t.gvs.error}<br />${hl}`,ll&&this.container.addEventListener("click",ll);const dl=Da||"Panoramax JS had a blocking exception",pl=new CustomEvent("broken",{detail:{error:dl}});throw this._parent.dispatchEvent(pl),new Error(dl)}{this.container.classList.remove("gvs-loader-visible"),setTimeout((()=>this.container.remove()),2e3);const F=new CustomEvent("ready");this._parent.dispatchEvent(F),ll&&ll()}}}},1951:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Map});ll(1120);var cl=ll(1300),hl=ll(5071),dl=ll(6883),pl=ll(270),fl=ll(6462),Al=ll(9740),bl=(ll(6795),ll(927)),kl=ll.n(bl),Dl=ll(587),Wl=ll.n(Dl),Ql=ll(6840);kl().workerClass=Wl(),kl().addProtocol("pmtiles",(new Ql.Zs).tile);const wc=["antialias","attributionControl","bearing","bearingSnap","bounds","boxZoom","center","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","keyboard","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle","zoom"];class Map extends kl().Map{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var hl,dl;(super({container:Da,style:(0,cl.CG)(F,ll),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,preserveDrawingBuffer:!F.isWidthSmall(),transformRequest:F._api._getMapRequestTransform(),locale:F._t.maplibre,...(hl=ll,Object.fromEntries(Object.entries(hl).filter((F=>{let[Da]=F;return wc.includes(Da)}))))}),this._loadMarkerImages(),this._parent=F,this._options=ll,this.getContainer().classList.add("gvs-map"),void 0===ll.touchZoomRotate)&&(null===this||void 0===this||null===(dl=this.touchZoomRotate)||void 0===dl||dl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(kl().AttributionControl)({compact:!1}),this.addControl(this._attribution),this._initGeocoder(),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this.on("mousemove","sequences",this._onSequenceHover.bind(this)),this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{!this.loaded()&&this._parent._loader.isVisible()&&this._parent._loader.dismiss({},this._parent._t.map.slow_loading,(()=>{}))}),15e3),this.on("load",(async()=>{await this.setVisibleUsers(this._parent._options.users),this.reloadLayersStyles(),this.resize()}))}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent._api.onceReady().then((()=>{var F,Da;let ll=null===(F=this._parent)||void 0===F||null===(Da=F._api)||void 0===Da?void 0:Da.getDataBbox();if(ll)try{ll=new(kl().LngLatBounds)(ll),this.loaded()?this.fitBounds(ll,{animate:!1}):this.on("load",(()=>this.fitBounds(ll,{animate:!1})))}catch(cl){console.warn("Received invalid bbox: "+ll)}}))}_initGeocoder(){var F,Da;const ll={ban:cl.Kf,nominatim:cl.RK},hl=(null===(F=this._options)||void 0===F||null===(Da=F.geocoder)||void 0===Da?void 0:Da.engine)||"nominatim";this.geocoder=ll[hl],this._geolocate=new(kl().GeolocateControl)({positionOptions:{enableHighAccuracy:!0,timeout:6e4,maximumAge:3e5},showAccuracyCircle:!0,showUserLocation:!0,trackUserLocation:!0}).onAdd(this)}_loadMarkerImages(){[{id:"gvs-marker",img:dl},{id:"gvs-arrow-flat",img:fl},{id:"gvs-arrow-360",img:Al}].forEach((F=>{const Da=new Image(64,64);Da.onload=()=>this.addImage(F.id,Da),Da.src=F.img}))}_hasQualityScore(){var F,Da,ll,cl;const hl=(null===(F=this.getStyle())||void 0===F||null===(Da=F.metadata)||void 0===Da?void 0:Da["panoramax:fields"])||{};return(null===hl||void 0===hl||null===(ll=hl.pictures)||void 0===ll?void 0:ll.includes("gps_accuracy"))&&(null===hl||void 0===hl||null===(cl=hl.pictures)||void 0===cl?void 0:cl.includes("h_pixel_density"))}_hasGridStats(){var F,Da,ll,cl,hl,dl;const pl=(null===(F=this.getStyle())||void 0===F||null===(Da=F.metadata)||void 0===Da?void 0:Da["panoramax:fields"])||{};return(null===pl||void 0===pl||null===(ll=pl.grid)||void 0===ll?void 0:ll.includes("nb_360_pictures"))&&(null===pl||void 0===pl||null===(cl=pl.grid)||void 0===cl?void 0:cl.includes("nb_flat_pictures"))&&(null===pl||void 0===pl||null===(hl=pl.grid)||void 0===hl?void 0:hl.includes("coef_360_pictures"))&&(null===pl||void 0===pl||null===(dl=pl.grid)||void 0===dl?void 0:dl.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((F=>{const Da=this.getSource((0,cl.e8)(F));Da.setTiles(Da.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(cl.m5)}getBackground(){if(!this.getLayer(cl.m5))return"streets";return"visible"==this.getLayoutProperty(cl.m5,"visibility")?"aerial":"streets"}setBackground(F){if(!this.getLayer(cl.m5)&&"aerial"===F)throw new Error("No aerial imagery available");if(this.getLayer(cl.m5)){this.setLayoutProperty(cl.m5,"visibility","aerial"===F?"visible":"none");const Da=new CustomEvent("map:background-changed",{detail:{background:F||"streets"}});this._parent.dispatchEvent(Da)}}getVisibleUsers(){return[...this._userLayers].filter((F=>"visible"===this.getLayoutProperty((0,cl.IN)(F,"pictures"),"visibility")))}async setVisibleUsers(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof F&&(F=[F]),await Promise.all(F.filter((F=>""!=F&&!this._userLayers.has(F))).map((F=>this._createPicturesTilesLayer(F))));const Da=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((ll=>{Da.forEach((Da=>{const hl=(0,cl.IN)(ll,Da);this.getLayer(hl)&&this.setLayoutProperty(hl,"visibility",F.includes(ll)?"visible":"none")}))}));const ll=new CustomEvent("map:users-changed",{detail:{usersIds:F}});this._parent.dispatchEvent(ll)}filterUserLayersContent(F,Da){[...this._userLayers].forEach((ll=>{this.setFilter((0,cl.IN)(ll,F),Da),"sequences"===F&&this.getLayer((0,cl.IN)(ll,"sequences_plus"))&&this.setFilter((0,cl.IN)(ll,"sequences_plus"),Da),"pictures"===F&&this.getLayer((0,cl.IN)(ll,"pictures_symbols"))&&this.setFilter((0,cl.IN)(ll,"pictures_symbols"),Da)}))}displayPictureMarker(F,Da,ll){this._picMarkerPreview.remove(),this._picMarker.setLngLat([F,Da]).setRotation(ll).addTo(this),this.reloadLayersStyles(),this.flyTo({center:[F,Da],zoom:this.getZoom()<cl.oe+2?cl.oe+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){var F;const updateStyle=(F,Da)=>{[...this._userLayers].forEach((ll=>{for(let hl in Da.layout)this.setLayoutProperty((0,cl.IN)(ll,F),hl,Da.layout[hl]);for(let hl in Da.paint)this.setPaintProperty((0,cl.IN)(ll,F),hl,Da.paint[hl])}))};if(["pictures","pictures_symbols","sequences"].forEach((F=>{updateStyle(F,this._getLayerStyleProperties(F))})),this._hasGridStats()&&null!==(F=this._parent)&&void 0!==F&&F._mapFilters){var Da;let F="coef";null!==(Da=this._parent._mapFilters)&&void 0!==Da&&Da.type&&(F="flat"==this._parent._mapFilters.type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((F=>F.id.endsWith("_grid"))).forEach((Da=>{const ll=(0,cl.Hj)(Da,F);for(let F in ll.layout)this.setLayoutProperty(Da.id,F,ll.layout[F]);for(let F in ll.paint)this.setPaintProperty(Da.id,F,ll.paint[F])}))}}async _createPicturesTilesLayer(F){this._userLayers.add(F);const Da=this.getStyle().layers.find(cl.Sf);if("geovisio"!==F&&!this.getSource(`geovisio_${F}`)){const ll=await this._parent._api.getUserMapStyle(F);Object.entries(ll.sources).forEach((F=>{let[Da,ll]=F;return this.addSource(Da,ll)})),ll.layers=ll.layers||[];ll.layers.concat((0,cl.Oq)(ll.sources,ll.layers)).filter((F=>Object.keys(F).length>0)).forEach((F=>this.addLayer(F,null===Da||void 0===Da?void 0:Da.id)))}this._picPreviewTimer=null,this._picPopup=new(kl().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const ll=(0,cl.IN)(F,"pictures");this.on("mousemove",ll,(F=>{this.getCanvas().style.cursor="pointer";const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,ll)),100)})),this.on("mouseleave",ll,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",ll,this._onPictureClick.bind(this));const hl=(0,cl.IN)(F,"sequences_plus");this.on("mousemove",hl,(F=>{if(this.getZoom()<=cl.oe+1&&(this.getCanvas().style.cursor="pointer",F.features[0].properties.id)){const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,hl)),100)}})),this.on("mouseleave",hl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",hl,(F=>{F.preventDefault(),this.getZoom()<=cl.oe+1&&this._onSequenceClick(F)})),"geovisio"===F&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(F=>{if(this.getZoom()<=cl.oe+1){this.getCanvas().style.cursor="pointer";const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(F=>{F.preventDefault(),this.flyTo({center:F.lngLat,zoom:cl.oe-6})}))),this.on("click",(F=>{!1===F.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(F){if("pictures_symbols"===F)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent._selectedPicId],"",["==",["get","type"],"equirectangular"],"gvs-arrow-360","gvs-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(F)}};{const Da={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${Da[F]}-color`]:this._getLayerColorStyle(F)},cl.VM[F.toUpperCase()].paint),layout:Object.assign({[`${Da[F]}-sort-key`]:this._getLayerSortStyle(F)},cl.VM[F.toUpperCase()].layout)}}}_getLayerColorStyle(F){const Da=["case",["==",["get","hidden"],!0],hl.lm.HIDDEN,["==",["get","geovisio:status"],"hidden"],hl.lm.HIDDEN],ll=this._parent._selectedSeqId;return"sequences"==F&&ll?Da.push(["==",["get","id"],ll],hl.lm.SELECTED):F.startsWith("pictures")&&ll&&Da.push(["in",ll,["get","sequences"]],hl.lm.SELECTED),Da.push(hl.lm.BASE),Da}_getLayerSortStyle(F){const Da=["case",["==",["get","hidden"],!0],90],ll=this._parent._selectedSeqId;return"sequences"==F&&ll?Da.push(["==",["get","id"],ll],100):F.startsWith("pictures")&&ll&&Da.push(["in",ll,["get","sequences"]],100),Da.push(10),Da}_attachPreviewToPictures(F,Da){let ll=F.features.pop();if(!ll||ll.properties.id==this._picPopup._picId)return;let hl=null;if(Da.endsWith("pictures")?hl=ll.geometry.coordinates.slice():F.lngLat&&(hl=[F.lngLat.lng,F.lngLat.lat]),!hl){const F="LineString"===ll.geometry.type?[ll.geometry.coordinates]:ll.geometry.coordinates;let Da=null;const cl=this.getBounds(),dl=cl.getCenter();for(let ll=0;ll<F.length;ll++)for(let pl=0;pl<F[ll].length;pl++)if(cl.contains(F[ll][pl])){let cl=dl.distanceTo(new(kl().LngLat)(...F[ll][pl]));(null===Da||cl<Da)&&(hl=F[ll][pl],Da=cl)}if(!hl)return}this._picPopup.setLngLat(hl).addTo(this),this._picThumbUrl[ll.properties.id]||this._picPopup.setDOMContent((0,cl.No)(this._parent._t)),this._picPopup._loading=ll.properties.id,this._picPopup._picId=ll.properties.id;const displayThumb=F=>{if(this._picPopup._loading===ll.properties.id)if(delete this._picPopup._loading,F){let Da=document.createElement("img");Da.classList.add("gvs-map-thumb"),Da.alt=this._parent._t.map.thumbnail;let cl=new Image;if(cl.src=F,cl.addEventListener("load",(()=>{ll.properties.hidden?Da.children[0].src=cl.src:Da.src=cl.src,this._picPopup.setDOMContent(Da)})),ll.properties.hidden){const F=document.createElement("div");F.classList.add("gvs-map-thumb-legend"),F.appendChild(document.createTextNode(this._parent._t.map.not_public));const ll=document.createElement("div");ll.appendChild(Da),ll.appendChild(F),Da=ll}}else this._picPopup.remove()};Da.endsWith("pictures")?this._getPictureThumbURL(ll.properties.id).then(displayThumb):Da.endsWith("grid")?this._getThumbURL(hl).then(displayThumb):this._getSequenceThumbURL(ll.properties.id,new(kl().LngLat)(...hl)).then(displayThumb)}_getThumbURL(F){return this._parent._api.getPicturesAroundCoordinates(F[1],F[0],.1,1).then((F=>{var Da;const ll=null===F||void 0===F||null===(Da=F.features)||void 0===Da?void 0:Da.pop();return ll?this._parent._api.findThumbnailInPictureFeature(ll):null}))}_getSequenceThumbURL(F,Da){return Da?this._parent._api.getPicturesAroundCoordinates(Da.lat,Da.lng,1,1,F).then((Da=>{var ll;return(null===Da||void 0===Da||null===(ll=Da.features)||void 0===ll?void 0:ll.length)>0?this._parent._api.findThumbnailInPictureFeature(Da.features[0]):this._parent._api.getPictureThumbnailURLForSequence(F)})):this._parent._api.getPictureThumbnailURLForSequence(F)}_getPictureThumbURL(F,Da){let ll=null;return F&&(void 0!==this._picThumbUrl[F]?ll="string"===typeof this._picThumbUrl[F]?Promise.resolve(this._picThumbUrl[F]):this._picThumbUrl[F]:(this._picThumbUrl[F]=this._parent._api.getPictureThumbnailURL(F,Da).then((Da=>Da?(this._picThumbUrl[F]=Da,Da):(this._picThumbUrl[F]=null,null))).catch((()=>{this._picThumbUrl[F]=null})),ll=this._picThumbUrl[F])),ll}_getPictureMarker(){let F=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const Da=document.createElement("img");return Da.src=F?pl:dl,Da.alt="",new(kl().Marker)({element:Da})}_onSequenceHover(F){var Da;F.preventDefault(),F.features.length>0&&null!==(Da=F.features[0].properties)&&void 0!==Da&&Da.id&&this._parent.dispatchEvent(new CustomEvent("map:sequence-hover",{detail:{seqId:F.features[0].properties.id}}))}_onSequenceClick(F){var Da;F.preventDefault(),F.features.length>0&&null!==(Da=F.features[0].properties)&&void 0!==Da&&Da.id&&this._parent.dispatchEvent(new CustomEvent("map:sequence-click",{detail:{seqId:F.features[0].properties.id,coordinates:F.lngLat}}))}_onPictureClick(F){var Da,ll;F.preventDefault();const cl=(null===F||void 0===F||null===(Da=F.features)||void 0===Da?void 0:Da.length)>0?F.features[0]:null;if(null!==cl&&void 0!==cl&&null!==(ll=cl.properties)&&void 0!==ll&&ll.id){let Da=null;try{cl.properties.sequences&&(Array.isArray(cl.properties.sequences)||(cl.properties.sequences=JSON.parse(cl.properties.sequences)),Da=cl.properties.sequences.pop())}catch(F){console.log("Sequence ID is not available in vector tiles for picture "+cl.properties.id)}this._parent.dispatchEvent(new CustomEvent("map:picture-click",{detail:{picId:cl.properties.id,seqId:Da,feature:cl}}))}}}},8489:(F,Da,ll)=>{"use strict";ll.d(Da,{Ay:()=>Photo,LM:()=>Dl,Vf:()=>Wl,cS:()=>kl});ll(8310);var cl=ll(5975),hl=ll(2305),dl=ll(5071),pl=(ll(3961),ll(1080),ll(2710),ll(1575),ll(1545)),fl=ll(3348),Al=ll(3727);const bl={baseUrl:cl,width:1280,cols:2,rows:1,tileUrl:()=>null},kl=30,Dl=250,Wl=3e3;pl.jM.useNewAnglesOrder=!0;class Photo extends pl.jM{constructor(F,Da){var ll,cl,hl,dl;let pl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:Da,adapter:[Al.A,{showErrorTile:!1,baseBlur:!1,resolution:F.isWidthSmall()?32:64,shouldGoFast:pl.shouldGoFast}],withCredentials:"include"==(null===(ll=F._options)||void 0===ll||null===(cl=ll.fetchOptions)||void 0===cl?void 0:cl.credentials),requestHeaders:null===(hl=F._options)||void 0===hl||null===(dl=hl.fetchOptions)||void 0===dl?void 0:dl.headers,panorama:bl,lang:F._t.psv,minFov:5,loadingTxt:" ",navbar:null,rendererParameters:{preserveDrawingBuffer:!F.isWidthSmall()},plugins:[[fl.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}]],...pl}),this._parent=F,Da.classList.add("gvs-psv"),this._shouldGoFast=(null===pl||void 0===pl?void 0:pl.shouldGoFast)||(()=>!1),this._transitionDuration=(null===pl||void 0===pl?void 0:pl.transitionDuration)||Dl,this._myVTour=this.getPlugin(fl.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent()}async _getNodeFromAPI(F){var Da,ll,cl;if(!F)return;const hl=await fetch(this._parent._api.getPictureMetadataUrl(F,this._picturesSequences[F]),this._parent._api._getFetchOptions());let pl=await hl.json();if(pl.features&&(pl=pl.features.pop()),!pl||0===Object.keys(pl).length||!hl.ok)throw this._parent._loader&&this._parent._loader.dismiss(!0,this._parent._t.gvs.error_pic),new Error("Picture with ID "+F+" was not found");this._picturesSequences[F]=pl.collection;const fl=(0,dl.rs)(pl,this._parent._t,this._parent._isInternetFast,null===(Da=this._parent._picturesNavFilter)||void 0===Da?void 0:Da.bind(this._parent));var Al,bl;null!==fl&&void 0!==fl&&null!==(ll=fl.sequence)&&void 0!==ll&&ll.prevPic&&(this._picturesSequences[null===fl||void 0===fl||null===(Al=fl.sequence)||void 0===Al?void 0:Al.prevPic]=pl.collection);null!==fl&&void 0!==fl&&null!==(cl=fl.sequence)&&void 0!==cl&&cl.nextPic&&(this._picturesSequences[null===fl||void 0===fl||null===(bl=fl.sequence)||void 0===bl?void 0:bl.nextPic]=pl.collection);return fl}_psvNodeTransition(F,Da,ll){var cl,hl;let pl={};const fl=this._shouldGoFast()?0:Math.min(Dl,this._transitionDuration),Al=fl>100,bl=null!=(ll||(null===Da||void 0===Da?void 0:Da.links.find((Da=>Da.nodeId==F.id)))),Wl=Da&&F.sequence.id===Da.sequence.id,Ql=((null===Da||void 0===Da||null===(cl=Da.properties)||void 0===cl?void 0:cl["view:azimuth"])||0)*(Math.PI/180),wc=((null===F||void 0===F||null===(hl=F.properties)||void 0===hl?void 0:hl["view:azimuth"])||0)*(Math.PI/180);this.setOption("maxFov",Math.min(3*F.horizontalFov/4,90));const Sc={speed:0,fadeIn:!1,rotation:!1,rotateTo:{pitch:0,yaw:0},zoomTo:kl};if(360==F.horizontalFov)pl=Da?(0,dl.Yf)(Da.gps,F.gps)>=.001?Sc:{speed:fl,fadeIn:bl&&Al,rotation:bl&&Wl&&Al,rotateTo:this.getPosition()}:Sc;else if(Wl){const F=this.getPosition().yaw,ll=Da.horizontalFov*(Math.PI/180)/2,cl=F<=ll||F>=2*Math.PI-ll,hl=Math.abs(Ql-wc)<=Math.PI/4;pl={speed:fl,fadeIn:bl&&hl&&Al,rotation:bl&&hl&&Al,rotateTo:cl?this.getPosition():{pitch:0,yaw:0},zoomTo:cl?this.getZoomLevel():kl}}else pl=Sc;pl.fadeIn&&pl.speed>=150?setTimeout(this._clearArrows,pl.speed-100):this._clearArrows();const eu=new CustomEvent("psv:picture-loading",{detail:{...Object.assign({},this.getXYZ(),pl.rotateTo?{x:180*(wc+pl.rotateTo.yaw)/Math.PI}:null,pl.zoomTo?{z:pl.zoomTo}:null),picId:F.id,lon:F.gps[0],lat:F.gps[1]}});return this._parent.dispatchEvent(eu),pl}_onEnterArrow(F){const Da=F.link,ll=F.node;let cl;ll&&(cl=360===ll.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const hl=new CustomEvent("psv:picture-preview-started",{detail:{picId:Da.nodeId,coordinates:Da.gps,direction:cl}});this._parent.dispatchEvent(hl)}_onLeaveArrow(F){const Da=F.link,ll=new CustomEvent("psv:picture-preview-stopped",{detail:{picId:Da.nodeId}});this._parent.dispatchEvent(ll)}_onPositionUpdated(F){let{position:Da}=F;const ll=(0,dl.oi)(Da,this.getZoomLevel());ll.x+=this.getPictureOriginalHeading(),ll.x=ll.x%360;const cl=new CustomEvent("psv:view-rotated",{detail:ll});this._parent.dispatchEvent(cl),this._onTilesStartLoading()}_onZoomUpdated(F){let{zoomLevel:Da}=F;const ll=new CustomEvent("psv:view-rotated",{detail:{...this.getXY(),z:Da}});this._parent.dispatchEvent(ll),this._onTilesStartLoading()}_onNodeChanged(F){for(let cl of document.getElementsByClassName("gvs-psv-tour-arrows"))cl.classList.remove("gvs-clicked");if(F.node.id){var Da,ll;this._parent.select(null===(Da=F.node)||void 0===Da||null===(ll=Da.sequence)||void 0===ll?void 0:ll.id,F.node.id);const cl=this.getPictureMetadata();if(!cl)return;this._prevSequence=cl.sequence.id;const hl=new CustomEvent("psv:picture-loaded",{detail:{...this.getXYZ(),picId:F.node.id,lon:cl.gps[0],lat:cl.gps[1]}});this._parent.dispatchEvent(hl),cl.panorama.hdUrl?(this.setOption("downloadUrl",cl.panorama.hdUrl),this.setOption("downloadName",F.node.id+".jpg")):this.setOption("downloadUrl",null)}this._onTilesStartLoading()}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const F=new Event("psv:picture-tiles-loaded",{picId:this._myVTour.state.currentNode.id});this._parent.dispatchEvent(F)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){return this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}_onSelect(F){var Da;F.detail.seqId&&(this._picturesSequences[F.detail.picId]=F.detail.seqId),(null===(Da=this._myVTour.getCurrentNode())||void 0===Da?void 0:Da.id)!==F.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(F.detail.picId).catch((F=>{this.showErrorOverlay(F,this._parent._t.gvs.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const F=this.getPictureMetadata().sequence.nextPic;if(!F)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,F)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const F=this.getPictureMetadata().sequence.prevPic;if(!F)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,F)}async goToPosition(F,Da){return this._parent._api.getPicturesAroundCoordinates(F,Da).then((F=>{if(F.features.length>0){const Da=F.features.pop();return this._parent.select(null===Da||void 0===Da?void 0:Da.collection,Da.id),Da.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const F=(0,dl.oi)(this.getPosition());return F.x=(F.x+this.getPictureOriginalHeading())%360,F}getXYZ(){const F=this.getXY();return F.z=this.getZoomLevel(),F}getPictureOriginalHeading(){var F,Da;return(null===(F=this.getPictureMetadata())||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"])||0}getPictureRelativeHeading(){return(0,dl.dj)(this.getPictureMetadata())}clearPictureMetadataCache(){var F,Da,ll,cl;const hl=null===(F=this.getPictureMetadata())||void 0===F?void 0:F.id,dl=null===(Da=this.getPictureMetadata())||void 0===Da||null===(ll=Da.sequence)||void 0===ll?void 0:ll.id;null===(cl=this._myVTour.state.currentTooltip)||void 0===cl||cl.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},hl&&this._parent.select(dl,hl)}setXYZ(F,Da,ll){const cl=(0,dl.y7)(F-this.getPictureOriginalHeading(),Da,ll);this.rotate({yaw:cl.yaw,pitch:cl.pitch}),this.zoom(cl.zoom)}setHigherContrast(F){this.renderer.renderer.toneMapping=F?3:0,this.renderer.renderer.toneMappingExposure=F?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(F){if((F=parseFloat(F))<100||F>Wl)throw new Error("Invalid transition duration (should be between 100 and "+Wl+")");this._transitionDuration=F;const Da=new CustomEvent("psv:transition-duration-changed",{detail:{value:F}});this._parent.dispatchEvent(Da)}setPanorama(F,Da){const onFailure=F=>this.showErrorOverlay(F,this._parent._t.gvs.error_pic,!0);try{return super.setPanorama(F,Da).catch(onFailure)}catch(ll){onFailure(ll)}}showErrorOverlay(F,Da,ll){this._parent._loader.isVisible()||!this.overlay.isVisible()?this._parent._loader.dismiss(F,Da,ll?()=>{this._parent._loader.dismiss(),this.overlay.hide()}:void 0):(console.error(F),this.overlay.show({image:`<img style="width: 200px" src="${hl}" alt="" />`,title:this._parent._t.gvs.error,text:Da+"<br />"+this._parent._t.gvs.error_click,dissmisable:ll}))}}},5254:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>API});var cl=ll(1300);class API{constructor(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===F||void 0===F||"string"!==typeof F)throw new Error("endpoint parameter is empty or not a valid string");if(F.startsWith("/")&&(F=window.location.href.split("/").slice(0,3).join("/")+F),!API.isValidHttpUrl(F))throw new Error(`endpoint parameter is not a valid URL: ${F}`);this._endpoint=F,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===Da||void 0===Da?void 0:Da.fetch)||{},this._metadata={},Da.skipReadLanding||(this._readLanding=fetch(F,this._getFetchOptions()).then((F=>F.json())).then((F=>this._parseLanding(F,Da))).catch((F=>(this._isReady=-1,console.error(F),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(Da.style,Da.users))).then((()=>(this._isReady=1,"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((F=>null!==F[1])).map((F=>F[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((F=>null===F[1])).map((F=>F[0]))}_parseLanding(F,Da){var ll,cl;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===Da||void 0===Da?void 0:Da.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!F||!F.links||!Array.isArray(F.links))throw new Error("API Landing page doesn't contain 'links' list");if(!F.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${F.stac_version})`);this._metadata.name=F.title||"Unnamed",this._metadata.stac_version=F.stac_version,this._metadata.geovisio_version=F.geovisio_version;const hl=[],dl=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((Da=>{const ll=F.links.find((F=>F.rel==Da.rel&&F.type==Da.type));if(ll){if(!API.isValidHttpUrl(ll.href))throw new Error(`API endpoint '${ll.rel}' (${ll.type}) is not a valid URL: ${ll.href}`);this._endpoints[Da.endpointId]||(this._endpoints[Da.endpointId]=ll.href)}else if(!this._endpoints[Da.endpointId]){let F=`API doesn't offer a '${Da.rel}' (${Da.type}) endpoint in its links`;Da.missingIssue&&(F+=`\n${Da.missingIssue}`),Da.mandatory?hl.push(F):Da.missingIssue&&dl.push(F)}})),this._endpoints.style||this._endpoints.tiles||dl.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||dl.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),dl.forEach((F=>console.warn(F))),hl.length>0)throw new Error(hl.join("\n"));const pl=null===F||void 0===F||null===(ll=F.extent)||void 0===ll||null===(cl=ll.spatial)||void 0===cl?void 0:cl.bbox;this._dataBbox=pl&&Array.isArray(pl)&&pl.length>0&&Array.isArray(pl[0])&&4===pl[0].length?[[pl[0][0],pl[0][1]],[pl[0][2],pl[0][3]]]:null}_loadMapStyles(F,Da){const ll=new Set(Da||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const cl=[this.getMapStyle()];if("string"===typeof F){const Da=F.startsWith(this._endpoint)?this._getFetchOptions():void 0;cl.push(fetch(F,Da).then((F=>F.json())))}else"object"===typeof F&&cl.push(Promise.resolve(F));return[...ll].filter((F=>"geovisio"!==F)).forEach((F=>{cl.push(this.getUserMapStyle(F,!0))})),Promise.all(cl).then((F=>{const Da=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];F.forEach((F=>{Da.forEach((Da=>{F[Da]&&(this.mapStyle[Da]=F[Da]||this.mapStyle[Da])})),Object.assign(this.mapStyle.sources,(null===F||void 0===F?void 0:F.sources)||{}),Object.assign(this.mapStyle.metadata,(null===F||void 0===F?void 0:F.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===F||void 0===F?void 0:F.layers)||[])}))})).catch((F=>console.error(F)))}_getFetchOptions(){return Object.assign({signal:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const F=this._getFetchOptions();if(delete F.signal,Object.keys(F).length>0)return Da=>{if(Da.startsWith(this._endpoint))return{url:Da,...F}}}async getSequenceItems(F){if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(F),fetch(`${this._endpoints.collections}/${F}/items`,this._getFetchOptions()).then((F=>F.json()))}catch(Da){return Promise.reject(Da)}}getPicturesAroundCoordinatesUrl(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,cl=arguments.length>3?arguments[3]:void 0,hl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(F))||isNaN(parseFloat(Da)))throw new Error("lat and lon parameters should be valid numbers");const dl=[Da-ll,F-ll,Da+ll,F+ll].map((F=>F.toFixed(4))).join(","),pl=cl?`&limit=${cl}`:"",fl=hl?`&collections=${hl}`:"";return`${this._endpoints.search}?bbox=${dl}${pl}${fl}`}getPicturesAroundCoordinates(F,Da,ll,cl,hl){return fetch(this.getPicturesAroundCoordinatesUrl(F,Da,ll,cl,hl),this._getFetchOptions()).then((F=>F.json()))}getPictureMetadataUrl(F,Da){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(F))return Da?`${this._endpoints.collections}/${Da}/items/${F}`:`${this._endpoints.search}?ids=${F}`}getMapStyle(){if(this.isReady())return this.mapStyle;let F;return F=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:cl.oe}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((F=>(console.error(F),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof F?fetch(F,this._getFetchOptions()).then((F=>F.json())):Promise.resolve(F)}getUserMapStyle(F){let Da;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?F?(this._endpoints.user_style?Da=this._endpoints.user_style.replace(/\{userId\}/g,F):this._endpoints.user_tiles&&(Da={version:8,sources:{[`geovisio_${F}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,F)],minzoom:0,maxzoom:cl.oe}}}),Da?"string"===typeof Da?fetch(Da,this._getFetchOptions()).then((F=>F.json())):Promise.resolve(Da):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(F){if(!this.isReady())throw new Error("API is not ready to use");if(!F||!F.assets)return null;let Da=null;for(let ll of Object.values(F.assets)){if(ll.roles.includes("thumbnail")&&"image/jpeg"==ll.type&&API.isValidHttpUrl(ll.href))return ll.href;ll.roles.includes("visual")&&"image/jpeg"==ll.type&&API.isValidHttpUrl(ll.href)&&(Da=ll.href)}return Da}getPictureThumbnailURLForSequence(F,Da){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",F));if(Da&&Array.isArray(Da.links)&&Da.links.length>0){let F=Da.links.find((F=>"preview"===F.rel&&"image/jpeg"===F.type));if(F&&API.isValidHttpUrl(F.href))return Promise.resolve(F.href)}const ll=`${this._endpoints.search}?limit=1&collections=${F}`;return fetch(ll,this._getFetchOptions()).then((F=>F.json())).then((F=>Array.isArray(F.features)&&0!=F.features.length?this.findThumbnailInPictureFeature(F.features.pop()):null))}getPictureThumbnailURL(F,Da){if(!this.isReady())throw new Error("API is not ready to use");return F?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",F)):F&&Da?fetch(`${this._endpoints.collections}/${Da}/items/${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>F?this.findThumbnailInPictureFeature(F):null)):fetch(`${this._endpoints.search}?ids=${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>F&&Array.isArray(F.features)&&0!=F.features.length?this.findThumbnailInPictureFeature(F.features.pop()):null)):Promise.resolve(null)}getRSSURL(F){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let Da=this._endpoints.rss;return F&&(Da+=Da.includes("?")?"&":"?",Da+="bbox="+[F.getWest(),F.getSouth(),F.getEast(),F.getNorth()].join(",")),Da}return null}getSequenceMetadataUrl(F){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${F}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>(null===F||void 0===F?void 0:F.features)||null))}getUserName(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${F}`),this._getFetchOptions()).then((F=>F.json())).then((F=>(null===F||void 0===F?void 0:F.name)||null))}sendReport(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const Da={...this._getFetchOptions(),method:"POST",body:JSON.stringify(F),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,Da).then((async F=>{if(F.status>=400){let ll=await F.text();try{ll=JSON.parse(ll).message}catch(Da){}return Promise.reject(ll)}return F.json()}))}static isValidHttpUrl(F){let Da;try{Da=new URL(F)}catch(ll){return!1}return"http:"===Da.protocol||"https:"===Da.protocol}static isIdValid(F){if(!F||"string"!==typeof F||0===F.length)throw new Error("id should be a valid picture unique identifier");return!0}}},654:(F,Da,ll)=>{"use strict";function getExifFloat(F){if(!([null,void 0,""].includes(F)||"string"===typeof F&&""===F.trim())){if("number"===typeof F)return F;if("string"!==typeof F);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(F)){const Da=F.split("/").map((F=>parseFloat(F)));return Da[0]/Da[1]}try{return parseFloat(F)}catch(Da){}}}}function getGPSPrecision(F){var Da,ll,cl,hl,dl;let pl="\u2753";const fl=(null===F||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["quality:horizontal_accuracy"])||getExifFloat(null===F||void 0===F||null===(ll=F.properties)||void 0===ll||null===(cl=ll.exif)||void 0===cl?void 0:cl["Exif.GPSInfo.GPSHPositioningError"]),Al=getExifFloat(null===F||void 0===F||null===(hl=F.properties)||void 0===hl||null===(dl=hl.exif)||void 0===dl?void 0:dl["Exif.GPSInfo.GPSDOP"]);return void 0!==fl?pl=`${fl} m`:void 0!==Al&&(pl=Al<1?"ideal":Al<2?"excellent":Al<5?"good":Al<10?"moderate":Al<20?"fair":"poor"),pl}function getSphereCorrection(F){var Da,ll,cl,hl;let dl=null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"];if(void 0===dl){var pl,fl;const Da=getExifFloat(null===(pl=F.properties)||void 0===pl||null===(fl=pl.exif)||void 0===fl?void 0:fl["Exif.GPSInfo.GPSImgDirection"]);void 0!==Da&&(dl=Da)}dl=dl||0;let Al=null===(ll=F.properties)||void 0===ll?void 0:ll["pers:yaw"],bl=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===Al)for(let su of bl){var kl,Dl;const Da=getExifFloat(null===(kl=F.properties)||void 0===kl||null===(Dl=kl.exif)||void 0===Dl?void 0:Dl[su]);if(void 0!==Da){Al=Da;break}}Al=Al||0,Math.round(dl)===Math.round(Al)&&Al>0&&console.warn("Picture with UUID",F.id,"has same GPS Image direction and Yaw, could cause rendering issues");let Wl=null===(cl=F.properties)||void 0===cl?void 0:cl["pers:pitch"];if(bl=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===Wl)for(let su of bl){var Ql,wc;const Da=getExifFloat(null===(Ql=F.properties)||void 0===Ql||null===(wc=Ql.exif)||void 0===wc?void 0:wc[su]);if(void 0!==Da){Wl=Da;break}}Wl=Wl||0;let Sc=null===(hl=F.properties)||void 0===hl?void 0:hl["pers:roll"];if(bl=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===Sc)for(let su of bl){var eu,iu;const Da=getExifFloat(null===(eu=F.properties)||void 0===eu||null===(iu=eu.exif)||void 0===iu?void 0:iu[su]);if(void 0!==Da){Sc=Da;break}}return Sc=Sc||0,0!==Wl&&0!==Sc?{pan:Al*Math.PI/180,tilt:Wl*Math.PI/180,roll:Sc*Math.PI/180}:{}}function getCroppedPanoData(F){var Da,ll;let cl;var hl,dl;if(null!==(Da=F.properties)&&void 0!==Da&&Da["pers:interior_orientation"]&&(null!==(hl=F.properties["pers:interior_orientation"])&&void 0!==hl&&hl.visible_area&&null!==(dl=F.properties["pers:interior_orientation"])&&void 0!==dl&&dl.sensor_array_dimensions)){const Da=F.properties["pers:interior_orientation"].visible_area,ll=F.properties["pers:interior_orientation"].sensor_array_dimensions;try{cl={fullWidth:parseInt(ll[0]),fullHeight:parseInt(ll[1]),croppedX:parseInt(Da[0]),croppedY:parseInt(Da[1]),croppedWidth:parseInt(ll[0])-parseInt(Da[2])-parseInt(Da[0]),croppedHeight:parseInt(ll[1])-parseInt(Da[3])-parseInt(Da[1])}}catch(Wl){console.warn("Invalid pers:interior_orientation values for cropped panorama "+F.id)}}if(!cl&&null!==(ll=F.properties)&&void 0!==ll&&ll.exif)try{var pl,fl,Al,bl,kl,Dl;cl={fullWidth:parseInt(null===(pl=F.properties.exif)||void 0===pl?void 0:pl["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(fl=F.properties.exif)||void 0===fl?void 0:fl["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(Al=F.properties.exif)||void 0===Al?void 0:Al["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(bl=F.properties.exif)||void 0===bl?void 0:bl["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(kl=F.properties.exif)||void 0===kl?void 0:kl["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(Dl=F.properties.exif)||void 0===Dl?void 0:Dl["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(Wl){console.warn("Invalid XMP.GPano values for cropped panorama "+F.id)}return cl&&(cl=Object.fromEntries(Object.entries(cl||{}).filter((F=>!isNaN(F[1])))),cl.fullWidth==cl.croppedWidth&&cl.fullHeight==cl.croppedHeight&&(cl={})),cl||{}}ll.d(Da,{MY:()=>getSphereCorrection,Pu:()=>getGPSPrecision,qx:()=>getCroppedPanoData})},6980:(F,Da,ll)=>{"use strict";ll.d(Da,{$:()=>getTranslations,D:()=>autoDetectLocale});var cl=ll(4149),hl=ll(369),dl=ll(389),pl=ll(9946),fl=ll(8302),Al=ll(5222),bl=ll(6909),kl=ll(4895),Dl=ll(9026),Wl=ll(6984);const Ql="en",wc={da:cl,de:hl,eo:pl,en:dl,es:fl,fr:Al,hu:bl,it:kl,pl:Dl,zh_Hant:Wl};function autoDetectLocale(F,Da){for(const ll of window.navigator.languages){let Da=ll;switch(Da){case"zh-TW":case"zh-HK":case"zh-MO":Da="zh_Hant";break;case"zh-CN":case"zh-SG":Da="zh_Hans";break;default:Da.length>2&&(Da=ll.substring(0,2))}const cl=F.find((F=>F===Da));if(cl)return cl}return Da}function getTranslations(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const Da=JSON.parse(JSON.stringify(dl));let ll;if(F||(F=autoDetectLocale(Object.keys(wc),Ql)),wc[F]&&"en"!==F&&(ll=wc[F]),F.length>2){const Da=F.substring(0,2);wc[Da]&&(ll=wc[Da])}return ll&&Object.entries(ll).forEach((F=>{let[ll,cl]=F;Object.entries(cl).forEach((F=>{let[cl,hl]=F;Array.isArray(hl)&&(hl=hl.filter((F=>null!=F))),Da[ll][cl]=hl}))})),Da}},1300:(F,Da,ll)=>{"use strict";ll.d(Da,{AV:()=>Al,CG:()=>combineStyles,Hj:()=>switchCoefValue,IN:()=>getUserLayerId,Kf:()=>forwardGeocodingBAN,No:()=>getThumbGif,Oq:()=>getMissingLayerStyles,RK:()=>forwardGeocodingNominatim,Sf:()=>isLabelLayer,VM:()=>Dl,d3:()=>wc,e8:()=>getUserSourceId,m5:()=>bl,oe:()=>kl});var cl=ll(927),hl=ll.n(cl),dl=ll(6883),pl=ll(5071),fl=ll(6980);const Al="https://panoramax.openstreetmap.fr/pmtiles/basic.json",bl="gvs-aerial",kl=15,Dl={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],kl,4.5,18,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],kl,0,kl+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],kl+1,0,kl+2,1,18,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],18,0,19,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"gvs-arrow-360","gvs-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],18,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,kl+1,30,kl+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},Wl=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...pl.Av],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...pl.U3],1]],Ql=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...pl.ql],1],wc=["round",["+",["*",Wl,pl.Xu],["*",Ql,pl.Bg]]];function getThumbGif(F){const Da=document.createElement("img");return Da.src=dl,Da.alt=F.loading,Da.title=F.loading,Da.classList.add("gvs-map-thumb","gvs-map-thumb-loader"),Da}function isLabelLayer(F){var Da;return"symbol"===F.type&&(null===F||void 0===F||null===(Da=F.layout)||void 0===Da?void 0:Da["text-field"])&&(void 0===F.minzoom||F.minzoom<15)}function combineStyles(F,Da){var ll,cl,hl;const dl=F._api.getMapStyle();if(dl.layers=dl.layers.concat(getMissingLayerStyles(dl.sources,dl.layers)),dl.metadata||(dl.metadata={}),Da.supplementaryStyle&&(Object.assign(dl.sources,Da.supplementaryStyle.sources||{}),Object.assign(dl.metadata,Da.supplementaryStyle.metadata||{}),dl.layers=dl.layers.concat(Da.supplementaryStyle.layers||[])),Da.raster&&(dl.sources["gvs-aerial"]=Da.raster,dl.layers.push({id:bl,type:"raster",source:"gvs-aerial",layout:{visibility:"aerial"===Da.background?"visible":"none"}})),null!==(ll=F._options)&&void 0!==ll&&null!==(cl=ll.users)&&void 0!==cl&&cl.includes("geovisio")||dl.layers.forEach((F=>{"geovisio"===F.source&&(F.layout||(F.layout={}),F.layout.visibility="none")})),dl.layers.sort(((F,Da)=>isLabelLayer(F)&&!isLabelLayer(Da)?1:!isLabelLayer(F)&&isLabelLayer(Da)?-1:F.id.startsWith("geovisio")&&!Da.id.startsWith("geovisio")?1:!F.id.startsWith("geovisio")&&Da.id.startsWith("geovisio")?-1:F.id.endsWith("_pictures")&&!Da.id.endsWith("_pictures")?1:!F.id.endsWith("_pictures")&&Da.id.endsWith("_pictures")?-1:0)),null!==(hl=dl.metadata)&&void 0!==hl&&hl["panoramax:locales"]||(dl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),dl.metadata["panoramax:locales"]){let Da=F._options.lang||(0,fl.D)(dl.metadata["panoramax:locales"],"latin");Da.includes("-")&&(Da=Da.split("-")[0]),Da.includes("_")&&(Da=Da.split("_")[0]),dl.layers.forEach((F=>{isLabelLayer(F)&&F.layout["text-field"].includes("name:latin")&&(F.layout["text-field"]=["coalesce",["get",`name:${Da}`],["get","name:latin"],["get","name"]])}))}const pl=dl.layers.find((F=>"place_label_city"==F.id));let Al=dl.layers.find((F=>"place_label_capital"==F.id));return pl&&!Al&&(pl.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},pl.layout["text-letter-spacing"]=.1,Al=JSON.parse(JSON.stringify(pl)),Al.id="place_label_capital",Al.filter.push(["<=","capital",2]),pl.filter.push([">","capital",2]),dl.layers.push(Al)),dl}function getMissingLayerStyles(F,Da){const ll=[];return Object.keys(F).filter((F=>void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.source)===F)))).forEach((F=>{F.startsWith("geovisio")&&(ll.push({id:`${F}_sequences`,type:"line",source:F,"source-layer":"sequences",layout:{...Dl.SEQUENCES.layout},paint:{...Dl.SEQUENCES.paint,"line-color":pl.lm.BASE}}),ll.push({id:`${F}_sequences_plus`,type:"line",source:F,"source-layer":"sequences",layout:{...Dl.SEQUENCES_PLUS.layout},paint:{...Dl.SEQUENCES_PLUS.paint}}),ll.push({id:`${F}_pictures_symbols`,type:"symbol",source:F,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),ll.push({id:`${F}_pictures_symbols`,type:"symbol",source:F,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),ll.push({id:`${F}_pictures`,type:"circle",source:F,"source-layer":"pictures",layout:{...Dl.PICTURES.layout},paint:{...Dl.PICTURES.paint,"circle-color":pl.lm.BASE}}))})),Da.filter((F=>{var ll;return(null===F||void 0===F||null===(ll=F.id)||void 0===ll?void 0:ll.endsWith("_sequences"))&&void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.id)===F.id+"_plus"))})).forEach((F=>{ll.push({id:`${F.id}_plus`,type:"line",source:F.source,"source-layer":F["source-layer"],layout:{...Dl.SEQUENCES_PLUS.layout},paint:{...Dl.SEQUENCES_PLUS.paint}})})),Da.filter((F=>{var ll;return(null===F||void 0===F||null===(ll=F.id)||void 0===ll?void 0:ll.endsWith("_pictures"))&&void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.id)===F.id+"_symbols"))})).forEach((F=>{ll.unshift({id:`${F.id}_symbols`,type:"symbol",source:F.source,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),F.paint=Object.assign(F.paint||{},Dl.PICTURES.paint),F.layout=Object.assign(F.layout||{},Dl.PICTURES.layout)})),ll}function getUserLayerId(F,Da){return`${getUserSourceId(F)}_${Da}`}function getUserSourceId(F){return"geovisio"===F?"geovisio":"geovisio_"+F}function switchCoefValue(F,Da){if(Array.isArray(F))return F.map((F=>switchCoefValue(F,Da)));if("object"===typeof F&&null!==F){const ll={};for(const cl in F)ll[cl]=switchCoefValue(F[cl],Da);return ll}return"string"===typeof F&&F.startsWith("coef")?Da:F}function geocoderParamsToURLString(F){let Da={};return Object.entries(F).filter((F=>void 0!==F[1]&&null!==F[1])).forEach((F=>Da[F[0]]=F[1])),new URLSearchParams(Da).toString()}function forwardGeocodingNominatim(F){const Da={q:F.query,countrycodes:F.countries,limit:F.limit,viewbox:F.bbox};return fetch(`https://nominatim.openstreetmap.org/search?${geocoderParamsToURLString(Da)}&format=geojson&polygon_geojson=1&addressdetails=1`).then((F=>F.json())).then((F=>{const Da={features:[]},ll=[];return F.features.forEach((F=>{ll.includes(F.properties.display_name)||(Da.features.push({place_type:["place"],place_name:F.properties.display_name,bounds:new(hl().LngLatBounds)(F.bbox)}),ll.push(F.properties.display_name))})),Da}))}function forwardGeocodingBAN(F){const Da={q:F.query,limit:F.limit};if("string"===typeof F.proximity){const[ll,cl]=F.proximity.split(",").map((F=>parseFloat(F.trim())));Da.lat=ll,Da.lon=cl}const ll={housenumber:20,street:18,locality:15,municipality:12};return fetch(`https://api-adresse.data.gouv.fr/search/?${geocoderParamsToURLString(Da)}`).then((F=>F.json())).then((F=>(F.features=F.features.map((F=>{return{place_type:["place"],place_name:(Da=F.properties,[Da.name,Da.district,Da.city].filter((F=>F)).join(", ")),center:new(hl().LngLat)(...F.geometry.coordinates),zoom:ll[F.properties.type]};var Da})),F)))}},3727:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>PhotoAdapter});var cl=ll(3890);class PhotoAdapter extends cl.D{constructor(F,Da){super(F,Da),this._shouldGoFast=Da.shouldGoFast||(()=>!0)}loadTexture(F,Da){return F.origBaseUrl?F.baseUrl=F.origBaseUrl:F.origBaseUrl=F.baseUrl,this._shouldGoFast()&&F.thumbUrl&&!F.hdLoaded&&1==F.rows&&(F.baseUrl=F.thumbUrl),super.loadTexture(F,Da).then((Da=>(F.baseUrl===F.origBaseUrl&&(F.hdLoaded=!0),Da)))}__loadTiles(F){this._shouldGoFast()||super.__loadTiles(F)}}},5071:(F,Da,ll)=>{"use strict";ll.d(Da,{Av:()=>bl,Bg:()=>Wl,Ch:()=>getGrade,GZ:()=>isInIframe,I0:()=>linkMapAndPhoto,KF:()=>isInternetFast,U3:()=>Al,Xu:()=>Dl,Yf:()=>getDistance,bG:()=>getUserAccount,dK:()=>josmBboxParameters,dj:()=>getRelativeHeading,fW:()=>fl,lm:()=>pl,oi:()=>positionToXYZ,ql:()=>kl,rs:()=>apiFeatureToPSVNode,y7:()=>xyzToPosition});var cl=ll(654),hl=ll(8407),dl=ll(6830);const pl={BASE:"#FF6F00",SELECTED:"#1E88E5",HIDDEN:"#34495E",NEXT:"#ffab40",QUALI_1:"#00695C",QUALI_2:"#fd8d3c",PALETTE_1:"#fecc5c",PALETTE_2:"#fd8d3c",PALETTE_3:"#f03b20",PALETTE_4:"#bd0026"},fl=(Object.fromEntries(Object.entries(pl).map((F=>(F[1]=parseInt(F[1].slice(1),16),F)))),[{color:"#007f4e",label:"A"},{color:"#72b043",label:"B"},{color:"#b5be2f",label:"C"},{color:"#f8cc1b",label:"D"},{color:"#f6a020",label:"E"}]),Al=[1,10,2,15,3,30,4],bl=[3,15,4,30,5],kl=[5,1.01,4,2.01,3,5.01,2,10.01,1],Dl=.8,Wl=.2,Ql=svgToPSVLink(hl,"white"),wc=svgToPSVLink(dl,pl.NEXT);function getGrade(F,Da){if(null===Da||void 0===Da||""===Da)return null;for(let ll=0;ll<F.length;ll+=2){const cl=F[ll];if(Da<F[ll+1])return cl}return F[F.length-1]}function getDistance(F,Da){const ll=F[0]-Da[0],cl=F[1]-Da[1];return Math.sqrt(ll*ll+cl*cl)}function sortPicturesInDirection(F){return(Da,ll)=>"related"!=Da.rel&&"related"!=ll.rel?0:"related"!=Da.rel?-1:"related"!=ll.rel?1:Da.date==ll.date?getDistance(F,Da.geometry.coordinates)-getDistance(F,ll.geometry.coordinates):ll.date.localeCompare(Da.date)}function svgToPSVLink(F,Da){try{const ll=atob(F.replace(/^data:image\/svg\+xml;base64,/,"")),cl=(new DOMParser).parseFromString(ll,"image/svg+xml").childNodes[0],hl=document.createElement("button");return hl.appendChild(cl),hl.classList.add("gvs-psv-tour-arrows"),hl.style.color=Da,hl}catch(ll){const Da=document.createElement("img");return Da.src=F,Da.alt="",Da}}function getArrow(F){const Da=F.cloneNode(!0);return Da.addEventListener("pointerup",(()=>Da.classList.add("gvs-clicked"))),Da}function getAzimuth(F,Da){return(Math.atan2(Da[0]-F[0],Da[1]-F[1])*(180/Math.PI)+360)%360}function getRelativeHeading(F){var Da,ll;if(!F)throw new Error("No picture selected");let cl,hl;const dl=F.properties["view:azimuth"];if(null!==F&&void 0!==F&&null!==(Da=F.sequence)&&void 0!==Da&&Da.prevPic){var pl;const Da=null===F||void 0===F||null===(pl=F.links)||void 0===pl?void 0:pl.find((Da=>Da.nodeId===F.sequence.prevPic));Da&&(cl=(dl-getAzimuth(Da.gps,F.gps)+180)%360-180)}if(null!==F&&void 0!==F&&null!==(ll=F.sequence)&&void 0!==ll&&ll.nextPic){var fl;const Da=null===F||void 0===F||null===(fl=F.links)||void 0===fl?void 0:fl.find((Da=>Da.nodeId===F.sequence.nextPic));Da&&(hl=(dl-getAzimuth(F.gps,Da.gps)+180)%360-180)}return void 0!==cl?cl:void 0!==hl?hl:0}function getSimplifiedAngle(F,Da){const ll=Math.atan2(Da[0]-F[0],Da[1]-F[1])*(180/Math.PI);return Math.abs(ll)<30?"N":ll>=30&&ll<90?"ENE":ll>=90&&ll<150?"ESE":Math.abs(ll)>=150?"S":ll<=-30&&ll>-90?"WNW":ll<=-90&&ll>-150?"WSW":void 0}function positionToXYZ(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const ll={x:F.yaw*(180/Math.PI),y:F.pitch*(180/Math.PI)};return void 0!==Da&&(ll.z=Da),ll}function xyzToPosition(F,Da,ll){return{yaw:F/(180/Math.PI),pitch:Da/(180/Math.PI),zoom:ll}}function getNodeCaption(F,Da){var ll,cl,hl;const dl={};if(null!==F&&void 0!==F&&null!==(ll=F.properties)&&void 0!==ll&&ll.datetimetz?dl.date=new Date(F.properties.datetimetz):null!==F&&void 0!==F&&null!==(cl=F.properties)&&void 0!==cl&&cl.datetime&&(dl.date=new Date(F.properties.datetime)),null!==F&&void 0!==F&&F.providers){var pl;const Da=null===F||void 0===F||null===(pl=F.providers)||void 0===pl?void 0:pl.filter((F=>{var Da;return null===F||void 0===F||null===(Da=F.roles)||void 0===Da?void 0:Da.includes("producer")}));if((null===Da||void 0===Da?void 0:Da.length)>=0){const F={};Da.map((F=>F.name)).forEach((Da=>{const ll=Da.toLowerCase().replace(/\s/g,"");F[ll]?F[ll].push(Da):F[ll]=[Da]})),dl.producer=[],Object.values(F).forEach((F=>{const Da=F[0],ll=F.find((F=>F.toLowerCase()!=F));dl.producer.push(ll||Da)})),dl.producer=dl.producer.join(", ")}}if(null!==F&&void 0!==F&&null!==(hl=F.properties)&&void 0!==hl&&hl.license&&(dl.license=F.properties.license,null!==F&&void 0!==F&&F.links)){const ll=F.links.find((F=>"license"===(null===F||void 0===F?void 0:F.rel)));ll&&(dl.license=`<a href="${ll.href}" title="${Da.gvs.metadata_general_license_link}" target="_blank">${dl.license}</a>`)}return dl}function linkMapAndPhoto(F){const onPicLoad=Da=>F.map.displayPictureMarker(Da.detail.lon,Da.detail.lat,F.psv.getXY().x);F.addEventListener("psv:picture-loading",onPicLoad),F.addEventListener("psv:picture-loaded",onPicLoad),F.addEventListener("psv:view-rotated",(()=>{let Da=F.psv.getPosition().yaw*(180/Math.PI);Da+=F.psv.getPictureOriginalHeading(),F.map._picMarker.setRotation(Da)})),F.addEventListener("psv:picture-preview-started",(Da=>{F.map._picMarkerPreview.setLngLat(Da.detail.coordinates).setRotation(Da.detail.direction||0).addTo(F.map)})),F.addEventListener("psv:picture-preview-stopped",(()=>{F.map._picMarkerPreview.remove()})),F.addEventListener("psv:picture-loaded",(Da=>{F.isWidthSmall()&&F._picPopup&&Da.detail.picId==F._picPopup._picId&&F._picPopup.remove()})),F.addEventListener("map:picture-click",(Da=>{F.select(Da.detail.seqId,Da.detail.picId),!F.psv._myVTour.state.currentNode&&null!==F&&void 0!==F&&F.setFocus&&F.setFocus("pic")})),F.addEventListener("map:sequence-click",(Da=>{F._api.getPicturesAroundCoordinates(Da.detail.coordinates.lat,Da.detail.coordinates.lng,1,1,Da.detail.seqId).then((Da=>{var ll,cl;(null===Da||void 0===Da||null===(ll=Da.features)||void 0===ll?void 0:ll.length)>0&&(F.select(null===(cl=Da.features[0])||void 0===cl?void 0:cl.collection,Da.features[0].id),!F.psv.getPictureMetadata()&&null!==F&&void 0!==F&&F.setFocus&&F.setFocus("pic"))}))}))}function apiFeatureToPSVNode(F,Da){var ll,hl,dl,pl,fl,Al,bl;let kl=arguments.length>2&&void 0!==arguments[2]&&arguments[2],Dl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const Wl=null!=(null===(ll=F.properties)||void 0===ll||null===(hl=ll["pers:interior_orientation"])||void 0===hl?void 0:hl.field_of_view);let Ql=Wl?parseInt(F.properties["pers:interior_orientation"].field_of_view):70;const wc=360===Ql,Sc=(Object.values(F.assets).find((F=>{var Da;return null===F||void 0===F||null===(Da=F.roles)||void 0===Da?void 0:Da.includes("data")}))||{}).href,eu=null===F||void 0===F||null===(dl=F.properties)||void 0===dl||null===(pl=dl["tiles:tile_matrix_sets"])||void 0===pl?void 0:pl.geovisio,iu=F.links.find((F=>"prev"===(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))),su=F.links.find((F=>"next"===(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))),cu=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("visual"))&&"image/webp"===F.type})),uu=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("visual"))&&"image/jpeg"===F.type})),hu=(cu||uu).href,Lu=null===(fl=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("thumbnail"))&&"image/jpeg"===F.type})))||void 0===fl?void 0:fl.href,zu=(null===F||void 0===F||null===(Al=F.asset_templates)||void 0===Al?void 0:Al.tiles_webp)||(null===F||void 0===F||null===(bl=F.asset_templates)||void 0===bl?void 0:bl.tiles),Du=(0,cl.qx)(F);let Nu;Nu=!zu&&Object.keys(Du).length>0?{baseUrl:kl?Sc:hu,origBaseUrl:kl?Sc:hu,hdUrl:Sc,thumbUrl:Lu,basePanoData:Du,cols:2,rows:1,width:2,tileUrl:()=>null}:wc&&eu?{baseUrl:hu,origBaseUrl:hu,basePanoData:F=>({fullWidth:F.width,fullHeight:F.height}),hdUrl:Sc,thumbUrl:Lu,cols:eu&&eu.tileMatrix[0].matrixWidth,rows:eu&&eu.tileMatrix[0].matrixHeight,width:eu&&eu.tileMatrix[0].matrixWidth*eu.tileMatrix[0].tileWidth,tileUrl:eu&&((F,Da)=>zu.href.replace(/\{TileCol\}/g,F).replace(/\{TileRow\}/g,Da))}:{baseUrl:kl?Sc:hu,origBaseUrl:kl?Sc:hu,hdUrl:Sc,thumbUrl:Lu,basePanoData:F=>{F.width<F.height&&!Wl&&(Ql=35);const Da=Ql*F.height/F.width,ll=360*F.width/Ql,cl=180*F.height/Da;return{fullWidth:ll,fullHeight:cl,croppedWidth:F.width,croppedHeight:F.height,croppedX:(ll-F.width)/2,croppedY:(cl-F.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null};return{id:F.id,caption:getNodeCaption(F,Da),panorama:Nu,links:filterRelatedPicsLinks(F,Dl),gps:F.geometry.coordinates,sequence:{id:F.collection,nextPic:su?su.id:void 0,prevPic:iu?iu.id:void 0},sphereCorrection:(0,cl.MY)(F),horizontalFov:Ql,properties:F.properties}}function filterRelatedPicsLinks(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const cl=F.links.filter((F=>["next","prev","related"].includes(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))).filter((F=>!ll||ll(F))).map((F=>(F.datetime&&(F.date=F.datetime.split("T")[0]),F))),hl=F.geometry.coordinates,dl=[],pl={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let Al of cl){pl[getSimplifiedAngle(hl,Al.geometry.coordinates)].push(Al)}for(let Al in pl){const F=pl[Al];0!=F.length&&(F.sort(sortPicturesInDirection(hl)),dl.push(F.shift()))}let arrowStyle=F=>"related"===F.rel?{element:getArrow(wc),size:{width:128/3,height:128}}:{element:getArrow(Ql),size:{width:75,height:75}};const fl=-((null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"])||0)*(Math.PI/180);return dl.map((F=>({nodeId:F.id,gps:F.geometry.coordinates,arrowStyle:arrowStyle(F),linkOffset:{yaw:fl}})))}function josmBboxParameters(F){if(F){var Da;const ll=F.gps,cl=null===F||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"],hl=2e-4,dl={left:ll[0]-(null===cl||cl>=180?hl:0),right:ll[0]+(null===cl||cl<=180?hl:0),top:ll[1]+(null===cl||cl<=90||cl>=270?hl:0),bottom:ll[1]-(null===cl||cl>=90&&cl<=270?hl:0),changeset_source:"Panoramax"};return Object.entries(dl).map((F=>F.join("="))).join("&")}return null}function isInIframe(){try{return window.self!==window.top}catch(F){return!0}}const Sc=10,eu="gvs-internet-fast",iu="https://panoramax.openstreetmap.fr/images/05/ca/2c/98/0111-4baf-b6f3-587bb8847d2e.jpg";function isInternetFast(){try{const F=navigator.connection.downlink;return Promise.resolve(F>=Sc)}catch(F){try{const F=sessionStorage.getItem(eu);if(["true","false"].includes(F))return Promise.resolve("true"===F);const Da=(new Date).getTime();return fetch(iu+"?nocache="+Da).then((async F=>[F,await F.blob()])).then((F=>{let[ll,cl]=F;const hl=8*parseInt(ll.headers.get("Content-Length")||cl.size)/1024/1024/(((new Date).getTime()-Da)/1e3)>=Sc;return sessionStorage.setItem(eu,hl?"true":"false"),hl})).catch((F=>(console.warn("Failed to run speedtest",F),!1)))}catch(F){return Promise.resolve(!1)}}}function getCookie(F){var Da,ll,cl;const hl=null===(Da=document.cookie)||void 0===Da||null===(ll=Da.split(";"))||void 0===ll||null===(cl=ll.find((Da=>Da.trimStart().startsWith(`${F}=`))))||void 0===cl?void 0:cl.split("=");if(hl)return hl.shift(),hl.join("=")}function getUserAccount(){const F=getCookie("session"),Da=getCookie("user_id"),ll=getCookie("user_name");return F&&Da&&ll?{id:Da,name:ll}:null}},4683:(F,Da,ll)=>{"use strict";ll.d(Da,{$c:()=>enableCopyButton,Ij:()=>createHeader,Lt:()=>showQualityScore,OZ:()=>createSearchBar,Qt:()=>fat,Tf:()=>createButton,W_:()=>closeOtherPanels,Y8:()=>enableButton,ZR:()=>createTable,do:()=>createButtonSpan,fM:()=>showGrade,fP:()=>createLinkCell,fa:()=>fa,fp:()=>createLabel,np:()=>createExpandableButton,t_:()=>createPanel,vI:()=>disableButton,wj:()=>createGroup});var cl=ll(3710),hl=ll(6627),dl=ll(4011),pl=ll(2593),fl=ll(7761),Al=ll(3444),bl=ll(174),kl=ll(4189),Dl=ll(4780),Wl=ll(7325),Ql=ll(5071);function createButton(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const hl=document.createElement("button");return Da&&(Da instanceof HTMLElement||Da instanceof Node?hl.appendChild(Da):hl.innerHTML=Da),hl.id=F,Array.isArray(cl)&&(cl=cl.filter((F=>null!=F&&F.length>0))),hl.classList.add("gvs-btn","gvs-widget-bg",...cl),ll&&(hl.title=ll),hl}function createExpandableButton(F,Da,ll,cl){let dl=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const fl=document.createElement("button");if(fl.id=F,fl.appendChild(fa(Da)),cl._viewer.isWidthSmall())fl.title=ll;else{if(fl.appendChild(document.createTextNode(ll)),dl.includes("gvs-filter-unset-btn")){const F=fa(hl.Jy,{classes:["gvs-filter-unset-btn"]});F.style.display="none",fl.appendChild(F),dl=dl.filter((F=>"gvs-filter-unset-btn"!==F))}fl.appendChild(fa(pl.Jt))}return fl.classList.add("gvs-btn","gvs-widget-bg","gvs-btn-expandable",...dl),fl.setActive=F=>{let Da=fl.querySelector(".gvs-filters-active");const ll=fl.querySelector(".gvs-filter-unset-btn"),cl=fl.querySelector(".fa-chevron-down");if(F&&!Da){Da=document.createElement("span"),Da.classList.add("gvs-filters-active");const F=fl.querySelector("svg");F.nextSibling?fl.insertBefore(Da,F.nextSibling):fl.appendChild(Da),ll&&(ll.style.display=null,cl.style.display="none")}else!F&&Da&&(Da.remove(),ll&&(ll.style.display="none",cl.style.display=null))},fl}function createSearchBar(F,Da,ll,cl,pl){let bl=arguments.length>5&&void 0!==arguments[5]&&arguments[5],kl=arguments.length>6&&void 0!==arguments[6]&&arguments[6],Dl=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;const Wl=document.createElement("div");Wl.classList.add("gvs-widget-bg","gvs-search-bar"),Wl.id=F,kl&&Wl.classList.add("gvs-search-bar-reducable"),Dl&&Wl.appendChild(Dl);const Ql=document.createElement("input");Ql.type="text",Ql.placeholder=Da,Ql.id=`${F}-input`,Ql.setAttribute("autocomplete","off"),Wl.appendChild(Ql);const extendInput=()=>{Wl.classList.remove("gvs-search-bar-reduced")},reduceInput=()=>{Wl.classList.add("gvs-search-bar-reduced")};kl&&reduceInput();const wc=document.createElement("span");wc.classList.add("gvs-search-bar-icon");const Sc=fa(fl.$U),eu=fa(Al.s4,{classes:["fa-spin"]}),iu=fa(hl.Jy),su=fa(dl.lE);wc.appendChild(Sc),Wl.appendChild(wc);const cu=createPanel(pl,Wl,[],["gvs-search-bar-results"],bl);Wl.appendChild(cu);const switchIcon=F=>{wc.innerHTML="",wc.appendChild(F)},resetSearch=()=>{Wl._throttler&&clearTimeout(Wl._throttler),Ql.value="",cu.innerHTML="",cu._toggle(!1),delete Wl._lastSearch,switchIcon(Sc),cl(null),kl&&reduceInput()};Wl.resetSearch=resetSearch,Ql.goItem=F=>{kl?(cl(F),resetSearch()):(Wl._throttler&&clearTimeout(Wl._throttler),Ql.value=F.title,cu.innerHTML="",cu._toggle(!1),switchIcon(iu),cl(F))},Ql.setItem=F=>{Wl._throttler&&clearTimeout(Wl._throttler),Ql.value=F,cu.innerHTML="",cu._toggle(!1),switchIcon(iu),kl&&extendInput()};const goSearch=()=>{if(Wl._throttler&&clearTimeout(Wl._throttler),0===Ql.value.length)return cu.innerHTML="",void cu._toggle(!1);Wl._throttler=setTimeout((()=>{cu.innerHTML="",cu._toggle(!1),switchIcon(eu),ll(Ql.value).then((F=>{switchIcon(iu),cu._toggle(!0),F&&0!=F.length?!0!==F?F.forEach((F=>{const Da=document.createElement("div");Da.classList.add("gvs-search-bar-result"),Da.innerHTML=`${F.title}<br /><small>${(null===F||void 0===F?void 0:F.subtitle)||""}</small>`,cu.appendChild(Da),Da.addEventListener("click",(()=>Ql.goItem(F)))})):cu._toggle(!1):cu.innerHTML=`<div class="gvs-search-empty">${pl._t.gvs.search_empty}</li>`})).catch((F=>{console.error(F),switchIcon(su)}))}),250)};return Ql.addEventListener("change",goSearch),Ql.addEventListener("keypress",goSearch),Ql.addEventListener("paste",goSearch),Ql.addEventListener("input",goSearch),wc.addEventListener("click",(()=>{wc.firstChild!=iu&&wc.firstChild!=su||resetSearch(),kl&&wc.firstChild==Sc&&(Wl.classList.contains("gvs-search-bar-reduced")?extendInput():reduceInput())})),Wl}function createPanel(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],hl=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const dl=document.createElement("div");dl.id=Da.id+"-panel",Array.isArray(cl)&&(cl=cl.filter((F=>null!=F&&F.length>0))),dl.classList.add("gvs-panel","gvs-widget-bg","gvs-hidden",...cl);for(let pl of ll)dl.appendChild(pl);const togglePanel=(Da,ll)=>{Da&&Da.stopPropagation(),!0===ll?dl.classList.remove("gvs-hidden"):!1===ll?dl.classList.add("gvs-hidden"):(dl.classList.toggle("gvs-hidden"),ll=!dl.classList.contains("gvs-hidden")),ll&&!hl&&closeOtherPanels(dl,F._viewer.container)};return dl._toggle=F=>togglePanel(null,F),"BUTTON"==Da.tagName&&(Da.addEventListener("click",togglePanel),Da.addEventListener("hover",togglePanel)),dl}function closeOtherPanels(F,Da){var ll;const isPanel=F=>F.classList.contains("gvs-panel")||F.classList.contains("gvs-search-bar-result")||F.classList.contains("gvs-search-empty")||F.classList.contains("gvs-search-bar-reducable");if(!isPanel(F)&&null!==(ll=F)&&void 0!==ll&&ll.parentNode)for(F=F.parentNode;F instanceof Element&&!isPanel(F);)F=F.parentNode;for(const cl of Da.getElementsByClassName("gvs-panel"))cl==F||cl.contains(F)||cl.classList.contains("gvs-hidden")||cl.classList.add("gvs-hidden");for(const cl of Da.getElementsByClassName("gvs-search-bar-reducable"))cl==F||cl.contains(F)||cl.classList.contains("gvs-search-bar-reduced")||cl.resetSearch()}function createGroup(F,Da,ll){let cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],hl=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const dl=document.createElement("div");dl.id=F,Array.isArray(hl)&&(hl=hl.filter((F=>null!=F&&F.length>0))),dl.classList.add("gvs-group",...hl);for(let pl of cl)dl.appendChild(pl);return ll._corners[Da].appendChild(dl),dl}function enableCopyButton(F,Da){for(let ll of F.getElementsByTagName("button")){const F=ll.getAttribute("data-input"),cl=ll.getAttribute("data-copy");(F||cl)&&ll.addEventListener("click",(()=>{let hl;if(F){const Da=document.getElementById(F);hl=Da.innerText||Da.value}else cl&&(hl=ll.getAttribute("data-copy"));navigator.clipboard.writeText(hl);const dl=ll.innerHTML;ll.innerHTML=`${Da.gvs.copied} ${fat(bl.e6)}`,ll.classList.add("gvs-btn-active"),setTimeout((()=>{ll.innerHTML=dl,ll.classList.remove("gvs-btn-active")}),2e3)}))}}function enableButton(F){F.removeAttribute("disabled")}function disableButton(F){F.setAttribute("disabled","")}function fa(F,Da){return(0,cl.Kk)(F,Da).node[0]}function fat(F,Da){return(0,cl.Kk)(F,Da).html[0]}function createLinkCell(F,Da,ll,cl){const hl=document.createElement("a");hl.href=Da,hl.target="_blank",hl.title=ll,hl.textContent=F;return[hl,createButtonSpan(`${fat(kl.jP)} ${cl}`,F)]}function createTable(F,Da){const ll=document.createElement("table");return ll.className=F,Da.forEach((F=>{let{section:Da,value:cl,values:hl,classes:dl}=F;const pl=document.createElement("tr"),fl=document.createElement("th");fl.scope="row",fl.textContent=Da,pl.appendChild(fl);const Al=document.createElement("td");dl&&Al.classList.add(...dl),hl?hl.forEach((F=>Al.appendChild(F))):cl instanceof HTMLElement?Al.appendChild(cl):Al.innerHTML=cl,pl.appendChild(Al),ll.appendChild(pl)})),ll}function createHeader(F,Da){const ll=document.createElement(F);return ll.innerHTML=Da,ll}function createButtonSpan(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const ll=document.createElement("button");ll.innerHTML=F,Da&&ll.setAttribute("data-copy",Da);const cl=document.createElement("span");return cl.className="gvs-input-btn",cl.appendChild(ll),cl}function createLabel(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const cl=document.createElement("label");return cl.htmlFor=F,ll&&cl.appendChild(fa(ll)),cl.appendChild(document.createTextNode(Da)),cl}function showGrade(F,Da){let ll='<span class="gvs-grade">';for(let cl=1;cl<=F;cl++)ll+=fat(Dl.yy);for(let cl=F+1;cl<=5;cl++)ll+=fat(Wl.yy);return ll+="</span> (",ll+=null===F?Da.gvs.metadata_quality_missing+")":F+"/5)",ll}function showQualityScore(F){const Da=document.createElement("span");for(let ll=1;ll<=Ql.fW.length;ll++){const cl=Ql.fW[ll-1],hl=document.createElement("span");hl.appendChild(document.createTextNode(cl.label)),hl.classList.add("gvs-qualityscore"),hl.style.backgroundColor=cl.color,ll===6-F&&hl.classList.add("gvs-qualityscore-selected"),Da.appendChild(hl)}return Da}},9194:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>URLHash});const cl={minDate:"date_from",maxDate:"date_to",type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},hl=Object.fromEntries(Object.entries(cl).map((F=>[F[1],F[0]]))),dl=["psv:view-rotated","psv:picture-loaded","focus-changed","filters-changed","psv:transition-duration-changed","map:background-changed","map:users-changed","pictures-navigation-changed"];class URLHash extends EventTarget{constructor(F){super(),this._viewer=F,this._delay=null,this._hashChangeHandler=this._onHashChange.bind(this),F.addEventListener("ready",(()=>{window.addEventListener("hashchange",this._hashChangeHandler,!1),dl.forEach((F=>this._viewer.addEventListener(F,this._updateHash.bind(this))))}),{once:!0})}destroy(){var F,Da;window.removeEventListener("hashchange",this._hashChangeHandler),delete this._hashChangeHandler,null===(F=this._viewer)||void 0===F||null===(Da=F.map)||void 0===Da||Da.off("moveend",this._updateHash),dl.forEach((F=>this._viewer.removeEventListener(F,this._updateHash))),delete this._viewer,this._updateHash()}bindMapEvents(){this._viewer.map.on("moveend",this._updateHash.bind(this))}_getHashParts(){let F={};"number"==typeof this._viewer.psv.getTransitionDuration()&&(F.speed=this._viewer.psv.getTransitionDuration()),[null,"any"].includes(this._viewer.getPicturesNavigation())||(F.nav=this._viewer.getPicturesNavigation());const Da=this._viewer.psv.getPictureMetadata();if(Da&&(F.pic=Da.id,F.xyz=this._getXyzHashString()),this._viewer.map){F.map=this._getMapHashString(),F.focus="pic",this._viewer.isMapWide()&&(F.focus="map"),this._viewer.popupContainer.classList.contains("gvs-hidden")||(F.focus="meta"),this._viewer.map.hasTwoBackgrounds()&&this._viewer.map.getBackground()&&(F.background=this._viewer.map.getBackground());const Da=this._viewer.map.getVisibleUsers();if((Da.length>1||!Da.includes("geovisio"))&&(F.users=Da.join(",")),this._viewer._mapFilters){for(let Da in cl)this._viewer._mapFilters[Da]&&(F[cl[Da]]=this._viewer._mapFilters[Da]);if(F.pic_score){const Da=[null,"E","D","C","B","A"];F.pic_score=F.pic_score.map((F=>Da[F])).join("")}}}else F.map="none";return F}getHashString(){let F="";return Object.entries(this._getHashParts()).sort(((F,Da)=>F[0].localeCompare(Da[0]))).forEach((Da=>{let[ll,cl]=Da,hl=!1;const dl=F.split("&").map((F=>{const Da=F.split("=")[0];return Da===ll?(hl=!0,`${Da}=${cl}`):F})).filter((F=>F));hl||dl.push(`${ll}=${cl}`),F=`${dl.join("&")}`})),`#${F}`.replace(/^#+/,"#")}_getCurrentHash(){const F=window.location.hash.replace("#","");let Da={};if(F.split("&").map((F=>F.split("="))).filter((F=>void 0!==F[0]&&F[0].length>0)).forEach((F=>{Da[F[0]]=F[1]})),Da.s){const F=Object.fromEntries(Da.s.split(";").map((F=>[F[0],F.substring(1)])));Da={},"m"===F.f?Da.focus="map":"p"===F.f?Da.focus="pic":"t"===F.f&&(Da.focus="meta"),""!==F.s&&(Da.speed=100*parseFloat(F.s)),"a"===F.n?Da.nav="any":"s"===F.n&&(Da.nav="seq"),"n"===F.n&&(Da.nav="none"),""!==F.p&&(Da.pic=F.p),""!==F.c&&(Da.xyz=F.c),""!==F.m&&(Da.map=F.m),""!==F.d&&(Da.date_from=F.d),""!==F.e&&(Da.date_to=F.e),"f"===F.t?Da.pic_type="flat":"e"===F.t&&(Da.pic_type="equirectangular"),""!==F.k&&(Da.camera=F.k),"d"===F.v?Da.theme="default":"a"===F.v?Da.theme="age":"t"===F.v?Da.theme="type":"s"===F.v&&(Da.theme="score"),"s"===F.b?Da.background="streets":"a"===F.b&&(Da.background="aerial"),""!==F.u&&(Da.users=F.u),""!==F.q&&(Da.pic_score=F.q)}return Da}_getMapHashString(){const F=this._viewer.map.getCenter(),Da=Math.round(100*this._viewer.map.getZoom())/100,ll=Math.ceil((Da*Math.LN2+Math.log(512/360/.5))/Math.LN10),cl=Math.pow(10,ll),hl=Math.round(F.lng*cl)/cl,dl=Math.round(F.lat*cl)/cl,pl=this._viewer.map.getBearing(),fl=this._viewer.map.getPitch();let Al=`${Da}/${dl}/${hl}`;return(pl||fl)&&(Al+="/"+Math.round(10*pl)/10),fl&&(Al+=`/${Math.round(fl)}`),Al}_getXyzHashString(){const F=this._viewer.psv.getXYZ();return`${F.x.toFixed(2)}/${F.y.toFixed(2)}/${Math.round(F.z||0)}`}_onHashChange(){let F=this._getCurrentHash();if(F.pic){const Da=F.pic.split(";");Da.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),this._viewer.select(null,Da[0])}if(F.focus&&["map","pic"].includes(F.focus)&&this._viewer.setFocus(F.focus),F.focus&&"meta"==F.focus&&this._viewer._widgets._showPictureMetadataPopup(),void 0!==F.speed&&this._viewer.psv.setTransitionDuration(F.speed),F.map&&this._viewer.map){const Da=this.getMapOptionsFromHashString(F.map);Da&&this._viewer.map.jumpTo(Da);let ll=(F.users||"").split(",");(0===ll.length||1===ll.length&&""===ll[0].trim())&&(ll=["geovisio"]),this._viewer.map.setVisibleUsers(ll)}if(F.xyz){const Da=this.getXyzOptionsFromHashString(F.xyz);this._viewer.psv.setXYZ(Da.x,Da.y,Da.z)}this._viewer.setFilters(this.getMapFiltersFromHashVals(F)),["aerial","streets"].includes(F.background)&&this._viewer.map.setBackground(F.background),["pic","any","seq"].includes(F.nav)&&this._viewer.setPicturesNavigation(F.nav)}getShortLink(F){const Da=new URL(F),ll=this._getHashParts(),cl={f:(ll.focus||"").substring(0,1),s:isNaN(parseInt(ll.speed))?void 0:Math.floor(parseInt(ll.speed)/100),n:(ll.nav||"").substring(0,1),p:ll.pic,c:ll.xyz,m:ll.map,d:ll.date_from,e:ll.date_to,t:(ll.pic_type||"").substring(0,1),k:ll.camera,v:(ll.theme||"").substring(0,1),b:(ll.background||"").substring(0,1),u:ll.users,q:ll.pic_score},hl=Object.entries(cl).filter((F=>{let[,Da]=F;return void 0!=Da&&""!=Da})).map((F=>{let[Da,ll]=F;return`${Da}${ll}`})).join(";");return Da.hash=`s=${hl}`,Da}getMapFiltersFromHashVals(F){const Da={};for(let ll in hl)F[ll]&&(Da[hl[ll]]=F[ll]);if(Da.qualityscore){let F=Da.qualityscore.split("");const ll={A:5,B:4,C:3,D:2,E:1};Da.qualityscore=F.map((F=>ll[F]))}return Da}getMapOptionsFromHashString(F){const Da=F.split("/");if(Da.length>=3&&!Da.some((F=>isNaN(F)))){const F={center:[+Da[2],+Da[1]],zoom:+Da[0],pitch:+(Da[4]||0)};return this._viewer.map&&(F.bearing=this._viewer.map.dragRotate.isEnabled()&&this._viewer.map.touchZoomRotate.isEnabled()?+(Da[3]||0):this._viewer.map.getBearing()),F}return null}getXyzOptionsFromHashString(F){const Da=F.split("/");if(3!==Da.length||Da.some((F=>isNaN(F))))return null;return{x:+Da[0],y:+Da[1],z:+Da[2]}}_updateHash(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var F,Da,ll;const cl=new URL(window.location.href),hl=new URL(window.location.href);if(hl.hash=this._viewer?this.getHashString():"",cl.hash==hl.hash)return;const dl=this._getCurrentHash().pic||"",pl=(null===(F=this._viewer)||void 0===F||null===(Da=F.psv)||void 0===Da||null===(ll=Da.getPictureMetadata())||void 0===ll?void 0:ll.id)||"";try{if(dl!=pl?window.history.pushState(window.history.state,null,hl.href):window.history.replaceState(window.history.state,null,hl.href),this._viewer){const F=new CustomEvent("url-changed",{detail:{url:hl.href}});this.dispatchEvent(F)}}catch(fl){}}),500)}}},490:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Widgets});ll(307);var cl=ll(2968),hl=ll(4683),dl=ll(5071),pl=ll(1462),fl=ll(5721),Al=ll(7534),bl=ll(6810),kl=ll(654),Dl=ll(1372),Wl=ll(7290),Ql=ll(1260),wc=ll(7964),Sc=ll(2e3),eu=ll(5279),iu=ll(9683),su=ll(6386),cu=ll(1705),uu=ll(5431),hu=ll(7472),Lu=ll(9186),zu=ll(6069),Du=ll(99),Nu=ll(7321),qu=ll(501),ih=ll(6787),gh=ll(6533),ed=ll(7744),td=ll(8629),id=ll(325),nd=ll(9243),rd=ll(1904),ad=ll(4220),sd=ll(7172),od=ll(7879),ld=ll(7516),cd=ll(8739),ud=ll(3520),hd=ll(3095),dd=ll(4162),pd=ll(4189),md=ll(6311),fd=ll(9564),gd=ll(2975),Ad=ll(4881),yd=ll(1708),vd=ll(3233),_d=ll(6668);class Widgets{constructor(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null==ll&&(ll={}),null==ll.editIdUrl&&(ll.editIdUrl="https://www.openstreetmap.org/edit"),this._viewer=F,this._t=this._viewer._t,this._options=ll;const cl=void 0!==this._viewer.map;this._corners={};const pl=cl?["main","mini"]:["main"],fl=["top","bottom"],Al=["left","middle","right"];for(let hl of pl)for(let F of fl){const Da=document.createElement("div");Da.id=`gvs-corner-${hl}-${F}`,Da.classList.add("gvs-corner-space");for(let ll of Al){const cl=document.createElement("div");cl.id=`${Da.id}-${ll}`,cl.classList.add("gvs-corner"),this._corners[`${hl}-${F}-${ll}`]=cl,Da.appendChild(cl)}"main"==hl?this._viewer.mainContainer.appendChild(Da):"mini"==hl&&this._viewer.miniContainer.appendChild(Da)}if((0,dl.GZ)()||this._initWidgetPlayer(cl),this._initWidgetLegend(cl,null===(Da=ll)||void 0===Da?void 0:Da.mapAttribution),cl&&(this._initWidgetMiniActions(),(0,dl.GZ)()||(this._initWidgetSearch(),this._initWidgetFilters(null!==this._viewer._api._endpoints.user_search&&null!==this._viewer._api._endpoints.user_tiles,this._viewer.map&&this._viewer.map._hasQualityScore()),this._initWidgetMapLayers(),this._listenMapFiltersChanges())),this._viewer.isWidthSmall()||this._initWidgetShare(),ll.customWidget){const F=this._corners["main-bottom-right"];switch(typeof ll.customWidget){case"string":for(let Da of(new DOMParser).parseFromString(ll.customWidget,"text/html").body.children)F.appendChild(Da);break;case"object":Array.isArray(ll.customWidget)?ll.customWidget.forEach((Da=>F.appendChild(Da))):F.appendChild(ll.customWidget)}}this._initWidgetZoom(cl),this._viewer.container.addEventListener("click",(F=>(0,hl.W_)(F.target,this._viewer.container)))}destroy(){Object.values(this._corners).forEach((F=>F.remove())),delete this._corners,delete this._t,delete this._viewer}_initWidgetZoom(F){this._lastWantedZoom=this._viewer.psv.getZoomLevel();const Da=(0,hl.Tf)("gvs-zoom-in",(0,hl.fa)(Dl.QL),this._t.gvs.zoomIn),ll=(0,hl.Tf)("gvs-zoom-out",(0,hl.fa)(Wl.EZ),this._t.gvs.zoomOut);(0,hl.wj)("gvs-widget-zoom","main-bottom-right",this,[Da,ll],["gvs-group-vertical","gvs-mobile-hidden","gvs-print-hidden"]);const zoomFct=(Da,ll)=>{if(F&&this._viewer.isMapWide())ll?this._viewer.map.zoomIn({},{originalEvent:Da}):this._viewer.map.zoomOut({},{originalEvent:Da});else{this._viewer.lastPsvAnim&&this._viewer.lastPsvAnim.cancel();const F=ll?Math.min(100,this._lastWantedZoom+cl.$p):Math.max(0,this._lastWantedZoom-cl.$p);this._viewer.lastPsvAnim=this._viewer.psv.animate({speed:cl.LM,zoom:F}),this._lastWantedZoom=F}};Da.addEventListener("click",(F=>zoomFct(F,!0))),ll.addEventListener("click",(F=>zoomFct(F,!1)))}_initWidgetPlayer(F){const Da=(0,hl.Tf)("gvs-player-prev",(0,hl.fa)(cu.TH),this._t.gvs.sequence_prev),ll=(0,hl.Tf)("gvs-player-play"),dl=(0,hl.Tf)("gvs-player-next",(0,hl.fa)(uu.vF),this._t.gvs.sequence_next),pl=(0,hl.Tf)("gvs-player-more",(0,hl.fa)(gh.nx),this._t.gvs.sequence_more,["gvs-xs-hidden"]),fl=(0,hl.t_)(this,pl,[],["gvs-player-options"]);fl.innerHTML=`\n\t\t\t<div class="gvs-input-range" title="${this._t.gvs.sequence_speed}">\n\t\t\t\t${(0,hl.Qt)(nd.rO)}\n\t\t\t\t<input\n\t\t\t\t\tid="gvs-player-speed"\n\t\t\t\t\ttype="range" name="speed"\n\t\t\t\t\tmin="0" max="${cl.Vf-100}"\n\t\t\t\t\tvalue="${cl.Vf-this._viewer.psv.getTransitionDuration()}"\n\t\t\t\t\ttitle="${this._t.gvs.sequence_speed}"\n\t\t\t\t\tstyle="width: 100%;" />\n\t\t\t\t${(0,hl.Qt)(ed.KM)}\n\t\t\t</div>\n\t\t\t<button title="${this._t.gvs.contrast}" id="gvs-player-contrast">\n\t\t\t\t${(0,hl.Qt)(id.rC)}\n\t\t\t</button>\n\t\t`;const Al=(0,hl.wj)("gvs-widget-player",F?"main-top-middle":"main-top-left",this,[Da,ll,dl].concat(this._viewer.isWidthSmall()?[]:[fl,pl]),["gvs-group-horizontal","gvs-only-psv","gvs-print-hidden",this._viewer.psv.getPictureMetadata()?"":"gvs-hidden"]),toggleBtnPlay=F=>{ll.innerHTML=F?(0,hl.Qt)(hu.G1):(0,hl.Qt)(su.ij),ll.title=F?this._t.gvs.sequence_pause:this._t.gvs.sequence_play};toggleBtnPlay(!1);const updatePlayBtn=()=>{var F,cl,pl,fl;"pic"===this._viewer.getPicturesNavigation()?((0,hl.vI)(dl),(0,hl.vI)(ll),(0,hl.vI)(Da)):(null!=(null===(F=this._viewer.psv.getPictureMetadata())||void 0===F||null===(cl=F.sequence)||void 0===cl?void 0:cl.prevPic)?(0,hl.Y8)(Da):(0,hl.vI)(Da),null!=(null===(pl=this._viewer.psv.getPictureMetadata())||void 0===pl||null===(fl=pl.sequence)||void 0===fl?void 0:fl.nextPic)?((0,hl.Y8)(dl),(0,hl.Y8)(ll)):((0,hl.vI)(dl),(0,hl.vI)(ll)))};if(updatePlayBtn(),this._viewer.addEventListener("sequence-playing",(()=>toggleBtnPlay(!0))),this._viewer.addEventListener("sequence-stopped",(()=>toggleBtnPlay(!1))),this._viewer.addEventListener("psv:picture-loaded",(()=>Al.classList.remove("gvs-hidden")),{once:!0}),this._viewer.addEventListener("psv:picture-loaded",updatePlayBtn),this._viewer.addEventListener("pictures-navigation-changed",updatePlayBtn),!this._viewer.isWidthSmall()){const F=fl.children[0].children[1];this._viewer.addEventListener("psv:transition-duration-changed",(Da=>{F.value=cl.Vf-Da.detail.value})),F.addEventListener("change",(F=>{const Da=cl.Vf-F.target.value;this._viewer.psv.setTransitionDuration(Da)}))}Da.addEventListener("click",(()=>this._viewer.psv.goToPrevPicture())),dl.addEventListener("click",(()=>this._viewer.psv.goToNextPicture())),ll.addEventListener("click",(()=>{this._viewer.isSequencePlaying()?(toggleBtnPlay(!1),this._viewer.stopSequence()):(toggleBtnPlay(!0),this._viewer.playSequence())}));const bl=document.getElementById("gvs-player-contrast");bl&&bl.addEventListener("click",(()=>{bl.classList.contains("gvs-btn-active")?(bl.classList.remove("gvs-btn-active"),this._viewer.psv.setHigherContrast(!1)):(bl.classList.add("gvs-btn-active"),this._viewer.psv.setHigherContrast(!0))}))}_initWidgetLegend(F,Da){const ll=(0,hl.wj)("gvs-widget-legend",F?"main-bottom-right":"main-bottom-left",this,[],["gvs-widget-bg"]);let cl,pl,fl;F&&(cl=(0,hl.wj)("gvs-widget-mini-legend","mini-bottom-right",this,[],["gvs-widget-bg","gvs-only-mini","gvs-mobile-hidden"])),this._viewer.isWidthSmall()&&(pl=document.createElement("button"),pl.id="gvs-legend-toggle",pl.classList.add("gvs-btn","gvs-widget-bg","gvs-print-hidden"),pl.appendChild((0,hl.fa)(ld.faCircleInfo)),fl=()=>{"hidden"===ll.style.visibility?(ll.style.visibility="visible",toggleLegend(!!F&&this._viewer.isMapWide())):(ll.innerHTML="",ll.style.visibility="hidden",ll.appendChild(pl))},pl.addEventListener("click",(F=>{F.stopPropagation(),fl()})));const toggleLegend=fl=>{var Al,bl,kl;let Dl=Da||(null===(Al=this._viewer.map)||void 0===Al||null===(bl=Al._attribution)||void 0===bl?void 0:bl._attribHTML)||"",Wl="<a href='https://panoramax.fr/' target='_blank'>Panoramax</a>";const Ql=null===(kl=this._viewer.psv.getPictureMetadata())||void 0===kl?void 0:kl.caption;let wc;!(0,dl.GZ)()&&Ql&&(Wl="",Ql.producer&&(Wl+=`<span style="font-weight: bold">© ${Ql.producer}</span>`),Ql.date&&(Ql.producer&&(Wl+=" - "),Wl+=Ql.date.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})),wc=(0,hl.fa)(fd.AP),wc.style.marginLeft="5px"),ll.title="",fl?(ll.innerHTML=Dl,(0,dl.GZ)()&&(ll.innerHTML="<a href='https://panoramax.fr/' target='_blank'>Panoramax</a><br />"+ll.innerHTML),ll.style.cursor=null,ll.onclick=null,cl.innerHTML=Wl):(ll.innerHTML=Wl,wc?(ll.appendChild(wc),ll.style.cursor="pointer",ll.title=this._t.gvs.legend_title,ll.onclick=(0,dl.GZ)()?()=>window.open(window.location.href,"_blank"):this._showPictureMetadataPopup.bind(this)):(ll.style.cursor=null,ll.onclick=null),F&&(cl.innerHTML=Dl)),pl&&ll.appendChild(pl)};pl?(ll.appendChild(pl),ll.style.visibility="hidden"):toggleLegend(!!F&&this._viewer.isMapWide()),this._viewer.addEventListener("focus-changed",(F=>toggleLegend("map"==F.detail.focus))),this._viewer.addEventListener("psv:picture-loaded",(()=>toggleLegend(F&&this._viewer.isMapWide())))}_showPictureMetadataPopup(){var F,Da,ll,cl,pl,fl,Al,bl,Dl,Wl,Ql,wc,Sc,eu,iu,su,cu,uu,hu,Lu,zu,Nu,qu;const ih=this._viewer.psv.getPictureMetadata();if(!ih)throw new Error("No picture currently selected");const gh=[];if(gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(ld.faCircleInfo)} ${this._t.gvs.metadata}`)),this._viewer._api._endpoints.report){const F=(0,hl.do)(`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`);F.firstChild.addEventListener("click",this._showReportForm.bind(this)),gh.push(F)}const ed=[{section:this._t.gvs.metadata_general_picid,classes:["gvs-td-with-id"],values:(0,hl.fP)(ih.id,this._viewer._api.getPictureMetadataUrl(ih.id,null===ih||void 0===ih||null===(F=ih.sequence)||void 0===F?void 0:F.id),this._t.gvs.metadata_general_picid_link,this._t.gvs.copy)},{section:this._t.gvs.metadata_general_seqid,classes:["gvs-td-with-id"],values:(0,hl.fP)(null===ih||void 0===ih||null===(Da=ih.sequence)||void 0===Da?void 0:Da.id,this._viewer._api.getSequenceMetadataUrl(null===ih||void 0===ih||null===(ll=ih.sequence)||void 0===ll?void 0:ll.id),this._t.gvs.metadata_general_seqid_link,this._t.gvs.copy)},{section:this._t.gvs.metadata_general_author,value:null===ih||void 0===ih||null===(cl=ih.caption)||void 0===cl?void 0:cl.producer},{section:this._t.gvs.metadata_general_license,value:null===ih||void 0===ih||null===(pl=ih.caption)||void 0===pl?void 0:pl.license},{section:this._t.gvs.metadata_general_date,value:null===ih||void 0===ih||null===(fl=ih.caption)||void 0===fl||null===(Al=fl.date)||void 0===Al?void 0:Al.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,timeZoneName:"short"})}];gh.push((0,hl.ZR)("gvs-table-light",ed)),gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(Du.rw)} ${this._t.gvs.metadata_camera}`));const td=null!==ih&&void 0!==ih&&null!==(bl=ih.properties)&&void 0!==bl&&null!==(Dl=bl["pers:interior_orientation"])&&void 0!==Dl&&Dl.focal_length?`${null===ih||void 0===ih||null===(Wl=ih.properties)||void 0===Wl||null===(Ql=Wl["pers:interior_orientation"])||void 0===Ql?void 0:Ql.focal_length} mm`:"\u2753";let id=null===ih||void 0===ih||null===(wc=ih.properties)||void 0===wc||null===(Sc=wc["pers:interior_orientation"])||void 0===Sc?void 0:Sc.sensor_array_dimensions;id&&(id=`${id[0]} x ${id[1]} px (${Math.floor(id[0]*id[1]/1e6)} Mpx)`);let nd=this._t.gvs.picture_flat,rd=null===ih||void 0===ih||null===(eu=ih.properties)||void 0===eu||null===(iu=eu["pers:interior_orientation"])||void 0===iu?void 0:iu.field_of_view;null!==rd&&void 0!==rd&&(360===rd?nd=this._t.gvs.picture_360:nd+=` (${rd}\xb0)`);const ad=[{section:this._t.gvs.metadata_camera_make,value:(null===ih||void 0===ih||null===(su=ih.properties)||void 0===su||null===(cu=su["pers:interior_orientation"])||void 0===cu?void 0:cu.camera_manufacturer)||"\u2753"},{section:this._t.gvs.metadata_camera_model,value:(null===ih||void 0===ih||null===(uu=ih.properties)||void 0===uu||null===(hu=uu["pers:interior_orientation"])||void 0===hu?void 0:hu.camera_model)||"\u2753"},{section:this._t.gvs.metadata_camera_type,value:nd},{section:this._t.gvs.metadata_camera_resolution,value:id||"\u2753"},{section:this._t.gvs.metadata_camera_focal_length,value:td}];gh.push((0,hl.ZR)("gvs-table-light",ad)),gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(ud.gK)} ${this._t.gvs.metadata_location}`));const sd=void 0!==(null===ih||void 0===ih||null===(Lu=ih.properties)||void 0===Lu?void 0:Lu["view:azimuth"])?`${ih.properties["view:azimuth"]}\xb0`:"\u2753",od=(0,kl.Pu)(ih),hd=[{section:this._t.gvs.metadata_location_longitude,value:ih.gps[0]},{section:this._t.gvs.metadata_location_latitude,value:ih.gps[1]},{section:this._t.gvs.metadata_location_orientation,value:sd},{section:this._t.gvs.metadata_location_precision,value:od}];if(gh.push((0,hl.ZR)("gvs-table-light",hd)),null!==(zu=this._viewer)&&void 0!==zu&&null!==(Nu=zu.map)&&void 0!==Nu&&Nu._hasQualityScore()){var dd,pd;const F=(0,hl.Ij)("h4",`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.metadata_quality} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW)}</button>`);F.lastChild.addEventListener("click",(()=>this._showQualityScoreDoc())),gh.push(F);const Da=(0,dl.Ch)(dl.ql,null===ih||void 0===ih||null===(dd=ih.properties)||void 0===dd?void 0:dd["quality:horizontal_accuracy"]),ll=(0,dl.Ch)(360===(null===ih||void 0===ih?void 0:ih.horizontalFov)?dl.Av:dl.U3,null===ih||void 0===ih||null===(pd=ih.properties)||void 0===pd?void 0:pd["panoramax:horizontal_pixel_density"]),cl=Math.round((ll||1)*dl.Xu+(Da||1)*dl.Bg),pl=[{section:this._t.gvs.metadata_quality_score,value:(0,hl.Lt)(cl)},{section:this._t.gvs.metadata_quality_gps_score,value:(0,hl.fM)(Da,this._t)},{section:this._t.gvs.metadata_quality_resolution_score,value:(0,hl.fM)(ll,this._t)}];gh.push((0,hl.ZR)("gvs-table-light",pl))}if(null!==(qu=ih.properties)&&void 0!==qu&&qu.exif){const F=document.createElement("details");F.appendChild((0,hl.Ij)("summary",`${(0,hl.Qt)(cd.BH)} ${this._t.gvs.metadata_exif}`));const Da=Object.entries(ih.properties.exif).sort().map((F=>{let[Da,ll]=F;return{section:Da,value:ll}}));F.appendChild((0,hl.ZR)("",Da)),gh.push(F)}this._viewer.setPopup(!0,gh),this._viewer.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_showQualityScoreDoc(){const F=[];F.push((0,hl.Ij)("h4",`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.qualityscore_title}`));const Da=document.createElement("a");Da.setAttribute("href","https://docs.panoramax.fr/pictures-metadata/quality_score/"),Da.setAttribute("target","_blank"),Da.appendChild(document.createTextNode(this._t.gvs.qualityscore_doc_link)),[document.createTextNode(this._t.gvs.qualityscore_doc_1),document.createTextNode(this._t.gvs.qualityscore_doc_2),(0,hl.Lt)(5),document.createTextNode(this._t.gvs.qualityscore_doc_3),Da].forEach((Da=>{const ll=document.createElement("p");ll.appendChild(Da),F.push(ll)})),this._viewer.setPopup(!0,F)}_showReportForm(){const F=this._viewer.psv.getPictureMetadata();if(!F)throw new Error("No picture currently selected");const Da=[];Da.push((0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`));const ll=(0,dl.bG)();if(ll){const F=document.createElement("p");F.appendChild(document.createTextNode(this._t.gvs.report_auth.replace("{a}",ll.name))),Da.push(F)}const cl=document.createElement("form");Da.push(cl);const pl=document.createElement("div");pl.classList.add("gvs-input-group");const fl=(0,hl.fp)("gvs-report-issue",this._t.gvs.report_nature_label,ld.faCircleInfo),Al=document.createElement("select");Al.name="gvs-report-issue",Al.required=!0;["","blur_missing","blur_excess","inappropriate","privacy","picture_low_quality","mislocated","copyright","other"].forEach((F=>{const Da=document.createElement("option");Da.value=F,Da.textContent=this._t.gvs.report_nature[F],""===F&&(Da.setAttribute("disabled",""),Da.setAttribute("selected",""),Da.setAttribute("hidden","")),Al.appendChild(Da)})),pl.appendChild(fl),pl.appendChild(Al),cl.appendChild(pl);const bl=document.createElement("div");bl.classList.add("gvs-input-group","gvs-input-group-inline");const kl=document.createElement("input");kl.id="gvs-report-whole-sequence",kl.name="gvs-report-whole-sequence",kl.type="checkbox";const Dl=(0,hl.fp)("gvs-report-whole-sequence",this._t.gvs.report_whole_sequence);bl.appendChild(kl),bl.appendChild(Dl),cl.appendChild(bl);const Wl=document.createElement("div");Wl.classList.add("gvs-input-group");const Ql=(0,hl.fp)("gvs-report-details",this._t.gvs.report_details,gd.Be),wc=document.createElement("textarea");let Sc;if(wc.name="gvs-report-details",wc.placeholder=this._t.gvs.report_details_placeholder,Wl.appendChild(Ql),Wl.appendChild(wc),cl.appendChild(Wl),!ll){const F=document.createElement("div");F.classList.add("gvs-input-group");const Da=(0,hl.fp)("email",this._t.gvs.report_email,Ad.Hz);Sc=document.createElement("input"),Sc.type="email",Sc.name="email",Sc.placeholder=this._t.gvs.report_email_placeholder,F.appendChild(Da),F.appendChild(Sc),cl.appendChild(F)}const eu=document.createElement("div");eu.classList.add("gvs-input-btn");const iu=document.createElement("button");iu.type="submit",iu.appendChild((0,hl.fa)(yd.is)),iu.appendChild(document.createTextNode(this._t.gvs.report_submit)),eu.appendChild(iu),cl.appendChild(eu),cl.addEventListener("submit",(Da=>{var ll;Da.preventDefault();const cl={issue:Al.value,picture_id:kl.checked?null:F.id,reporter_comments:wc.value,reporter_email:null===(ll=Sc)||void 0===ll?void 0:ll.value,sequence_id:F.sequence.id};this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_wait)]),this._viewer._api.sendReport(cl).then((()=>{this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_success)])})).catch((F=>{console.error(F),this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_failure.replace("{e}",F))])}))})),this._viewer.setPopup(!0,Da),this._viewer.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_initWidgetMiniActions(){const F=document.createElement("img");F.alt="",F.height=120,F.draggable=!1,F.src=pl;const Da=document.createElement("span");Da.classList.add("gvs-mobile-hidden"),Da.appendChild(document.createTextNode(this._t.gvs.expand));const ll=(0,hl.Tf)("gvs-mini-expand",Da,this._t.gvs.expand_info,["gvs-only-mini","gvs-print-hidden"]);ll.appendChild(F),this._corners["mini-top-right"].appendChild(ll),ll.addEventListener("click",(()=>{this._viewer.setFocus(this._viewer.isMapWide()?"pic":"map")}));const cl=document.createElement("img");cl.alt=this._t.gvs.minimize_short,cl.height=120,cl.draggable=!1,cl.src=fl;const Al=(0,hl.Tf)("gvs-mini-hide",cl,this._t.gvs.minimize,["gvs-only-mini","gvs-print-hidden"]);this._corners["mini-bottom-left"].appendChild(Al),Al.addEventListener("click",(()=>{this._viewer.setUnfocusedVisible(!1)}));const bl=(0,hl.Tf)("gvs-mini-show",null,null,["gvs-btn-large","gvs-only-mini-hidden","gvs-print-hidden"]);this._corners["main-bottom-left"].appendChild(bl),bl.addEventListener("click",(()=>{(0,dl.GZ)()?this._viewer.setFocus(this._viewer.isMapWide()?"pic":"map"):this._viewer.setUnfocusedVisible(!0)}));const miniBtnRendering=()=>{this._viewer.map&&this._viewer.isMapWide()?(bl.title=this._t.gvs.show_psv,bl.innerHTML=(0,hl.Qt)(iu.pt)):(bl.title=this._t.gvs.show_map,bl.innerHTML=(0,hl.Qt)(Sc.e5))};miniBtnRendering(),this._viewer.addEventListener("focus-changed",miniBtnRendering)}_initWidgetSearch(){const F=(0,hl.OZ)("gvs-widget-search-bar",this._t.gvs.search_address,(F=>{const Da=F.match(/([-+]?\d{1,2}\.\d+),\s*([-+]?\d{1,3}\.\d+)/),ll=F.match(/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/);if(Da){const F=parseFloat(Da[1]),ll=parseFloat(Da[2]);return this._viewer.map.flyTo({center:[ll,F],zoom:16}),Promise.resolve(!0)}return ll?(this._viewer.select(null,F),Promise.resolve(!0)):this._viewer.map.geocoder({query:F,limit:3,bbox:this._viewer.map.getBounds().toArray().map((F=>F.join(","))).join(","),proximity:this._viewer.map.getCenter().lat+","+this._viewer.map.getCenter().lng}).then((F=>F=F.features.map((F=>({title:F.place_name.split(",")[0],subtitle:F.place_name.split(",").slice(1).join(", "),data:F})))))}),(F=>{F&&(F.data.bounds?this._viewer.map.fitBounds(F.data.bounds):this._viewer.map.flyTo({center:F.data.center,zoom:F.data.zoom||13}))}),this,void 0,this._viewer.isWidthSmall(),this._viewer.map._geolocate);(0,hl.wj)("gvs-widget-search",this._viewer.isWidthSmall()?"main-top-right":"main-top-left",this,[F],["gvs-only-map","gvs-print-hidden"])}_initWidgetMapLayers(){var F,Da;const ll=(0,hl.np)("gvs-map-layers",ad.qI,this._t.gvs.layers,this),cl=(0,hl.t_)(this,ll,[]);(0,hl.wj)("gvs-widget-map-layers","main-top-right",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-only-map","gvs-print-hidden"]),this._viewer.map.hasTwoBackgrounds()&&(cl.innerHTML=`\n\t\t\t\t<h4>${(0,hl.Qt)(sd.YS)} ${this._t.gvs.map_background}</h4>\n\t\t\t\t<div id="gvs-map-bg" class="gvs-input-group">\n\t\t\t\t\t<input type="radio" id="gvs-map-bg-streets" name="gvs-map-bg" value="streets" />\n\t\t\t\t\t<label for="gvs-map-bg-streets">\n\t\t\t\t\t\t<img id="gvs-map-bg-streets-img" alt="" />\n\t\t\t\t\t\t${this._t.gvs.map_background_streets}\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type="radio" id="gvs-map-bg-aerial" name="gvs-map-bg" value="aerial" />\n\t\t\t\t\t<label for="gvs-map-bg-aerial">\n\t\t\t\t\t\t<img id="gvs-map-bg-aerial-img" alt="" />\n\t\t\t\t\t\t${this._t.gvs.map_background_aerial}\n\t\t\t\t\t</label>\n\t\t\t\t</div>`),cl.innerHTML+=`\n\t\t\t<h4>${(0,hl.Qt)(td.fy)} ${this._t.gvs.map_theme}</h4>\n\t\t\t<div class="gvs-input-group">\n\t\t\t\t<select id="gvs-map-theme" style="width: 100%;">\n\t\t\t\t\t<option value="default">${this._t.gvs.map_theme_default}</option>\n\t\t\t\t\t<option value="age">${this._t.gvs.map_theme_age}</option>\n\t\t\t\t\t<option value="type">${this._t.gvs.map_theme_type}</option>\n\t\t\t\t\t${null!==(F=this._viewer)&&void 0!==F&&null!==(Da=F.map)&&void 0!==Da&&Da._hasQualityScore()?'<option value="score">'+this._t.gvs.map_theme_score+"</option>":""}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<div id="gvs-map-theme-legend-age" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_4}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_4}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_3}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_3}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_2}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_2}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_1}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_1}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id="gvs-map-theme-legend-type" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.QUALI_1}"></span>\n\t\t\t\t\t\t${this._t.gvs.picture_360}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.QUALI_2}"></span>\n\t\t\t\t\t\t${this._t.gvs.picture_flat}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id="gvs-map-theme-legend-score" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t${dl.fW.map((F=>'<span class="gvs-qualityscore" style="background-color: '+F.color+';">'+F.label+"</span>")).join("")}\n\t\t\t\t\t<button id="gvs-map-theme-quality-help" class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW,{transform:{x:6,size:24}})}</button>\n\t\t\t\t</div>\n\t\t\t</div>`,cl.querySelector("#gvs-map-theme-quality-help").addEventListener("click",(()=>this._showQualityScoreDoc()));const pl=cl.querySelector("#gvs-map-theme"),onChange=()=>{this._onMapThemeChange(),this._onMapFiltersChange()};if(pl.addEventListener("change",onChange),pl.addEventListener("keypress",onChange),pl.addEventListener("paste",onChange),pl.addEventListener("input",onChange),this._viewer.map.hasTwoBackgrounds()){cl.querySelector("#gvs-map-bg-aerial-img").src=Al;cl.querySelector("#gvs-map-bg-streets-img").src=bl;const F=cl.querySelector("#gvs-map-bg-aerial"),Da=cl.querySelector("#gvs-map-bg-streets"),onBgChange=F=>{this._viewer.map.setBackground(F.target.value)};F.addEventListener("change",onBgChange),Da.addEventListener("change",onBgChange),this._viewer.addEventListener("map:background-changed",(F=>this._onMapBackgroundChange(F.detail.background))),this._onMapBackgroundChange(this._viewer.map.getBackground())}}_onMapBackgroundChange(F){const Da=document.getElementById("gvs-map-bg-aerial"),ll=document.getElementById("gvs-map-bg-streets");"aerial"===F?Da.checked=!0:ll.checked=!0}_onMapThemeChange(){const F=document.getElementById("gvs-map-theme"),Da=document.getElementById("gvs-map-layers"),ll=F.value;Da.setActive("default"!==ll);for(let cl of document.getElementsByClassName("gvs-map-theme-legend"))cl.id=="gvs-map-theme-legend-"+ll?cl.classList.remove("gvs-hidden"):cl.classList.add("gvs-hidden")}_initWidgetFilters(F,Da){const ll=(0,hl.np)("gvs-filter",rd._$,this._t.gvs.filters,this,["gvs-filter-unset-btn"]),cl=(0,hl.t_)(this,ll,[]);cl.innerHTML=`\n\t\t\t<form id="gvs-filter-form">\n\t\t\t\t<div class="gvs-filter-block">\n\t\t\t\t\t<div class="gvs-filter-zoomin">${this._t.gvs.filter_zoom_in}</div>\n\t\t\t\t\t<h4>${(0,hl.Qt)(Lu.ok)} ${this._t.gvs.filter_date}</h4>\n\t\t\t\t\t<div class="gvs-input-shortcuts">\n\t\t\t\t\t\t<button data-for="gvs-filter-date-from" data-value="${new Date((new Date).setMonth((new Date).getMonth()-1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1month}</button>\n\t\t\t\t\t\t<button data-for="gvs-filter-date-from" data-value="${new Date((new Date).setFullYear((new Date).getFullYear()-1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1year}</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="gvs-input-group">\n\t\t\t\t\t\t<input type="date" id="gvs-filter-date-from" />\n\t\t\t\t\t\t${(0,hl.Qt)(zu.dm)}\n\t\t\t\t\t\t<input type="date" id="gvs-filter-date-end" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="gvs-filter-block">\n\t\t\t\t\t<h4>${(0,hl.Qt)(eu.jb)} ${this._t.gvs.filter_picture}</h4>\n\t\t\t\t\t<div class="gvs-input-group gvs-checkbox-btns" style="justify-content: center;">\n\t\t\t\t\t\t<input type="checkbox" id="gvs-filter-type-flat" name="flat" />\n\t\t\t\t\t\t<label for="gvs-filter-type-flat">${(0,hl.Qt)(eu.jb)} ${this._t.gvs.picture_flat}</label>\n\t\t\t\t\t\t<input type="checkbox" id="gvs-filter-type-360" name="360" />\n\t\t\t\t\t\t<label for="gvs-filter-type-360">${(0,hl.Qt)(iu.pt)} ${this._t.gvs.picture_360}</label>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t`;const pl=cl.children[0];(0,hl.wj)("gvs-widget-filter",this._viewer.isWidthSmall()?"main-top-right":"main-top-left",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-only-map","gvs-print-hidden"]);const fl=ll.querySelector(".gvs-filter-unset-btn");if(fl&&fl.addEventListener("click",(F=>{F.stopPropagation(),pl.reset()})),this._viewer.isWidthSmall()&&(cl.style.width=this._viewer.container.offsetWidth-70+"px"),Da){const F=document.createElement("div");F.classList.add("gvs-filter-block"),pl.appendChild(F);const Da=document.createElement("div");Da.classList.add("gvs-filter-zoomin"),Da.appendChild(document.createTextNode(this._t.gvs.filter_zoom_in)),F.appendChild(Da);const ll=document.createElement("h4");ll.innerHTML=`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.filter_qualityscore} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW)}</button>`,ll.style.marginBottom="3px",ll.lastChild.addEventListener("click",(()=>this._showQualityScoreDoc())),F.appendChild(ll);const cl=document.createElement("div");cl.id="gvs-filter-qualityscore",cl.classList.add("gvs-input-group"),dl.fW.forEach((F=>{const Da=document.createElement("input");Da.id="gvs-filter-qualityscore-"+F.label,Da.type="checkbox",Da.name="qualityscore",Da.value=F.label;const ll=document.createElement("label");ll.setAttribute("for",Da.id),ll.title=this._t.gvs.filter_qualityscore_help,ll.appendChild(document.createTextNode(F.label)),ll.style.backgroundColor=F.color,cl.appendChild(Da),cl.appendChild(ll)})),F.appendChild(cl)}if(F){const F=document.createElement("div");F.classList.add("gvs-filter-block"),pl.appendChild(F);const Da=document.createElement("h4");Da.innerHTML=`${(0,hl.Qt)(od.X4)} ${this._t.gvs.filter_user}`,F.appendChild(Da);const ll=(0,dl.bG)();let cl;if(ll){const Da=document.createElement("div");Da.classList.add("gvs-input-shortcuts"),cl=document.createElement("button"),cl.appendChild(document.createTextNode(this._t.gvs.filter_user_mypics)),Da.appendChild(cl),F.appendChild(Da)}const fl=document.createElement("div");let Al;fl.id="gvs-filter-user",fl.classList.add("gvs-input-group"),Al=(0,hl.OZ)("gvs-filter-search-user",this._t.gvs.search_user,(F=>(Al.classList.remove("gvs-filter-active"),this._viewer._api.searchUsers(F).then((F=>(F||[]).map((F=>({title:F.label,data:F}))))))),(F=>(F?Al.classList.add("gvs-filter-active"):Al.classList.remove("gvs-filter-active"),this._viewer.map.setVisibleUsers(F?[F.data.id]:["geovisio"]))),this,!0),F.addEventListener("reset",(()=>{Al.classList.remove("gvs-filter-active"),Al.resetSearch()})),fl.appendChild(Al),F.appendChild(fl),ll&&cl.addEventListener("click",(()=>{const F=Al.querySelector("input");F.value===ll.name?Al.resetSearch():F.goItem({title:ll.name,data:{id:ll.id}})}))}cl.querySelectorAll(".gvs-input-shortcuts button").forEach((F=>{F.addEventListener("click",(()=>{const Da=document.getElementById(F.getAttribute("data-for")),ll=F.getAttribute("data-value");Da&&(Da.value!==ll?Da.value=ll:Da.value="")}))}));[document.getElementById("gvs-filter-date-from"),document.getElementById("gvs-filter-date-end")].forEach((F=>{F.addEventListener("change",(()=>{F.value?F.classList.add("gvs-filter-active"):F.classList.remove("gvs-filter-active")}))})),this._formDelay=null;const onFormChange=()=>{this._formDelay&&clearTimeout(this._formDelay),this._formDelay=setTimeout((()=>{this._onMapFiltersChange()}),250)};pl.addEventListener("change",onFormChange),pl.addEventListener("reset",onFormChange),pl.addEventListener("submit",(F=>(onFormChange(),F.preventDefault(),!1)),!0);for(let hl of pl.getElementsByTagName("input"))hl.addEventListener("change",onFormChange),hl.addEventListener("keypress",onFormChange),hl.addEventListener("paste",onFormChange),hl.addEventListener("input",onFormChange)}_onMapFiltersChange(){var F,Da;const ll=document.getElementById("gvs-filter-date-from"),cl=document.getElementById("gvs-filter-date-end"),hl=document.getElementById("gvs-filter-type-flat"),dl=document.getElementById("gvs-filter-type-360"),pl=document.getElementById("gvs-map-theme");let fl="";dl.checked&&!hl.checked&&(fl="equirectangular"),!dl.checked&&hl.checked&&(fl="flat");let Al=[];if(null!==(F=this._viewer)&&void 0!==F&&null!==(Da=F.map)&&void 0!==Da&&Da._hasQualityScore()){const F=document.getElementById("gvs-filter-qualityscore-A"),Da=document.getElementById("gvs-filter-qualityscore-B"),ll=document.getElementById("gvs-filter-qualityscore-C"),cl=document.getElementById("gvs-filter-qualityscore-D"),hl=document.getElementById("gvs-filter-qualityscore-E");F.checked&&Al.push(5),Da.checked&&Al.push(4),ll.checked&&Al.push(3),cl.checked&&Al.push(2),hl.checked&&Al.push(1),5==Al.length&&(Al=[])}const bl={minDate:ll.value,maxDate:cl.value,type:fl,theme:pl.value,qualityscore:Al};this._viewer.setFilters(bl)}_listenMapFiltersChanges(){const F=document.getElementById("gvs-filter"),Da=document.getElementById("gvs-filter-date-from"),ll=document.getElementById("gvs-filter-date-end"),cl=document.getElementById("gvs-filter-type-flat"),hl=document.getElementById("gvs-filter-type-360"),dl=document.getElementById("gvs-map-theme"),pl=document.getElementById("gvs-filter-qualityscore-A"),fl=document.getElementById("gvs-filter-qualityscore-B"),Al=document.getElementById("gvs-filter-qualityscore-C"),bl=document.getElementById("gvs-filter-qualityscore-D"),kl=document.getElementById("gvs-filter-qualityscore-E");this._viewer.addEventListener("filters-changed",(Dl=>{Dl.detail.minDate?(Da.value=Dl.detail.minDate,Da.classList.add("gvs-filter-active")):Da.classList.remove("gvs-filter-active"),Dl.detail.maxDate?(ll.value=Dl.detail.maxDate,ll.classList.add("gvs-filter-active")):ll.classList.remove("gvs-filter-active"),Dl.detail.theme&&(dl.value=Dl.detail.theme),Dl.detail.type&&(hl.checked=["","equirectangular"].includes(Dl.detail.type),cl.checked=["","flat"].includes(Dl.detail.type)),Dl.detail.qualityscore&&(pl.checked=Dl.detail.qualityscore.includes(5)&&Dl.detail.qualityscore.length<5,fl.checked=Dl.detail.qualityscore.includes(4)&&Dl.detail.qualityscore.length<5,Al.checked=Dl.detail.qualityscore.includes(3)&&Dl.detail.qualityscore.length<5,bl.checked=Dl.detail.qualityscore.includes(2)&&Dl.detail.qualityscore.length<5,kl.checked=Dl.detail.qualityscore.includes(1)&&Dl.detail.qualityscore.length<5);let Wl=Object.keys(Dl.detail).filter((F=>F&&"theme"!==F)).length>0||this._viewer.map.getVisibleUsers().filter((F=>"geovisio"!==F)).length>0;F.setActive(Wl),this._onMapThemeChange()})),this._viewer.addEventListener("map:users-changed",(Da=>{let ll=Object.keys(this._viewer._mapFilters).filter((F=>F&&"theme"!==F)).length>0||Da.detail.usersIds.filter((F=>"geovisio"!==F)).length>0;F.setActive(ll)}));const Dl=document.getElementsByClassName("gvs-filter-zoomin"),changeLblZoomInDisplay=()=>{for(let F of Dl)this._viewer.map.getZoom()<7?F.style.display=null:F.style.display="none"};changeLblZoomInDisplay(),this._viewer.map.on("zoomend",changeLblZoomInDisplay)}_initWidgetShare(){var F,Da;const ll=(0,hl.Tf)("gvs-share",(0,hl.fa)(Ql.ek),this._t.gvs.share,["gvs-btn-large"]),cl=(0,hl.t_)(this,ll,[]);cl.innerHTML=`\n\t\t\t<div class="gvs-hidden">\n\t\t\t\t<p id="gvs-share-license" style="margin: 0 0 10px 0;"></p>\n\t\t\t</div>\n\t\t\t<h4 style="margin-top: 0">${(0,hl.Qt)(wc.CQ)} ${this._t.gvs.share_links}</h4>\n\t\t\t<div id="gvs-share-links" class="gvs-input-btn">\n\t\t\t\t<a id="gvs-share-image" class="gvs-link-btn gvs-hidden" download target="_blank">${(0,hl.Qt)(dd.sA)} ${this._t.gvs.share_image}</a>\n\t\t\t\t<button id="gvs-share-url" data-copy="true" style="flex-basis: 100%; flex-grow: 2; flex-shrink: 2;">${(0,hl.Qt)(pd.jP)} ${this._t.gvs.share_page}</button>\n\t\t\t\t<button id="gvs-share-print" style="flex-basis: 100%; flex-grow: 2; flex-shrink: 2;">${(0,hl.Qt)(qu.Jx)} ${this._t.gvs.share_print}</button>\n\t\t\t</div>\n\t\t\t<h4>\n\t\t\t\t${(0,hl.Qt)(Sc.e5)} ${this._t.gvs.share_embed}\n\t\t\t\t<a href="https://docs.panoramax.fr/web-viewer/03_URL_settings/"\n\t\t\t\t\ttitle="${this._t.gvs.share_embed_docs}"\n\t\t\t\t\ttarget="_blank"\n\t\t\t\t\tstyle="vertical-align: middle">\n\t\t\t\t\t${(0,hl.Qt)(ld.faCircleInfo)}\n\t\t\t\t</a>\n\t\t\t</h4>\n\t\t\t<div class="gvs-input-btn">\n\t\t\t\t<textarea id="gvs-share-iframe" readonly></textarea>\n\t\t\t\t<button data-input="gvs-share-iframe">${(0,hl.Qt)(pd.jP)} ${this._t.gvs.copy}</button>\n\t\t\t</div>\n\t\t\t<h4 class="gvs-hidden">${(0,hl.Qt)(Nu.hp)} ${this._t.gvs.edit_osm}</h4>\n\t\t\t<div class="gvs-input-btn gvs-hidden" style="justify-content: center">\n\t\t\t\t<a id="gvs-edit-id" class="gvs-link-btn" target="_blank">${(0,hl.Qt)(ud.gK)} ${this._t.gvs.id}</a>\n\t\t\t\t<button id="gvs-edit-josm" title="${this._t.gvs.josm_live}">${(0,hl.Qt)(ih.hU)} ${this._t.gvs.josm}</button>\n\t\t\t</div>\n\t\t`,(0,hl.wj)("gvs-widget-share","main-bottom-right",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-mobile-hidden","gvs-print-hidden"]);const dl=document.getElementById("gvs-share-links"),pl=document.getElementById("gvs-share-image"),fl=document.getElementById("gvs-share-url");if(this._viewer._api.getRSSURL()){const F=document.createElement("a");F.id="gvs-share-rss",F.classList.add("gvs-link-btn"),F.setAttribute("target","_blank"),F.setAttribute("title",this._t.gvs.share_rss_title),F.appendChild((0,hl.fa)(hd.zb)),F.appendChild(document.createTextNode(this._t.gvs.share_rss)),dl.insertBefore(F,fl)}this._viewer.addEventListener("psv:picture-loaded",(()=>{var F;const Da=this._viewer.psv.getPictureMetadata();pl.href=Da.panorama.hdUrl;for(document.getElementById("gvs-share-license").innerHTML=null!==Da&&void 0!==Da&&null!==(F=Da.caption)&&void 0!==F&&F.license?this._t.gvs.legend_license.replace("{l}",Da.caption.license):"";cl.getElementsByClassName("gvs-hidden").length>0;){cl.getElementsByClassName("gvs-hidden")[0].classList.remove("gvs-hidden")}}));const updateLinks=F=>{var Da,ll,hl;const dl=(null===F||void 0===F||null===(Da=F.detail)||void 0===Da?void 0:Da.url)||window.location.href.replace(/\/$/,""),pl=this._options.iframeBaseURL?this._options.iframeBaseURL+window.location.hash:dl,fl=cl.querySelector("#gvs-share-url"),Al=cl.querySelector("#gvs-share-iframe"),bl=cl.querySelector("#gvs-edit-id"),kl=cl.querySelector("#gvs-share-rss");fl.setAttribute("data-copy",(null===(ll=this._viewer)||void 0===ll||null===(hl=ll._hash)||void 0===hl?void 0:hl.getShortLink(dl))||dl),Al.innerText=`<iframe src="${pl}" style="border: none; width: 500px; height: 300px"></iframe>`;const Dl=this._viewer.psv.getPictureMetadata();if(Dl){const F={map:`19/${Dl.gps[1]}/${Dl.gps[0]}`,source:"Panoramax",photo_overlay:"panoramax",photo:`panoramax/${Dl.id}`};bl.setAttribute("href",`${this._options.editIdUrl}#${new URLSearchParams(F).toString()}`)}var Wl,Ql;kl&&kl.setAttribute("href",this._viewer._api.getRSSURL(null===(Wl=this._viewer)||void 0===Wl||null===(Ql=Wl.map)||void 0===Ql?void 0:Ql.getBounds()))};updateLinks(),this._viewer.addEventListener("ready",updateLinks,{once:!0}),null===(F=this._viewer)||void 0===F||null===(Da=F._hash)||void 0===Da||Da.addEventListener("url-changed",updateLinks),(0,hl.$c)(cl,this._viewer._t);const Al=cl.querySelector("#gvs-edit-josm");Al.addEventListener("click",(()=>{Al.classList.contains("gvs-btn-active")?this._viewer.toggleJOSMLive(!1):this._viewer.toggleJOSMLive(!0).catch((F=>{console.warn(F),alert(this._t.gvs.error_josm)}))})),this._viewer.addEventListener("josm-live-enabled",(()=>Al.classList.add("gvs-btn-active"))),this._viewer.addEventListener("josm-live-disabled",(()=>Al.classList.remove("gvs-btn-active")));cl.querySelector("#gvs-share-print").addEventListener("click",window.print.bind(window))}}},7325:(F,Da)=>{"use strict";var ll="star",cl=[11088,61446],hl="f005",dl="M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z";Da.mw={prefix:"far",iconName:ll,icon:[576,512,cl,hl,dl]},Da.yy=Da.mw},6069:(F,Da)=>{"use strict";var ll="arrow-right",cl=[8594],hl="f061",dl="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.dm=Da.mw},4881:(F,Da)=>{"use strict";var ll=[61946],cl="M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256l0 32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32l0 80 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z";Da.mw={prefix:"fas",iconName:"at",icon:[512,512,ll,"40",cl]},Da.Hz=Da.mw},1705:(F,Da)=>{"use strict";var ll="backward",cl=[9194],hl="f04a",dl="M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3l0 41.7 0 41.7L459.5 440.6zM256 352l0-96 0-128 0-32c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.TH=Da.mw},9186:(F,Da)=>{"use strict";var ll="calendar",cl=[128197,128198],hl="f133",dl="M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.ok=Da.mw},99:(F,Da)=>{"use strict";var ll="camera",cl=[62258,"camera-alt"],hl="f030",dl="M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.rw=Da.mw},174:(F,Da)=>{"use strict";var ll="check",cl=[10003,10004],hl="f00c",dl="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.e6=Da.mw},2593:(F,Da)=>{"use strict";var ll="chevron-down",cl=[],hl="f078",dl="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Jt=Da.mw},4011:(F,Da)=>{"use strict";var ll="circle-exclamation",cl=["exclamation-circle"],hl="f06a",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.lE=Da.mw},7516:(F,Da)=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var ll="circle-info",cl=["info-circle"],hl="f05a",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z";Da.definition={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.faCircleInfo=Da.definition,Da.prefix="fas",Da.iconName=ll,Da.width=512,Da.height=512,Da.ligatures=cl,Da.unicode=hl,Da.svgPathData=dl,Da.aliases=cl},3444:(F,Da)=>{"use strict";var ll="circle-notch",cl=[],hl="f1ce",dl="M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.s4=Da.mw},9564:(F,Da)=>{"use strict";var ll="circle-question",cl=[62108,"question-circle"],hl="f059",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.AP=Da.mw},4162:(F,Da)=>{"use strict";var ll="cloud-arrow-down",cl=[62337,"cloud-download","cloud-download-alt"],hl="f0ed",dl="M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.sA=Da.mw},2975:(F,Da)=>{"use strict";var ll="comment-dots",cl=[128172,62075,"commenting"],hl="f4ad",dl="M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Be=Da.mw},4189:(F,Da)=>{"use strict";var ll="copy",cl=[],hl="f0c5",dl="M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.jP=Da.mw},7172:(F,Da)=>{"use strict";var ll="earth-europe",cl=["globe-europe"],hl="f7a2",dl="M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.YS=Da.mw},6533:(F,Da)=>{"use strict";var ll="ellipsis-vertical",cl=["ellipsis-v"],hl="f142",dl="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z";Da.mw={prefix:"fas",iconName:ll,icon:[128,512,cl,hl,dl]},Da.nx=Da.mw},5431:(F,Da)=>{"use strict";var ll="forward",cl=[9193],hl="f04e",dl="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3l0 41.7 0 41.7L52.5 440.6zM256 352l0-96 0-128 0-32c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29l0-64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.vF=Da.mw},8739:(F,Da)=>{"use strict";var ll="gear",cl=[9881,"cog"],hl="f013",dl="M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.BH=Da.mw},5279:(F,Da)=>{"use strict";var ll="image",cl=[],hl="f03e",dl="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.jb=Da.mw},6668:(F,Da,ll)=>{"use strict";var cl=ll(7516);Da.mw={prefix:cl.prefix,iconName:cl.iconName,icon:[cl.width,cl.height,cl.aliases,cl.unicode,cl.svgPathData]},Da.iW=Da.mw,cl.prefix,cl.iconName,cl.width,cl.height,cl.aliases,cl.unicode,cl.svgPathData,cl.aliases},4220:(F,Da)=>{"use strict";var ll="layer-group",cl=[],hl="f5fd",dl="M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z";Da.mw={prefix:"fas",iconName:ll,icon:[576,512,cl,hl,dl]},Da.qI=Da.mw},325:(F,Da)=>{"use strict";var ll="lightbulb",cl=[128161],hl="f0eb",dl="M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.rC=Da.mw},7964:(F,Da)=>{"use strict";var ll="link",cl=[128279,"chain"],hl="f0c1",dl="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.CQ=Da.mw},3520:(F,Da)=>{"use strict";var ll="location-dot",cl=["map-marker-alt"],hl="f3c5",dl="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.gK=Da.mw},7761:(F,Da)=>{"use strict";var ll="magnifying-glass",cl=[128269,"search"],hl="f002",dl="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.$U=Da.mw},2e3:(F,Da)=>{"use strict";var ll=[128506,62072],cl="f279",hl="M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z";Da.mw={prefix:"fas",iconName:"map",icon:[576,512,ll,cl,hl]},Da.e5=Da.mw},3233:(F,Da)=>{"use strict";var ll="medal",cl=[127941],hl="f5a2",dl="M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0L133.9 0c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0L487.4 0C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.B9=Da.mw},7290:(F,Da)=>{"use strict";var ll="minus",cl=[8211,8722,10134,"subtract"],hl="f068",dl="M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.EZ=Da.mw},8629:(F,Da)=>{"use strict";var ll="palette",cl=[127912],hl="f53f",dl="M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.fy=Da.mw},9683:(F,Da)=>{"use strict";var ll="panorama",cl=[],hl="e209",dl="M45.6 32C20.4 32 0 52.4 0 77.6L0 434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6l0-356.7C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.pt=Da.mw},1708:(F,Da)=>{"use strict";var ll="paper-plane",cl=[61913],hl="f1d8",dl="M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.is=Da.mw},7472:(F,Da)=>{"use strict";var ll="pause",cl=[9208],hl="f04c",dl="M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z";Da.mw={prefix:"fas",iconName:ll,icon:[320,512,cl,hl,dl]},Da.G1=Da.mw},7321:(F,Da)=>{"use strict";var ll=[128394],cl="f304",hl="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z";Da.mw={prefix:"fas",iconName:"pen",icon:[512,512,ll,cl,hl]},Da.hp=Da.mw},9243:(F,Da)=>{"use strict";var ll="person-biking",cl=[128692,"biking"],hl="f84a",dl="M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1 288 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.rO=Da.mw},6386:(F,Da)=>{"use strict";var ll="play",cl=[9654],hl="f04b",dl="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.ij=Da.mw},1372:(F,Da)=>{"use strict";var ll="plus",cl=[10133,61543,"add"],hl="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,"2b",hl]},Da.QL=Da.mw},501:(F,Da)=>{"use strict";var ll="print",cl=[128424,128438,9113],hl="f02f",dl="M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Jx=Da.mw},7744:(F,Da)=>{"use strict";var ll="rocket",cl=[],hl="f135",dl="M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.KM=Da.mw},6787:(F,Da)=>{"use strict";var ll="satellite-dish",cl=[128225],hl="f7c0",dl="M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.hU=Da.mw},1260:(F,Da)=>{"use strict";var ll="share-nodes",cl=["share-alt"],hl="f1e0",dl="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.ek=Da.mw},1904:(F,Da)=>{"use strict";var ll="sliders",cl=["sliders-h"],hl="f1de",dl="M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da._$=Da.mw},3095:(F,Da)=>{"use strict";var ll="square-rss",cl=["rss-square"],hl="f143",dl="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 136c0-13.3 10.7-24 24-24c137 0 248 111 248 248c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24c83.9 0 152 68.1 152 152c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104c-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.zb=Da.mw},4780:(F,Da)=>{"use strict";var ll="star",cl=[11088,61446],hl="f005",dl="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z";Da.mw={prefix:"fas",iconName:ll,icon:[576,512,cl,hl,dl]},Da.yy=Da.mw},6311:(F,Da)=>{"use strict";var ll="triangle-exclamation",cl=[9888,"exclamation-triangle","warning"],hl="f071",dl="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.JA=Da.mw},7879:(F,Da)=>{"use strict";var ll="user",cl=[128100,62144],hl="f007",dl="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.X4=Da.mw},6627:(F,Da)=>{"use strict";var ll="xmark",cl=[128473,10005,10006,10060,215,"close","multiply","remove","times"],hl="f00d",dl="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.Jy=Da.mw},1545:(F,Da,ll)=>{"use strict";ll.d(Da,{AZ:()=>od,GR:()=>Op,IJ:()=>Up,Qw:()=>Rp,TL:()=>am,Wp:()=>Lu,aH:()=>dl,e6:()=>zu,jM:()=>Um,rx:()=>ld,uj:()=>jp,zY:()=>sm});var cl=ll(9408),hl=Object.defineProperty,__export=(F,Da)=>{for(var ll in Da)hl(F,ll,{get:Da[ll],enumerable:!0})},dl={};
|
|
12
|
+
!function(F,Da){"object"===typeof exports&&"object"===typeof module?module.exports=Da():"function"===typeof define&&define.amd?define("Panoramax",[],Da):"object"===typeof exports?exports.Panoramax=Da():F.Panoramax=Da()}(this,(()=>(()=>{var F={9555:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Editor});ll(980);var cl=ll(6803),hl=ll(1951),dl=ll(8489),pl=ll(7534),fl=ll(6810),Al=ll(5071),bl=ll(1300),kl=ll(1545);const Dl="sequence-headings";class Editor extends cl.A{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(F,Da,Object.assign(ll,{users:[]})),this._selectedSeqId||this._loader.dismiss({},"No sequence is selected"),this.psvContainer=document.createElement("div"),this.mapContainer=document.createElement("div"),this.container.appendChild(this.psvContainer),this.container.appendChild(this.mapContainer);try{this.psv=new dl.Ay(this,this.psvContainer),this.psv._myVTour.datasource.nodeResolver=this._getNode.bind(this)}catch(cl){let F=kl.IJ.isWebGLSupported?this._t.gvs.error_psv:this._t.gvs.error_webgl;this._loader.dismiss(cl,F)}this._api.onceReady().then((()=>{try{this.map=new hl.A(this,this.mapContainer,{raster:ll.raster,background:ll.background,supplementaryStyle:this._createMapStyle()}),(0,Al.I0)(this),this._loadSequence(),this.map.once("load",(()=>{this.map.setPaintProperty("geovisio_editor_sequences","line-color",this.map._getLayerColorStyle("sequences")),this.map.setPaintProperty("geovisio_editor_pictures","circle-color",this.map._getLayerColorStyle("pictures")),this.map.setLayoutProperty("geovisio_editor_sequences","visibility","visible"),this.map.setLayoutProperty("geovisio_editor_pictures","visibility","visible"),ll.raster&&this._addMapBackgroundWidget(),this._bindPicturesEvents()}));const F=this.map._picMarker.setRotation.bind(this.map._picMarker);this.map._picMarker.setRotation=Da=>(Da=void 0===this._lastRelHeading?Da:Da+this._lastRelHeading-this.psv.getPictureRelativeHeading(),F(Da))}catch(cl){this._loader.dismiss(cl,this._t.gvs.error_psv)}})),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"Editor"}_createMapStyle(){return{sources:{geovisio_editor_sequences:{type:"geojson",data:{type:"FeatureCollection",features:[]}}},layers:[{id:"geovisio_editor_sequences",type:"line",source:"geovisio_editor_sequences",layout:{...bl.VM.SEQUENCES.layout},paint:{...bl.VM.SEQUENCES.paint}},{id:"geovisio_editor_pictures",type:"circle",source:"geovisio_editor_sequences",layout:{...bl.VM.PICTURES.layout},paint:{...bl.VM.PICTURES.paint}}]}}_bindPicturesEvents(){this.map.on("mousemove","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor="pointer"})),this.map.on("mouseleave","geovisio_editor_pictures",(()=>{this.map.getCanvas().style.cursor=""})),this.map.on("click","geovisio_editor_pictures",this.map._onPictureClick.bind(this.map))}_loadSequence(){return this._api.getSequenceItems(this._selectedSeqId).then((F=>{this._sequenceData=F.features,this.map.getSource("geovisio_editor_sequences").setData({type:"FeatureCollection",features:[{type:"Feature",properties:{id:this._selectedSeqId},geometry:{type:"LineString",coordinates:F.features.map((F=>F.geometry.coordinates))}},...F.features.map((F=>(F.properties.id=F.id,F.properties.sequences=[this._selectedSeqId],F)))]});const onMapLoad=()=>{if(this._selectedPicId){const Da=F.features.find((F=>F.id===this._selectedPicId));Da?(this.select(this._selectedSeqId,this._selectedPicId,!0),this.map.jumpTo({center:Da.geometry.coordinates,zoom:18})):console.log("Picture with ID",Da,"was not found")}else{const Da=[...F.features[0].geometry.coordinates,...F.features[0].geometry.coordinates];for(let ll=1;ll<F.features.length;ll++){const cl=F.features[ll].geometry.coordinates;cl[0]<Da[0]&&(Da[0]=cl[0]),cl[1]<Da[1]&&(Da[1]=cl[1]),cl[0]>Da[2]&&(Da[2]=cl[0]),cl[1]>Da[3]&&(Da[3]=cl[1])}this.map.fitBounds(Da,{animate:!1})}this._loader.dismiss()};this.map.loaded()?onMapLoad():this.map.once("load",onMapLoad)})).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api)))}_getNode(F){const Da=this._sequenceData.find((Da=>Da.properties.id===F)),ll=Da?(0,Al.rs)(Da,this._t,this._isInternetFast):null;return ll&&delete ll.links,ll}_addMapBackgroundWidget(){const F=document.createElement("div");F.id="gvs-map-bg",F.classList.add("gvs-panel","gvs-widget-bg","gvs-input-group");const onBgChange=F=>this.map.setBackground(F.target.value),Da=document.createElement("input");Da.id="gvs-map-bg-streets",Da.setAttribute("type","radio"),Da.setAttribute("name","gvs-map-bg"),Da.setAttribute("value","streets"),Da.addEventListener("change",onBgChange),F.appendChild(Da);const ll=document.createElement("label");ll.setAttribute("for",Da.id);const cl=document.createElement("img");cl.src=fl,cl.alt="",ll.appendChild(cl),ll.appendChild(document.createTextNode(this._t.gvs.map_background_streets)),F.appendChild(ll);const hl=document.createElement("input");hl.id="gvs-map-bg-aerial",hl.setAttribute("type","radio"),hl.setAttribute("name","gvs-map-bg"),hl.setAttribute("value","aerial"),hl.addEventListener("change",onBgChange),F.appendChild(hl);const dl=document.createElement("label");dl.setAttribute("for",hl.id);const Al=document.createElement("img");Al.src=pl,Al.alt="",dl.appendChild(Al),dl.appendChild(document.createTextNode(this._t.gvs.map_background_aerial)),F.appendChild(dl),this.mapContainer.appendChild(F);const onMapBgChange=F=>{"aerial"===F?hl.checked=!0:Da.checked=!0};this.addEventListener("map:background-changed",(F=>onMapBgChange(F.detail.background))),onMapBgChange(this.map.getBackground())}previewSequenceHeadingChange(F){const Da=void 0!==this.map.getLayer(Dl);if(this.map._picMarkerPreview.remove(),void 0===F)return delete this._lastRelHeading,Da&&this.map.setLayoutProperty(Dl,"visibility","none"),void(this._selectedPicId&&this.map._picMarker.setRotation(this.psv.getXY().x));this._lastRelHeading=F,Da||this.map.addLayer({id:Dl,type:"symbol",source:"geovisio_editor_sequences",layout:{"icon-image":"gvs-marker","icon-overlap":"always","icon-size":.8}});const ll=-this.psv.getPictureRelativeHeading();this.map.setLayoutProperty(Dl,"visibility","visible"),this.map.setLayoutProperty(Dl,"icon-rotate",["+",["get","view:azimuth"],ll,F]);const cl=[["==",["geometry-type"],"Point"]];this._selectedPicId&&cl.push(["!=",["get","id"],this._selectedPicId]),this.map.setFilter(Dl,["all",...cl]),this._selectedPicId&&this.map._picMarker.setRotation(this.psv.getXY().x)}_onSelect(){void 0!==this._lastRelHeading&&this.previewSequenceHeadingChange(this._lastRelHeading)}}},7531:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>fl});var cl=ll(6803),hl=ll(1951),dl=ll(1300),pl=ll(927);class StandaloneMap extends cl.A{constructor(F,Da){super(F,Da,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}),this.mapContainer=document.createElement("div"),this.container.appendChild(this.mapContainer),this._api.onceReady().then((()=>this._initMap())),this.addEventListener("map:picture-click",(F=>this.select(F.detail.seqId,F.detail.picId))),this.addEventListener("map:sequence-click",(F=>this.select(F.detail.seqId))),this.addEventListener("select",this._onSelect.bind(this))}getClassName(){return"Map"}destroy(){super.destroy(),this.map.destroy(),delete this.map,this.mapContainer.remove(),this.container.innerHTML="",this.container.classList.remove(...[...this.container.classList].filter((F=>F.startsWith("gvs"))))}_initMap(){this._options.hash=!0;class MyMap extends hl.A{_getLayerStyleProperties(F){return"pictures_symbols"===F?{layout:{visibility:"none"}}:super._getLayerStyleProperties(F)}}this.map=new MyMap(this,this.mapContainer,this._options),this.map.addControl(new pl.NavigationControl({showCompass:!1})),this.map.on("load",(()=>{this.map.reloadLayersStyles(),this._loader.dismiss()}))}_onSelect(F){if(F.detail.picId||F.detail.seqId){const Da=F.detail.picId?"pictures":"sequences",ll=this.map.queryRenderedFeatures({layers:[...this.map._userLayers].map((F=>(0,dl.IN)(F,Da))),filter:["==",["get","id"],F.detail.picId||F.detail.seqId]});ll.length>=0&&null!=ll[0]&&this.map._attachPreviewToPictures({features:ll},Da)}}}const fl=StandaloneMap},2968:(F,Da,ll)=>{"use strict";ll.d(Da,{$p:()=>Ql,Ay:()=>Viewer,LM:()=>Al.LM,Vf:()=>Al.Vf});ll(2101);var cl=ll(1545),hl=ll(490),dl=ll(9194),pl=ll(5071),fl=ll(6803),Al=ll(8489),bl=ll(1951),kl=ll(1300),Dl=ll(4683),Wl=ll(6627);const Ql=20,wc=Math.PI/6,Sc=100,eu="http://127.0.0.1:8111",iu={DEFAULT:"default",AGE:"age",TYPE:"type",SCORE:"score"};class Viewer extends fl.A{constructor(F,Da){var ll;let pl,fl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(F,Da,fl),null==this._options.map&&(this._options.map={}),null==this._options.widgets&&(this._options.widgets={}),this._sequencePlaying=!1,this._prevSequence=null,this._mapTheme=(null===fl||void 0===fl||null===(ll=fl.map)||void 0===ll?void 0:ll.theme)||iu.DEFAULT,this._picNav=(null===fl||void 0===fl?void 0:fl.picturesNavigation)||"any",this._options.testing)return;if(!0===this._options.hash||void 0===this._options.hash){if(this._hash=new dl.A(this),pl=this._hash._getCurrentHash(),"none"===pl.map&&(this._options.map=!1),"object"===typeof this._options.map&&(this._options.map.hash=!1),this._options.map&&pl.focus&&(this._options.map.startWide="map"===pl.focus),this._options.map&&pl.background&&(this._options.map.background=pl.background),this._options.map&&pl.users&&(this._options.users=[...new Set(pl.users.split(","))]),pl.xyz){const F=this._hash.getXyzOptionsFromHashString(pl.xyz);this.addEventListener("psv:picture-loaded",(()=>{this.psv.setXYZ(F.x,F.y,F.z)}),{once:!0})}if(this._options.map&&"string"===typeof pl.map){const F=this._hash.getMapOptionsFromHashString(pl.map);F&&(this._options.map=Object.assign({},this._options.map,F))}if(this._options.map&&this.setFilters(this._hash.getMapFiltersFromHashVals(pl),!0),pl.pic){const F=pl.pic.split(";");F.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),this._options.selectedPicture=F[0]}"string"===typeof pl.speed&&(this._options.transition=parseInt(pl.speed)),pl.nav&&(this._picNav=pl.nav)}this._initContainerStructure();try{this.psv=new Al.Ay(this,this.psvContainer,{transitionDuration:this._options.transition,shouldGoFast:this._psvShouldGoFast.bind(this),keyboard:"always",keyboardActions:{...cl.zY.keyboardActions,8:"ROTATE_UP",2:"ROTATE_DOWN",4:"ROTATE_LEFT",6:"ROTATE_RIGHT",PageUp:()=>this.psv.goToNextPicture(),9:()=>this.psv.goToNextPicture(),PageDown:()=>this.psv.goToPrevPicture(),3:()=>this.psv.goToPrevPicture(),5:()=>this.moveCenter(),"*":()=>this.moveCenter(),Home:()=>this.toggleFocus(),7:()=>this.toggleFocus(),End:()=>this.toggleUnfocusedVisible(),1:()=>this.toggleUnfocusedVisible()," ":()=>this.toggleSequencePlaying(),0:()=>this.toggleSequencePlaying()}}),this.psv.addEventListener("dblclick",(()=>{this.map&&this.isMapWide()&&this.setFocus("pic")}))}catch(bl){let F=cl.IJ.isWebGLSupported?this._t.gvs.error_psv:this._t.gvs.error_webgl;this._loader.dismiss(bl,F)}const onceStuffReady=()=>{this._widgets=new hl.A(this,this._options.widgets),this.map&&this.isWidthSmall()&&this.setUnfocusedVisible(!1),this._options.selectedPicture?(this.select(null,this._options.selectedPicture,!0),this.addEventListener("psv:picture-loaded",(()=>{var F,Da,ll,cl,hl;!this._selectedSeqId&&null!==(F=this.psv)&&void 0!==F&&null!==(Da=F._myVTour)&&void 0!==Da&&null!==(ll=Da.getCurrentNode())&&void 0!==ll&&null!==(cl=ll.sequence)&&void 0!==cl&&cl.id&&this.select(this.psv._myVTour.getCurrentNode().sequence.id,this._options.selectedPicture),this.map&&this._options.map&&this.map.jumpTo(this._options.map),"meta"===(null===(hl=pl)||void 0===hl?void 0:hl.focus)&&this._widgets._showPictureMetadataPopup(),this._loader.dismiss()}),{once:!0})):this._loader.dismiss(),this._options.position&&this.goToPosition(...this._options.position).catch((F=>this._loader.dismiss(F,this._t.gvs.error_nopic))),this._hash&&this.map&&(this.map._attribution._container.classList.add("gvs-hidden"),this._hash.bindMapEvents(),this._mapFilters&&this.setFilters(this._mapFilters,!0),pl.users&&Promise.all(this.map.getVisibleUsers().filter((F=>"geovisio"!=F)).map((F=>this._api.getUserName(F)))).then((F=>{F=F.filter((F=>null!=F)).join(", ");const Da=document.getElementById("gvs-filter-search-user").querySelector("input");Da&&(Da.setItem(F),Da.parentNode.classList.add("gvs-filter-active"))})).catch((F=>console.warn("Error when looking up for user names",F)))),document.addEventListener("keyup",(F=>{"Escape"!==F.key||this.popupContainer.classList.contains("gvs-hidden")||this.setPopup(!1)}))};this._api.onceReady().then((()=>{this._options.map?(void 0===this._options.map.doubleClickZoom&&(this._options.map.doubleClickZoom=!1),this._initMap().then(onceStuffReady).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api_compatibility)))):onceStuffReady()}))}getClassName(){return"Viewer"}destroy(){super.destroy(),this._widgets.destroy(),delete this._widgets,this._hash.destroy(),delete this._hash,this.map.destroy(),delete this.map,delete this._mapFilters,this.psv.destroy(),delete this.psv,this.miniContainer.remove(),this.mainContainer.remove(),this.mapContainer.remove(),this.psvContainer.remove(),this.popupContainer.remove(),this.container.innerHTML="",this.container.classList.remove(...[...this.container.classList].filter((F=>F.startsWith("gvs"))))}_initContainerStructure(){this.miniContainer=document.createElement("div"),this.miniContainer.classList.add("gvs-mini"),this.mainContainer=document.createElement("div"),this.mainContainer.classList.add("gvs-main"),this.popupContainer=document.createElement("div"),this.popupContainer.classList.add("gvs-popup","gvs-hidden"),this.psvContainer=document.createElement("div"),this.mainContainer.appendChild(this.psvContainer),this.mapContainer=document.createElement("div"),this.miniContainer.appendChild(this.mapContainer),this.container.appendChild(this.mainContainer),this.container.appendChild(this.miniContainer),this.container.appendChild(this.popupContainer)}async _initMap(){await new Promise((F=>{this.map=new bl.A(this,this.mapContainer,this._options.map),this.map._getLayerColorStyle=this._getLayerColorStyle.bind(this),this.map._getLayerSortStyle=this._getLayerSortStyle.bind(this),this.addEventListener("map:users-changed",F,{once:!0}),this.container.classList.add("gvs-has-mini"),this.map.on("dblclick",(()=>{this.isMapWide()||this.setFocus("map")})),"object"===typeof this._options.map&&this._options.map.startWide?this.setFocus("map",!0):this.setFocus("pic",!0)})),this._initMapKeyboardHandler(),(0,pl.I0)(this)}_initMapKeyboardHandler(){const F=this;this.map.keyboard.keydown=function(Da){if(Da.altKey||Da.ctrlKey||Da.metaKey)return;switch(Da.key){case"*":case"5":return void F.moveCenter();case"PageUp":case"9":return void F.psv.goToNextPicture();case"PageDown":case"3":return void F.psv.goToPrevPicture();case"Home":case"7":return Da.stopPropagation(),void F.toggleFocus();case"End":case"1":return void F.toggleUnfocusedVisible();case" ":case"0":return void F.toggleSequencePlaying()}let ll=0,cl=0,hl=0,dl=0,pl=0;switch(Da.keyCode){case 61:case 107:case 171:case 187:ll=1;break;case 189:case 109:case 173:ll=-1;break;case 37:case 100:Da.shiftKey?cl=-1:(Da.preventDefault(),dl=-1);break;case 39:case 102:Da.shiftKey?cl=1:(Da.preventDefault(),dl=1);break;case 38:case 104:Da.shiftKey?hl=1:(Da.preventDefault(),pl=-1);break;case 40:case 98:Da.shiftKey?hl=-1:(Da.preventDefault(),pl=1);break;default:return}return this._rotationDisabled&&(cl=0,hl=0),{cameraAnimation:F=>{const fl=this._tr;F.easeTo({duration:300,easeId:"keyboardHandler",easing:F=>F*(2-F),zoom:ll?Math.round(fl.zoom)+ll*(Da.shiftKey?2:1):fl.zoom,bearing:fl.bearing+cl*this._bearingStep,pitch:fl.pitch+hl*this._pitchStep,offset:[-dl*this._panStep,-pl*this._panStep],center:fl.center},{originalEvent:Da})}}}.bind(this.map.keyboard)}_psvShouldGoFast(){return this._sequencePlaying&&this.psv.getTransitionDuration()<1e3||this.map&&this.isMapWide()}refreshPSV(){var F;const Da=this.psv._myVTour.getCurrentNode();if(Da&&Da.panorama.baseUrl!==(null===Da||void 0===Da||null===(F=Da.panorama)||void 0===F?void 0:F.origBaseUrl)){const F=this.psv.getZoomLevel(),ll=this.psv.getPosition();this.psv._myVTour.state.currentNode=null,this.psv._myVTour.setCurrentNode(Da.id,{zoomTo:F,rotateTo:ll,fadeIn:!1,speed:0,rotation:!1})}Da&&Da.panorama.rows>1&&this.psv.adapter.__refresh()}setPopup(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(F)if(Da){this.psv.stopKeyboardControl(),this.popupContainer.innerHTML="";const F=document.createElement("div");F.classList.add("gvs-popup-backdrop"),F.addEventListener("click",(()=>this.setPopup(!1)));const ll=document.createElement("div");ll.classList.add("gvs-widget-bg"),"string"===typeof Da?ll.innerHTML=Da:Array.isArray(Da)&&Da.forEach((F=>ll.appendChild(F)));const cl=document.createElement("button");cl.id="gvs-popup-btn-close",cl.classList.add("gvs-btn","gvs-widget-bg"),cl.appendChild((0,Dl.fa)(Wl.Jy)),cl.addEventListener("click",(()=>this.setPopup(!1))),ll.insertBefore(cl,ll.firstChild),this.popupContainer.appendChild(F),this.popupContainer.appendChild(ll),this.popupContainer.classList.remove("gvs-hidden"),(0,Dl.$c)(this.popupContainer,this._t)}else this.popupContainer.classList.remove("gvs-hidden");else this.popupContainer.classList.add("gvs-hidden"),this.psv.startKeyboardControl()}playSequence(){this._sequencePlaying=!0;const F=new Event("sequence-playing");this.dispatchEvent(F);const nextPicturePlay=()=>{if(this._sequencePlaying){this.addEventListener("psv:picture-loaded",(()=>{this._playTimer=setTimeout((()=>{nextPicturePlay()}),this.psv.getTransitionDuration())}),{once:!0});try{this.psv.goToNextPicture()}catch(F){this.stopSequence()}}};this.psv.addEventListener("click",(()=>{this.stopSequence()})),nextPicturePlay()}stopSequence(){this._sequencePlaying=!1,this._playTimer&&(clearTimeout(this._playTimer),delete this._playTimer),this.refreshPSV();const F=new Event("sequence-stopped");this.dispatchEvent(F)}isSequencePlaying(){return this._sequencePlaying}toggleSequencePlaying(){this.isSequencePlaying()?this.stopSequence():this.playSequence()}moveCenter(){const F=this.psv.getPictureMetadata();F&&(this.map&&this.isMapWide()?this.map.flyTo({center:F.gps,zoom:20}):this._psvAnimate({speed:Al.LM,yaw:0,pitch:0,zoom:Al.cS}))}moveLeft(){this._moveToDirection("left")}moveRight(){this._moveToDirection("right")}moveUp(){this._moveToDirection("up")}moveDown(){this._moveToDirection("down")}_moveToDirection(F){if(this.map&&this.isMapWide()){let Da;switch(F){case"up":Da=[0,-100];break;case"left":Da=[-100,0];break;case"down":Da=[0,Sc];break;case"right":Da=[Sc,0]}this.map.panBy(Da)}else{let Da=this.psv.getPosition();switch(F){case"up":Da.pitch+=wc;break;case"left":Da.yaw-=wc;break;case"down":Da.pitch-=wc;break;case"right":Da.yaw+=wc}this._psvAnimate({speed:Al.LM,...Da})}}_psvAnimate(F){this._lastPsvAnim&&this._lastPsvAnim.cancel(),this._lastPsvAnim=this.psv.animate(F)}isMapWide(){if(!this.map)throw new Error("Map is not enabled");return this.mapContainer.parentNode==this.mainContainer}_getDatesForLayerColors(){const F=864e5,Da=Date.now();return[Da-30*F,Da-365*F,Da-730*F].map((F=>new Date(F).toISOString().split("T")[0]))}_getLayerColorStyle(F){var Da,ll,cl,hl,dl;const fl=["case",["==",["get","hidden"],!0],pl.lm.HIDDEN],Al=(null===(Da=this.psv._myVTour)||void 0===Da||null===(ll=Da.state)||void 0===ll?void 0:ll.loadingNode)||(null===(cl=this.psv._myVTour)||void 0===cl||null===(hl=cl.state)||void 0===hl||null===(dl=hl.currentNode)||void 0===dl?void 0:dl.id),bl=Al?this.psv._picturesSequences[Al]:null;if("sequences"==F&&bl?fl.push(["==",["get","id"],bl],pl.lm.SELECTED):"pictures"==F&&bl&&fl.push(["in",bl,["get","sequences"]],pl.lm.SELECTED),this._mapTheme==iu.AGE){const Da="sequences"==F?"date":"ts",ll=this._getDatesForLayerColors();fl.push(["!",["has",Da]],pl.lm.BASE,[">=",["get",Da],ll[0]],pl.lm.PALETTE_4,[">=",["get",Da],ll[1]],pl.lm.PALETTE_3,[">=",["get",Da],ll[2]],pl.lm.PALETTE_2,pl.lm.PALETTE_1)}else this._mapTheme==iu.TYPE?fl.push(["!",["has","type"]],pl.lm.BASE,["==",["get","type"],"equirectangular"],pl.lm.QUALI_1,pl.lm.QUALI_2):this._mapTheme==iu.SCORE?fl.push(["==",kl.d3,5],pl.fW[0].color,["==",kl.d3,4],pl.fW[1].color,["==",kl.d3,3],pl.fW[2].color,["==",kl.d3,2],pl.fW[3].color,pl.fW[4].color):fl.push(pl.lm.BASE);return fl}_getLayerSortStyle(F){var Da,ll,cl,hl,dl;const pl=["case",["==",["get","hidden"],!0],90],fl=(null===(Da=this.psv._myVTour)||void 0===Da||null===(ll=Da.state)||void 0===ll?void 0:ll.loadingNode)||(null===(cl=this.psv._myVTour)||void 0===cl||null===(hl=cl.state)||void 0===hl||null===(dl=hl.currentNode)||void 0===dl?void 0:dl.id),Al=fl?this.psv._picturesSequences[fl]:null;if("sequences"==F&&Al?pl.push(["==",["get","id"],Al],100):"pictures"==F&&Al&&pl.push(["in",Al,["get","sequences"]],100),this._mapTheme==iu.AGE){const Da="sequences"==F?"date":"ts",ll=this._getDatesForLayerColors();pl.push(["!",["has",Da]],0,[">=",["get",Da],ll[0]],50,[">=",["get",Da],ll[1]],49,[">=",["get",Da],ll[2]],48)}else this._mapTheme==iu.TYPE?pl.push(["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50):this._mapTheme==iu.SCORE&&pl.push(["==",kl.d3,5],80,["==",kl.d3,4],65,["==",kl.d3,3],50,["==",kl.d3,2],35,["==",kl.d3,1],20);return pl.push(10),pl}getPicturesNavigation(){return this._picNav}setPicturesNavigation(F){this._picNav=F;const Da=new CustomEvent("pictures-navigation-changed",{detail:{value:F}});this.dispatchEvent(Da)}_picturesNavFilter(F){switch(this._picNav){case"seq":return["next","prev"].includes(F.rel);case"pic":return!1;default:return!0}}toggleJOSMLive(F){if(F){const F=new CustomEvent("josm-live-enabled");return this.dispatchEvent(F),fetch(eu+"/version").catch((F=>{throw this.dispatchEvent(new CustomEvent("josm-live-disabled")),F})).then((()=>{const F=(0,pl.dK)(this.psv.getPictureMetadata());if(F){fetch(`${eu}/load_and_zoom?${F}`).catch((F=>{console.warn(F),this.toggleJOSMLive(!1)}))}this._josmListener=()=>{const F=(0,pl.dK)(this.psv.getPictureMetadata());if(F){fetch(`${eu}/zoom?${F}`).catch((F=>{console.warn(F),this.toggleJOSMLive(!1)}))}},this.addEventListener("psv:picture-loaded",this._josmListener),this.addEventListener("psv:picture-loading",this._josmListener)}))}{const F=new CustomEvent("josm-live-disabled");return this.dispatchEvent(F),this._josmListener&&(this.removeEventListener("picture-loading",this._josmListener),this.removeEventListener("picture-loaded",this._josmListener),delete this._josmListener),Promise.resolve()}}setFocus(F){var Da,ll,cl;let hl=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("map"===F&&!this.map)throw new Error("Map is not enabled");if(!["map","pic"].includes(F))throw new Error("Invalid focus value (should be pic or map)");if(("map"!==F||!this.map||!this.isMapWide())&&("pic"!==F||this.map&&this.isMapWide())){var dl;if(null===(Da=this.mapContainer.parentElement)||void 0===Da||Da.removeChild(this.mapContainer),null===(ll=this.psvContainer.parentElement)||void 0===ll||ll.removeChild(this.psvContainer),"map"===F)this.psv.stopKeyboardControl(),this.map.keyboard.enable(),this.container.classList.add("gvs-focus-map"),this.mainContainer.appendChild(this.mapContainer),this.miniContainer.appendChild(this.psvContainer),this.map.getCanvas().focus();else null===this||void 0===this||null===(dl=this.map)||void 0===dl||dl.keyboard.disable(),this.psv.startKeyboardControl(),this.container.classList.remove("gvs-focus-map"),this.mainContainer.appendChild(this.psvContainer),this.miniContainer.appendChild(this.mapContainer),this.psvContainer.focus();if(null===this||void 0===this||null===(cl=this.map)||void 0===cl||cl.resize(),this.psv.autoSize(),this.refreshPSV(),!hl){const Da=new CustomEvent("focus-changed",{detail:{focus:F}});this.dispatchEvent(Da)}}}toggleFocus(){if(!this.map)throw new Error("Map is not enabled");this.setFocus(this.isMapWide()?"pic":"map")}setUnfocusedVisible(F){if(!this.map)throw new Error("Map is not enabled");F?this.container.classList.remove("gvs-mini-hidden"):this.container.classList.add("gvs-mini-hidden"),this.map.resize(),this.psv.autoSize()}toggleUnfocusedVisible(){if(!this.map)throw new Error("Map is not enabled");this.setUnfocusedVisible(this.container.classList.contains("gvs-mini-hidden"))}setFilters(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]&&arguments[1],cl=[],hl=[],dl=!1;if(this._mapFilters={},F.minDate&&""!==F.minDate&&(this._mapFilters.minDate=F.minDate,cl.push([">=",["get","date"],F.minDate]),hl.push([">=",["get","ts"],F.minDate])),F.maxDate&&""!==F.maxDate){this._mapFilters.maxDate=F.maxDate,cl.push(["<=",["get","date"],F.maxDate]);let Da=new Date(F.maxDate);Da.setDate(Da.getDate()+1),Da=Da.toISOString().split("T")[0],hl.push(["<=",["get","ts"],Da])}if(F.type&&""!==F.type&&(this._mapFilters.type=F.type,cl.push(["==",["get","type"],F.type]),hl.push(["==",["get","type"],F.type])),null!==(Da=this.map)&&void 0!==Da&&Da._hasGridStats()&&(dl=!0),F.camera&&""!==F.camera){this._mapFilters.camera=F.camera;const Da=F.camera.toLowerCase().trim()+" ",ll=F.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",dl=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];cl.push([">=",["get","model"],Da,dl]),cl.push(["<=",["get","model"],ll,dl]),hl.push([">=",["get","model"],Da,dl]),hl.push(["<=",["get","model"],ll,dl])}if(F.qualityscore&&F.qualityscore.length>0&&(this._mapFilters.qualityscore=F.qualityscore,cl.push(["in",kl.d3,["literal",this._mapFilters.qualityscore]]),hl.push(["in",kl.d3,["literal",this._mapFilters.qualityscore]])),F.theme&&Object.values(iu).includes(F.theme)&&(this._mapFilters.theme=F.theme,this.map&&(this._mapTheme=this._mapFilters.theme,dl=!0)),0==cl.length?cl=null:cl.unshift("all"),0==hl.length?hl=null:(hl.unshift("all"),hl=["step",["zoom"],!0,kl.oe,hl]),this.map){dl&&this.map.reloadLayersStyles();const F=this.map.getVisibleUsers().includes("geovisio");cl&&F&&(cl=["step",["zoom"],!0,7,cl]),this.map.filterUserLayersContent("sequences",cl),this.map.filterUserLayersContent("pictures",hl),!ll&&(null!==cl||null!==hl||null!==this._mapFilters.theme&&this._mapFilters.theme!==iu.DEFAULT)&&F&&this.map.getZoom()<7&&!this.map._hasGridStats()&&this.map.easeTo({zoom:7})}const pl=new CustomEvent("filters-changed",{detail:Object.assign({},this._mapFilters)});this.dispatchEvent(pl)}}},6803:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>CoreView});ll(8946);var cl=ll(5254),hl=ll(6980),dl=ll(1300),pl=ll(5071),fl=ll(8330),Al=ll(2730);class CoreView extends EventTarget{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(super(),this._options=ll,null==this._options&&(this._options={}),this._options.users||(this._options.users=["geovisio"]),"string"===typeof this._options.users&&(this._options.users=[this._options.users]),this._options.style||(this._options.style=dl.AV),this._options.testing||console.info(`\ud83d\udcf7 Panoramax ${this.getClassName()} - Version ${fl.rE} (4ceb780)\n\n\ud83c\udd98 Issues can be reported at ${fl.Jk.O}`),this._t=(0,hl.$)(this._options.lang),this._isInternetFast=null,(0,pl.KF)().then((F=>this._isInternetFast=F)),this._selectedSeqId=this._options.selectedSequence||null,this._selectedPicId=this._options.selectedPicture||null,this.container="string"===typeof F?document.getElementById(F):F,!(this.container instanceof Element))throw new Error("Container is not a valid HTML element, does it exist in your page ?");this.container.classList.add("gvs",`gvs-${this.getClassName().toLocaleLowerCase()}`),(0,pl.GZ)()&&this.container.classList.add("gvs-iframed"),this.loaderContainer=document.createElement("div"),this.container.appendChild(this.loaderContainer),this._loader=new Al.A(this,this.loaderContainer),Da=(Da||"").replace("/api/search","/api");try{var bl;this._api=new cl.A(Da,{users:this._options.users,fetch:null===(bl=this._options)||void 0===bl?void 0:bl.fetchOptions,style:this._options.style}),this._api.onceReady().then((()=>{let F=this._api.getUnavailableFeatures(),Da=this._api.getAvailableFeatures();Da=0===F.length?"\u2705 All features available":"\u2705 Available features: "+Da.join(", "),F=0===F.length?"":"\ud83d\udeab Unavailable features: "+F.join(", "),console.info(`\ud83c\udf10 Connected to API "${this._api._metadata.name}" (${this._api._endpoint})\n\u2139\ufe0f API runs STAC ${this._api._metadata.stac_version} ${this._api._metadata.geovisio_version?"& GeoVisio "+this._api._metadata.geovisio_version:""}\n ${Da}\n ${F}\n`.trim())})).catch((F=>this._loader.dismiss(F,this._t.gvs.error_api)))}catch(kl){this._loader.dismiss(kl,this._t.gvs.error_api)}}getClassName(){return"CoreView"}destroy(){delete this._options,delete this._t,delete this._api,delete this._loader,this.loaderContainer.remove(),delete this.loaderContainer}isWidthSmall(){var F;return(null===(F=this.container)||void 0===F?void 0:F.offsetWidth)<576}isHeightSmall(){var F;return(null===(F=this.container)||void 0===F?void 0:F.offsetHeight)<400}select(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const cl=this._selectedSeqId||null,hl=this._selectedPicId||null;(ll||hl!=Da||cl!=F)&&(this._selectedSeqId=F,this._selectedPicId=Da,this.dispatchEvent(new CustomEvent("select",{detail:{seqId:F,picId:Da,prevSeqId:cl,prevPicId:hl}})))}}},2730:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Loader});ll(737);var cl=ll(2305),hl=ll(6883);class Loader{constructor(F,Da){this._parent=F,this.container=Da,this.container.classList.add("gvs-loader","gvs-loader-visible");const ll=document.createElement("img");ll.src=hl,ll.alt="",ll.title=this._parent._t.map.loading,ll.classList.add("gvs-loader-img"),this.container.appendChild(ll);const cl=document.createElement("div"),dl=document.createElement("span"),nextLabelFun=()=>this._parent._t.gvs.loading_labels_fun[Math.floor(Math.random()*this._parent._t.gvs.loading_labels_fun.length)];dl.innerHTML=this._parent._t.gvs.loading_labels_serious[Math.floor(Math.random()*this._parent._t.gvs.loading_labels_serious.length)];const nextLabelFct=()=>setTimeout((()=>{dl.innerHTML=nextLabelFun(),this._loaderLabelChanger=nextLabelFct()}),500+1e3*Math.random());this._loaderLabelChanger=nextLabelFct(),cl.appendChild(dl),this.container.appendChild(cl)}isVisible(){return this.container.classList.contains("gvs-loader-visible")}dismiss(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(clearTimeout(this._loaderLabelChanger),F){!0!==F&&console.error(F),this.container.children[0].src=cl,this.container.children[0].style.width="200px",this.container.children[0].style.animation="unset";let hl=`<small>${ll?this._parent._t.gvs.error_click:this._parent._t.gvs.error_retry}</small>`;Da&&(hl=Da+"<br />"+hl),this.container.children[1].innerHTML=`${this._parent._t.gvs.error}<br />${hl}`,ll&&this.container.addEventListener("click",ll);const dl=Da||"Panoramax JS had a blocking exception",pl=new CustomEvent("broken",{detail:{error:dl}});throw this._parent.dispatchEvent(pl),new Error(dl)}{this.container.classList.remove("gvs-loader-visible"),setTimeout((()=>this.container.remove()),2e3);const F=new CustomEvent("ready");this._parent.dispatchEvent(F),ll&&ll()}}}},1951:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Map});ll(1120);var cl=ll(1300),hl=ll(5071),dl=ll(6883),pl=ll(270),fl=ll(6462),Al=ll(9740),bl=(ll(6795),ll(927)),kl=ll.n(bl),Dl=ll(587),Wl=ll.n(Dl),Ql=ll(6840);kl().workerClass=Wl(),kl().addProtocol("pmtiles",(new Ql.Zs).tile);const wc=["antialias","attributionControl","bearing","bearingSnap","bounds","boxZoom","center","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","fadeDuration","failIfMajorPerformanceCaveat","fitBoundsOptions","hash","interactive","keyboard","localIdeographFontFamily","locale","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","preserveDrawingBuffer","refreshExpiredTiles","renderWorldCopies","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle","zoom"];class Map extends kl().Map{constructor(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var hl,dl;(super({container:Da,style:(0,cl.CG)(F,ll),center:[0,0],zoom:0,maxZoom:24,attributionControl:!1,dragRotate:!1,pitchWithRotate:!1,touchZoomRotate:!0,touchPitch:!1,preserveDrawingBuffer:!F.isWidthSmall(),transformRequest:F._api._getMapRequestTransform(),locale:F._t.maplibre,...(hl=ll,Object.fromEntries(Object.entries(hl).filter((F=>{let[Da]=F;return wc.includes(Da)}))))}),this._loadMarkerImages(),this._parent=F,this._options=ll,this.getContainer().classList.add("gvs-map"),void 0===ll.touchZoomRotate)&&(null===this||void 0===this||null===(dl=this.touchZoomRotate)||void 0===dl||dl.disableRotation());this._options.raster&&(this._options.background=this._options.background||"streets"),this._attribution=new(kl().AttributionControl)({compact:!1}),this.addControl(this._attribution),this._initGeocoder(),this._initMapPosition(),this._picMarker=this._getPictureMarker(),this._picMarkerPreview=this._getPictureMarker(!1),this._picThumbUrl={},this._seqPictures={},this._userLayers=new Set,this.on("mousemove","sequences",this._onSequenceHover.bind(this)),this._parent.addEventListener("select",this.reloadLayersStyles.bind(this)),setTimeout((()=>{!this.loaded()&&this._parent._loader.isVisible()&&this._parent._loader.dismiss({},this._parent._t.map.slow_loading,(()=>{}))}),15e3),this.on("load",(async()=>{await this.setVisibleUsers(this._parent._options.users),this.reloadLayersStyles(),this.resize()}))}destroy(){this.remove(),delete this._parent,delete this._options,delete this._attribution,delete this._picMarker,delete this._picMarkerPreview,delete this._picThumbUrl,delete this._seqPictures,delete this._userLayers}_initMapPosition(){this._options.center&&this._options.center!=[0,0]||this._options.zoom&&0!==this._options.zoom||this._options.hash||this._parent._api.onceReady().then((()=>{var F,Da;let ll=null===(F=this._parent)||void 0===F||null===(Da=F._api)||void 0===Da?void 0:Da.getDataBbox();if(ll)try{ll=new(kl().LngLatBounds)(ll),this.loaded()?this.fitBounds(ll,{animate:!1}):this.on("load",(()=>this.fitBounds(ll,{animate:!1})))}catch(cl){console.warn("Received invalid bbox: "+ll)}}))}_initGeocoder(){var F,Da;const ll={ban:cl.Kf,nominatim:cl.RK},hl=(null===(F=this._options)||void 0===F||null===(Da=F.geocoder)||void 0===Da?void 0:Da.engine)||"nominatim";this.geocoder=ll[hl],this._geolocate=new(kl().GeolocateControl)({positionOptions:{enableHighAccuracy:!0,timeout:6e4,maximumAge:3e5},showAccuracyCircle:!0,showUserLocation:!0,trackUserLocation:!0}).onAdd(this)}_loadMarkerImages(){[{id:"gvs-marker",img:dl},{id:"gvs-arrow-flat",img:fl},{id:"gvs-arrow-360",img:Al}].forEach((F=>{const Da=new Image(64,64);Da.onload=()=>this.addImage(F.id,Da),Da.src=F.img}))}_hasQualityScore(){var F,Da,ll,cl;const hl=(null===(F=this.getStyle())||void 0===F||null===(Da=F.metadata)||void 0===Da?void 0:Da["panoramax:fields"])||{};return(null===hl||void 0===hl||null===(ll=hl.pictures)||void 0===ll?void 0:ll.includes("gps_accuracy"))&&(null===hl||void 0===hl||null===(cl=hl.pictures)||void 0===cl?void 0:cl.includes("h_pixel_density"))}_hasGridStats(){var F,Da,ll,cl,hl,dl;const pl=(null===(F=this.getStyle())||void 0===F||null===(Da=F.metadata)||void 0===Da?void 0:Da["panoramax:fields"])||{};return(null===pl||void 0===pl||null===(ll=pl.grid)||void 0===ll?void 0:ll.includes("nb_360_pictures"))&&(null===pl||void 0===pl||null===(cl=pl.grid)||void 0===cl?void 0:cl.includes("nb_flat_pictures"))&&(null===pl||void 0===pl||null===(hl=pl.grid)||void 0===hl?void 0:hl.includes("coef_360_pictures"))&&(null===pl||void 0===pl||null===(dl=pl.grid)||void 0===dl?void 0:dl.includes("coef_flat_pictures"))}reloadVectorTiles(){[...this._userLayers].forEach((F=>{const Da=this.getSource((0,cl.e8)(F));Da.setTiles(Da.tiles)}))}hasTwoBackgrounds(){return void 0!==this.getLayer(cl.m5)}getBackground(){if(!this.getLayer(cl.m5))return"streets";return"visible"==this.getLayoutProperty(cl.m5,"visibility")?"aerial":"streets"}setBackground(F){if(!this.getLayer(cl.m5)&&"aerial"===F)throw new Error("No aerial imagery available");if(this.getLayer(cl.m5)){this.setLayoutProperty(cl.m5,"visibility","aerial"===F?"visible":"none");const Da=new CustomEvent("map:background-changed",{detail:{background:F||"streets"}});this._parent.dispatchEvent(Da)}}getVisibleUsers(){return[...this._userLayers].filter((F=>"visible"===this.getLayoutProperty((0,cl.IN)(F,"pictures"),"visibility")))}async setVisibleUsers(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof F&&(F=[F]),await Promise.all(F.filter((F=>""!=F&&!this._userLayers.has(F))).map((F=>this._createPicturesTilesLayer(F))));const Da=["pictures","sequences","sequences_plus","grid","pictures_symbols"];[...this._userLayers].forEach((ll=>{Da.forEach((Da=>{const hl=(0,cl.IN)(ll,Da);this.getLayer(hl)&&this.setLayoutProperty(hl,"visibility",F.includes(ll)?"visible":"none")}))}));const ll=new CustomEvent("map:users-changed",{detail:{usersIds:F}});this._parent.dispatchEvent(ll)}filterUserLayersContent(F,Da){[...this._userLayers].forEach((ll=>{this.setFilter((0,cl.IN)(ll,F),Da),"sequences"===F&&this.getLayer((0,cl.IN)(ll,"sequences_plus"))&&this.setFilter((0,cl.IN)(ll,"sequences_plus"),Da),"pictures"===F&&this.getLayer((0,cl.IN)(ll,"pictures_symbols"))&&this.setFilter((0,cl.IN)(ll,"pictures_symbols"),Da)}))}displayPictureMarker(F,Da,ll){this._picMarkerPreview.remove(),this._picMarker.setLngLat([F,Da]).setRotation(ll).addTo(this),this.reloadLayersStyles(),this.flyTo({center:[F,Da],zoom:this.getZoom()<cl.oe+2?cl.oe+2:this.getZoom(),maxDuration:2e3})}reloadLayersStyles(){var F;const updateStyle=(F,Da)=>{[...this._userLayers].forEach((ll=>{for(let hl in Da.layout)this.setLayoutProperty((0,cl.IN)(ll,F),hl,Da.layout[hl]);for(let hl in Da.paint)this.setPaintProperty((0,cl.IN)(ll,F),hl,Da.paint[hl])}))};if(["pictures","pictures_symbols","sequences"].forEach((F=>{updateStyle(F,this._getLayerStyleProperties(F))})),this._hasGridStats()&&null!==(F=this._parent)&&void 0!==F&&F._mapFilters){var Da;let F="coef";null!==(Da=this._parent._mapFilters)&&void 0!==Da&&Da.type&&(F="flat"==this._parent._mapFilters.type?"coef_flat_pictures":"coef_360_pictures"),this.getStyle().layers.filter((F=>F.id.endsWith("_grid"))).forEach((Da=>{const ll=(0,cl.Hj)(Da,F);for(let F in ll.layout)this.setLayoutProperty(Da.id,F,ll.layout[F]);for(let F in ll.paint)this.setPaintProperty(Da.id,F,ll.paint[F])}))}}async _createPicturesTilesLayer(F){this._userLayers.add(F);const Da=this.getStyle().layers.find(cl.Sf);if("geovisio"!==F&&!this.getSource(`geovisio_${F}`)){const ll=await this._parent._api.getUserMapStyle(F);Object.entries(ll.sources).forEach((F=>{let[Da,ll]=F;return this.addSource(Da,ll)})),ll.layers=ll.layers||[];ll.layers.concat((0,cl.Oq)(ll.sources,ll.layers)).filter((F=>Object.keys(F).length>0)).forEach((F=>this.addLayer(F,null===Da||void 0===Da?void 0:Da.id)))}this._picPreviewTimer=null,this._picPopup=new(kl().Popup)({closeButton:!1,closeOnClick:!this._parent.isWidthSmall(),offset:3}),this._picPopup.on("close",(()=>{delete this._picPopup._picId}));const ll=(0,cl.IN)(F,"pictures");this.on("mousemove",ll,(F=>{this.getCanvas().style.cursor="pointer";const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,ll)),100)})),this.on("mouseleave",ll,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",ll,this._onPictureClick.bind(this));const hl=(0,cl.IN)(F,"sequences_plus");this.on("mousemove",hl,(F=>{if(this.getZoom()<=cl.oe+1&&(this.getCanvas().style.cursor="pointer",F.features[0].properties.id)){const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,hl)),100)}})),this.on("mouseleave",hl,(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click",hl,(F=>{F.preventDefault(),this.getZoom()<=cl.oe+1&&this._onSequenceClick(F)})),"geovisio"===F&&this.getLayer("geovisio_grid")&&(this.on("mousemove","geovisio_grid",(F=>{if(this.getZoom()<=cl.oe+1){this.getCanvas().style.cursor="pointer";const Da=Object.assign({},F);clearTimeout(this._picPreviewTimer),this._picPreviewTimer=setTimeout((()=>this._attachPreviewToPictures(Da,"geovisio_grid")),100)}})),this.on("mouseleave","geovisio_grid",(()=>{clearTimeout(this._picPreviewTimer),this.getCanvas().style.cursor="",this._picPopup._picId,this._picPopup.remove()})),this.on("click","geovisio_grid",(F=>{F.preventDefault(),this.flyTo({center:F.lngLat,zoom:cl.oe-6})}))),this.on("click",(F=>{!1===F.defaultPrevented&&(clearTimeout(this._picPreviewTimer),this._picPopup.remove())}))}_getLayerStyleProperties(F){if("pictures_symbols"===F)return{paint:{},layout:{"icon-image":["case",["==",["get","id"],this._parent._selectedPicId],"",["==",["get","type"],"equirectangular"],"gvs-arrow-360","gvs-arrow-flat"],"symbol-sort-key":this._getLayerSortStyle(F)}};{const Da={pictures:"circle",sequences:"line"};return{paint:Object.assign({[`${Da[F]}-color`]:this._getLayerColorStyle(F)},cl.VM[F.toUpperCase()].paint),layout:Object.assign({[`${Da[F]}-sort-key`]:this._getLayerSortStyle(F)},cl.VM[F.toUpperCase()].layout)}}}_getLayerColorStyle(F){const Da=["case",["==",["get","hidden"],!0],hl.lm.HIDDEN,["==",["get","geovisio:status"],"hidden"],hl.lm.HIDDEN],ll=this._parent._selectedSeqId;return"sequences"==F&&ll?Da.push(["==",["get","id"],ll],hl.lm.SELECTED):F.startsWith("pictures")&&ll&&Da.push(["in",ll,["get","sequences"]],hl.lm.SELECTED),Da.push(hl.lm.BASE),Da}_getLayerSortStyle(F){const Da=["case",["==",["get","hidden"],!0],90],ll=this._parent._selectedSeqId;return"sequences"==F&&ll?Da.push(["==",["get","id"],ll],100):F.startsWith("pictures")&&ll&&Da.push(["in",ll,["get","sequences"]],100),Da.push(10),Da}_attachPreviewToPictures(F,Da){let ll=F.features.pop();if(!ll||ll.properties.id==this._picPopup._picId)return;let hl=null;if(Da.endsWith("pictures")?hl=ll.geometry.coordinates.slice():F.lngLat&&(hl=[F.lngLat.lng,F.lngLat.lat]),!hl){const F="LineString"===ll.geometry.type?[ll.geometry.coordinates]:ll.geometry.coordinates;let Da=null;const cl=this.getBounds(),dl=cl.getCenter();for(let ll=0;ll<F.length;ll++)for(let pl=0;pl<F[ll].length;pl++)if(cl.contains(F[ll][pl])){let cl=dl.distanceTo(new(kl().LngLat)(...F[ll][pl]));(null===Da||cl<Da)&&(hl=F[ll][pl],Da=cl)}if(!hl)return}this._picPopup.setLngLat(hl).addTo(this),this._picThumbUrl[ll.properties.id]||this._picPopup.setDOMContent((0,cl.No)(this._parent._t)),this._picPopup._loading=ll.properties.id,this._picPopup._picId=ll.properties.id;const displayThumb=F=>{if(this._picPopup._loading===ll.properties.id)if(delete this._picPopup._loading,F){let Da=document.createElement("img");Da.classList.add("gvs-map-thumb"),Da.alt=this._parent._t.map.thumbnail;let cl=new Image;if(cl.src=F,cl.addEventListener("load",(()=>{ll.properties.hidden?Da.children[0].src=cl.src:Da.src=cl.src,this._picPopup.setDOMContent(Da)})),ll.properties.hidden){const F=document.createElement("div");F.classList.add("gvs-map-thumb-legend"),F.appendChild(document.createTextNode(this._parent._t.map.not_public));const ll=document.createElement("div");ll.appendChild(Da),ll.appendChild(F),Da=ll}}else this._picPopup.remove()};Da.endsWith("pictures")?this._getPictureThumbURL(ll.properties.id).then(displayThumb):Da.endsWith("grid")?this._getThumbURL(hl).then(displayThumb):this._getSequenceThumbURL(ll.properties.id,new(kl().LngLat)(...hl)).then(displayThumb)}_getThumbURL(F){return this._parent._api.getPicturesAroundCoordinates(F[1],F[0],.1,1).then((F=>{var Da;const ll=null===F||void 0===F||null===(Da=F.features)||void 0===Da?void 0:Da.pop();return ll?this._parent._api.findThumbnailInPictureFeature(ll):null}))}_getSequenceThumbURL(F,Da){return Da?this._parent._api.getPicturesAroundCoordinates(Da.lat,Da.lng,1,1,F).then((Da=>{var ll;return(null===Da||void 0===Da||null===(ll=Da.features)||void 0===ll?void 0:ll.length)>0?this._parent._api.findThumbnailInPictureFeature(Da.features[0]):this._parent._api.getPictureThumbnailURLForSequence(F)})):this._parent._api.getPictureThumbnailURLForSequence(F)}_getPictureThumbURL(F,Da){let ll=null;return F&&(void 0!==this._picThumbUrl[F]?ll="string"===typeof this._picThumbUrl[F]?Promise.resolve(this._picThumbUrl[F]):this._picThumbUrl[F]:(this._picThumbUrl[F]=this._parent._api.getPictureThumbnailURL(F,Da).then((Da=>Da?(this._picThumbUrl[F]=Da,Da):(this._picThumbUrl[F]=null,null))).catch((()=>{this._picThumbUrl[F]=null})),ll=this._picThumbUrl[F])),ll}_getPictureMarker(){let F=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const Da=document.createElement("img");return Da.src=F?pl:dl,Da.alt="",new(kl().Marker)({element:Da})}_onSequenceHover(F){var Da;F.preventDefault(),F.features.length>0&&null!==(Da=F.features[0].properties)&&void 0!==Da&&Da.id&&this._parent.dispatchEvent(new CustomEvent("map:sequence-hover",{detail:{seqId:F.features[0].properties.id}}))}_onSequenceClick(F){var Da;F.preventDefault(),F.features.length>0&&null!==(Da=F.features[0].properties)&&void 0!==Da&&Da.id&&this._parent.dispatchEvent(new CustomEvent("map:sequence-click",{detail:{seqId:F.features[0].properties.id,coordinates:F.lngLat}}))}_onPictureClick(F){var Da,ll;F.preventDefault();const cl=(null===F||void 0===F||null===(Da=F.features)||void 0===Da?void 0:Da.length)>0?F.features[0]:null;if(null!==cl&&void 0!==cl&&null!==(ll=cl.properties)&&void 0!==ll&&ll.id){let Da=null;try{cl.properties.sequences&&(Array.isArray(cl.properties.sequences)||(cl.properties.sequences=JSON.parse(cl.properties.sequences)),Da=cl.properties.sequences.pop())}catch(F){console.log("Sequence ID is not available in vector tiles for picture "+cl.properties.id)}this._parent.dispatchEvent(new CustomEvent("map:picture-click",{detail:{picId:cl.properties.id,seqId:Da,feature:cl}}))}}}},8489:(F,Da,ll)=>{"use strict";ll.d(Da,{Ay:()=>Photo,LM:()=>Dl,Vf:()=>Wl,cS:()=>kl});ll(8310);var cl=ll(5975),hl=ll(2305),dl=ll(5071),pl=(ll(3961),ll(1080),ll(2710),ll(1575),ll(1545)),fl=ll(3348),Al=ll(3727);const bl={baseUrl:cl,width:1280,cols:2,rows:1,tileUrl:()=>null},kl=30,Dl=250,Wl=3e3;pl.jM.useNewAnglesOrder=!0;class Photo extends pl.jM{constructor(F,Da){var ll,cl,hl,dl;let pl=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super({container:Da,adapter:[Al.A,{showErrorTile:!1,baseBlur:!1,resolution:F.isWidthSmall()?32:64,shouldGoFast:pl.shouldGoFast}],withCredentials:"include"==(null===(ll=F._options)||void 0===ll||null===(cl=ll.fetchOptions)||void 0===cl?void 0:cl.credentials),requestHeaders:null===(hl=F._options)||void 0===hl||null===(dl=hl.fetchOptions)||void 0===dl?void 0:dl.headers,panorama:bl,lang:F._t.psv,minFov:5,loadingTxt:" ",navbar:null,rendererParameters:{preserveDrawingBuffer:!F.isWidthSmall()},plugins:[[fl.$,{dataMode:"server",positionMode:"gps",renderMode:"3d",preload:!0,getNode:()=>{},transitionOptions:()=>{},arrowsPosition:{linkOverlapAngle:Math.PI/6}}]],...pl}),this._parent=F,Da.classList.add("gvs-psv"),this._shouldGoFast=(null===pl||void 0===pl?void 0:pl.shouldGoFast)||(()=>!1),this._transitionDuration=(null===pl||void 0===pl?void 0:pl.transitionDuration)||Dl,this._myVTour=this.getPlugin(fl.$),this._myVTour.datasource.nodeResolver=this._getNodeFromAPI.bind(this),this._myVTour.config.transitionOptions=this._psvNodeTransition.bind(this),this._clearArrows=this._myVTour.arrowsRenderer.clear.bind(this._myVTour.arrowsRenderer),this._myVTour.arrowsRenderer.clear=()=>{},this._picturesSequences={},this._myVTour.addEventListener("enter-arrow",this._onEnterArrow.bind(this)),this._myVTour.addEventListener("leave-arrow",this._onLeaveArrow.bind(this)),this._myVTour.addEventListener("node-changed",this._onNodeChanged.bind(this)),this.addEventListener("position-updated",this._onPositionUpdated.bind(this)),this.addEventListener("zoom-updated",this._onZoomUpdated.bind(this)),this._parent.addEventListener("select",this._onSelect.bind(this)),this.loader.size=150,this.loader.color="rgba(61, 61, 61, 0.5)",this.loader.textColor="rgba(255, 255, 255, 0.7)",this.loader.border=5,this.loader.thickness=10,this.loader.canvas.setAttribute("viewBox","0 0 150 150"),this.loader.__updateContent()}async _getNodeFromAPI(F){var Da,ll,cl;if(!F)return;const hl=await fetch(this._parent._api.getPictureMetadataUrl(F,this._picturesSequences[F]),this._parent._api._getFetchOptions());let pl=await hl.json();if(pl.features&&(pl=pl.features.pop()),!pl||0===Object.keys(pl).length||!hl.ok)throw this._parent._loader&&this._parent._loader.dismiss(!0,this._parent._t.gvs.error_pic),new Error("Picture with ID "+F+" was not found");this._picturesSequences[F]=pl.collection;const fl=(0,dl.rs)(pl,this._parent._t,this._parent._isInternetFast,null===(Da=this._parent._picturesNavFilter)||void 0===Da?void 0:Da.bind(this._parent));var Al,bl;null!==fl&&void 0!==fl&&null!==(ll=fl.sequence)&&void 0!==ll&&ll.prevPic&&(this._picturesSequences[null===fl||void 0===fl||null===(Al=fl.sequence)||void 0===Al?void 0:Al.prevPic]=pl.collection);null!==fl&&void 0!==fl&&null!==(cl=fl.sequence)&&void 0!==cl&&cl.nextPic&&(this._picturesSequences[null===fl||void 0===fl||null===(bl=fl.sequence)||void 0===bl?void 0:bl.nextPic]=pl.collection);return fl}_psvNodeTransition(F,Da,ll){var cl,hl;let pl={};const fl=this._shouldGoFast()?0:Math.min(Dl,this._transitionDuration),Al=fl>100,bl=null!=(ll||(null===Da||void 0===Da?void 0:Da.links.find((Da=>Da.nodeId==F.id)))),Wl=Da&&F.sequence.id===Da.sequence.id,Ql=((null===Da||void 0===Da||null===(cl=Da.properties)||void 0===cl?void 0:cl["view:azimuth"])||0)*(Math.PI/180),wc=((null===F||void 0===F||null===(hl=F.properties)||void 0===hl?void 0:hl["view:azimuth"])||0)*(Math.PI/180);this.setOption("maxFov",Math.min(3*F.horizontalFov/4,90));const Sc={speed:0,fadeIn:!1,rotation:!1,rotateTo:{pitch:0,yaw:0},zoomTo:kl};if(360==F.horizontalFov)pl=Da?(0,dl.Yf)(Da.gps,F.gps)>=.001?Sc:{speed:fl,fadeIn:bl&&Al,rotation:bl&&Wl&&Al,rotateTo:this.getPosition()}:Sc;else if(Wl){const F=this.getPosition().yaw,ll=Da.horizontalFov*(Math.PI/180)/2,cl=F<=ll||F>=2*Math.PI-ll,hl=Math.abs(Ql-wc)<=Math.PI/4;pl={speed:fl,fadeIn:bl&&hl&&Al,rotation:bl&&hl&&Al,rotateTo:cl?this.getPosition():{pitch:0,yaw:0},zoomTo:cl?this.getZoomLevel():kl}}else pl=Sc;pl.fadeIn&&pl.speed>=150?setTimeout(this._clearArrows,pl.speed-100):this._clearArrows();const eu=new CustomEvent("psv:picture-loading",{detail:{...Object.assign({},this.getXYZ(),pl.rotateTo?{x:180*(wc+pl.rotateTo.yaw)/Math.PI}:null,pl.zoomTo?{z:pl.zoomTo}:null),picId:F.id,lon:F.gps[0],lat:F.gps[1]}});return this._parent.dispatchEvent(eu),pl}_onEnterArrow(F){const Da=F.link,ll=F.node;let cl;ll&&(cl=360===ll.horizontalFov?(this.getPictureOriginalHeading()+180*this.getPosition().yaw/Math.PI)%360:this.getPictureOriginalHeading());const hl=new CustomEvent("psv:picture-preview-started",{detail:{picId:Da.nodeId,coordinates:Da.gps,direction:cl}});this._parent.dispatchEvent(hl)}_onLeaveArrow(F){const Da=F.link,ll=new CustomEvent("psv:picture-preview-stopped",{detail:{picId:Da.nodeId}});this._parent.dispatchEvent(ll)}_onPositionUpdated(F){let{position:Da}=F;const ll=(0,dl.oi)(Da,this.getZoomLevel());ll.x+=this.getPictureOriginalHeading(),ll.x=ll.x%360;const cl=new CustomEvent("psv:view-rotated",{detail:ll});this._parent.dispatchEvent(cl),this._onTilesStartLoading()}_onZoomUpdated(F){let{zoomLevel:Da}=F;const ll=new CustomEvent("psv:view-rotated",{detail:{...this.getXY(),z:Da}});this._parent.dispatchEvent(ll),this._onTilesStartLoading()}_onNodeChanged(F){for(let cl of document.getElementsByClassName("gvs-psv-tour-arrows"))cl.classList.remove("gvs-clicked");if(F.node.id){var Da,ll;this._parent.select(null===(Da=F.node)||void 0===Da||null===(ll=Da.sequence)||void 0===ll?void 0:ll.id,F.node.id);const cl=this.getPictureMetadata();if(!cl)return;this._prevSequence=cl.sequence.id;const hl=new CustomEvent("psv:picture-loaded",{detail:{...this.getXYZ(),picId:F.node.id,lon:cl.gps[0],lat:cl.gps[1]}});this._parent.dispatchEvent(hl),cl.panorama.hdUrl?(this.setOption("downloadUrl",cl.panorama.hdUrl),this.setOption("downloadName",F.node.id+".jpg")):this.setOption("downloadUrl",null)}this._onTilesStartLoading()}_onTilesStartLoading(){this._tilesQueueTimer&&(clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer),this._tilesQueueTimer=setInterval((()=>{if(0===Object.keys(this.adapter.queue.tasks).length){if(this._myVTour.state.currentNode){const F=new Event("psv:picture-tiles-loaded",{picId:this._myVTour.state.currentNode.id});this._parent.dispatchEvent(F)}clearInterval(this._tilesQueueTimer),delete this._tilesQueueTimer}}),100)}getPictureMetadata(){return this._myVTour.state.currentNode?Object.assign({},this._myVTour.state.currentNode):null}_onSelect(F){var Da;F.detail.seqId&&(this._picturesSequences[F.detail.picId]=F.detail.seqId),(null===(Da=this._myVTour.getCurrentNode())||void 0===Da?void 0:Da.id)!==F.detail.picId&&(this.loader.show(),this._myVTour.setCurrentNode(F.detail.picId).catch((F=>{this.showErrorOverlay(F,this._parent._t.gvs.error_pic,!0)})))}goToNextPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const F=this.getPictureMetadata().sequence.nextPic;if(!F)throw new Error("No next picture available");this._parent.select(this.getPictureMetadata().sequence.id,F)}goToPrevPicture(){if(!this.getPictureMetadata())throw new Error("No picture currently selected");const F=this.getPictureMetadata().sequence.prevPic;if(!F)throw new Error("No previous picture available");this._parent.select(this.getPictureMetadata().sequence.id,F)}async goToPosition(F,Da){return this._parent._api.getPicturesAroundCoordinates(F,Da).then((F=>{if(F.features.length>0){const Da=F.features.pop();return this._parent.select(null===Da||void 0===Da?void 0:Da.collection,Da.id),Da.id}return Promise.reject(new Error("No picture found nearby given coordinates"))}))}getXY(){const F=(0,dl.oi)(this.getPosition());return F.x=(F.x+this.getPictureOriginalHeading())%360,F}getXYZ(){const F=this.getXY();return F.z=this.getZoomLevel(),F}getPictureOriginalHeading(){var F,Da;return(null===(F=this.getPictureMetadata())||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"])||0}getPictureRelativeHeading(){return(0,dl.dj)(this.getPictureMetadata())}clearPictureMetadataCache(){var F,Da,ll,cl;const hl=null===(F=this.getPictureMetadata())||void 0===F?void 0:F.id,dl=null===(Da=this.getPictureMetadata())||void 0===Da||null===(ll=Da.sequence)||void 0===ll?void 0:ll.id;null===(cl=this._myVTour.state.currentTooltip)||void 0===cl||cl.hide(),this._myVTour.state.currentTooltip=null,this._myVTour.state.currentNode=null,this._myVTour.state.preload={},this._myVTour.datasource.nodes={},hl&&this._parent.select(dl,hl)}setXYZ(F,Da,ll){const cl=(0,dl.y7)(F-this.getPictureOriginalHeading(),Da,ll);this.rotate({yaw:cl.yaw,pitch:cl.pitch}),this.zoom(cl.zoom)}setHigherContrast(F){this.renderer.renderer.toneMapping=F?3:0,this.renderer.renderer.toneMappingExposure=F?2:1,this.needsUpdate()}getTransitionDuration(){return this._transitionDuration}setTransitionDuration(F){if((F=parseFloat(F))<100||F>Wl)throw new Error("Invalid transition duration (should be between 100 and "+Wl+")");this._transitionDuration=F;const Da=new CustomEvent("psv:transition-duration-changed",{detail:{value:F}});this._parent.dispatchEvent(Da)}setPanorama(F,Da){const onFailure=F=>this.showErrorOverlay(F,this._parent._t.gvs.error_pic,!0);try{return super.setPanorama(F,Da).catch(onFailure)}catch(ll){onFailure(ll)}}showErrorOverlay(F,Da,ll){this._parent._loader.isVisible()||!this.overlay.isVisible()?this._parent._loader.dismiss(F,Da,ll?()=>{this._parent._loader.dismiss(),this.overlay.hide()}:void 0):(console.error(F),this.overlay.show({image:`<img style="width: 200px" src="${hl}" alt="" />`,title:this._parent._t.gvs.error,text:Da+"<br />"+this._parent._t.gvs.error_click,dissmisable:ll}))}}},5254:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>API});var cl=ll(1300);class API{constructor(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===F||void 0===F||"string"!==typeof F)throw new Error("endpoint parameter is empty or not a valid string");if(F.startsWith("/")&&(F=window.location.href.split("/").slice(0,3).join("/")+F),!API.isValidHttpUrl(F))throw new Error(`endpoint parameter is not a valid URL: ${F}`);this._endpoint=F,this._isReady=0,this._dataBbox=null,this._fetchOpts=(null===Da||void 0===Da?void 0:Da.fetch)||{},this._metadata={},Da.skipReadLanding||(this._readLanding=fetch(F,this._getFetchOptions()).then((F=>F.json())).then((F=>this._parseLanding(F,Da))).catch((F=>(this._isReady=-1,console.error(F),Promise.reject("Viewer failed to communicate with API")))).then((()=>this._loadMapStyles(Da.style,Da.users))).then((()=>(this._isReady=1,"API is ready"))))}onceReady(){return-1==this._isReady?Promise.reject("Viewer failed to communicate with API"):1==this._isReady?Promise.resolve("API is ready"):this._readLanding}isReady(){return 1==this._isReady}getAvailableFeatures(){return Object.entries(this._endpoints).filter((F=>null!==F[1])).map((F=>F[0]))}getUnavailableFeatures(){return Object.entries(this._endpoints).filter((F=>null===F[1])).map((F=>F[0]))}_parseLanding(F,Da){var ll,cl;if(this._endpoints={collections:null,search:null,style:null,user_style:null,tiles:(null===Da||void 0===Da?void 0:Da.tiles)||null,user_tiles:null,user_search:null,collection_preview:null,item_preview:null,rss:null,report:null},!F||!F.links||!Array.isArray(F.links))throw new Error("API Landing page doesn't contain 'links' list");if(!F.stac_version.startsWith("1."))throw new Error(`API is not in a supported STAC version (Panoramax viewer supports only 1.x, API is ${F.stac_version})`);this._metadata.name=F.title||"Unnamed",this._metadata.stac_version=F.stac_version,this._metadata.geovisio_version=F.geovisio_version;const hl=[],dl=[];if([{rel:"search",type:"application/geo+json",endpointId:"search",mandatory:!0,missingIssue:"No direct access to pictures metadata."},{rel:"data",type:"application/json",endpointId:"collections",mandatory:!0,missingIssue:"No way for viewer to access sequences."},{rel:"data",type:"application/rss+xml",endpointId:"rss"},{rel:"xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"tiles"},{rel:"xyz-style",type:"application/json",endpointId:"style"},{rel:"user-xyz-style",type:"application/json",endpointId:"user_style"},{rel:"user-xyz",type:"application/vnd.mapbox-vector-tile",endpointId:"user_tiles"},{rel:"user-search",type:"application/json",endpointId:"user_search",missingIssue:"Filter map data by user name will not be available."},{rel:"collection-preview",type:"image/jpeg",endpointId:"collection_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"item-preview",type:"image/jpeg",endpointId:"item_preview",missingIssue:"Display of thumbnail could be slower."},{rel:"report",type:"application/json",endpointId:"report"}].forEach((Da=>{const ll=F.links.find((F=>F.rel==Da.rel&&F.type==Da.type));if(ll){if(!API.isValidHttpUrl(ll.href))throw new Error(`API endpoint '${ll.rel}' (${ll.type}) is not a valid URL: ${ll.href}`);this._endpoints[Da.endpointId]||(this._endpoints[Da.endpointId]=ll.href)}else if(!this._endpoints[Da.endpointId]){let F=`API doesn't offer a '${Da.rel}' (${Da.type}) endpoint in its links`;Da.missingIssue&&(F+=`\n${Da.missingIssue}`),Da.mandatory?hl.push(F):Da.missingIssue&&dl.push(F)}})),this._endpoints.style||this._endpoints.tiles||dl.push("API doesn't offer 'xyz' or 'xyz-style' endpoints in its links.\nMap widget will not be available."),this._endpoints.user_style||this._endpoints.user_tiles||dl.push("API doesn't offer 'user-xyz' or 'user-xyz-style' endpoints in its links.\nFilter map data by user ID will not be available."),dl.forEach((F=>console.warn(F))),hl.length>0)throw new Error(hl.join("\n"));const pl=null===F||void 0===F||null===(ll=F.extent)||void 0===ll||null===(cl=ll.spatial)||void 0===cl?void 0:cl.bbox;this._dataBbox=pl&&Array.isArray(pl)&&pl.length>0&&Array.isArray(pl[0])&&4===pl[0].length?[[pl[0][0],pl[0][1]],[pl[0][2],pl[0][3]]]:null}_loadMapStyles(F,Da){const ll=new Set(Da||[]);this.mapStyle={version:8,sources:{},layers:[],metadata:{}};const cl=[this.getMapStyle()];if("string"===typeof F){const Da=F.startsWith(this._endpoint)?this._getFetchOptions():void 0;cl.push(fetch(F,Da).then((F=>F.json())))}else"object"===typeof F&&cl.push(Promise.resolve(F));return[...ll].filter((F=>"geovisio"!==F)).forEach((F=>{cl.push(this.getUserMapStyle(F,!0))})),Promise.all(cl).then((F=>{const Da=["bearing","center","glyphs","light","name","pitch","sky","sprite","terrain","transition","zoom"];F.forEach((F=>{Da.forEach((Da=>{F[Da]&&(this.mapStyle[Da]=F[Da]||this.mapStyle[Da])})),Object.assign(this.mapStyle.sources,(null===F||void 0===F?void 0:F.sources)||{}),Object.assign(this.mapStyle.metadata,(null===F||void 0===F?void 0:F.metadata)||{}),this.mapStyle.layers=this.mapStyle.layers.concat((null===F||void 0===F?void 0:F.layers)||[])}))})).catch((F=>console.error(F)))}_getFetchOptions(){return Object.assign({signal:AbortSignal.timeout(15e3)},this._fetchOpts)}_getMapRequestTransform(){const F=this._getFetchOptions();if(delete F.signal,Object.keys(F).length>0)return Da=>{if(Da.startsWith(this._endpoint))return{url:Da,...F}}}async getSequenceItems(F){if(!this.isReady())throw new Error("API is not ready to use");try{return API.isIdValid(F),fetch(`${this._endpoints.collections}/${F}/items`,this._getFetchOptions()).then((F=>F.json()))}catch(Da){return Promise.reject(Da)}}getPicturesAroundCoordinatesUrl(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e-4,cl=arguments.length>3?arguments[3]:void 0,hl=arguments.length>4?arguments[4]:void 0;if(!this.isReady())throw new Error("API is not ready to use");if(isNaN(parseFloat(F))||isNaN(parseFloat(Da)))throw new Error("lat and lon parameters should be valid numbers");const dl=[Da-ll,F-ll,Da+ll,F+ll].map((F=>F.toFixed(4))).join(","),pl=cl?`&limit=${cl}`:"",fl=hl?`&collections=${hl}`:"";return`${this._endpoints.search}?bbox=${dl}${pl}${fl}`}getPicturesAroundCoordinates(F,Da,ll,cl,hl){return fetch(this.getPicturesAroundCoordinatesUrl(F,Da,ll,cl,hl),this._getFetchOptions()).then((F=>F.json()))}getPictureMetadataUrl(F,Da){if(!this.isReady())throw new Error("API is not ready to use");if(API.isIdValid(F))return Da?`${this._endpoints.collections}/${Da}/items/${F}`:`${this._endpoints.search}?ids=${F}`}getMapStyle(){if(this.isReady())return this.mapStyle;let F;return F=this._endpoints.style?this._endpoints.style:this._endpoints.tiles?{version:8,sources:{geovisio:{type:"vector",tiles:[this._endpoints.tiles],minzoom:0,maxzoom:cl.oe}}}:fetch(`${this._endpoint}/map/14/0/0.mvt`,this._getFetchOptions()).then((()=>(this._endpoints.tiles=`${this._endpoint}/map/{z}/{x}/{y}.mvt`,console.log("Using fallback endpoint for vector tiles"),this.getMapStyle()))).catch((F=>(console.error(F),Promise.reject(new Error("API doesn't offer a vector tiles endpoint"))))),"string"===typeof F?fetch(F,this._getFetchOptions()).then((F=>F.json())):Promise.resolve(F)}getUserMapStyle(F){let Da;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||this.isReady()?F?(this._endpoints.user_style?Da=this._endpoints.user_style.replace(/\{userId\}/g,F):this._endpoints.user_tiles&&(Da={version:8,sources:{[`geovisio_${F}`]:{type:"vector",tiles:[this._endpoints.user_tiles.replace(/\{userId\}/g,F)],minzoom:0,maxzoom:cl.oe}}}),Da?"string"===typeof Da?fetch(Da,this._getFetchOptions()).then((F=>F.json())):Promise.resolve(Da):Promise.reject(new Error("API doesn't offer map style for specific user"))):Promise.reject(new Error("Parameter userId is empty")):Promise.reject(new Error("API is not ready to use"))}findThumbnailInPictureFeature(F){if(!this.isReady())throw new Error("API is not ready to use");if(!F||!F.assets)return null;let Da=null;for(let ll of Object.values(F.assets)){if(ll.roles.includes("thumbnail")&&"image/jpeg"==ll.type&&API.isValidHttpUrl(ll.href))return ll.href;ll.roles.includes("visual")&&"image/jpeg"==ll.type&&API.isValidHttpUrl(ll.href)&&(Da=ll.href)}return Da}getPictureThumbnailURLForSequence(F,Da){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.collection_preview)return Promise.resolve(this._endpoints.collection_preview.replace("{id}",F));if(Da&&Array.isArray(Da.links)&&Da.links.length>0){let F=Da.links.find((F=>"preview"===F.rel&&"image/jpeg"===F.type));if(F&&API.isValidHttpUrl(F.href))return Promise.resolve(F.href)}const ll=`${this._endpoints.search}?limit=1&collections=${F}`;return fetch(ll,this._getFetchOptions()).then((F=>F.json())).then((F=>Array.isArray(F.features)&&0!=F.features.length?this.findThumbnailInPictureFeature(F.features.pop()):null))}getPictureThumbnailURL(F,Da){if(!this.isReady())throw new Error("API is not ready to use");return F?this._endpoints.item_preview?Promise.resolve(this._endpoints.item_preview.replace("{id}",F)):F&&Da?fetch(`${this._endpoints.collections}/${Da}/items/${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>F?this.findThumbnailInPictureFeature(F):null)):fetch(`${this._endpoints.search}?ids=${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>F&&Array.isArray(F.features)&&0!=F.features.length?this.findThumbnailInPictureFeature(F.features.pop()):null)):Promise.resolve(null)}getRSSURL(F){if(!this.isReady())throw new Error("API is not ready to use");if(this._endpoints.rss){let Da=this._endpoints.rss;return F&&(Da+=Da.includes("?")?"&":"?",Da+="bbox="+[F.getWest(),F.getSouth(),F.getEast(),F.getNorth()].join(",")),Da}return null}getSequenceMetadataUrl(F){if(!this.isReady())throw new Error("API is not ready to use");return`${this._endpoints.collections}/${F}`}getDataBbox(){if(!this.isReady())throw new Error("API is not ready to use");return this._dataBbox}searchUsers(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(`${this._endpoints.user_search}?q=${F}`,this._getFetchOptions()).then((F=>F.json())).then((F=>(null===F||void 0===F?void 0:F.features)||null))}getUserName(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.user_search)throw new Error("User search is not available");return fetch(this._endpoints.user_search.replace(/\/search$/,`/${F}`),this._getFetchOptions()).then((F=>F.json())).then((F=>(null===F||void 0===F?void 0:F.name)||null))}sendReport(F){if(!this.isReady())throw new Error("API is not ready to use");if(!this._endpoints.report)throw new Error("Report sending is not available");const Da={...this._getFetchOptions(),method:"POST",body:JSON.stringify(F),headers:{"Content-Type":"application/json"}};return fetch(this._endpoints.report,Da).then((async F=>{if(F.status>=400){let ll=await F.text();try{ll=JSON.parse(ll).message}catch(Da){}return Promise.reject(ll)}return F.json()}))}static isValidHttpUrl(F){let Da;try{Da=new URL(F)}catch(ll){return!1}return"http:"===Da.protocol||"https:"===Da.protocol}static isIdValid(F){if(!F||"string"!==typeof F||0===F.length)throw new Error("id should be a valid picture unique identifier");return!0}}},654:(F,Da,ll)=>{"use strict";function getExifFloat(F){if(!([null,void 0,""].includes(F)||"string"===typeof F&&""===F.trim())){if("number"===typeof F)return F;if("string"!==typeof F);else{if(/^-?\d+(\.\d+)?\/-?\d+(\.\d+)?$/.test(F)){const Da=F.split("/").map((F=>parseFloat(F)));return Da[0]/Da[1]}try{return parseFloat(F)}catch(Da){}}}}function getGPSPrecision(F){var Da,ll,cl,hl,dl;let pl="\u2753";const fl=(null===F||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["quality:horizontal_accuracy"])||getExifFloat(null===F||void 0===F||null===(ll=F.properties)||void 0===ll||null===(cl=ll.exif)||void 0===cl?void 0:cl["Exif.GPSInfo.GPSHPositioningError"]),Al=getExifFloat(null===F||void 0===F||null===(hl=F.properties)||void 0===hl||null===(dl=hl.exif)||void 0===dl?void 0:dl["Exif.GPSInfo.GPSDOP"]);return void 0!==fl?pl=`${fl} m`:void 0!==Al&&(pl=Al<1?"ideal":Al<2?"excellent":Al<5?"good":Al<10?"moderate":Al<20?"fair":"poor"),pl}function getSphereCorrection(F){var Da,ll,cl,hl;let dl=null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"];if(void 0===dl){var pl,fl;const Da=getExifFloat(null===(pl=F.properties)||void 0===pl||null===(fl=pl.exif)||void 0===fl?void 0:fl["Exif.GPSInfo.GPSImgDirection"]);void 0!==Da&&(dl=Da)}dl=dl||0;let Al=null===(ll=F.properties)||void 0===ll?void 0:ll["pers:yaw"],bl=["Xmp.GPano.PoseHeadingDegrees","Xmp.Camera.Yaw","Exif.MpfInfo.MPFYawAngle"];if(void 0===Al)for(let su of bl){var kl,Dl;const Da=getExifFloat(null===(kl=F.properties)||void 0===kl||null===(Dl=kl.exif)||void 0===Dl?void 0:Dl[su]);if(void 0!==Da){Al=Da;break}}Al=Al||0,Math.round(dl)===Math.round(Al)&&Al>0&&console.warn("Picture with UUID",F.id,"has same GPS Image direction and Yaw, could cause rendering issues");let Wl=null===(cl=F.properties)||void 0===cl?void 0:cl["pers:pitch"];if(bl=["Xmp.GPano.PosePitchDegrees","Xmp.Camera.Pitch","Exif.MpfInfo.MPFPitchAngle"],void 0===Wl)for(let su of bl){var Ql,wc;const Da=getExifFloat(null===(Ql=F.properties)||void 0===Ql||null===(wc=Ql.exif)||void 0===wc?void 0:wc[su]);if(void 0!==Da){Wl=Da;break}}Wl=Wl||0;let Sc=null===(hl=F.properties)||void 0===hl?void 0:hl["pers:roll"];if(bl=["Xmp.GPano.PoseRollDegrees","Xmp.Camera.Roll","Exif.MpfInfo.MPFRollAngle"],void 0===Sc)for(let su of bl){var eu,iu;const Da=getExifFloat(null===(eu=F.properties)||void 0===eu||null===(iu=eu.exif)||void 0===iu?void 0:iu[su]);if(void 0!==Da){Sc=Da;break}}return Sc=Sc||0,0!==Wl&&0!==Sc?{pan:Al*Math.PI/180,tilt:Wl*Math.PI/180,roll:Sc*Math.PI/180}:{}}function getCroppedPanoData(F){var Da,ll;let cl;var hl,dl;if(null!==(Da=F.properties)&&void 0!==Da&&Da["pers:interior_orientation"]&&(null!==(hl=F.properties["pers:interior_orientation"])&&void 0!==hl&&hl.visible_area&&null!==(dl=F.properties["pers:interior_orientation"])&&void 0!==dl&&dl.sensor_array_dimensions)){const Da=F.properties["pers:interior_orientation"].visible_area,ll=F.properties["pers:interior_orientation"].sensor_array_dimensions;try{cl={fullWidth:parseInt(ll[0]),fullHeight:parseInt(ll[1]),croppedX:parseInt(Da[0]),croppedY:parseInt(Da[1]),croppedWidth:parseInt(ll[0])-parseInt(Da[2])-parseInt(Da[0]),croppedHeight:parseInt(ll[1])-parseInt(Da[3])-parseInt(Da[1])}}catch(Wl){console.warn("Invalid pers:interior_orientation values for cropped panorama "+F.id)}}if(!cl&&null!==(ll=F.properties)&&void 0!==ll&&ll.exif)try{var pl,fl,Al,bl,kl,Dl;cl={fullWidth:parseInt(null===(pl=F.properties.exif)||void 0===pl?void 0:pl["Xmp.GPano.FullPanoWidthPixels"]),fullHeight:parseInt(null===(fl=F.properties.exif)||void 0===fl?void 0:fl["Xmp.GPano.FullPanoHeightPixels"]),croppedX:parseInt(null===(Al=F.properties.exif)||void 0===Al?void 0:Al["Xmp.GPano.CroppedAreaLeftPixels"]),croppedY:parseInt(null===(bl=F.properties.exif)||void 0===bl?void 0:bl["Xmp.GPano.CroppedAreaTopPixels"]),croppedWidth:parseInt(null===(kl=F.properties.exif)||void 0===kl?void 0:kl["Xmp.GPano.CroppedAreaImageWidthPixels"]),croppedHeight:parseInt(null===(Dl=F.properties.exif)||void 0===Dl?void 0:Dl["Xmp.GPano.CroppedAreaImageHeightPixels"])}}catch(Wl){console.warn("Invalid XMP.GPano values for cropped panorama "+F.id)}return cl&&(cl=Object.fromEntries(Object.entries(cl||{}).filter((F=>!isNaN(F[1])))),cl.fullWidth==cl.croppedWidth&&cl.fullHeight==cl.croppedHeight&&(cl={})),cl||{}}ll.d(Da,{MY:()=>getSphereCorrection,Pu:()=>getGPSPrecision,qx:()=>getCroppedPanoData})},6980:(F,Da,ll)=>{"use strict";ll.d(Da,{$:()=>getTranslations,D:()=>autoDetectLocale});var cl=ll(4149),hl=ll(369),dl=ll(389),pl=ll(9946),fl=ll(8302),Al=ll(5222),bl=ll(6909),kl=ll(4895),Dl=ll(9026),Wl=ll(6984);const Ql="en",wc={da:cl,de:hl,eo:pl,en:dl,es:fl,fr:Al,hu:bl,it:kl,pl:Dl,zh_Hant:Wl};function autoDetectLocale(F,Da){for(const ll of window.navigator.languages){let Da=ll;switch(Da){case"zh-TW":case"zh-HK":case"zh-MO":Da="zh_Hant";break;case"zh-CN":case"zh-SG":Da="zh_Hans";break;default:Da.length>2&&(Da=ll.substring(0,2))}const cl=F.find((F=>F===Da));if(cl)return cl}return Da}function getTranslations(){let F=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const Da=JSON.parse(JSON.stringify(dl));let ll;if(F||(F=autoDetectLocale(Object.keys(wc),Ql)),wc[F]&&"en"!==F&&(ll=wc[F]),F.length>2){const Da=F.substring(0,2);wc[Da]&&(ll=wc[Da])}return ll&&Object.entries(ll).forEach((F=>{let[ll,cl]=F;Object.entries(cl).forEach((F=>{let[cl,hl]=F;Array.isArray(hl)&&(hl=hl.filter((F=>null!=F))),Da[ll][cl]=hl}))})),Da}},1300:(F,Da,ll)=>{"use strict";ll.d(Da,{AV:()=>Al,CG:()=>combineStyles,Hj:()=>switchCoefValue,IN:()=>getUserLayerId,Kf:()=>forwardGeocodingBAN,No:()=>getThumbGif,Oq:()=>getMissingLayerStyles,RK:()=>forwardGeocodingNominatim,Sf:()=>isLabelLayer,VM:()=>Dl,d3:()=>wc,e8:()=>getUserSourceId,m5:()=>bl,oe:()=>kl});var cl=ll(927),hl=ll.n(cl),dl=ll(6883),pl=ll(5071),fl=ll(6980);const Al="https://panoramax.openstreetmap.fr/pmtiles/basic.json",bl="gvs-aerial",kl=15,Dl={PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],kl,4.5,18,6,24,12],"circle-opacity":["interpolate",["linear"],["zoom"],kl,0,kl+1,1],"circle-stroke-color":"#ffffff","circle-stroke-width":["interpolate",["linear"],["zoom"],kl+1,0,kl+2,1,18,1.5,24,3]},layout:{}},PICTURES_SYMBOLS:{paint:{"icon-opacity":["interpolate",["linear"],["zoom"],18,0,19,1]},layout:{"icon-image":["case",["==",["get","type"],"equirectangular"],"gvs-arrow-360","gvs-arrow-flat"],"icon-size":["interpolate",["linear"],["zoom"],18,.5,24,1],"icon-rotate":["to-number",["get","heading"]],"icon-allow-overlap":!0}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,2,14,4,16,5,22,3]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,kl+1,30,kl+2,0],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}}},Wl=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...pl.Av],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...pl.U3],1]],Ql=["case",["has","gps_accuracy"],["step",["get","gps_accuracy"],...pl.ql],1],wc=["round",["+",["*",Wl,pl.Xu],["*",Ql,pl.Bg]]];function getThumbGif(F){const Da=document.createElement("img");return Da.src=dl,Da.alt=F.loading,Da.title=F.loading,Da.classList.add("gvs-map-thumb","gvs-map-thumb-loader"),Da}function isLabelLayer(F){var Da;return"symbol"===F.type&&(null===F||void 0===F||null===(Da=F.layout)||void 0===Da?void 0:Da["text-field"])&&(void 0===F.minzoom||F.minzoom<15)}function combineStyles(F,Da){var ll,cl,hl;const dl=F._api.getMapStyle();if(dl.layers=dl.layers.concat(getMissingLayerStyles(dl.sources,dl.layers)),dl.metadata||(dl.metadata={}),Da.supplementaryStyle&&(Object.assign(dl.sources,Da.supplementaryStyle.sources||{}),Object.assign(dl.metadata,Da.supplementaryStyle.metadata||{}),dl.layers=dl.layers.concat(Da.supplementaryStyle.layers||[])),Da.raster&&(dl.sources["gvs-aerial"]=Da.raster,dl.layers.push({id:bl,type:"raster",source:"gvs-aerial",layout:{visibility:"aerial"===Da.background?"visible":"none"}})),null!==(ll=F._options)&&void 0!==ll&&null!==(cl=ll.users)&&void 0!==cl&&cl.includes("geovisio")||dl.layers.forEach((F=>{"geovisio"===F.source&&(F.layout||(F.layout={}),F.layout.visibility="none")})),dl.layers.sort(((F,Da)=>isLabelLayer(F)&&!isLabelLayer(Da)?1:!isLabelLayer(F)&&isLabelLayer(Da)?-1:F.id.startsWith("geovisio")&&!Da.id.startsWith("geovisio")?1:!F.id.startsWith("geovisio")&&Da.id.startsWith("geovisio")?-1:F.id.endsWith("_pictures")&&!Da.id.endsWith("_pictures")?1:!F.id.endsWith("_pictures")&&Da.id.endsWith("_pictures")?-1:0)),null!==(hl=dl.metadata)&&void 0!==hl&&hl["panoramax:locales"]||(dl.metadata["panoramax:locales"]=["fr","en","de","es","ru","pt","zh","hi","latin"]),dl.metadata["panoramax:locales"]){let Da=F._options.lang||(0,fl.D)(dl.metadata["panoramax:locales"],"latin");Da.includes("-")&&(Da=Da.split("-")[0]),Da.includes("_")&&(Da=Da.split("_")[0]),dl.layers.forEach((F=>{isLabelLayer(F)&&F.layout["text-field"].includes("name:latin")&&(F.layout["text-field"]=["coalesce",["get",`name:${Da}`],["get","name:latin"],["get","name"]])}))}const pl=dl.layers.find((F=>"place_label_city"==F.id));let Al=dl.layers.find((F=>"place_label_capital"==F.id));return pl&&!Al&&(pl.paint={"text-color":"hsl(0, 0%, 0%)","text-halo-blur":0,"text-halo-color":"hsla(0, 0%, 100%, 1)","text-halo-width":3},pl.layout["text-letter-spacing"]=.1,Al=JSON.parse(JSON.stringify(pl)),Al.id="place_label_capital",Al.filter.push(["<=","capital",2]),pl.filter.push([">","capital",2]),dl.layers.push(Al)),dl}function getMissingLayerStyles(F,Da){const ll=[];return Object.keys(F).filter((F=>void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.source)===F)))).forEach((F=>{F.startsWith("geovisio")&&(ll.push({id:`${F}_sequences`,type:"line",source:F,"source-layer":"sequences",layout:{...Dl.SEQUENCES.layout},paint:{...Dl.SEQUENCES.paint,"line-color":pl.lm.BASE}}),ll.push({id:`${F}_sequences_plus`,type:"line",source:F,"source-layer":"sequences",layout:{...Dl.SEQUENCES_PLUS.layout},paint:{...Dl.SEQUENCES_PLUS.paint}}),ll.push({id:`${F}_pictures_symbols`,type:"symbol",source:F,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),ll.push({id:`${F}_pictures_symbols`,type:"symbol",source:F,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),ll.push({id:`${F}_pictures`,type:"circle",source:F,"source-layer":"pictures",layout:{...Dl.PICTURES.layout},paint:{...Dl.PICTURES.paint,"circle-color":pl.lm.BASE}}))})),Da.filter((F=>{var ll;return(null===F||void 0===F||null===(ll=F.id)||void 0===ll?void 0:ll.endsWith("_sequences"))&&void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.id)===F.id+"_plus"))})).forEach((F=>{ll.push({id:`${F.id}_plus`,type:"line",source:F.source,"source-layer":F["source-layer"],layout:{...Dl.SEQUENCES_PLUS.layout},paint:{...Dl.SEQUENCES_PLUS.paint}})})),Da.filter((F=>{var ll;return(null===F||void 0===F||null===(ll=F.id)||void 0===ll?void 0:ll.endsWith("_pictures"))&&void 0===Da.find((Da=>(null===Da||void 0===Da?void 0:Da.id)===F.id+"_symbols"))})).forEach((F=>{ll.unshift({id:`${F.id}_symbols`,type:"symbol",source:F.source,"source-layer":"pictures",...Dl.PICTURES_SYMBOLS}),F.paint=Object.assign(F.paint||{},Dl.PICTURES.paint),F.layout=Object.assign(F.layout||{},Dl.PICTURES.layout)})),ll}function getUserLayerId(F,Da){return`${getUserSourceId(F)}_${Da}`}function getUserSourceId(F){return"geovisio"===F?"geovisio":"geovisio_"+F}function switchCoefValue(F,Da){if(Array.isArray(F))return F.map((F=>switchCoefValue(F,Da)));if("object"===typeof F&&null!==F){const ll={};for(const cl in F)ll[cl]=switchCoefValue(F[cl],Da);return ll}return"string"===typeof F&&F.startsWith("coef")?Da:F}function geocoderParamsToURLString(F){let Da={};return Object.entries(F).filter((F=>void 0!==F[1]&&null!==F[1])).forEach((F=>Da[F[0]]=F[1])),new URLSearchParams(Da).toString()}function forwardGeocodingNominatim(F){const Da={q:F.query,countrycodes:F.countries,limit:F.limit,viewbox:F.bbox};return fetch(`https://nominatim.openstreetmap.org/search?${geocoderParamsToURLString(Da)}&format=geojson&polygon_geojson=1&addressdetails=1`).then((F=>F.json())).then((F=>{const Da={features:[]},ll=[];return F.features.forEach((F=>{ll.includes(F.properties.display_name)||(Da.features.push({place_type:["place"],place_name:F.properties.display_name,bounds:new(hl().LngLatBounds)(F.bbox)}),ll.push(F.properties.display_name))})),Da}))}function forwardGeocodingBAN(F){const Da={q:F.query,limit:F.limit};if("string"===typeof F.proximity){const[ll,cl]=F.proximity.split(",").map((F=>parseFloat(F.trim())));Da.lat=ll,Da.lon=cl}const ll={housenumber:20,street:18,locality:15,municipality:12};return fetch(`https://api-adresse.data.gouv.fr/search/?${geocoderParamsToURLString(Da)}`).then((F=>F.json())).then((F=>(F.features=F.features.map((F=>{return{place_type:["place"],place_name:(Da=F.properties,[Da.name,Da.district,Da.city].filter((F=>F)).join(", ")),center:new(hl().LngLat)(...F.geometry.coordinates),zoom:ll[F.properties.type]};var Da})),F)))}},3727:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>PhotoAdapter});var cl=ll(3890);class PhotoAdapter extends cl.D{constructor(F,Da){super(F,Da),this._shouldGoFast=Da.shouldGoFast||(()=>!0)}loadTexture(F,Da){return F.origBaseUrl?F.baseUrl=F.origBaseUrl:F.origBaseUrl=F.baseUrl,this._shouldGoFast()&&F.thumbUrl&&!F.hdLoaded&&1==F.rows&&(F.baseUrl=F.thumbUrl),super.loadTexture(F,Da).then((Da=>(F.baseUrl===F.origBaseUrl&&(F.hdLoaded=!0),Da)))}__loadTiles(F){this._shouldGoFast()||super.__loadTiles(F)}}},5071:(F,Da,ll)=>{"use strict";ll.d(Da,{Av:()=>bl,Bg:()=>Wl,Ch:()=>getGrade,GZ:()=>isInIframe,I0:()=>linkMapAndPhoto,KF:()=>isInternetFast,U3:()=>Al,Xu:()=>Dl,Yf:()=>getDistance,bG:()=>getUserAccount,dK:()=>josmBboxParameters,dj:()=>getRelativeHeading,fW:()=>fl,lm:()=>pl,oi:()=>positionToXYZ,ql:()=>kl,rs:()=>apiFeatureToPSVNode,y7:()=>xyzToPosition});var cl=ll(654),hl=ll(8407),dl=ll(6830);const pl={BASE:"#FF6F00",SELECTED:"#1E88E5",HIDDEN:"#34495E",NEXT:"#ffab40",QUALI_1:"#00695C",QUALI_2:"#fd8d3c",PALETTE_1:"#fecc5c",PALETTE_2:"#fd8d3c",PALETTE_3:"#f03b20",PALETTE_4:"#bd0026"},fl=(Object.fromEntries(Object.entries(pl).map((F=>(F[1]=parseInt(F[1].slice(1),16),F)))),[{color:"#007f4e",label:"A"},{color:"#72b043",label:"B"},{color:"#b5be2f",label:"C"},{color:"#f8cc1b",label:"D"},{color:"#f6a020",label:"E"}]),Al=[1,10,2,15,3,30,4],bl=[3,15,4,30,5],kl=[5,1.01,4,2.01,3,5.01,2,10.01,1],Dl=.8,Wl=.2,Ql=svgToPSVLink(hl,"white"),wc=svgToPSVLink(dl,pl.NEXT);function getGrade(F,Da){if(null===Da||void 0===Da||""===Da)return null;for(let ll=0;ll<F.length;ll+=2){const cl=F[ll];if(Da<F[ll+1])return cl}return F[F.length-1]}function getDistance(F,Da){const ll=F[0]-Da[0],cl=F[1]-Da[1];return Math.sqrt(ll*ll+cl*cl)}function sortPicturesInDirection(F){return(Da,ll)=>"related"!=Da.rel&&"related"!=ll.rel?0:"related"!=Da.rel?-1:"related"!=ll.rel?1:Da.date==ll.date?getDistance(F,Da.geometry.coordinates)-getDistance(F,ll.geometry.coordinates):ll.date.localeCompare(Da.date)}function svgToPSVLink(F,Da){try{const ll=atob(F.replace(/^data:image\/svg\+xml;base64,/,"")),cl=(new DOMParser).parseFromString(ll,"image/svg+xml").childNodes[0],hl=document.createElement("button");return hl.appendChild(cl),hl.classList.add("gvs-psv-tour-arrows"),hl.style.color=Da,hl}catch(ll){const Da=document.createElement("img");return Da.src=F,Da.alt="",Da}}function getArrow(F){const Da=F.cloneNode(!0);return Da.addEventListener("pointerup",(()=>Da.classList.add("gvs-clicked"))),Da}function getAzimuth(F,Da){return(Math.atan2(Da[0]-F[0],Da[1]-F[1])*(180/Math.PI)+360)%360}function getRelativeHeading(F){var Da,ll;if(!F)throw new Error("No picture selected");let cl,hl;const dl=F.properties["view:azimuth"];if(null!==F&&void 0!==F&&null!==(Da=F.sequence)&&void 0!==Da&&Da.prevPic){var pl;const Da=null===F||void 0===F||null===(pl=F.links)||void 0===pl?void 0:pl.find((Da=>Da.nodeId===F.sequence.prevPic));Da&&(cl=(dl-getAzimuth(Da.gps,F.gps)+180)%360-180)}if(null!==F&&void 0!==F&&null!==(ll=F.sequence)&&void 0!==ll&&ll.nextPic){var fl;const Da=null===F||void 0===F||null===(fl=F.links)||void 0===fl?void 0:fl.find((Da=>Da.nodeId===F.sequence.nextPic));Da&&(hl=(dl-getAzimuth(F.gps,Da.gps)+180)%360-180)}return void 0!==cl?cl:void 0!==hl?hl:0}function getSimplifiedAngle(F,Da){const ll=Math.atan2(Da[0]-F[0],Da[1]-F[1])*(180/Math.PI);return Math.abs(ll)<30?"N":ll>=30&&ll<90?"ENE":ll>=90&&ll<150?"ESE":Math.abs(ll)>=150?"S":ll<=-30&&ll>-90?"WNW":ll<=-90&&ll>-150?"WSW":void 0}function positionToXYZ(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const ll={x:F.yaw*(180/Math.PI),y:F.pitch*(180/Math.PI)};return void 0!==Da&&(ll.z=Da),ll}function xyzToPosition(F,Da,ll){return{yaw:F/(180/Math.PI),pitch:Da/(180/Math.PI),zoom:ll}}function getNodeCaption(F,Da){var ll,cl,hl;const dl={};if(null!==F&&void 0!==F&&null!==(ll=F.properties)&&void 0!==ll&&ll.datetimetz?dl.date=new Date(F.properties.datetimetz):null!==F&&void 0!==F&&null!==(cl=F.properties)&&void 0!==cl&&cl.datetime&&(dl.date=new Date(F.properties.datetime)),null!==F&&void 0!==F&&F.providers){var pl;const Da=null===F||void 0===F||null===(pl=F.providers)||void 0===pl?void 0:pl.filter((F=>{var Da;return null===F||void 0===F||null===(Da=F.roles)||void 0===Da?void 0:Da.includes("producer")}));if((null===Da||void 0===Da?void 0:Da.length)>=0){const F={};Da.map((F=>F.name)).forEach((Da=>{const ll=Da.toLowerCase().replace(/\s/g,"");F[ll]?F[ll].push(Da):F[ll]=[Da]})),dl.producer=[],Object.values(F).forEach((F=>{const Da=F[0],ll=F.find((F=>F.toLowerCase()!=F));dl.producer.push(ll||Da)})),dl.producer=dl.producer.join(", ")}}if(null!==F&&void 0!==F&&null!==(hl=F.properties)&&void 0!==hl&&hl.license&&(dl.license=F.properties.license,null!==F&&void 0!==F&&F.links)){const ll=F.links.find((F=>"license"===(null===F||void 0===F?void 0:F.rel)));ll&&(dl.license=`<a href="${ll.href}" title="${Da.gvs.metadata_general_license_link}" target="_blank">${dl.license}</a>`)}return dl}function linkMapAndPhoto(F){const onPicLoad=Da=>F.map.displayPictureMarker(Da.detail.lon,Da.detail.lat,F.psv.getXY().x);F.addEventListener("psv:picture-loading",onPicLoad),F.addEventListener("psv:picture-loaded",onPicLoad),F.addEventListener("psv:view-rotated",(()=>{let Da=F.psv.getPosition().yaw*(180/Math.PI);Da+=F.psv.getPictureOriginalHeading(),F.map._picMarker.setRotation(Da)})),F.addEventListener("psv:picture-preview-started",(Da=>{F.map._picMarkerPreview.setLngLat(Da.detail.coordinates).setRotation(Da.detail.direction||0).addTo(F.map)})),F.addEventListener("psv:picture-preview-stopped",(()=>{F.map._picMarkerPreview.remove()})),F.addEventListener("psv:picture-loaded",(Da=>{F.isWidthSmall()&&F._picPopup&&Da.detail.picId==F._picPopup._picId&&F._picPopup.remove()})),F.addEventListener("map:picture-click",(Da=>{F.select(Da.detail.seqId,Da.detail.picId),!F.psv._myVTour.state.currentNode&&null!==F&&void 0!==F&&F.setFocus&&F.setFocus("pic")})),F.addEventListener("map:sequence-click",(Da=>{F._api.getPicturesAroundCoordinates(Da.detail.coordinates.lat,Da.detail.coordinates.lng,1,1,Da.detail.seqId).then((Da=>{var ll,cl;(null===Da||void 0===Da||null===(ll=Da.features)||void 0===ll?void 0:ll.length)>0&&(F.select(null===(cl=Da.features[0])||void 0===cl?void 0:cl.collection,Da.features[0].id),!F.psv.getPictureMetadata()&&null!==F&&void 0!==F&&F.setFocus&&F.setFocus("pic"))}))}))}function apiFeatureToPSVNode(F,Da){var ll,hl,dl,pl,fl,Al,bl;let kl=arguments.length>2&&void 0!==arguments[2]&&arguments[2],Dl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const Wl=null!=(null===(ll=F.properties)||void 0===ll||null===(hl=ll["pers:interior_orientation"])||void 0===hl?void 0:hl.field_of_view);let Ql=Wl?parseInt(F.properties["pers:interior_orientation"].field_of_view):70;const wc=360===Ql,Sc=(Object.values(F.assets).find((F=>{var Da;return null===F||void 0===F||null===(Da=F.roles)||void 0===Da?void 0:Da.includes("data")}))||{}).href,eu=null===F||void 0===F||null===(dl=F.properties)||void 0===dl||null===(pl=dl["tiles:tile_matrix_sets"])||void 0===pl?void 0:pl.geovisio,iu=F.links.find((F=>"prev"===(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))),su=F.links.find((F=>"next"===(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))),cu=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("visual"))&&"image/webp"===F.type})),uu=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("visual"))&&"image/jpeg"===F.type})),hu=(cu||uu).href,Lu=null===(fl=Object.values(F.assets).find((F=>{var Da;return(null===(Da=F.roles)||void 0===Da?void 0:Da.includes("thumbnail"))&&"image/jpeg"===F.type})))||void 0===fl?void 0:fl.href,zu=(null===F||void 0===F||null===(Al=F.asset_templates)||void 0===Al?void 0:Al.tiles_webp)||(null===F||void 0===F||null===(bl=F.asset_templates)||void 0===bl?void 0:bl.tiles),Du=(0,cl.qx)(F);let Nu;Nu=!zu&&Object.keys(Du).length>0?{baseUrl:kl?Sc:hu,origBaseUrl:kl?Sc:hu,hdUrl:Sc,thumbUrl:Lu,basePanoData:Du,cols:2,rows:1,width:2,tileUrl:()=>null}:wc&&eu?{baseUrl:hu,origBaseUrl:hu,basePanoData:F=>({fullWidth:F.width,fullHeight:F.height}),hdUrl:Sc,thumbUrl:Lu,cols:eu&&eu.tileMatrix[0].matrixWidth,rows:eu&&eu.tileMatrix[0].matrixHeight,width:eu&&eu.tileMatrix[0].matrixWidth*eu.tileMatrix[0].tileWidth,tileUrl:eu&&((F,Da)=>zu.href.replace(/\{TileCol\}/g,F).replace(/\{TileRow\}/g,Da))}:{baseUrl:kl?Sc:hu,origBaseUrl:kl?Sc:hu,hdUrl:Sc,thumbUrl:Lu,basePanoData:F=>{F.width<F.height&&!Wl&&(Ql=35);const Da=Ql*F.height/F.width,ll=360*F.width/Ql,cl=180*F.height/Da;return{fullWidth:ll,fullHeight:cl,croppedWidth:F.width,croppedHeight:F.height,croppedX:(ll-F.width)/2,croppedY:(cl-F.height)/2}},cols:2,rows:1,width:2,tileUrl:()=>null};return{id:F.id,caption:getNodeCaption(F,Da),panorama:Nu,links:filterRelatedPicsLinks(F,Dl),gps:F.geometry.coordinates,sequence:{id:F.collection,nextPic:su?su.id:void 0,prevPic:iu?iu.id:void 0},sphereCorrection:(0,cl.MY)(F),horizontalFov:Ql,properties:F.properties}}function filterRelatedPicsLinks(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const cl=F.links.filter((F=>["next","prev","related"].includes(null===F||void 0===F?void 0:F.rel)&&"application/geo+json"===(null===F||void 0===F?void 0:F.type))).filter((F=>!ll||ll(F))).map((F=>(F.datetime&&(F.date=F.datetime.split("T")[0]),F))),hl=F.geometry.coordinates,dl=[],pl={N:[],ENE:[],ESE:[],S:[],WSW:[],WNW:[]};for(let Al of cl){pl[getSimplifiedAngle(hl,Al.geometry.coordinates)].push(Al)}for(let Al in pl){const F=pl[Al];0!=F.length&&(F.sort(sortPicturesInDirection(hl)),dl.push(F.shift()))}let arrowStyle=F=>"related"===F.rel?{element:getArrow(wc),size:{width:128/3,height:128}}:{element:getArrow(Ql),size:{width:75,height:75}};const fl=-((null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"])||0)*(Math.PI/180);return dl.map((F=>({nodeId:F.id,gps:F.geometry.coordinates,arrowStyle:arrowStyle(F),linkOffset:{yaw:fl}})))}function josmBboxParameters(F){if(F){var Da;const ll=F.gps,cl=null===F||void 0===F||null===(Da=F.properties)||void 0===Da?void 0:Da["view:azimuth"],hl=2e-4,dl={left:ll[0]-(null===cl||cl>=180?hl:0),right:ll[0]+(null===cl||cl<=180?hl:0),top:ll[1]+(null===cl||cl<=90||cl>=270?hl:0),bottom:ll[1]-(null===cl||cl>=90&&cl<=270?hl:0),changeset_source:"Panoramax"};return Object.entries(dl).map((F=>F.join("="))).join("&")}return null}function isInIframe(){try{return window.self!==window.top}catch(F){return!0}}const Sc=10,eu="gvs-internet-fast",iu="https://panoramax.openstreetmap.fr/images/05/ca/2c/98/0111-4baf-b6f3-587bb8847d2e.jpg";function isInternetFast(){try{const F=navigator.connection.downlink;return Promise.resolve(F>=Sc)}catch(F){try{const F=sessionStorage.getItem(eu);if(["true","false"].includes(F))return Promise.resolve("true"===F);const Da=(new Date).getTime();return fetch(iu+"?nocache="+Da).then((async F=>[F,await F.blob()])).then((F=>{let[ll,cl]=F;const hl=8*parseInt(ll.headers.get("Content-Length")||cl.size)/1024/1024/(((new Date).getTime()-Da)/1e3)>=Sc;return sessionStorage.setItem(eu,hl?"true":"false"),hl})).catch((F=>(console.warn("Failed to run speedtest",F),!1)))}catch(F){return Promise.resolve(!1)}}}function getCookie(F){var Da,ll,cl;const hl=null===(Da=document.cookie)||void 0===Da||null===(ll=Da.split(";"))||void 0===ll||null===(cl=ll.find((Da=>Da.trimStart().startsWith(`${F}=`))))||void 0===cl?void 0:cl.split("=");if(hl)return hl.shift(),hl.join("=")}function getUserAccount(){const F=getCookie("session"),Da=getCookie("user_id"),ll=getCookie("user_name");return F&&Da&&ll?{id:Da,name:ll}:null}},4683:(F,Da,ll)=>{"use strict";ll.d(Da,{$c:()=>enableCopyButton,Ij:()=>createHeader,Lt:()=>showQualityScore,OZ:()=>createSearchBar,Qt:()=>fat,Tf:()=>createButton,W_:()=>closeOtherPanels,Y8:()=>enableButton,ZR:()=>createTable,do:()=>createButtonSpan,fM:()=>showGrade,fP:()=>createLinkCell,fa:()=>fa,fp:()=>createLabel,np:()=>createExpandableButton,t_:()=>createPanel,vI:()=>disableButton,wj:()=>createGroup});var cl=ll(3710),hl=ll(6627),dl=ll(4011),pl=ll(2593),fl=ll(7761),Al=ll(3444),bl=ll(174),kl=ll(4189),Dl=ll(4780),Wl=ll(7325),Ql=ll(5071);function createButton(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const hl=document.createElement("button");return Da&&(Da instanceof HTMLElement||Da instanceof Node?hl.appendChild(Da):hl.innerHTML=Da),hl.id=F,Array.isArray(cl)&&(cl=cl.filter((F=>null!=F&&F.length>0))),hl.classList.add("gvs-btn","gvs-widget-bg",...cl),ll&&(hl.title=ll),hl}function createExpandableButton(F,Da,ll,cl){let dl=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const fl=document.createElement("button");if(fl.id=F,fl.appendChild(fa(Da)),cl._viewer.isWidthSmall())fl.title=ll;else{if(fl.appendChild(document.createTextNode(ll)),dl.includes("gvs-filter-unset-btn")){const F=fa(hl.Jy,{classes:["gvs-filter-unset-btn"]});F.style.display="none",fl.appendChild(F),dl=dl.filter((F=>"gvs-filter-unset-btn"!==F))}fl.appendChild(fa(pl.Jt))}return fl.classList.add("gvs-btn","gvs-widget-bg","gvs-btn-expandable",...dl),fl.setActive=F=>{let Da=fl.querySelector(".gvs-filters-active");const ll=fl.querySelector(".gvs-filter-unset-btn"),cl=fl.querySelector(".fa-chevron-down");if(F&&!Da){Da=document.createElement("span"),Da.classList.add("gvs-filters-active");const F=fl.querySelector("svg");F.nextSibling?fl.insertBefore(Da,F.nextSibling):fl.appendChild(Da),ll&&(ll.style.display=null,cl.style.display="none")}else!F&&Da&&(Da.remove(),ll&&(ll.style.display="none",cl.style.display=null))},fl}function createSearchBar(F,Da,ll,cl,pl){let bl=arguments.length>5&&void 0!==arguments[5]&&arguments[5],kl=arguments.length>6&&void 0!==arguments[6]&&arguments[6],Dl=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;const Wl=document.createElement("div");Wl.classList.add("gvs-widget-bg","gvs-search-bar"),Wl.id=F,kl&&Wl.classList.add("gvs-search-bar-reducable"),Dl&&Wl.appendChild(Dl);const Ql=document.createElement("input");Ql.type="text",Ql.placeholder=Da,Ql.id=`${F}-input`,Ql.setAttribute("autocomplete","off"),Wl.appendChild(Ql);const extendInput=()=>{Wl.classList.remove("gvs-search-bar-reduced")},reduceInput=()=>{Wl.classList.add("gvs-search-bar-reduced")};kl&&reduceInput();const wc=document.createElement("span");wc.classList.add("gvs-search-bar-icon");const Sc=fa(fl.$U),eu=fa(Al.s4,{classes:["fa-spin"]}),iu=fa(hl.Jy),su=fa(dl.lE);wc.appendChild(Sc),Wl.appendChild(wc);const cu=createPanel(pl,Wl,[],["gvs-search-bar-results"],bl);Wl.appendChild(cu);const switchIcon=F=>{wc.innerHTML="",wc.appendChild(F)},resetSearch=()=>{Wl._throttler&&clearTimeout(Wl._throttler),Ql.value="",cu.innerHTML="",cu._toggle(!1),delete Wl._lastSearch,switchIcon(Sc),cl(null),kl&&reduceInput()};Wl.resetSearch=resetSearch,Ql.goItem=F=>{kl?(cl(F),resetSearch()):(Wl._throttler&&clearTimeout(Wl._throttler),Ql.value=F.title,cu.innerHTML="",cu._toggle(!1),switchIcon(iu),cl(F))},Ql.setItem=F=>{Wl._throttler&&clearTimeout(Wl._throttler),Ql.value=F,cu.innerHTML="",cu._toggle(!1),switchIcon(iu),kl&&extendInput()};const goSearch=()=>{if(Wl._throttler&&clearTimeout(Wl._throttler),0===Ql.value.length)return cu.innerHTML="",void cu._toggle(!1);Wl._throttler=setTimeout((()=>{cu.innerHTML="",cu._toggle(!1),switchIcon(eu),ll(Ql.value).then((F=>{switchIcon(iu),cu._toggle(!0),F&&0!=F.length?!0!==F?F.forEach((F=>{const Da=document.createElement("div");Da.classList.add("gvs-search-bar-result"),Da.innerHTML=`${F.title}<br /><small>${(null===F||void 0===F?void 0:F.subtitle)||""}</small>`,cu.appendChild(Da),Da.addEventListener("click",(()=>Ql.goItem(F)))})):cu._toggle(!1):cu.innerHTML=`<div class="gvs-search-empty">${pl._t.gvs.search_empty}</li>`})).catch((F=>{console.error(F),switchIcon(su)}))}),250)};return Ql.addEventListener("change",goSearch),Ql.addEventListener("keypress",goSearch),Ql.addEventListener("paste",goSearch),Ql.addEventListener("input",goSearch),wc.addEventListener("click",(()=>{wc.firstChild!=iu&&wc.firstChild!=su||resetSearch(),kl&&wc.firstChild==Sc&&(Wl.classList.contains("gvs-search-bar-reduced")?extendInput():reduceInput())})),Wl}function createPanel(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],hl=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const dl=document.createElement("div");dl.id=Da.id+"-panel",Array.isArray(cl)&&(cl=cl.filter((F=>null!=F&&F.length>0))),dl.classList.add("gvs-panel","gvs-widget-bg","gvs-hidden",...cl);for(let pl of ll)dl.appendChild(pl);const togglePanel=(Da,ll)=>{Da&&Da.stopPropagation(),!0===ll?dl.classList.remove("gvs-hidden"):!1===ll?dl.classList.add("gvs-hidden"):(dl.classList.toggle("gvs-hidden"),ll=!dl.classList.contains("gvs-hidden")),ll&&!hl&&closeOtherPanels(dl,F._viewer.container)};return dl._toggle=F=>togglePanel(null,F),"BUTTON"==Da.tagName&&(Da.addEventListener("click",togglePanel),Da.addEventListener("hover",togglePanel)),dl}function closeOtherPanels(F,Da){var ll;const isPanel=F=>F.classList.contains("gvs-panel")||F.classList.contains("gvs-search-bar-result")||F.classList.contains("gvs-search-empty")||F.classList.contains("gvs-search-bar-reducable");if(!isPanel(F)&&null!==(ll=F)&&void 0!==ll&&ll.parentNode)for(F=F.parentNode;F instanceof Element&&!isPanel(F);)F=F.parentNode;for(const cl of Da.getElementsByClassName("gvs-panel"))cl==F||cl.contains(F)||cl.classList.contains("gvs-hidden")||cl.classList.add("gvs-hidden");for(const cl of Da.getElementsByClassName("gvs-search-bar-reducable"))cl==F||cl.contains(F)||cl.classList.contains("gvs-search-bar-reduced")||cl.resetSearch()}function createGroup(F,Da,ll){let cl=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],hl=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const dl=document.createElement("div");dl.id=F,Array.isArray(hl)&&(hl=hl.filter((F=>null!=F&&F.length>0))),dl.classList.add("gvs-group",...hl);for(let pl of cl)dl.appendChild(pl);return ll._corners[Da].appendChild(dl),dl}function enableCopyButton(F,Da){for(let ll of F.getElementsByTagName("button")){const F=ll.getAttribute("data-input"),cl=ll.getAttribute("data-copy");(F||cl)&&ll.addEventListener("click",(()=>{let hl;if(F){const Da=document.getElementById(F);hl=Da.innerText||Da.value}else cl&&(hl=ll.getAttribute("data-copy"));navigator.clipboard.writeText(hl);const dl=ll.innerHTML;ll.innerHTML=`${Da.gvs.copied} ${fat(bl.e6)}`,ll.classList.add("gvs-btn-active"),setTimeout((()=>{ll.innerHTML=dl,ll.classList.remove("gvs-btn-active")}),2e3)}))}}function enableButton(F){F.removeAttribute("disabled")}function disableButton(F){F.setAttribute("disabled","")}function fa(F,Da){return(0,cl.Kk)(F,Da).node[0]}function fat(F,Da){return(0,cl.Kk)(F,Da).html[0]}function createLinkCell(F,Da,ll,cl){const hl=document.createElement("a");hl.href=Da,hl.target="_blank",hl.title=ll,hl.textContent=F;return[hl,createButtonSpan(`${fat(kl.jP)} ${cl}`,F)]}function createTable(F,Da){const ll=document.createElement("table");return ll.className=F,Da.forEach((F=>{let{section:Da,value:cl,values:hl,classes:dl}=F;const pl=document.createElement("tr"),fl=document.createElement("th");fl.scope="row",fl.textContent=Da,pl.appendChild(fl);const Al=document.createElement("td");dl&&Al.classList.add(...dl),hl?hl.forEach((F=>Al.appendChild(F))):cl instanceof HTMLElement?Al.appendChild(cl):Al.innerHTML=cl,pl.appendChild(Al),ll.appendChild(pl)})),ll}function createHeader(F,Da){const ll=document.createElement(F);return ll.innerHTML=Da,ll}function createButtonSpan(F){let Da=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const ll=document.createElement("button");ll.innerHTML=F,Da&&ll.setAttribute("data-copy",Da);const cl=document.createElement("span");return cl.className="gvs-input-btn",cl.appendChild(ll),cl}function createLabel(F,Da){let ll=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const cl=document.createElement("label");return cl.htmlFor=F,ll&&cl.appendChild(fa(ll)),cl.appendChild(document.createTextNode(Da)),cl}function showGrade(F,Da){let ll='<span class="gvs-grade">';for(let cl=1;cl<=F;cl++)ll+=fat(Dl.yy);for(let cl=F+1;cl<=5;cl++)ll+=fat(Wl.yy);return ll+="</span> (",ll+=null===F?Da.gvs.metadata_quality_missing+")":F+"/5)",ll}function showQualityScore(F){const Da=document.createElement("span");for(let ll=1;ll<=Ql.fW.length;ll++){const cl=Ql.fW[ll-1],hl=document.createElement("span");hl.appendChild(document.createTextNode(cl.label)),hl.classList.add("gvs-qualityscore"),hl.style.backgroundColor=cl.color,ll===6-F&&hl.classList.add("gvs-qualityscore-selected"),Da.appendChild(hl)}return Da}},9194:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>URLHash});const cl={minDate:"date_from",maxDate:"date_to",type:"pic_type",camera:"camera",theme:"theme",qualityscore:"pic_score"},hl=Object.fromEntries(Object.entries(cl).map((F=>[F[1],F[0]]))),dl=["psv:view-rotated","psv:picture-loaded","focus-changed","filters-changed","psv:transition-duration-changed","map:background-changed","map:users-changed","pictures-navigation-changed"];class URLHash extends EventTarget{constructor(F){super(),this._viewer=F,this._delay=null,this._hashChangeHandler=this._onHashChange.bind(this),F.addEventListener("ready",(()=>{window.addEventListener("hashchange",this._hashChangeHandler,!1),dl.forEach((F=>this._viewer.addEventListener(F,this._updateHash.bind(this))))}),{once:!0})}destroy(){var F,Da;window.removeEventListener("hashchange",this._hashChangeHandler),delete this._hashChangeHandler,null===(F=this._viewer)||void 0===F||null===(Da=F.map)||void 0===Da||Da.off("moveend",this._updateHash),dl.forEach((F=>this._viewer.removeEventListener(F,this._updateHash))),delete this._viewer,this._updateHash()}bindMapEvents(){this._viewer.map.on("moveend",this._updateHash.bind(this))}_getHashParts(){let F={};"number"==typeof this._viewer.psv.getTransitionDuration()&&(F.speed=this._viewer.psv.getTransitionDuration()),[null,"any"].includes(this._viewer.getPicturesNavigation())||(F.nav=this._viewer.getPicturesNavigation());const Da=this._viewer.psv.getPictureMetadata();if(Da&&(F.pic=Da.id,F.xyz=this._getXyzHashString()),this._viewer.map){F.map=this._getMapHashString(),F.focus="pic",this._viewer.isMapWide()&&(F.focus="map"),this._viewer.popupContainer.classList.contains("gvs-hidden")||(F.focus="meta"),this._viewer.map.hasTwoBackgrounds()&&this._viewer.map.getBackground()&&(F.background=this._viewer.map.getBackground());const Da=this._viewer.map.getVisibleUsers();if((Da.length>1||!Da.includes("geovisio"))&&(F.users=Da.join(",")),this._viewer._mapFilters){for(let Da in cl)this._viewer._mapFilters[Da]&&(F[cl[Da]]=this._viewer._mapFilters[Da]);if(F.pic_score){const Da=[null,"E","D","C","B","A"];F.pic_score=F.pic_score.map((F=>Da[F])).join("")}}}else F.map="none";return F}getHashString(){let F="";return Object.entries(this._getHashParts()).sort(((F,Da)=>F[0].localeCompare(Da[0]))).forEach((Da=>{let[ll,cl]=Da,hl=!1;const dl=F.split("&").map((F=>{const Da=F.split("=")[0];return Da===ll?(hl=!0,`${Da}=${cl}`):F})).filter((F=>F));hl||dl.push(`${ll}=${cl}`),F=`${dl.join("&")}`})),`#${F}`.replace(/^#+/,"#")}_getCurrentHash(){const F=window.location.hash.replace("#","");let Da={};if(F.split("&").map((F=>F.split("="))).filter((F=>void 0!==F[0]&&F[0].length>0)).forEach((F=>{Da[F[0]]=F[1]})),Da.s){const F=Object.fromEntries(Da.s.split(";").map((F=>[F[0],F.substring(1)])));Da={},"m"===F.f?Da.focus="map":"p"===F.f?Da.focus="pic":"t"===F.f&&(Da.focus="meta"),""!==F.s&&(Da.speed=100*parseFloat(F.s)),"a"===F.n?Da.nav="any":"s"===F.n&&(Da.nav="seq"),"n"===F.n&&(Da.nav="none"),""!==F.p&&(Da.pic=F.p),""!==F.c&&(Da.xyz=F.c),""!==F.m&&(Da.map=F.m),""!==F.d&&(Da.date_from=F.d),""!==F.e&&(Da.date_to=F.e),"f"===F.t?Da.pic_type="flat":"e"===F.t&&(Da.pic_type="equirectangular"),""!==F.k&&(Da.camera=F.k),"d"===F.v?Da.theme="default":"a"===F.v?Da.theme="age":"t"===F.v?Da.theme="type":"s"===F.v&&(Da.theme="score"),"s"===F.b?Da.background="streets":"a"===F.b&&(Da.background="aerial"),""!==F.u&&(Da.users=F.u),""!==F.q&&(Da.pic_score=F.q)}return Da}_getMapHashString(){const F=this._viewer.map.getCenter(),Da=Math.round(100*this._viewer.map.getZoom())/100,ll=Math.ceil((Da*Math.LN2+Math.log(512/360/.5))/Math.LN10),cl=Math.pow(10,ll),hl=Math.round(F.lng*cl)/cl,dl=Math.round(F.lat*cl)/cl,pl=this._viewer.map.getBearing(),fl=this._viewer.map.getPitch();let Al=`${Da}/${dl}/${hl}`;return(pl||fl)&&(Al+="/"+Math.round(10*pl)/10),fl&&(Al+=`/${Math.round(fl)}`),Al}_getXyzHashString(){const F=this._viewer.psv.getXYZ();return`${F.x.toFixed(2)}/${F.y.toFixed(2)}/${Math.round(F.z||0)}`}_onHashChange(){let F=this._getCurrentHash();if(F.pic){const Da=F.pic.split(";");Da.length>1&&console.warn("Multiple picture IDs passed in URL, only first one kept"),this._viewer.select(null,Da[0])}if(F.focus&&["map","pic"].includes(F.focus)&&this._viewer.setFocus(F.focus),F.focus&&"meta"==F.focus&&this._viewer._widgets._showPictureMetadataPopup(),void 0!==F.speed&&this._viewer.psv.setTransitionDuration(F.speed),F.map&&this._viewer.map){const Da=this.getMapOptionsFromHashString(F.map);Da&&this._viewer.map.jumpTo(Da);let ll=(F.users||"").split(",");(0===ll.length||1===ll.length&&""===ll[0].trim())&&(ll=["geovisio"]),this._viewer.map.setVisibleUsers(ll)}if(F.xyz){const Da=this.getXyzOptionsFromHashString(F.xyz);this._viewer.psv.setXYZ(Da.x,Da.y,Da.z)}this._viewer.setFilters(this.getMapFiltersFromHashVals(F)),["aerial","streets"].includes(F.background)&&this._viewer.map.setBackground(F.background),["pic","any","seq"].includes(F.nav)&&this._viewer.setPicturesNavigation(F.nav)}getShortLink(F){const Da=new URL(F),ll=this._getHashParts(),cl={f:(ll.focus||"").substring(0,1),s:isNaN(parseInt(ll.speed))?void 0:Math.floor(parseInt(ll.speed)/100),n:(ll.nav||"").substring(0,1),p:ll.pic,c:ll.xyz,m:ll.map,d:ll.date_from,e:ll.date_to,t:(ll.pic_type||"").substring(0,1),k:ll.camera,v:(ll.theme||"").substring(0,1),b:(ll.background||"").substring(0,1),u:ll.users,q:ll.pic_score},hl=Object.entries(cl).filter((F=>{let[,Da]=F;return void 0!=Da&&""!=Da})).map((F=>{let[Da,ll]=F;return`${Da}${ll}`})).join(";");return Da.hash=`s=${hl}`,Da}getMapFiltersFromHashVals(F){const Da={};for(let ll in hl)F[ll]&&(Da[hl[ll]]=F[ll]);if(Da.qualityscore){let F=Da.qualityscore.split("");const ll={A:5,B:4,C:3,D:2,E:1};Da.qualityscore=F.map((F=>ll[F]))}return Da}getMapOptionsFromHashString(F){const Da=F.split("/");if(Da.length>=3&&!Da.some((F=>isNaN(F)))){const F={center:[+Da[2],+Da[1]],zoom:+Da[0],pitch:+(Da[4]||0)};return this._viewer.map&&(F.bearing=this._viewer.map.dragRotate.isEnabled()&&this._viewer.map.touchZoomRotate.isEnabled()?+(Da[3]||0):this._viewer.map.getBearing()),F}return null}getXyzOptionsFromHashString(F){const Da=F.split("/");if(3!==Da.length||Da.some((F=>isNaN(F))))return null;return{x:+Da[0],y:+Da[1],z:+Da[2]}}_updateHash(){this._delay&&(clearTimeout(this._delay),this._delay=null),this._delay=setTimeout((()=>{var F,Da,ll;const cl=new URL(window.location.href),hl=new URL(window.location.href);if(hl.hash=this._viewer?this.getHashString():"",cl.hash==hl.hash)return;const dl=this._getCurrentHash().pic||"",pl=(null===(F=this._viewer)||void 0===F||null===(Da=F.psv)||void 0===Da||null===(ll=Da.getPictureMetadata())||void 0===ll?void 0:ll.id)||"";try{if(dl!=pl?window.history.pushState(window.history.state,null,hl.href):window.history.replaceState(window.history.state,null,hl.href),this._viewer){const F=new CustomEvent("url-changed",{detail:{url:hl.href}});this.dispatchEvent(F)}}catch(fl){}}),500)}}},490:(F,Da,ll)=>{"use strict";ll.d(Da,{A:()=>Widgets});ll(307);var cl=ll(2968),hl=ll(4683),dl=ll(5071),pl=ll(1462),fl=ll(5721),Al=ll(7534),bl=ll(6810),kl=ll(654),Dl=ll(1372),Wl=ll(7290),Ql=ll(1260),wc=ll(7964),Sc=ll(2e3),eu=ll(5279),iu=ll(9683),su=ll(6386),cu=ll(1705),uu=ll(5431),hu=ll(7472),Lu=ll(9186),zu=ll(6069),Du=ll(99),Nu=ll(7321),qu=ll(501),ih=ll(6787),gh=ll(6533),ed=ll(7744),td=ll(8629),id=ll(325),nd=ll(9243),rd=ll(1904),ad=ll(4220),sd=ll(7172),od=ll(7879),ld=ll(7516),cd=ll(8739),ud=ll(3520),hd=ll(3095),dd=ll(4162),pd=ll(4189),md=ll(6311),fd=ll(9564),gd=ll(2975),Ad=ll(4881),yd=ll(1708),vd=ll(3233),_d=ll(6668);class Widgets{constructor(F){var Da;let ll=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};null==ll&&(ll={}),null==ll.editIdUrl&&(ll.editIdUrl="https://www.openstreetmap.org/edit"),this._viewer=F,this._t=this._viewer._t,this._options=ll;const cl=void 0!==this._viewer.map;this._corners={};const pl=cl?["main","mini"]:["main"],fl=["top","bottom"],Al=["left","middle","right"];for(let hl of pl)for(let F of fl){const Da=document.createElement("div");Da.id=`gvs-corner-${hl}-${F}`,Da.classList.add("gvs-corner-space");for(let ll of Al){const cl=document.createElement("div");cl.id=`${Da.id}-${ll}`,cl.classList.add("gvs-corner"),this._corners[`${hl}-${F}-${ll}`]=cl,Da.appendChild(cl)}"main"==hl?this._viewer.mainContainer.appendChild(Da):"mini"==hl&&this._viewer.miniContainer.appendChild(Da)}if((0,dl.GZ)()||this._initWidgetPlayer(cl),this._initWidgetLegend(cl,null===(Da=ll)||void 0===Da?void 0:Da.mapAttribution),cl&&(this._initWidgetMiniActions(),(0,dl.GZ)()||(this._initWidgetSearch(),this._initWidgetFilters(null!==this._viewer._api._endpoints.user_search&&null!==this._viewer._api._endpoints.user_tiles,this._viewer.map&&this._viewer.map._hasQualityScore()),this._initWidgetMapLayers(),this._listenMapFiltersChanges())),this._viewer.isWidthSmall()||this._initWidgetShare(),ll.customWidget){const F=this._corners["main-bottom-right"];switch(typeof ll.customWidget){case"string":for(let Da of(new DOMParser).parseFromString(ll.customWidget,"text/html").body.children)F.appendChild(Da);break;case"object":Array.isArray(ll.customWidget)?ll.customWidget.forEach((Da=>F.appendChild(Da))):F.appendChild(ll.customWidget)}}this._initWidgetZoom(cl),this._viewer.container.addEventListener("click",(F=>(0,hl.W_)(F.target,this._viewer.container)))}destroy(){Object.values(this._corners).forEach((F=>F.remove())),delete this._corners,delete this._t,delete this._viewer}_initWidgetZoom(F){this._lastWantedZoom=this._viewer.psv.getZoomLevel();const Da=(0,hl.Tf)("gvs-zoom-in",(0,hl.fa)(Dl.QL),this._t.gvs.zoomIn),ll=(0,hl.Tf)("gvs-zoom-out",(0,hl.fa)(Wl.EZ),this._t.gvs.zoomOut);(0,hl.wj)("gvs-widget-zoom","main-bottom-right",this,[Da,ll],["gvs-group-vertical","gvs-mobile-hidden","gvs-print-hidden"]);const zoomFct=(Da,ll)=>{if(F&&this._viewer.isMapWide())ll?this._viewer.map.zoomIn({},{originalEvent:Da}):this._viewer.map.zoomOut({},{originalEvent:Da});else{this._viewer.lastPsvAnim&&this._viewer.lastPsvAnim.cancel();const F=ll?Math.min(100,this._lastWantedZoom+cl.$p):Math.max(0,this._lastWantedZoom-cl.$p);this._viewer.lastPsvAnim=this._viewer.psv.animate({speed:cl.LM,zoom:F}),this._lastWantedZoom=F}};Da.addEventListener("click",(F=>zoomFct(F,!0))),ll.addEventListener("click",(F=>zoomFct(F,!1)))}_initWidgetPlayer(F){const Da=(0,hl.Tf)("gvs-player-prev",(0,hl.fa)(cu.TH),this._t.gvs.sequence_prev),ll=(0,hl.Tf)("gvs-player-play"),dl=(0,hl.Tf)("gvs-player-next",(0,hl.fa)(uu.vF),this._t.gvs.sequence_next),pl=(0,hl.Tf)("gvs-player-more",(0,hl.fa)(gh.nx),this._t.gvs.sequence_more,["gvs-xs-hidden"]),fl=(0,hl.t_)(this,pl,[],["gvs-player-options"]);fl.innerHTML=`\n\t\t\t<div class="gvs-input-range" title="${this._t.gvs.sequence_speed}">\n\t\t\t\t${(0,hl.Qt)(nd.rO)}\n\t\t\t\t<input\n\t\t\t\t\tid="gvs-player-speed"\n\t\t\t\t\ttype="range" name="speed"\n\t\t\t\t\tmin="0" max="${cl.Vf-100}"\n\t\t\t\t\tvalue="${cl.Vf-this._viewer.psv.getTransitionDuration()}"\n\t\t\t\t\ttitle="${this._t.gvs.sequence_speed}"\n\t\t\t\t\tstyle="width: 100%;" />\n\t\t\t\t${(0,hl.Qt)(ed.KM)}\n\t\t\t</div>\n\t\t\t<button title="${this._t.gvs.contrast}" id="gvs-player-contrast">\n\t\t\t\t${(0,hl.Qt)(id.rC)}\n\t\t\t</button>\n\t\t`;const Al=(0,hl.wj)("gvs-widget-player",F?"main-top-middle":"main-top-left",this,[Da,ll,dl].concat(this._viewer.isWidthSmall()?[]:[fl,pl]),["gvs-group-horizontal","gvs-only-psv","gvs-print-hidden",this._viewer.psv.getPictureMetadata()?"":"gvs-hidden"]),toggleBtnPlay=F=>{ll.innerHTML=F?(0,hl.Qt)(hu.G1):(0,hl.Qt)(su.ij),ll.title=F?this._t.gvs.sequence_pause:this._t.gvs.sequence_play};toggleBtnPlay(!1);const updatePlayBtn=()=>{var F,cl,pl,fl;"pic"===this._viewer.getPicturesNavigation()?((0,hl.vI)(dl),(0,hl.vI)(ll),(0,hl.vI)(Da)):(null!=(null===(F=this._viewer.psv.getPictureMetadata())||void 0===F||null===(cl=F.sequence)||void 0===cl?void 0:cl.prevPic)?(0,hl.Y8)(Da):(0,hl.vI)(Da),null!=(null===(pl=this._viewer.psv.getPictureMetadata())||void 0===pl||null===(fl=pl.sequence)||void 0===fl?void 0:fl.nextPic)?((0,hl.Y8)(dl),(0,hl.Y8)(ll)):((0,hl.vI)(dl),(0,hl.vI)(ll)))};if(updatePlayBtn(),this._viewer.addEventListener("sequence-playing",(()=>toggleBtnPlay(!0))),this._viewer.addEventListener("sequence-stopped",(()=>toggleBtnPlay(!1))),this._viewer.addEventListener("psv:picture-loaded",(()=>Al.classList.remove("gvs-hidden")),{once:!0}),this._viewer.addEventListener("psv:picture-loaded",updatePlayBtn),this._viewer.addEventListener("pictures-navigation-changed",updatePlayBtn),!this._viewer.isWidthSmall()){const F=fl.children[0].children[1];this._viewer.addEventListener("psv:transition-duration-changed",(Da=>{F.value=cl.Vf-Da.detail.value})),F.addEventListener("change",(F=>{const Da=cl.Vf-F.target.value;this._viewer.psv.setTransitionDuration(Da)}))}Da.addEventListener("click",(()=>this._viewer.psv.goToPrevPicture())),dl.addEventListener("click",(()=>this._viewer.psv.goToNextPicture())),ll.addEventListener("click",(()=>{this._viewer.isSequencePlaying()?(toggleBtnPlay(!1),this._viewer.stopSequence()):(toggleBtnPlay(!0),this._viewer.playSequence())}));const bl=document.getElementById("gvs-player-contrast");bl&&bl.addEventListener("click",(()=>{bl.classList.contains("gvs-btn-active")?(bl.classList.remove("gvs-btn-active"),this._viewer.psv.setHigherContrast(!1)):(bl.classList.add("gvs-btn-active"),this._viewer.psv.setHigherContrast(!0))}))}_initWidgetLegend(F,Da){const ll=(0,hl.wj)("gvs-widget-legend",F?"main-bottom-right":"main-bottom-left",this,[],["gvs-widget-bg"]);let cl,pl,fl;F&&(cl=(0,hl.wj)("gvs-widget-mini-legend","mini-bottom-right",this,[],["gvs-widget-bg","gvs-only-mini","gvs-mobile-hidden"])),this._viewer.isWidthSmall()&&(pl=document.createElement("button"),pl.id="gvs-legend-toggle",pl.classList.add("gvs-btn","gvs-widget-bg","gvs-print-hidden"),pl.appendChild((0,hl.fa)(ld.faCircleInfo)),fl=()=>{"hidden"===ll.style.visibility?(ll.style.visibility="visible",toggleLegend(!!F&&this._viewer.isMapWide())):(ll.innerHTML="",ll.style.visibility="hidden",ll.appendChild(pl))},pl.addEventListener("click",(F=>{F.stopPropagation(),fl()})));const toggleLegend=fl=>{var Al,bl,kl;let Dl=Da||(null===(Al=this._viewer.map)||void 0===Al||null===(bl=Al._attribution)||void 0===bl?void 0:bl._attribHTML)||"",Wl="<a href='https://panoramax.fr/' target='_blank'>Panoramax</a>";const Ql=null===(kl=this._viewer.psv.getPictureMetadata())||void 0===kl?void 0:kl.caption;let wc;!(0,dl.GZ)()&&Ql&&(Wl="",Ql.producer&&(Wl+=`<span style="font-weight: bold">© ${Ql.producer}</span>`),Ql.date&&(Ql.producer&&(Wl+=" - "),Wl+=Ql.date.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})),wc=(0,hl.fa)(fd.AP),wc.style.marginLeft="5px"),ll.title="",fl?(ll.innerHTML=Dl,(0,dl.GZ)()&&(ll.innerHTML="<a href='https://panoramax.fr/' target='_blank'>Panoramax</a><br />"+ll.innerHTML),ll.style.cursor=null,ll.onclick=null,cl.innerHTML=Wl):(ll.innerHTML=Wl,wc?(ll.appendChild(wc),ll.style.cursor="pointer",ll.title=this._t.gvs.legend_title,ll.onclick=(0,dl.GZ)()?()=>window.open(window.location.href,"_blank"):this._showPictureMetadataPopup.bind(this)):(ll.style.cursor=null,ll.onclick=null),F&&(cl.innerHTML=Dl)),pl&&ll.appendChild(pl)};pl?(ll.appendChild(pl),ll.style.visibility="hidden"):toggleLegend(!!F&&this._viewer.isMapWide()),this._viewer.addEventListener("focus-changed",(F=>toggleLegend("map"==F.detail.focus))),this._viewer.addEventListener("psv:picture-loaded",(()=>toggleLegend(F&&this._viewer.isMapWide())))}_showPictureMetadataPopup(){var F,Da,ll,cl,pl,fl,Al,bl,Dl,Wl,Ql,wc,Sc,eu,iu,su,cu,uu,hu,Lu,zu,Nu,qu;const ih=this._viewer.psv.getPictureMetadata();if(!ih)throw new Error("No picture currently selected");const gh=[];if(gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(ld.faCircleInfo)} ${this._t.gvs.metadata}`)),this._viewer._api._endpoints.report){const F=(0,hl.do)(`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`);F.firstChild.addEventListener("click",this._showReportForm.bind(this)),gh.push(F)}const ed=[{section:this._t.gvs.metadata_general_picid,classes:["gvs-td-with-id"],values:(0,hl.fP)(ih.id,this._viewer._api.getPictureMetadataUrl(ih.id,null===ih||void 0===ih||null===(F=ih.sequence)||void 0===F?void 0:F.id),this._t.gvs.metadata_general_picid_link,this._t.gvs.copy)},{section:this._t.gvs.metadata_general_seqid,classes:["gvs-td-with-id"],values:(0,hl.fP)(null===ih||void 0===ih||null===(Da=ih.sequence)||void 0===Da?void 0:Da.id,this._viewer._api.getSequenceMetadataUrl(null===ih||void 0===ih||null===(ll=ih.sequence)||void 0===ll?void 0:ll.id),this._t.gvs.metadata_general_seqid_link,this._t.gvs.copy)},{section:this._t.gvs.metadata_general_author,value:null===ih||void 0===ih||null===(cl=ih.caption)||void 0===cl?void 0:cl.producer},{section:this._t.gvs.metadata_general_license,value:null===ih||void 0===ih||null===(pl=ih.caption)||void 0===pl?void 0:pl.license},{section:this._t.gvs.metadata_general_date,value:null===ih||void 0===ih||null===(fl=ih.caption)||void 0===fl||null===(Al=fl.date)||void 0===Al?void 0:Al.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,timeZoneName:"short"})}];gh.push((0,hl.ZR)("gvs-table-light",ed)),gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(Du.rw)} ${this._t.gvs.metadata_camera}`));const td=null!==ih&&void 0!==ih&&null!==(bl=ih.properties)&&void 0!==bl&&null!==(Dl=bl["pers:interior_orientation"])&&void 0!==Dl&&Dl.focal_length?`${null===ih||void 0===ih||null===(Wl=ih.properties)||void 0===Wl||null===(Ql=Wl["pers:interior_orientation"])||void 0===Ql?void 0:Ql.focal_length} mm`:"\u2753";let id=null===ih||void 0===ih||null===(wc=ih.properties)||void 0===wc||null===(Sc=wc["pers:interior_orientation"])||void 0===Sc?void 0:Sc.sensor_array_dimensions;id&&(id=`${id[0]} x ${id[1]} px (${Math.floor(id[0]*id[1]/1e6)} Mpx)`);let nd=this._t.gvs.picture_flat,rd=null===ih||void 0===ih||null===(eu=ih.properties)||void 0===eu||null===(iu=eu["pers:interior_orientation"])||void 0===iu?void 0:iu.field_of_view;null!==rd&&void 0!==rd&&(360===rd?nd=this._t.gvs.picture_360:nd+=` (${rd}\xb0)`);const ad=[{section:this._t.gvs.metadata_camera_make,value:(null===ih||void 0===ih||null===(su=ih.properties)||void 0===su||null===(cu=su["pers:interior_orientation"])||void 0===cu?void 0:cu.camera_manufacturer)||"\u2753"},{section:this._t.gvs.metadata_camera_model,value:(null===ih||void 0===ih||null===(uu=ih.properties)||void 0===uu||null===(hu=uu["pers:interior_orientation"])||void 0===hu?void 0:hu.camera_model)||"\u2753"},{section:this._t.gvs.metadata_camera_type,value:nd},{section:this._t.gvs.metadata_camera_resolution,value:id||"\u2753"},{section:this._t.gvs.metadata_camera_focal_length,value:td}];gh.push((0,hl.ZR)("gvs-table-light",ad)),gh.push((0,hl.Ij)("h4",`${(0,hl.Qt)(ud.gK)} ${this._t.gvs.metadata_location}`));const sd=void 0!==(null===ih||void 0===ih||null===(Lu=ih.properties)||void 0===Lu?void 0:Lu["view:azimuth"])?`${ih.properties["view:azimuth"]}\xb0`:"\u2753",od=(0,kl.Pu)(ih),hd=[{section:this._t.gvs.metadata_location_longitude,value:ih.gps[0]},{section:this._t.gvs.metadata_location_latitude,value:ih.gps[1]},{section:this._t.gvs.metadata_location_orientation,value:sd},{section:this._t.gvs.metadata_location_precision,value:od}];if(gh.push((0,hl.ZR)("gvs-table-light",hd)),null!==(zu=this._viewer)&&void 0!==zu&&null!==(Nu=zu.map)&&void 0!==Nu&&Nu._hasQualityScore()){var dd,pd;const F=(0,hl.Ij)("h4",`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.metadata_quality} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW)}</button>`);F.lastChild.addEventListener("click",(()=>this._showQualityScoreDoc())),gh.push(F);const Da=(0,dl.Ch)(dl.ql,null===ih||void 0===ih||null===(dd=ih.properties)||void 0===dd?void 0:dd["quality:horizontal_accuracy"]),ll=(0,dl.Ch)(360===(null===ih||void 0===ih?void 0:ih.horizontalFov)?dl.Av:dl.U3,null===ih||void 0===ih||null===(pd=ih.properties)||void 0===pd?void 0:pd["panoramax:horizontal_pixel_density"]),cl=Math.round((ll||1)*dl.Xu+(Da||1)*dl.Bg),pl=[{section:this._t.gvs.metadata_quality_score,value:(0,hl.Lt)(cl)},{section:this._t.gvs.metadata_quality_gps_score,value:(0,hl.fM)(Da,this._t)},{section:this._t.gvs.metadata_quality_resolution_score,value:(0,hl.fM)(ll,this._t)}];gh.push((0,hl.ZR)("gvs-table-light",pl))}if(null!==(qu=ih.properties)&&void 0!==qu&&qu.exif){const F=document.createElement("details");F.appendChild((0,hl.Ij)("summary",`${(0,hl.Qt)(cd.BH)} ${this._t.gvs.metadata_exif}`));const Da=Object.entries(ih.properties.exif).sort().map((F=>{let[Da,ll]=F;return{section:Da,value:ll}}));F.appendChild((0,hl.ZR)("",Da)),gh.push(F)}this._viewer.setPopup(!0,gh),this._viewer.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_showQualityScoreDoc(){const F=[];F.push((0,hl.Ij)("h4",`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.qualityscore_title}`));const Da=document.createElement("a");Da.setAttribute("href","https://docs.panoramax.fr/pictures-metadata/quality_score/"),Da.setAttribute("target","_blank"),Da.appendChild(document.createTextNode(this._t.gvs.qualityscore_doc_link)),[document.createTextNode(this._t.gvs.qualityscore_doc_1),document.createTextNode(this._t.gvs.qualityscore_doc_2),(0,hl.Lt)(5),document.createTextNode(this._t.gvs.qualityscore_doc_3),Da].forEach((Da=>{const ll=document.createElement("p");ll.appendChild(Da),F.push(ll)})),this._viewer.setPopup(!0,F)}_showReportForm(){const F=this._viewer.psv.getPictureMetadata();if(!F)throw new Error("No picture currently selected");const Da=[];Da.push((0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`));const ll=(0,dl.bG)();if(ll){const F=document.createElement("p");F.appendChild(document.createTextNode(this._t.gvs.report_auth.replace("{a}",ll.name))),Da.push(F)}const cl=document.createElement("form");Da.push(cl);const pl=document.createElement("div");pl.classList.add("gvs-input-group");const fl=(0,hl.fp)("gvs-report-issue",this._t.gvs.report_nature_label,ld.faCircleInfo),Al=document.createElement("select");Al.name="gvs-report-issue",Al.required=!0;["","blur_missing","blur_excess","inappropriate","privacy","picture_low_quality","mislocated","copyright","other"].forEach((F=>{const Da=document.createElement("option");Da.value=F,Da.textContent=this._t.gvs.report_nature[F],""===F&&(Da.setAttribute("disabled",""),Da.setAttribute("selected",""),Da.setAttribute("hidden","")),Al.appendChild(Da)})),pl.appendChild(fl),pl.appendChild(Al),cl.appendChild(pl);const bl=document.createElement("div");bl.classList.add("gvs-input-group","gvs-input-group-inline");const kl=document.createElement("input");kl.id="gvs-report-whole-sequence",kl.name="gvs-report-whole-sequence",kl.type="checkbox";const Dl=(0,hl.fp)("gvs-report-whole-sequence",this._t.gvs.report_whole_sequence);bl.appendChild(kl),bl.appendChild(Dl),cl.appendChild(bl);const Wl=document.createElement("div");Wl.classList.add("gvs-input-group");const Ql=(0,hl.fp)("gvs-report-details",this._t.gvs.report_details,gd.Be),wc=document.createElement("textarea");let Sc;if(wc.name="gvs-report-details",wc.placeholder=this._t.gvs.report_details_placeholder,Wl.appendChild(Ql),Wl.appendChild(wc),cl.appendChild(Wl),!ll){const F=document.createElement("div");F.classList.add("gvs-input-group");const Da=(0,hl.fp)("email",this._t.gvs.report_email,Ad.Hz);Sc=document.createElement("input"),Sc.type="email",Sc.name="email",Sc.placeholder=this._t.gvs.report_email_placeholder,F.appendChild(Da),F.appendChild(Sc),cl.appendChild(F)}const eu=document.createElement("div");eu.classList.add("gvs-input-btn");const iu=document.createElement("button");iu.type="submit",iu.appendChild((0,hl.fa)(yd.is)),iu.appendChild(document.createTextNode(this._t.gvs.report_submit)),eu.appendChild(iu),cl.appendChild(eu),cl.addEventListener("submit",(Da=>{var ll;Da.preventDefault();const cl={issue:Al.value,picture_id:kl.checked?null:F.id,reporter_comments:wc.value,reporter_email:null===(ll=Sc)||void 0===ll?void 0:ll.value,sequence_id:F.sequence.id};this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_wait)]),this._viewer._api.sendReport(cl).then((()=>{this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_success)])})).catch((F=>{console.error(F),this._viewer.setPopup(!0,[(0,hl.Ij)("h4",`${(0,hl.Qt)(md.JA)} ${this._t.gvs.report}`),document.createTextNode(this._t.gvs.report_failure.replace("{e}",F))])}))})),this._viewer.setPopup(!0,Da),this._viewer.dispatchEvent(new CustomEvent("focus-changed",{detail:{focus:"meta"}}))}_initWidgetMiniActions(){const F=document.createElement("img");F.alt="",F.height=120,F.draggable=!1,F.src=pl;const Da=document.createElement("span");Da.classList.add("gvs-mobile-hidden"),Da.appendChild(document.createTextNode(this._t.gvs.expand));const ll=(0,hl.Tf)("gvs-mini-expand",Da,this._t.gvs.expand_info,["gvs-only-mini","gvs-print-hidden"]);ll.appendChild(F),this._corners["mini-top-right"].appendChild(ll),ll.addEventListener("click",(()=>{this._viewer.setFocus(this._viewer.isMapWide()?"pic":"map")}));const cl=document.createElement("img");cl.alt=this._t.gvs.minimize_short,cl.height=120,cl.draggable=!1,cl.src=fl;const Al=(0,hl.Tf)("gvs-mini-hide",cl,this._t.gvs.minimize,["gvs-only-mini","gvs-print-hidden"]);this._corners["mini-bottom-left"].appendChild(Al),Al.addEventListener("click",(()=>{this._viewer.setUnfocusedVisible(!1)}));const bl=(0,hl.Tf)("gvs-mini-show",null,null,["gvs-btn-large","gvs-only-mini-hidden","gvs-print-hidden"]);this._corners["main-bottom-left"].appendChild(bl),bl.addEventListener("click",(()=>{(0,dl.GZ)()?this._viewer.setFocus(this._viewer.isMapWide()?"pic":"map"):this._viewer.setUnfocusedVisible(!0)}));const miniBtnRendering=()=>{this._viewer.map&&this._viewer.isMapWide()?(bl.title=this._t.gvs.show_psv,bl.innerHTML=(0,hl.Qt)(iu.pt)):(bl.title=this._t.gvs.show_map,bl.innerHTML=(0,hl.Qt)(Sc.e5))};miniBtnRendering(),this._viewer.addEventListener("focus-changed",miniBtnRendering)}_initWidgetSearch(){const F=(0,hl.OZ)("gvs-widget-search-bar",this._t.gvs.search_address,(F=>{const Da=F.match(/([-+]?\d{1,2}\.\d+),\s*([-+]?\d{1,3}\.\d+)/),ll=F.match(/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/);if(Da){const F=parseFloat(Da[1]),ll=parseFloat(Da[2]);return this._viewer.map.flyTo({center:[ll,F],zoom:16}),Promise.resolve(!0)}return ll?(this._viewer.select(null,F),Promise.resolve(!0)):this._viewer.map.geocoder({query:F,limit:3,bbox:this._viewer.map.getBounds().toArray().map((F=>F.join(","))).join(","),proximity:this._viewer.map.getCenter().lat+","+this._viewer.map.getCenter().lng}).then((F=>F=F.features.map((F=>({title:F.place_name.split(",")[0],subtitle:F.place_name.split(",").slice(1).join(", "),data:F})))))}),(F=>{F&&(F.data.bounds?this._viewer.map.fitBounds(F.data.bounds):this._viewer.map.flyTo({center:F.data.center,zoom:F.data.zoom||13}))}),this,void 0,this._viewer.isWidthSmall(),this._viewer.map._geolocate);(0,hl.wj)("gvs-widget-search",this._viewer.isWidthSmall()?"main-top-right":"main-top-left",this,[F],["gvs-only-map","gvs-print-hidden"])}_initWidgetMapLayers(){var F,Da;const ll=(0,hl.np)("gvs-map-layers",ad.qI,this._t.gvs.layers,this),cl=(0,hl.t_)(this,ll,[]);(0,hl.wj)("gvs-widget-map-layers","main-top-right",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-only-map","gvs-print-hidden"]),this._viewer.map.hasTwoBackgrounds()&&(cl.innerHTML=`\n\t\t\t\t<h4>${(0,hl.Qt)(sd.YS)} ${this._t.gvs.map_background}</h4>\n\t\t\t\t<div id="gvs-map-bg" class="gvs-input-group">\n\t\t\t\t\t<input type="radio" id="gvs-map-bg-streets" name="gvs-map-bg" value="streets" />\n\t\t\t\t\t<label for="gvs-map-bg-streets">\n\t\t\t\t\t\t<img id="gvs-map-bg-streets-img" alt="" />\n\t\t\t\t\t\t${this._t.gvs.map_background_streets}\n\t\t\t\t\t</label>\n\t\t\t\t\t<input type="radio" id="gvs-map-bg-aerial" name="gvs-map-bg" value="aerial" />\n\t\t\t\t\t<label for="gvs-map-bg-aerial">\n\t\t\t\t\t\t<img id="gvs-map-bg-aerial-img" alt="" />\n\t\t\t\t\t\t${this._t.gvs.map_background_aerial}\n\t\t\t\t\t</label>\n\t\t\t\t</div>`),cl.innerHTML+=`\n\t\t\t<h4>${(0,hl.Qt)(td.fy)} ${this._t.gvs.map_theme}</h4>\n\t\t\t<div class="gvs-input-group">\n\t\t\t\t<select id="gvs-map-theme" style="width: 100%;">\n\t\t\t\t\t<option value="default">${this._t.gvs.map_theme_default}</option>\n\t\t\t\t\t<option value="age">${this._t.gvs.map_theme_age}</option>\n\t\t\t\t\t<option value="type">${this._t.gvs.map_theme_type}</option>\n\t\t\t\t\t${null!==(F=this._viewer)&&void 0!==F&&null!==(Da=F.map)&&void 0!==Da&&Da._hasQualityScore()?'<option value="score">'+this._t.gvs.map_theme_score+"</option>":""}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<div id="gvs-map-theme-legend-age" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_4}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_4}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_3}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_3}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_2}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_2}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.PALETTE_1}"></span>\n\t\t\t\t\t\t\t${this._t.gvs.map_theme_age_1}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id="gvs-map-theme-legend-type" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.QUALI_1}"></span>\n\t\t\t\t\t\t${this._t.gvs.picture_360}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="gvs-map-theme-legend-entry">\n\t\t\t\t\t\t<span class="gvs-map-theme-color" style="background-color: ${dl.lm.QUALI_2}"></span>\n\t\t\t\t\t\t${this._t.gvs.picture_flat}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id="gvs-map-theme-legend-score" class="gvs-map-theme-legend gvs-hidden">\n\t\t\t\t\t${dl.fW.map((F=>'<span class="gvs-qualityscore" style="background-color: '+F.color+';">'+F.label+"</span>")).join("")}\n\t\t\t\t\t<button id="gvs-map-theme-quality-help" class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW,{transform:{x:6,size:24}})}</button>\n\t\t\t\t</div>\n\t\t\t</div>`,cl.querySelector("#gvs-map-theme-quality-help").addEventListener("click",(()=>this._showQualityScoreDoc()));const pl=cl.querySelector("#gvs-map-theme"),onChange=()=>{this._onMapThemeChange(),this._onMapFiltersChange()};if(pl.addEventListener("change",onChange),pl.addEventListener("keypress",onChange),pl.addEventListener("paste",onChange),pl.addEventListener("input",onChange),this._viewer.map.hasTwoBackgrounds()){cl.querySelector("#gvs-map-bg-aerial-img").src=Al;cl.querySelector("#gvs-map-bg-streets-img").src=bl;const F=cl.querySelector("#gvs-map-bg-aerial"),Da=cl.querySelector("#gvs-map-bg-streets"),onBgChange=F=>{this._viewer.map.setBackground(F.target.value)};F.addEventListener("change",onBgChange),Da.addEventListener("change",onBgChange),this._viewer.addEventListener("map:background-changed",(F=>this._onMapBackgroundChange(F.detail.background))),this._onMapBackgroundChange(this._viewer.map.getBackground())}}_onMapBackgroundChange(F){const Da=document.getElementById("gvs-map-bg-aerial"),ll=document.getElementById("gvs-map-bg-streets");"aerial"===F?Da.checked=!0:ll.checked=!0}_onMapThemeChange(){const F=document.getElementById("gvs-map-theme"),Da=document.getElementById("gvs-map-layers"),ll=F.value;Da.setActive("default"!==ll);for(let cl of document.getElementsByClassName("gvs-map-theme-legend"))cl.id=="gvs-map-theme-legend-"+ll?cl.classList.remove("gvs-hidden"):cl.classList.add("gvs-hidden")}_initWidgetFilters(F,Da){const ll=(0,hl.np)("gvs-filter",rd._$,this._t.gvs.filters,this,["gvs-filter-unset-btn"]),cl=(0,hl.t_)(this,ll,[]);cl.innerHTML=`\n\t\t\t<form id="gvs-filter-form">\n\t\t\t\t<div class="gvs-filter-block">\n\t\t\t\t\t<div class="gvs-filter-zoomin">${this._t.gvs.filter_zoom_in}</div>\n\t\t\t\t\t<h4>${(0,hl.Qt)(Lu.ok)} ${this._t.gvs.filter_date}</h4>\n\t\t\t\t\t<div class="gvs-input-shortcuts">\n\t\t\t\t\t\t<button data-for="gvs-filter-date-from" data-value="${new Date((new Date).setMonth((new Date).getMonth()-1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1month}</button>\n\t\t\t\t\t\t<button data-for="gvs-filter-date-from" data-value="${new Date((new Date).setFullYear((new Date).getFullYear()-1)).toISOString().split("T")[0]}">${this._t.gvs.filter_date_1year}</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="gvs-input-group">\n\t\t\t\t\t\t<input type="date" id="gvs-filter-date-from" />\n\t\t\t\t\t\t${(0,hl.Qt)(zu.dm)}\n\t\t\t\t\t\t<input type="date" id="gvs-filter-date-end" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="gvs-filter-block">\n\t\t\t\t\t<h4>${(0,hl.Qt)(eu.jb)} ${this._t.gvs.filter_picture}</h4>\n\t\t\t\t\t<div class="gvs-input-group gvs-checkbox-btns" style="justify-content: center;">\n\t\t\t\t\t\t<input type="checkbox" id="gvs-filter-type-flat" name="flat" />\n\t\t\t\t\t\t<label for="gvs-filter-type-flat">${(0,hl.Qt)(eu.jb)} ${this._t.gvs.picture_flat}</label>\n\t\t\t\t\t\t<input type="checkbox" id="gvs-filter-type-360" name="360" />\n\t\t\t\t\t\t<label for="gvs-filter-type-360">${(0,hl.Qt)(iu.pt)} ${this._t.gvs.picture_360}</label>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t`;const pl=cl.children[0];(0,hl.wj)("gvs-widget-filter",this._viewer.isWidthSmall()?"main-top-right":"main-top-left",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-only-map","gvs-print-hidden"]);const fl=ll.querySelector(".gvs-filter-unset-btn");if(fl&&fl.addEventListener("click",(F=>{F.stopPropagation(),pl.reset()})),this._viewer.isWidthSmall()&&(cl.style.width=this._viewer.container.offsetWidth-70+"px"),Da){const F=document.createElement("div");F.classList.add("gvs-filter-block"),pl.appendChild(F);const Da=document.createElement("div");Da.classList.add("gvs-filter-zoomin"),Da.appendChild(document.createTextNode(this._t.gvs.filter_zoom_in)),F.appendChild(Da);const ll=document.createElement("h4");ll.innerHTML=`${(0,hl.Qt)(vd.B9)} ${this._t.gvs.filter_qualityscore} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${(0,hl.Qt)(_d.iW)}</button>`,ll.style.marginBottom="3px",ll.lastChild.addEventListener("click",(()=>this._showQualityScoreDoc())),F.appendChild(ll);const cl=document.createElement("div");cl.id="gvs-filter-qualityscore",cl.classList.add("gvs-input-group"),dl.fW.forEach((F=>{const Da=document.createElement("input");Da.id="gvs-filter-qualityscore-"+F.label,Da.type="checkbox",Da.name="qualityscore",Da.value=F.label;const ll=document.createElement("label");ll.setAttribute("for",Da.id),ll.title=this._t.gvs.filter_qualityscore_help,ll.appendChild(document.createTextNode(F.label)),ll.style.backgroundColor=F.color,cl.appendChild(Da),cl.appendChild(ll)})),F.appendChild(cl)}if(F){const F=document.createElement("div");F.classList.add("gvs-filter-block"),pl.appendChild(F);const Da=document.createElement("h4");Da.innerHTML=`${(0,hl.Qt)(od.X4)} ${this._t.gvs.filter_user}`,F.appendChild(Da);const ll=(0,dl.bG)();let cl;if(ll){const Da=document.createElement("div");Da.classList.add("gvs-input-shortcuts"),cl=document.createElement("button"),cl.appendChild(document.createTextNode(this._t.gvs.filter_user_mypics)),Da.appendChild(cl),F.appendChild(Da)}const fl=document.createElement("div");let Al;fl.id="gvs-filter-user",fl.classList.add("gvs-input-group"),Al=(0,hl.OZ)("gvs-filter-search-user",this._t.gvs.search_user,(F=>(Al.classList.remove("gvs-filter-active"),this._viewer._api.searchUsers(F).then((F=>(F||[]).map((F=>({title:F.label,data:F}))))))),(F=>(F?Al.classList.add("gvs-filter-active"):Al.classList.remove("gvs-filter-active"),this._viewer.map.setVisibleUsers(F?[F.data.id]:["geovisio"]))),this,!0),F.addEventListener("reset",(()=>{Al.classList.remove("gvs-filter-active"),Al.resetSearch()})),fl.appendChild(Al),F.appendChild(fl),ll&&cl.addEventListener("click",(()=>{const F=Al.querySelector("input");F.value===ll.name?Al.resetSearch():F.goItem({title:ll.name,data:{id:ll.id}})}))}cl.querySelectorAll(".gvs-input-shortcuts button").forEach((F=>{F.addEventListener("click",(()=>{const Da=document.getElementById(F.getAttribute("data-for")),ll=F.getAttribute("data-value");Da&&(Da.value!==ll?Da.value=ll:Da.value="")}))}));[document.getElementById("gvs-filter-date-from"),document.getElementById("gvs-filter-date-end")].forEach((F=>{F.addEventListener("change",(()=>{F.value?F.classList.add("gvs-filter-active"):F.classList.remove("gvs-filter-active")}))})),this._formDelay=null;const onFormChange=()=>{this._formDelay&&clearTimeout(this._formDelay),this._formDelay=setTimeout((()=>{this._onMapFiltersChange()}),250)};pl.addEventListener("change",onFormChange),pl.addEventListener("reset",onFormChange),pl.addEventListener("submit",(F=>(onFormChange(),F.preventDefault(),!1)),!0);for(let hl of pl.getElementsByTagName("input"))hl.addEventListener("change",onFormChange),hl.addEventListener("keypress",onFormChange),hl.addEventListener("paste",onFormChange),hl.addEventListener("input",onFormChange)}_onMapFiltersChange(){var F,Da;const ll=document.getElementById("gvs-filter-date-from"),cl=document.getElementById("gvs-filter-date-end"),hl=document.getElementById("gvs-filter-type-flat"),dl=document.getElementById("gvs-filter-type-360"),pl=document.getElementById("gvs-map-theme");let fl="";dl.checked&&!hl.checked&&(fl="equirectangular"),!dl.checked&&hl.checked&&(fl="flat");let Al=[];if(null!==(F=this._viewer)&&void 0!==F&&null!==(Da=F.map)&&void 0!==Da&&Da._hasQualityScore()){const F=document.getElementById("gvs-filter-qualityscore-A"),Da=document.getElementById("gvs-filter-qualityscore-B"),ll=document.getElementById("gvs-filter-qualityscore-C"),cl=document.getElementById("gvs-filter-qualityscore-D"),hl=document.getElementById("gvs-filter-qualityscore-E");F.checked&&Al.push(5),Da.checked&&Al.push(4),ll.checked&&Al.push(3),cl.checked&&Al.push(2),hl.checked&&Al.push(1),5==Al.length&&(Al=[])}const bl={minDate:ll.value,maxDate:cl.value,type:fl,theme:pl.value,qualityscore:Al};this._viewer.setFilters(bl)}_listenMapFiltersChanges(){const F=document.getElementById("gvs-filter"),Da=document.getElementById("gvs-filter-date-from"),ll=document.getElementById("gvs-filter-date-end"),cl=document.getElementById("gvs-filter-type-flat"),hl=document.getElementById("gvs-filter-type-360"),dl=document.getElementById("gvs-map-theme"),pl=document.getElementById("gvs-filter-qualityscore-A"),fl=document.getElementById("gvs-filter-qualityscore-B"),Al=document.getElementById("gvs-filter-qualityscore-C"),bl=document.getElementById("gvs-filter-qualityscore-D"),kl=document.getElementById("gvs-filter-qualityscore-E");this._viewer.addEventListener("filters-changed",(Dl=>{Dl.detail.minDate?(Da.value=Dl.detail.minDate,Da.classList.add("gvs-filter-active")):Da.classList.remove("gvs-filter-active"),Dl.detail.maxDate?(ll.value=Dl.detail.maxDate,ll.classList.add("gvs-filter-active")):ll.classList.remove("gvs-filter-active"),Dl.detail.theme&&(dl.value=Dl.detail.theme),Dl.detail.type&&(hl.checked=["","equirectangular"].includes(Dl.detail.type),cl.checked=["","flat"].includes(Dl.detail.type)),Dl.detail.qualityscore&&(pl.checked=Dl.detail.qualityscore.includes(5)&&Dl.detail.qualityscore.length<5,fl.checked=Dl.detail.qualityscore.includes(4)&&Dl.detail.qualityscore.length<5,Al.checked=Dl.detail.qualityscore.includes(3)&&Dl.detail.qualityscore.length<5,bl.checked=Dl.detail.qualityscore.includes(2)&&Dl.detail.qualityscore.length<5,kl.checked=Dl.detail.qualityscore.includes(1)&&Dl.detail.qualityscore.length<5);let Wl=Object.keys(Dl.detail).filter((F=>F&&"theme"!==F)).length>0||this._viewer.map.getVisibleUsers().filter((F=>"geovisio"!==F)).length>0;F.setActive(Wl),this._onMapThemeChange()})),this._viewer.addEventListener("map:users-changed",(Da=>{let ll=Object.keys(this._viewer._mapFilters).filter((F=>F&&"theme"!==F)).length>0||Da.detail.usersIds.filter((F=>"geovisio"!==F)).length>0;F.setActive(ll)}));const Dl=document.getElementsByClassName("gvs-filter-zoomin"),changeLblZoomInDisplay=()=>{for(let F of Dl)this._viewer.map.getZoom()<7?F.style.display=null:F.style.display="none"};changeLblZoomInDisplay(),this._viewer.map.on("zoomend",changeLblZoomInDisplay)}_initWidgetShare(){var F,Da;const ll=(0,hl.Tf)("gvs-share",(0,hl.fa)(Ql.ek),this._t.gvs.share,["gvs-btn-large"]),cl=(0,hl.t_)(this,ll,[]);cl.innerHTML=`\n\t\t\t<div class="gvs-hidden">\n\t\t\t\t<p id="gvs-share-license" style="margin: 0 0 10px 0;"></p>\n\t\t\t</div>\n\t\t\t<h4 style="margin-top: 0">${(0,hl.Qt)(wc.CQ)} ${this._t.gvs.share_links}</h4>\n\t\t\t<div id="gvs-share-links" class="gvs-input-btn">\n\t\t\t\t<a id="gvs-share-image" class="gvs-link-btn gvs-hidden" download target="_blank">${(0,hl.Qt)(dd.sA)} ${this._t.gvs.share_image}</a>\n\t\t\t\t<button id="gvs-share-url" data-copy="true" style="flex-basis: 100%; flex-grow: 2; flex-shrink: 2;">${(0,hl.Qt)(pd.jP)} ${this._t.gvs.share_page}</button>\n\t\t\t\t<button id="gvs-share-print" style="flex-basis: 100%; flex-grow: 2; flex-shrink: 2;">${(0,hl.Qt)(qu.Jx)} ${this._t.gvs.share_print}</button>\n\t\t\t</div>\n\t\t\t<h4>\n\t\t\t\t${(0,hl.Qt)(Sc.e5)} ${this._t.gvs.share_embed}\n\t\t\t\t<a href="https://docs.panoramax.fr/web-viewer/03_URL_settings/"\n\t\t\t\t\ttitle="${this._t.gvs.share_embed_docs}"\n\t\t\t\t\ttarget="_blank"\n\t\t\t\t\tstyle="vertical-align: middle">\n\t\t\t\t\t${(0,hl.Qt)(ld.faCircleInfo)}\n\t\t\t\t</a>\n\t\t\t</h4>\n\t\t\t<div class="gvs-input-btn">\n\t\t\t\t<textarea id="gvs-share-iframe" readonly></textarea>\n\t\t\t\t<button data-input="gvs-share-iframe">${(0,hl.Qt)(pd.jP)} ${this._t.gvs.copy}</button>\n\t\t\t</div>\n\t\t\t<h4 class="gvs-hidden">${(0,hl.Qt)(Nu.hp)} ${this._t.gvs.edit_osm}</h4>\n\t\t\t<div class="gvs-input-btn gvs-hidden" style="justify-content: center">\n\t\t\t\t<a id="gvs-edit-id" class="gvs-link-btn" target="_blank">${(0,hl.Qt)(ud.gK)} ${this._t.gvs.id}</a>\n\t\t\t\t<button id="gvs-edit-josm" title="${this._t.gvs.josm_live}">${(0,hl.Qt)(ih.hU)} ${this._t.gvs.josm}</button>\n\t\t\t</div>\n\t\t`,(0,hl.wj)("gvs-widget-share","main-bottom-right",this,[ll,cl],["gvs-group-large","gvs-group-btnpanel","gvs-mobile-hidden","gvs-print-hidden"]);const dl=document.getElementById("gvs-share-links"),pl=document.getElementById("gvs-share-image"),fl=document.getElementById("gvs-share-url");if(this._viewer._api.getRSSURL()){const F=document.createElement("a");F.id="gvs-share-rss",F.classList.add("gvs-link-btn"),F.setAttribute("target","_blank"),F.setAttribute("title",this._t.gvs.share_rss_title),F.appendChild((0,hl.fa)(hd.zb)),F.appendChild(document.createTextNode(this._t.gvs.share_rss)),dl.insertBefore(F,fl)}this._viewer.addEventListener("psv:picture-loaded",(()=>{var F;const Da=this._viewer.psv.getPictureMetadata();pl.href=Da.panorama.hdUrl;for(document.getElementById("gvs-share-license").innerHTML=null!==Da&&void 0!==Da&&null!==(F=Da.caption)&&void 0!==F&&F.license?this._t.gvs.legend_license.replace("{l}",Da.caption.license):"";cl.getElementsByClassName("gvs-hidden").length>0;){cl.getElementsByClassName("gvs-hidden")[0].classList.remove("gvs-hidden")}}));const updateLinks=F=>{var Da,ll,hl;const dl=(null===F||void 0===F||null===(Da=F.detail)||void 0===Da?void 0:Da.url)||window.location.href.replace(/\/$/,""),pl=this._options.iframeBaseURL?this._options.iframeBaseURL+window.location.hash:dl,fl=cl.querySelector("#gvs-share-url"),Al=cl.querySelector("#gvs-share-iframe"),bl=cl.querySelector("#gvs-edit-id"),kl=cl.querySelector("#gvs-share-rss");fl.setAttribute("data-copy",(null===(ll=this._viewer)||void 0===ll||null===(hl=ll._hash)||void 0===hl?void 0:hl.getShortLink(dl))||dl),Al.innerText=`<iframe src="${pl}" style="border: none; width: 500px; height: 300px"></iframe>`;const Dl=this._viewer.psv.getPictureMetadata();if(Dl){const F={map:`19/${Dl.gps[1]}/${Dl.gps[0]}`,source:"Panoramax",photo_overlay:"panoramax",photo:`panoramax/${Dl.id}`};bl.setAttribute("href",`${this._options.editIdUrl}#${new URLSearchParams(F).toString()}`)}var Wl,Ql;kl&&kl.setAttribute("href",this._viewer._api.getRSSURL(null===(Wl=this._viewer)||void 0===Wl||null===(Ql=Wl.map)||void 0===Ql?void 0:Ql.getBounds()))};updateLinks(),this._viewer.addEventListener("ready",updateLinks,{once:!0}),null===(F=this._viewer)||void 0===F||null===(Da=F._hash)||void 0===Da||Da.addEventListener("url-changed",updateLinks),(0,hl.$c)(cl,this._viewer._t);const Al=cl.querySelector("#gvs-edit-josm");Al.addEventListener("click",(()=>{Al.classList.contains("gvs-btn-active")?this._viewer.toggleJOSMLive(!1):this._viewer.toggleJOSMLive(!0).catch((F=>{console.warn(F),alert(this._t.gvs.error_josm)}))})),this._viewer.addEventListener("josm-live-enabled",(()=>Al.classList.add("gvs-btn-active"))),this._viewer.addEventListener("josm-live-disabled",(()=>Al.classList.remove("gvs-btn-active")));cl.querySelector("#gvs-share-print").addEventListener("click",window.print.bind(window))}}},7325:(F,Da)=>{"use strict";var ll="star",cl=[11088,61446],hl="f005",dl="M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z";Da.mw={prefix:"far",iconName:ll,icon:[576,512,cl,hl,dl]},Da.yy=Da.mw},6069:(F,Da)=>{"use strict";var ll="arrow-right",cl=[8594],hl="f061",dl="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.dm=Da.mw},4881:(F,Da)=>{"use strict";var ll=[61946],cl="M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256l0 32c0 53-43 96-96 96c-29.3 0-55.6-13.2-73.2-33.9C320 371.1 289.5 384 256 384c-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1c5.7-5 13.1-8.1 21.3-8.1c17.7 0 32 14.3 32 32l0 80 0 32c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32c0-106-86-192-192-192zm64 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0z";Da.mw={prefix:"fas",iconName:"at",icon:[512,512,ll,"40",cl]},Da.Hz=Da.mw},1705:(F,Da)=>{"use strict";var ll="backward",cl=[9194],hl="f04a",dl="M459.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-320c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4L288 214.3l0 41.7 0 41.7L459.5 440.6zM256 352l0-96 0-128 0-32c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160C4.2 237.5 0 246.5 0 256s4.2 18.5 11.5 24.6l192 160c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29l0-64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.TH=Da.mw},9186:(F,Da)=>{"use strict";var ll="calendar",cl=[128197,128198],hl="f133",dl="M96 32l0 32L48 64C21.5 64 0 85.5 0 112l0 48 448 0 0-48c0-26.5-21.5-48-48-48l-48 0 0-32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 32L160 64l0-32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192L0 192 0 464c0 26.5 21.5 48 48 48l352 0c26.5 0 48-21.5 48-48l0-272z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.ok=Da.mw},99:(F,Da)=>{"use strict";var ll="camera",cl=[62258,"camera-alt"],hl="f030",dl="M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.rw=Da.mw},174:(F,Da)=>{"use strict";var ll="check",cl=[10003,10004],hl="f00c",dl="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.e6=Da.mw},2593:(F,Da)=>{"use strict";var ll="chevron-down",cl=[],hl="f078",dl="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Jt=Da.mw},4011:(F,Da)=>{"use strict";var ll="circle-exclamation",cl=["exclamation-circle"],hl="f06a",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.lE=Da.mw},7516:(F,Da)=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});var ll="circle-info",cl=["info-circle"],hl="f05a",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z";Da.definition={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.faCircleInfo=Da.definition,Da.prefix="fas",Da.iconName=ll,Da.width=512,Da.height=512,Da.ligatures=cl,Da.unicode=hl,Da.svgPathData=dl,Da.aliases=cl},3444:(F,Da)=>{"use strict";var ll="circle-notch",cl=[],hl="f1ce",dl="M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8C121.8 95.6 64 169.1 64 256c0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1c-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 140 77.1 42.1 182.9 10.6c16.9-5 34.8 4.6 39.8 21.5z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.s4=Da.mw},9564:(F,Da)=>{"use strict";var ll="circle-question",cl=[62108,"question-circle"],hl="f059",dl="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.AP=Da.mw},4162:(F,Da)=>{"use strict";var ll="cloud-arrow-down",cl=[62337,"cloud-download","cloud-download-alt"],hl="f0ed",dl="M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-167l80 80c9.4 9.4 24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-39 39L344 184c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 134.1-39-39c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.sA=Da.mw},2975:(F,Da)=>{"use strict";var ll="comment-dots",cl=[128172,62075,"commenting"],hl="f4ad",dl="M256 448c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9c-5.5 9.2-11.1 16.6-15.2 21.6c-2.1 2.5-3.7 4.4-4.9 5.7c-.6 .6-1 1.1-1.3 1.4l-.3 .3c0 0 0 0 0 0c0 0 0 0 0 0s0 0 0 0s0 0 0 0c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c28.7 0 57.6-8.9 81.6-19.3c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9zM128 208a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm128 0a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm96 32a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Be=Da.mw},4189:(F,Da)=>{"use strict";var ll="copy",cl=[],hl="f0c5",dl="M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.jP=Da.mw},7172:(F,Da)=>{"use strict";var ll="earth-europe",cl=["globe-europe"],hl="f7a2",dl="M266.3 48.3L232.5 73.6c-5.4 4-8.5 10.4-8.5 17.1l0 9.1c0 6.8 5.5 12.3 12.3 12.3c2.4 0 4.8-.7 6.8-2.1l41.8-27.9c2-1.3 4.4-2.1 6.8-2.1l1 0c6.2 0 11.3 5.1 11.3 11.3c0 3-1.2 5.9-3.3 8l-19.9 19.9c-5.8 5.8-12.9 10.2-20.7 12.8l-26.5 8.8c-5.8 1.9-9.6 7.3-9.6 13.4c0 3.7-1.5 7.3-4.1 10l-17.9 17.9c-6.4 6.4-9.9 15-9.9 24l0 4.3c0 16.4 13.6 29.7 29.9 29.7c11 0 21.2-6.2 26.1-16l4-8.1c2.4-4.8 7.4-7.9 12.8-7.9c4.5 0 8.7 2.1 11.4 5.7l16.3 21.7c2.1 2.9 5.5 4.5 9.1 4.5c8.4 0 13.9-8.9 10.1-16.4l-1.1-2.3c-3.5-7 0-15.5 7.5-18l21.2-7.1c7.6-2.5 12.7-9.6 12.7-17.6c0-10.3 8.3-18.6 18.6-18.6l29.4 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-20.7 0c-7.2 0-14.2 2.9-19.3 8l-4.7 4.7c-2.1 2.1-3.3 5-3.3 8c0 6.2 5.1 11.3 11.3 11.3l11.3 0c6 0 11.8 2.4 16 6.6l6.5 6.5c1.8 1.8 2.8 4.3 2.8 6.8s-1 5-2.8 6.8l-7.5 7.5C386 262 384 266.9 384 272s2 10 5.7 13.7L408 304c10.2 10.2 24.1 16 38.6 16l7.3 0c6.5-20.2 10-41.7 10-64c0-111.4-87.6-202.4-197.7-207.7zm172 307.9c-3.7-2.6-8.2-4.1-13-4.1c-6 0-11.8-2.4-16-6.6L396 332c-7.7-7.7-18-12-28.9-12c-9.7 0-19.2-3.5-26.6-9.8L314 287.4c-11.6-9.9-26.4-15.4-41.7-15.4l-20.9 0c-12.6 0-25 3.7-35.5 10.7L188.5 301c-17.8 11.9-28.5 31.9-28.5 53.3l0 3.2c0 17 6.7 33.3 18.7 45.3l16 16c8.5 8.5 20 13.3 32 13.3l21.3 0c13.3 0 24 10.7 24 24c0 2.5 .4 5 1.1 7.3c71.3-5.8 132.5-47.6 165.2-107.2zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM187.3 100.7c-6.2-6.2-16.4-6.2-22.6 0l-32 32c-6.2 6.2-6.2 16.4 0 22.6s16.4 6.2 22.6 0l32-32c6.2-6.2 6.2-16.4 0-22.6z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.YS=Da.mw},6533:(F,Da)=>{"use strict";var ll="ellipsis-vertical",cl=["ellipsis-v"],hl="f142",dl="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z";Da.mw={prefix:"fas",iconName:ll,icon:[128,512,cl,hl,dl]},Da.nx=Da.mw},5431:(F,Da)=>{"use strict";var ll="forward",cl=[9193],hl="f04e",dl="M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416L0 96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4L224 214.3l0 41.7 0 41.7L52.5 440.6zM256 352l0-96 0-128 0-32c0-12.4 7.2-23.7 18.4-29s24.5-3.6 34.1 4.4l192 160c7.3 6.1 11.5 15.1 11.5 24.6s-4.2 18.5-11.5 24.6l-192 160c-9.5 7.9-22.8 9.7-34.1 4.4s-18.4-16.6-18.4-29l0-64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.vF=Da.mw},8739:(F,Da)=>{"use strict";var ll="gear",cl=[9881,"cog"],hl="f013",dl="M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.BH=Da.mw},5279:(F,Da)=>{"use strict";var ll="image",cl=[],hl="f03e",dl="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.jb=Da.mw},6668:(F,Da,ll)=>{"use strict";var cl=ll(7516);Da.mw={prefix:cl.prefix,iconName:cl.iconName,icon:[cl.width,cl.height,cl.aliases,cl.unicode,cl.svgPathData]},Da.iW=Da.mw,cl.prefix,cl.iconName,cl.width,cl.height,cl.aliases,cl.unicode,cl.svgPathData,cl.aliases},4220:(F,Da)=>{"use strict";var ll="layer-group",cl=[],hl="f5fd",dl="M264.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 149.8C37.4 145.8 32 137.3 32 128s5.4-17.9 13.9-21.8L264.5 5.2zM476.9 209.6l53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 277.8C37.4 273.8 32 265.3 32 256s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0l152-70.2zm-152 198.2l152-70.2 53.2 24.6c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L45.9 405.8C37.4 401.8 32 393.3 32 384s5.4-17.9 13.9-21.8l53.2-24.6 152 70.2c23.4 10.8 50.4 10.8 73.8 0z";Da.mw={prefix:"fas",iconName:ll,icon:[576,512,cl,hl,dl]},Da.qI=Da.mw},325:(F,Da)=>{"use strict";var ll="lightbulb",cl=[128161],hl="f0eb",dl="M272 384c9.6-31.9 29.5-59.1 49.2-86.2c0 0 0 0 0 0c5.2-7.1 10.4-14.2 15.4-21.4c19.8-28.5 31.4-63 31.4-100.3C368 78.8 289.2 0 192 0S16 78.8 16 176c0 37.3 11.6 71.9 31.4 100.3c5 7.2 10.2 14.3 15.4 21.4c0 0 0 0 0 0c19.8 27.1 39.7 54.4 49.2 86.2l160 0zM192 512c44.2 0 80-35.8 80-80l0-16-160 0 0 16c0 44.2 35.8 80 80 80zM112 176c0 8.8-7.2 16-16 16s-16-7.2-16-16c0-61.9 50.1-112 112-112c8.8 0 16 7.2 16 16s-7.2 16-16 16c-44.2 0-80 35.8-80 80z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.rC=Da.mw},7964:(F,Da)=>{"use strict";var ll="link",cl=[128279,"chain"],hl="f0c1",dl="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.CQ=Da.mw},3520:(F,Da)=>{"use strict";var ll="location-dot",cl=["map-marker-alt"],hl="f3c5",dl="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.gK=Da.mw},7761:(F,Da)=>{"use strict";var ll="magnifying-glass",cl=[128269,"search"],hl="f002",dl="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.$U=Da.mw},2e3:(F,Da)=>{"use strict";var ll=[128506,62072],cl="f279",hl="M384 476.1L192 421.2l0-385.3L384 90.8l0 385.3zm32-1.2l0-386.5L543.1 37.5c15.8-6.3 32.9 5.3 32.9 22.3l0 334.8c0 9.8-6 18.6-15.1 22.3L416 474.8zM15.1 95.1L160 37.2l0 386.5L32.9 474.5C17.1 480.8 0 469.2 0 452.2L0 117.4c0-9.8 6-18.6 15.1-22.3z";Da.mw={prefix:"fas",iconName:"map",icon:[576,512,ll,cl,hl]},Da.e5=Da.mw},3233:(F,Da)=>{"use strict";var ll="medal",cl=[127941],hl="f5a2",dl="M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0L133.9 0c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0L487.4 0C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.B9=Da.mw},7290:(F,Da)=>{"use strict";var ll="minus",cl=[8211,8722,10134,"subtract"],hl="f068",dl="M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.EZ=Da.mw},8629:(F,Da)=>{"use strict";var ll="palette",cl=[127912],hl="f53f",dl="M512 256c0 .9 0 1.8 0 2.7c-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48c0 3.4 .4 6.7 1 9.9c2.1 10.2 6.5 20 10.8 29.9c6.1 13.8 12.1 27.5 12.1 42c0 31.8-21.6 60.7-53.4 62c-3.5 .1-7 .2-10.6 .2C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.fy=Da.mw},9683:(F,Da)=>{"use strict";var ll="panorama",cl=[],hl="e209",dl="M45.6 32C20.4 32 0 52.4 0 77.6L0 434.4C0 459.6 20.4 480 45.6 480c5.1 0 10-.8 14.7-2.4C74.6 472.8 177.6 440 320 440s245.4 32.8 259.6 37.6c4.7 1.6 9.7 2.4 14.7 2.4c25.2 0 45.6-20.4 45.6-45.6l0-356.7C640 52.4 619.6 32 594.4 32c-5 0-10 .8-14.7 2.4C565.4 39.2 462.4 72 320 72S74.6 39.2 60.4 34.4C55.6 32.8 50.7 32 45.6 32zM96 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm272 0c7.9 0 15.4 3.9 19.8 10.5L512.3 353c5.4 8 5.6 18.4 .4 26.5s-14.7 12.3-24.2 10.7C442.7 382.4 385.2 376 320 376c-65.6 0-123.4 6.5-169.3 14.4c-9.8 1.7-19.7-2.9-24.7-11.5s-4.3-19.4 1.9-27.2L197.3 265c4.6-5.7 11.4-9 18.7-9s14.2 3.3 18.7 9l26.4 33.1 87-127.6c4.5-6.6 11.9-10.5 19.8-10.5z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.pt=Da.mw},1708:(F,Da)=>{"use strict";var ll="paper-plane",cl=[61913],hl="f1d8",dl="M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480l0-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.is=Da.mw},7472:(F,Da)=>{"use strict";var ll="pause",cl=[9208],hl="f04c",dl="M48 64C21.5 64 0 85.5 0 112L0 400c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48L48 64zm192 0c-26.5 0-48 21.5-48 48l0 288c0 26.5 21.5 48 48 48l32 0c26.5 0 48-21.5 48-48l0-288c0-26.5-21.5-48-48-48l-32 0z";Da.mw={prefix:"fas",iconName:ll,icon:[320,512,cl,hl,dl]},Da.G1=Da.mw},7321:(F,Da)=>{"use strict";var ll=[128394],cl="f304",hl="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z";Da.mw={prefix:"fas",iconName:"pen",icon:[512,512,ll,cl,hl]},Da.hp=Da.mw},9243:(F,Da)=>{"use strict";var ll="person-biking",cl=[128692,"biking"],hl="f84a",dl="M400 96a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm27.2 64l-61.8-48.8c-17.3-13.6-41.7-13.8-59.1-.3l-83.1 64.2c-30.7 23.8-28.5 70.8 4.3 91.6L288 305.1 288 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-128c0-10.7-5.3-20.7-14.2-26.6L295 232.9l60.3-48.5L396 217c5.7 4.5 12.7 7 20 7l64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-52.8 0zM56 384a72 72 0 1 1 144 0A72 72 0 1 1 56 384zm200 0A128 128 0 1 0 0 384a128 128 0 1 0 256 0zm184 0a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zm200 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z";Da.mw={prefix:"fas",iconName:ll,icon:[640,512,cl,hl,dl]},Da.rO=Da.mw},6386:(F,Da)=>{"use strict";var ll="play",cl=[9654],hl="f04b",dl="M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.ij=Da.mw},1372:(F,Da)=>{"use strict";var ll="plus",cl=[10133,61543,"add"],hl="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,"2b",hl]},Da.QL=Da.mw},501:(F,Da)=>{"use strict";var ll="print",cl=[128424,128438,9113],hl="f02f",dl="M128 0C92.7 0 64 28.7 64 64l0 96 64 0 0-96 226.7 0L384 93.3l0 66.7 64 0 0-66.7c0-17-6.7-33.3-18.7-45.3L400 18.7C388 6.7 371.7 0 354.7 0L128 0zM384 352l0 32 0 64-256 0 0-64 0-16 0-16 256 0zm64 32l32 0c17.7 0 32-14.3 32-32l0-96c0-35.3-28.7-64-64-64L64 192c-35.3 0-64 28.7-64 64l0 96c0 17.7 14.3 32 32 32l32 0 0 64c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-64zM432 248a24 24 0 1 1 0 48 24 24 0 1 1 0-48z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.Jx=Da.mw},7744:(F,Da)=>{"use strict";var ll="rocket",cl=[],hl="f135",dl="M156.6 384.9L125.7 354c-8.5-8.5-11.5-20.8-7.7-32.2c3-8.9 7-20.5 11.8-33.8L24 288c-8.6 0-16.6-4.6-20.9-12.1s-4.2-16.7 .2-24.1l52.5-88.5c13-21.9 36.5-35.3 61.9-35.3l82.3 0c2.4-4 4.8-7.7 7.2-11.3C289.1-4.1 411.1-8.1 483.9 5.3c11.6 2.1 20.6 11.2 22.8 22.8c13.4 72.9 9.3 194.8-111.4 276.7c-3.5 2.4-7.3 4.8-11.3 7.2l0 82.3c0 25.4-13.4 49-35.3 61.9l-88.5 52.5c-7.4 4.4-16.6 4.5-24.1 .2s-12.1-12.2-12.1-20.9l0-107.2c-14.1 4.9-26.4 8.9-35.7 11.9c-11.2 3.6-23.4 .5-31.8-7.8zM384 168a40 40 0 1 0 0-80 40 40 0 1 0 0 80z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.KM=Da.mw},6787:(F,Da)=>{"use strict";var ll="satellite-dish",cl=[128225],hl="f7c0",dl="M192 32c0-17.7 14.3-32 32-32C383.1 0 512 128.9 512 288c0 17.7-14.3 32-32 32s-32-14.3-32-32C448 164.3 347.7 64 224 64c-17.7 0-32-14.3-32-32zM60.6 220.6L164.7 324.7l28.4-28.4c-.7-2.6-1.1-5.4-1.1-8.3c0-17.7 14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32c-2.9 0-5.6-.4-8.3-1.1l-28.4 28.4L291.4 451.4c14.5 14.5 11.8 38.8-7.3 46.3C260.5 506.9 234.9 512 208 512C93.1 512 0 418.9 0 304c0-26.9 5.1-52.5 14.4-76.1c7.5-19 31.8-21.8 46.3-7.3zM224 96c106 0 192 86 192 192c0 17.7-14.3 32-32 32s-32-14.3-32-32c0-70.7-57.3-128-128-128c-17.7 0-32-14.3-32-32s14.3-32 32-32z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.hU=Da.mw},1260:(F,Da)=>{"use strict";var ll="share-nodes",cl=["share-alt"],hl="f1e0",dl="M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.ek=Da.mw},1904:(F,Da)=>{"use strict";var ll="sliders",cl=["sliders-h"],hl="f1de",dl="M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da._$=Da.mw},3095:(F,Da)=>{"use strict";var ll="square-rss",cl=["rss-square"],hl="f143",dl="M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zM96 136c0-13.3 10.7-24 24-24c137 0 248 111 248 248c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-110.5-89.5-200-200-200c-13.3 0-24-10.7-24-24zm0 96c0-13.3 10.7-24 24-24c83.9 0 152 68.1 152 152c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-57.4-46.6-104-104-104c-13.3 0-24-10.7-24-24zm0 120a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.zb=Da.mw},4780:(F,Da)=>{"use strict";var ll="star",cl=[11088,61446],hl="f005",dl="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z";Da.mw={prefix:"fas",iconName:ll,icon:[576,512,cl,hl,dl]},Da.yy=Da.mw},6311:(F,Da)=>{"use strict";var ll="triangle-exclamation",cl=[9888,"exclamation-triangle","warning"],hl="f071",dl="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z";Da.mw={prefix:"fas",iconName:ll,icon:[512,512,cl,hl,dl]},Da.JA=Da.mw},7879:(F,Da)=>{"use strict";var ll="user",cl=[128100,62144],hl="f007",dl="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l388.6 0c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304l-91.4 0z";Da.mw={prefix:"fas",iconName:ll,icon:[448,512,cl,hl,dl]},Da.X4=Da.mw},6627:(F,Da)=>{"use strict";var ll="xmark",cl=[128473,10005,10006,10060,215,"close","multiply","remove","times"],hl="f00d",dl="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z";Da.mw={prefix:"fas",iconName:ll,icon:[384,512,cl,hl,dl]},Da.Jy=Da.mw},1545:(F,Da,ll)=>{"use strict";ll.d(Da,{AZ:()=>od,GR:()=>Op,IJ:()=>Up,Qw:()=>Rp,TL:()=>am,Wp:()=>Lu,aH:()=>dl,e6:()=>zu,jM:()=>Um,rx:()=>ld,uj:()=>jp,zY:()=>sm});var cl=ll(9408),hl=Object.defineProperty,__export=(F,Da)=>{for(var ll in Da)hl(F,ll,{get:Da[ll],enumerable:!0})},dl={};
|
|
13
13
|
/*!
|
|
14
14
|
* Photo Sphere Viewer 5.11.0-beta.1
|
|
15
15
|
* @copyright 2014-2015 Jérémy Heleine
|
|
@@ -31,5 +31,5 @@ F.exports=function(){"use strict";var F={},Da={};function define(ll,cl,hl){if(Da
|
|
|
31
31
|
* Copyright 2010-2024 Three.js Authors
|
|
32
32
|
* SPDX-License-Identifier: MIT
|
|
33
33
|
*/
|
|
34
|
-
const cl="168",hl=0,dl=1,pl=2,fl=100,Al=101,bl=102,kl=200,Dl=201,Wl=202,Ql=203,wc=204,Sc=205,eu=206,iu=207,su=208,cu=209,uu=210,hu=211,Lu=212,zu=213,Du=214,Nu=301,qu=302,ih=303,gh=304,ed=306,td=1e3,id=1001,nd=1002,rd=1003,ad=1004,sd=1005,od=1006,ld=1007,cd=1008,ud=1009,hd=1010,dd=1011,pd=1012,md=1013,fd=1014,gd=1015,Ad=1016,yd=1017,vd=1018,_d=1020,xd=35902,bd=1023,wd=1026,Ed=1027,Md=1028,Sd=1029,kd=1031,Td=1033,Id=33776,Cd=33777,Ld=33778,zd=33779,Pd=35840,Dd=35841,Rd=35842,Nd=35843,Ud=36196,Bd=37492,Od=37496,Fd=37808,jd=37809,Vd=37810,Gd=37811,Hd=37812,qd=37813,Zd=37814,Wd=37815,Kd=37816,Qd=37817,Xd=37818,Yd=37819,Jd=37820,$d=37821,lp=36492,mp=36494,gp=36495,Ap=36284,vp=36285,_p=36286,xp=2300,bp=2301,wp=2302,Ep=2400,Mp=2401,Sp=2402,kp="",Tp="srgb",Ip="srgb-linear",Cp="display-p3",Lp="display-p3-linear",zp="linear",Pp="srgb",Dp="rec709",Rp="p3",Np=7680,Up=512,Bp=513,Op=514,Fp=515,jp=516,Vp=517,Gp=518,Hp=519,qp=35044,Zp="300 es",Wp=2e3,Kp=2001;class EventDispatcher{addEventListener(F,Da){void 0===this._listeners&&(this._listeners={});const ll=this._listeners;void 0===ll[F]&&(ll[F]=[]),-1===ll[F].indexOf(Da)&&ll[F].push(Da)}hasEventListener(F,Da){if(void 0===this._listeners)return!1;const ll=this._listeners;return void 0!==ll[F]&&-1!==ll[F].indexOf(Da)}removeEventListener(F,Da){if(void 0===this._listeners)return;const ll=this._listeners[F];if(void 0!==ll){const F=ll.indexOf(Da);-1!==F&&ll.splice(F,1)}}dispatchEvent(F){if(void 0===this._listeners)return;const Da=this._listeners[F.type];if(void 0!==Da){F.target=this;const ll=Da.slice(0);for(let Da=0,cl=ll.length;Da<cl;Da++)ll[Da].call(this,F);F.target=null}}}const Qp=["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 Xp=1234567;const Yp=Math.PI/180,Jp=180/Math.PI;function generateUUID(){const F=4294967295*Math.random()|0,Da=4294967295*Math.random()|0,ll=4294967295*Math.random()|0,cl=4294967295*Math.random()|0;return(Qp[255&F]+Qp[F>>8&255]+Qp[F>>16&255]+Qp[F>>24&255]+"-"+Qp[255&Da]+Qp[Da>>8&255]+"-"+Qp[Da>>16&15|64]+Qp[Da>>24&255]+"-"+Qp[63&ll|128]+Qp[ll>>8&255]+"-"+Qp[ll>>16&255]+Qp[ll>>24&255]+Qp[255&cl]+Qp[cl>>8&255]+Qp[cl>>16&255]+Qp[cl>>24&255]).toLowerCase()}function clamp(F,Da,ll){return Math.max(Da,Math.min(ll,F))}function euclideanModulo(F,Da){return(F%Da+Da)%Da}function lerp(F,Da,ll){return(1-ll)*F+ll*Da}function denormalize(F,Da){switch(Da.constructor){case Float32Array:return F;case Uint32Array:return F/4294967295;case Uint16Array:return F/65535;case Uint8Array:return F/255;case Int32Array:return Math.max(F/2147483647,-1);case Int16Array:return Math.max(F/32767,-1);case Int8Array:return Math.max(F/127,-1);default:throw new Error("Invalid component type.")}}function normalize(F,Da){switch(Da.constructor){case Float32Array:return F;case Uint32Array:return Math.round(4294967295*F);case Uint16Array:return Math.round(65535*F);case Uint8Array:return Math.round(255*F);case Int32Array:return Math.round(2147483647*F);case Int16Array:return Math.round(32767*F);case Int8Array:return Math.round(127*F);default:throw new Error("Invalid component type.")}}const $p={DEG2RAD:Yp,RAD2DEG:Jp,generateUUID:generateUUID,clamp:clamp,euclideanModulo:euclideanModulo,mapLinear:function(F,Da,ll,cl,hl){return cl+(F-Da)*(hl-cl)/(ll-Da)},inverseLerp:function(F,Da,ll){return F!==Da?(ll-F)/(Da-F):0},lerp:lerp,damp:function(F,Da,ll,cl){return lerp(F,Da,1-Math.exp(-ll*cl))},pingpong:function(F,Da){return void 0===Da&&(Da=1),Da-Math.abs(euclideanModulo(F,2*Da)-Da)},smoothstep:function(F,Da,ll){return F<=Da?0:F>=ll?1:(F=(F-Da)/(ll-Da))*F*(3-2*F)},smootherstep:function(F,Da,ll){return F<=Da?0:F>=ll?1:(F=(F-Da)/(ll-Da))*F*F*(F*(6*F-15)+10)},randInt:function(F,Da){return F+Math.floor(Math.random()*(Da-F+1))},randFloat:function(F,Da){return F+Math.random()*(Da-F)},randFloatSpread:function(F){return F*(.5-Math.random())},seededRandom:function(F){void 0!==F&&(Xp=F);let Da=Xp+=1831565813;return Da=Math.imul(Da^Da>>>15,1|Da),Da^=Da+Math.imul(Da^Da>>>7,61|Da),((Da^Da>>>14)>>>0)/4294967296},degToRad:function(F){return F*Yp},radToDeg:function(F){return F*Jp},isPowerOfTwo:function(F){return 0===(F&F-1)&&0!==F},ceilPowerOfTwo:function(F){return Math.pow(2,Math.ceil(Math.log(F)/Math.LN2))},floorPowerOfTwo:function(F){return Math.pow(2,Math.floor(Math.log(F)/Math.LN2))},setQuaternionFromProperEuler:function(F,Da,ll,cl,hl){const dl=Math.cos,pl=Math.sin,fl=dl(ll/2),Al=pl(ll/2),bl=dl((Da+cl)/2),kl=pl((Da+cl)/2),Dl=dl((Da-cl)/2),Wl=pl((Da-cl)/2),Ql=dl((cl-Da)/2),wc=pl((cl-Da)/2);switch(hl){case"XYX":F.set(fl*kl,Al*Dl,Al*Wl,fl*bl);break;case"YZY":F.set(Al*Wl,fl*kl,Al*Dl,fl*bl);break;case"ZXZ":F.set(Al*Dl,Al*Wl,fl*kl,fl*bl);break;case"XZX":F.set(fl*kl,Al*wc,Al*Ql,fl*bl);break;case"YXY":F.set(Al*Ql,fl*kl,Al*wc,fl*bl);break;case"ZYZ":F.set(Al*wc,Al*Ql,fl*kl,fl*bl);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+hl)}},normalize:normalize,denormalize:denormalize};class Vector2{constructor(F,Da){void 0===F&&(F=0),void 0===Da&&(Da=0),Vector2.prototype.isVector2=!0,this.x=F,this.y=Da}get width(){return this.x}set width(F){this.x=F}get height(){return this.y}set height(F){this.y=F}set(F,Da){return this.x=F,this.y=Da,this}setScalar(F){return this.x=F,this.y=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+F)}}clone(){return new this.constructor(this.x,this.y)}copy(F){return this.x=F.x,this.y=F.y,this}add(F){return this.x+=F.x,this.y+=F.y,this}addScalar(F){return this.x+=F,this.y+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this}subScalar(F){return this.x-=F,this.y-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this}multiply(F){return this.x*=F.x,this.y*=F.y,this}multiplyScalar(F){return this.x*=F,this.y*=F,this}divide(F){return this.x/=F.x,this.y/=F.y,this}divideScalar(F){return this.multiplyScalar(1/F)}applyMatrix3(F){const Da=this.x,ll=this.y,cl=F.elements;return this.x=cl[0]*Da+cl[3]*ll+cl[6],this.y=cl[1]*Da+cl[4]*ll+cl[7],this}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y}cross(F){return this.x*F.y-this.y*F.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(F){const Da=Math.sqrt(this.lengthSq()*F.lengthSq());if(0===Da)return Math.PI/2;const ll=this.dot(F)/Da;return Math.acos(clamp(ll,-1,1))}distanceTo(F){return Math.sqrt(this.distanceToSquared(F))}distanceToSquared(F){const Da=this.x-F.x,ll=this.y-F.y;return Da*Da+ll*ll}manhattanDistanceTo(F){return Math.abs(this.x-F.x)+Math.abs(this.y-F.y)}setLength(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this}equals(F){return F.x===this.x&&F.y===this.y}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this}rotateAround(F,Da){const ll=Math.cos(Da),cl=Math.sin(Da),hl=this.x-F.x,dl=this.y-F.y;return this.x=hl*ll-dl*cl+F.x,this.y=hl*cl+dl*ll+F.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==F&&this.set(F,Da,ll,cl,hl,dl,pl,fl,Al)}set(F,Da,ll,cl,hl,dl,pl,fl,Al){const bl=this.elements;return bl[0]=F,bl[1]=cl,bl[2]=pl,bl[3]=Da,bl[4]=hl,bl[5]=fl,bl[6]=ll,bl[7]=dl,bl[8]=Al,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(F){const Da=this.elements,ll=F.elements;return Da[0]=ll[0],Da[1]=ll[1],Da[2]=ll[2],Da[3]=ll[3],Da[4]=ll[4],Da[5]=ll[5],Da[6]=ll[6],Da[7]=ll[7],Da[8]=ll[8],this}extractBasis(F,Da,ll){return F.setFromMatrix3Column(this,0),Da.setFromMatrix3Column(this,1),ll.setFromMatrix3Column(this,2),this}setFromMatrix4(F){const Da=F.elements;return this.set(Da[0],Da[4],Da[8],Da[1],Da[5],Da[9],Da[2],Da[6],Da[10]),this}multiply(F){return this.multiplyMatrices(this,F)}premultiply(F){return this.multiplyMatrices(F,this)}multiplyMatrices(F,Da){const ll=F.elements,cl=Da.elements,hl=this.elements,dl=ll[0],pl=ll[3],fl=ll[6],Al=ll[1],bl=ll[4],kl=ll[7],Dl=ll[2],Wl=ll[5],Ql=ll[8],wc=cl[0],Sc=cl[3],eu=cl[6],iu=cl[1],su=cl[4],cu=cl[7],uu=cl[2],hu=cl[5],Lu=cl[8];return hl[0]=dl*wc+pl*iu+fl*uu,hl[3]=dl*Sc+pl*su+fl*hu,hl[6]=dl*eu+pl*cu+fl*Lu,hl[1]=Al*wc+bl*iu+kl*uu,hl[4]=Al*Sc+bl*su+kl*hu,hl[7]=Al*eu+bl*cu+kl*Lu,hl[2]=Dl*wc+Wl*iu+Ql*uu,hl[5]=Dl*Sc+Wl*su+Ql*hu,hl[8]=Dl*eu+Wl*cu+Ql*Lu,this}multiplyScalar(F){const Da=this.elements;return Da[0]*=F,Da[3]*=F,Da[6]*=F,Da[1]*=F,Da[4]*=F,Da[7]*=F,Da[2]*=F,Da[5]*=F,Da[8]*=F,this}determinant(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8];return Da*dl*bl-Da*pl*Al-ll*hl*bl+ll*pl*fl+cl*hl*Al-cl*dl*fl}invert(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8],kl=bl*dl-pl*Al,Dl=pl*fl-bl*hl,Wl=Al*hl-dl*fl,Ql=Da*kl+ll*Dl+cl*Wl;if(0===Ql)return this.set(0,0,0,0,0,0,0,0,0);const wc=1/Ql;return F[0]=kl*wc,F[1]=(cl*Al-bl*ll)*wc,F[2]=(pl*ll-cl*dl)*wc,F[3]=Dl*wc,F[4]=(bl*Da-cl*fl)*wc,F[5]=(cl*hl-pl*Da)*wc,F[6]=Wl*wc,F[7]=(ll*fl-Al*Da)*wc,F[8]=(dl*Da-ll*hl)*wc,this}transpose(){let F;const Da=this.elements;return F=Da[1],Da[1]=Da[3],Da[3]=F,F=Da[2],Da[2]=Da[6],Da[6]=F,F=Da[5],Da[5]=Da[7],Da[7]=F,this}getNormalMatrix(F){return this.setFromMatrix4(F).invert().transpose()}transposeIntoArray(F){const Da=this.elements;return F[0]=Da[0],F[1]=Da[3],F[2]=Da[6],F[3]=Da[1],F[4]=Da[4],F[5]=Da[7],F[6]=Da[2],F[7]=Da[5],F[8]=Da[8],this}setUvTransform(F,Da,ll,cl,hl,dl,pl){const fl=Math.cos(hl),Al=Math.sin(hl);return this.set(ll*fl,ll*Al,-ll*(fl*dl+Al*pl)+dl+F,-cl*Al,cl*fl,-cl*(-Al*dl+fl*pl)+pl+Da,0,0,1),this}scale(F,Da){return this.premultiply(em.makeScale(F,Da)),this}rotate(F){return this.premultiply(em.makeRotation(-F)),this}translate(F,Da){return this.premultiply(em.makeTranslation(F,Da)),this}makeTranslation(F,Da){return F.isVector2?this.set(1,0,F.x,0,1,F.y,0,0,1):this.set(1,0,F,0,1,Da,0,0,1),this}makeRotation(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,-ll,0,ll,Da,0,0,0,1),this}makeScale(F,Da){return this.set(F,0,0,0,Da,0,0,0,1),this}equals(F){const Da=this.elements,ll=F.elements;for(let cl=0;cl<9;cl++)if(Da[cl]!==ll[cl])return!1;return!0}fromArray(F,Da){void 0===Da&&(Da=0);for(let ll=0;ll<9;ll++)this.elements[ll]=F[ll+Da];return this}toArray(F,Da){void 0===F&&(F=[]),void 0===Da&&(Da=0);const ll=this.elements;return F[Da]=ll[0],F[Da+1]=ll[1],F[Da+2]=ll[2],F[Da+3]=ll[3],F[Da+4]=ll[4],F[Da+5]=ll[5],F[Da+6]=ll[6],F[Da+7]=ll[7],F[Da+8]=ll[8],F}clone(){return(new this.constructor).fromArray(this.elements)}}const em=new Matrix3;function arrayNeedsUint32(F){for(let Da=F.length-1;Da>=0;--Da)if(F[Da]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function createElementNS(F){return document.createElementNS("http://www.w3.org/1999/xhtml",F)}function createCanvasElement(){const F=createElementNS("canvas");return F.style.display="block",F}const tm={};function warnOnce(F){F in tm||(tm[F]=!0,console.warn(F))}const im=(new Matrix3).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),nm=(new Matrix3).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),rm={[Ip]:{transfer:zp,primaries:Dp,luminanceCoefficients:[.2126,.7152,.0722],toReference:F=>F,fromReference:F=>F},[Tp]:{transfer:Pp,primaries:Dp,luminanceCoefficients:[.2126,.7152,.0722],toReference:F=>F.convertSRGBToLinear(),fromReference:F=>F.convertLinearToSRGB()},[Lp]:{transfer:zp,primaries:Rp,luminanceCoefficients:[.2289,.6917,.0793],toReference:F=>F.applyMatrix3(nm),fromReference:F=>F.applyMatrix3(im)},[Cp]:{transfer:Pp,primaries:Rp,luminanceCoefficients:[.2289,.6917,.0793],toReference:F=>F.convertSRGBToLinear().applyMatrix3(nm),fromReference:F=>F.applyMatrix3(im).convertLinearToSRGB()}},am=new Set([Ip,Lp]),sm={enabled:!0,_workingColorSpace:Ip,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(F){if(!am.has(F))throw new Error(`Unsupported working color space, "${F}".`);this._workingColorSpace=F},convert:function(F,Da,ll){if(!1===this.enabled||Da===ll||!Da||!ll)return F;const cl=rm[Da].toReference;return(0,rm[ll].fromReference)(cl(F))},fromWorkingColorSpace:function(F,Da){return this.convert(F,this._workingColorSpace,Da)},toWorkingColorSpace:function(F,Da){return this.convert(F,Da,this._workingColorSpace)},getPrimaries:function(F){return rm[F].primaries},getTransfer:function(F){return F===kp?zp:rm[F].transfer},getLuminanceCoefficients:function(F,Da){return void 0===Da&&(Da=this._workingColorSpace),F.fromArray(rm[Da].luminanceCoefficients)}};function SRGBToLinear(F){return F<.04045?.0773993808*F:Math.pow(.9478672986*F+.0521327014,2.4)}function LinearToSRGB(F){return F<.0031308?12.92*F:1.055*Math.pow(F,.41666)-.055}let om;class ImageUtils{static getDataURL(F){if(/^data:/i.test(F.src))return F.src;if("undefined"===typeof HTMLCanvasElement)return F.src;let Da;if(F instanceof HTMLCanvasElement)Da=F;else{void 0===om&&(om=createElementNS("canvas")),om.width=F.width,om.height=F.height;const ll=om.getContext("2d");F instanceof ImageData?ll.putImageData(F,0,0):ll.drawImage(F,0,0,F.width,F.height),Da=om}return Da.width>2048||Da.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",F),Da.toDataURL("image/jpeg",.6)):Da.toDataURL("image/png")}static sRGBToLinear(F){if("undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap){const Da=createElementNS("canvas");Da.width=F.width,Da.height=F.height;const ll=Da.getContext("2d");ll.drawImage(F,0,0,F.width,F.height);const cl=ll.getImageData(0,0,F.width,F.height),hl=cl.data;for(let F=0;F<hl.length;F++)hl[F]=255*SRGBToLinear(hl[F]/255);return ll.putImageData(cl,0,0),Da}if(F.data){const Da=F.data.slice(0);for(let F=0;F<Da.length;F++)Da instanceof Uint8Array||Da instanceof Uint8ClampedArray?Da[F]=Math.floor(255*SRGBToLinear(Da[F]/255)):Da[F]=SRGBToLinear(Da[F]);return{data:Da,width:F.width,height:F.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),F}}let lm=0;class Source{constructor(F){void 0===F&&(F=null),this.isSource=!0,Object.defineProperty(this,"id",{value:lm++}),this.uuid=generateUUID(),this.data=F,this.dataReady=!0,this.version=0}set needsUpdate(F){!0===F&&this.version++}toJSON(F){const Da=void 0===F||"string"===typeof F;if(!Da&&void 0!==F.images[this.uuid])return F.images[this.uuid];const ll={uuid:this.uuid,url:""},cl=this.data;if(null!==cl){let F;if(Array.isArray(cl)){F=[];for(let Da=0,ll=cl.length;Da<ll;Da++)cl[Da].isDataTexture?F.push(serializeImage(cl[Da].image)):F.push(serializeImage(cl[Da]))}else F=serializeImage(cl);ll.url=F}return Da||(F.images[this.uuid]=ll),ll}}function serializeImage(F){return"undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap?ImageUtils.getDataURL(F):F.data?{data:Array.from(F.data),width:F.width,height:F.height,type:F.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let cm=0;class Texture extends EventDispatcher{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){void 0===F&&(F=Texture.DEFAULT_IMAGE),void 0===Da&&(Da=Texture.DEFAULT_MAPPING),void 0===ll&&(ll=id),void 0===cl&&(cl=id),void 0===hl&&(hl=od),void 0===dl&&(dl=cd),void 0===pl&&(pl=bd),void 0===fl&&(fl=ud),void 0===Al&&(Al=Texture.DEFAULT_ANISOTROPY),void 0===bl&&(bl=kp),super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:cm++}),this.uuid=generateUUID(),this.name="",this.source=new Source(F),this.mipmaps=[],this.mapping=Da,this.channel=0,this.wrapS=ll,this.wrapT=cl,this.magFilter=hl,this.minFilter=dl,this.anisotropy=Al,this.format=pl,this.internalFormat=null,this.type=fl,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=bl,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(F){void 0===F&&(F=null),this.source.data=F}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(F){return this.name=F.name,this.source=F.source,this.mipmaps=F.mipmaps.slice(0),this.mapping=F.mapping,this.channel=F.channel,this.wrapS=F.wrapS,this.wrapT=F.wrapT,this.magFilter=F.magFilter,this.minFilter=F.minFilter,this.anisotropy=F.anisotropy,this.format=F.format,this.internalFormat=F.internalFormat,this.type=F.type,this.offset.copy(F.offset),this.repeat.copy(F.repeat),this.center.copy(F.center),this.rotation=F.rotation,this.matrixAutoUpdate=F.matrixAutoUpdate,this.matrix.copy(F.matrix),this.generateMipmaps=F.generateMipmaps,this.premultiplyAlpha=F.premultiplyAlpha,this.flipY=F.flipY,this.unpackAlignment=F.unpackAlignment,this.colorSpace=F.colorSpace,this.userData=JSON.parse(JSON.stringify(F.userData)),this.needsUpdate=!0,this}toJSON(F){const Da=void 0===F||"string"===typeof F;if(!Da&&void 0!==F.textures[this.uuid])return F.textures[this.uuid];const ll={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(F).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&&(ll.userData=this.userData),Da||(F.textures[this.uuid]=ll),ll}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(F){if(300!==this.mapping)return F;if(F.applyMatrix3(this.matrix),F.x<0||F.x>1)switch(this.wrapS){case td:F.x=F.x-Math.floor(F.x);break;case id:F.x=F.x<0?0:1;break;case nd:1===Math.abs(Math.floor(F.x)%2)?F.x=Math.ceil(F.x)-F.x:F.x=F.x-Math.floor(F.x)}if(F.y<0||F.y>1)switch(this.wrapT){case td:F.y=F.y-Math.floor(F.y);break;case id:F.y=F.y<0?0:1;break;case nd:1===Math.abs(Math.floor(F.y)%2)?F.y=Math.ceil(F.y)-F.y:F.y=F.y-Math.floor(F.y)}return this.flipY&&(F.y=1-F.y),F}set needsUpdate(F){!0===F&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(F){!0===F&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=300,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=1),Vector4.prototype.isVector4=!0,this.x=F,this.y=Da,this.z=ll,this.w=cl}get width(){return this.z}set width(F){this.z=F}get height(){return this.w}set height(F){this.w=F}set(F,Da,ll,cl){return this.x=F,this.y=Da,this.z=ll,this.w=cl,this}setScalar(F){return this.x=F,this.y=F,this.z=F,this.w=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setZ(F){return this.z=F,this}setW(F){return this.w=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;case 2:this.z=Da;break;case 3:this.w=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){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: "+F)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(F){return this.x=F.x,this.y=F.y,this.z=F.z,this.w=void 0!==F.w?F.w:1,this}add(F){return this.x+=F.x,this.y+=F.y,this.z+=F.z,this.w+=F.w,this}addScalar(F){return this.x+=F,this.y+=F,this.z+=F,this.w+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this.z=F.z+Da.z,this.w=F.w+Da.w,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this.z+=F.z*Da,this.w+=F.w*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this.z-=F.z,this.w-=F.w,this}subScalar(F){return this.x-=F,this.y-=F,this.z-=F,this.w-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this.z=F.z-Da.z,this.w=F.w-Da.w,this}multiply(F){return this.x*=F.x,this.y*=F.y,this.z*=F.z,this.w*=F.w,this}multiplyScalar(F){return this.x*=F,this.y*=F,this.z*=F,this.w*=F,this}applyMatrix4(F){const Da=this.x,ll=this.y,cl=this.z,hl=this.w,dl=F.elements;return this.x=dl[0]*Da+dl[4]*ll+dl[8]*cl+dl[12]*hl,this.y=dl[1]*Da+dl[5]*ll+dl[9]*cl+dl[13]*hl,this.z=dl[2]*Da+dl[6]*ll+dl[10]*cl+dl[14]*hl,this.w=dl[3]*Da+dl[7]*ll+dl[11]*cl+dl[15]*hl,this}divideScalar(F){return this.multiplyScalar(1/F)}setAxisAngleFromQuaternion(F){this.w=2*Math.acos(F.w);const Da=Math.sqrt(1-F.w*F.w);return Da<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=F.x/Da,this.y=F.y/Da,this.z=F.z/Da),this}setAxisAngleFromRotationMatrix(F){let Da,ll,cl,hl;const dl=.01,pl=.1,fl=F.elements,Al=fl[0],bl=fl[4],kl=fl[8],Dl=fl[1],Wl=fl[5],Ql=fl[9],wc=fl[2],Sc=fl[6],eu=fl[10];if(Math.abs(bl-Dl)<dl&&Math.abs(kl-wc)<dl&&Math.abs(Ql-Sc)<dl){if(Math.abs(bl+Dl)<pl&&Math.abs(kl+wc)<pl&&Math.abs(Ql+Sc)<pl&&Math.abs(Al+Wl+eu-3)<pl)return this.set(1,0,0,0),this;Da=Math.PI;const F=(Al+1)/2,fl=(Wl+1)/2,iu=(eu+1)/2,su=(bl+Dl)/4,cu=(kl+wc)/4,uu=(Ql+Sc)/4;return F>fl&&F>iu?F<dl?(ll=0,cl=.707106781,hl=.707106781):(ll=Math.sqrt(F),cl=su/ll,hl=cu/ll):fl>iu?fl<dl?(ll=.707106781,cl=0,hl=.707106781):(cl=Math.sqrt(fl),ll=su/cl,hl=uu/cl):iu<dl?(ll=.707106781,cl=.707106781,hl=0):(hl=Math.sqrt(iu),ll=cu/hl,cl=uu/hl),this.set(ll,cl,hl,Da),this}let iu=Math.sqrt((Sc-Ql)*(Sc-Ql)+(kl-wc)*(kl-wc)+(Dl-bl)*(Dl-bl));return Math.abs(iu)<.001&&(iu=1),this.x=(Sc-Ql)/iu,this.y=(kl-wc)/iu,this.z=(Dl-bl)/iu,this.w=Math.acos((Al+Wl+eu-1)/2),this}setFromMatrixPosition(F){const Da=F.elements;return this.x=Da[12],this.y=Da[13],this.z=Da[14],this.w=Da[15],this}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this.z=Math.min(this.z,F.z),this.w=Math.min(this.w,F.w),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this.z=Math.max(this.z,F.z),this.w=Math.max(this.w,F.w),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this.z=Math.max(F.z,Math.min(Da.z,this.z)),this.w=Math.max(F.w,Math.min(Da.w,this.w)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this.z=Math.max(F,Math.min(Da,this.z)),this.w=Math.max(F,Math.min(Da,this.w)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y+this.z*F.z+this.w*F.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(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this.z+=(F.z-this.z)*Da,this.w+=(F.w-this.w)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this.z=F.z+(Da.z-F.z)*ll,this.w=F.w+(Da.w-F.w)*ll,this}equals(F){return F.x===this.x&&F.y===this.y&&F.z===this.z&&F.w===this.w}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this.z=F[Da+2],this.w=F[Da+3],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F[Da+2]=this.z,F[Da+3]=this.w,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this.z=F.getZ(Da),this.w=F.getW(Da),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 RenderTarget extends EventDispatcher{constructor(F,Da,ll){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll={}),super(),this.isRenderTarget=!0,this.width=F,this.height=Da,this.depth=1,this.scissor=new Vector4(0,0,F,Da),this.scissorTest=!1,this.viewport=new Vector4(0,0,F,Da);const cl={width:F,height:Da,depth:1};ll=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:od,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},ll);const hl=new Texture(cl,ll.mapping,ll.wrapS,ll.wrapT,ll.magFilter,ll.minFilter,ll.format,ll.type,ll.anisotropy,ll.colorSpace);hl.flipY=!1,hl.generateMipmaps=ll.generateMipmaps,hl.internalFormat=ll.internalFormat,this.textures=[];const dl=ll.count;for(let pl=0;pl<dl;pl++)this.textures[pl]=hl.clone(),this.textures[pl].isRenderTargetTexture=!0;this.depthBuffer=ll.depthBuffer,this.stencilBuffer=ll.stencilBuffer,this.resolveDepthBuffer=ll.resolveDepthBuffer,this.resolveStencilBuffer=ll.resolveStencilBuffer,this.depthTexture=ll.depthTexture,this.samples=ll.samples}get texture(){return this.textures[0]}set texture(F){this.textures[0]=F}setSize(F,Da,ll){if(void 0===ll&&(ll=1),this.width!==F||this.height!==Da||this.depth!==ll){this.width=F,this.height=Da,this.depth=ll;for(let cl=0,hl=this.textures.length;cl<hl;cl++)this.textures[cl].image.width=F,this.textures[cl].image.height=Da,this.textures[cl].image.depth=ll;this.dispose()}this.viewport.set(0,0,F,Da),this.scissor.set(0,0,F,Da)}clone(){return(new this.constructor).copy(this)}copy(F){this.width=F.width,this.height=F.height,this.depth=F.depth,this.scissor.copy(F.scissor),this.scissorTest=F.scissorTest,this.viewport.copy(F.viewport),this.textures.length=0;for(let ll=0,cl=F.textures.length;ll<cl;ll++)this.textures[ll]=F.textures[ll].clone(),this.textures[ll].isRenderTargetTexture=!0;const Da=Object.assign({},F.texture.image);return this.texture.source=new Source(Da),this.depthBuffer=F.depthBuffer,this.stencilBuffer=F.stencilBuffer,this.resolveDepthBuffer=F.resolveDepthBuffer,this.resolveStencilBuffer=F.resolveStencilBuffer,null!==F.depthTexture&&(this.depthTexture=F.depthTexture.clone()),this.samples=F.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(F,Da,ll){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll={}),super(F,Da,ll),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(F,Da,ll,cl){void 0===F&&(F=null),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(null),this.isDataArrayTexture=!0,this.image={data:F,width:Da,height:ll,depth:cl},this.magFilter=rd,this.minFilter=rd,this.wrapR=id,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(F){this.layerUpdates.add(F)}clearLayerUpdates(){this.layerUpdates.clear()}}class Data3DTexture extends Texture{constructor(F,Da,ll,cl){void 0===F&&(F=null),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(null),this.isData3DTexture=!0,this.image={data:F,width:Da,height:ll,depth:cl},this.magFilter=rd,this.minFilter=rd,this.wrapR=id,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Quaternion{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=1),this.isQuaternion=!0,this._x=F,this._y=Da,this._z=ll,this._w=cl}static slerpFlat(F,Da,ll,cl,hl,dl,pl){let fl=ll[cl+0],Al=ll[cl+1],bl=ll[cl+2],kl=ll[cl+3];const Dl=hl[dl+0],Wl=hl[dl+1],Ql=hl[dl+2],wc=hl[dl+3];if(0===pl)return F[Da+0]=fl,F[Da+1]=Al,F[Da+2]=bl,void(F[Da+3]=kl);if(1===pl)return F[Da+0]=Dl,F[Da+1]=Wl,F[Da+2]=Ql,void(F[Da+3]=wc);if(kl!==wc||fl!==Dl||Al!==Wl||bl!==Ql){let F=1-pl;const Da=fl*Dl+Al*Wl+bl*Ql+kl*wc,ll=Da>=0?1:-1,cl=1-Da*Da;if(cl>Number.EPSILON){const hl=Math.sqrt(cl),dl=Math.atan2(hl,Da*ll);F=Math.sin(F*dl)/hl,pl=Math.sin(pl*dl)/hl}const hl=pl*ll;if(fl=fl*F+Dl*hl,Al=Al*F+Wl*hl,bl=bl*F+Ql*hl,kl=kl*F+wc*hl,F===1-pl){const F=1/Math.sqrt(fl*fl+Al*Al+bl*bl+kl*kl);fl*=F,Al*=F,bl*=F,kl*=F}}F[Da]=fl,F[Da+1]=Al,F[Da+2]=bl,F[Da+3]=kl}static multiplyQuaternionsFlat(F,Da,ll,cl,hl,dl){const pl=ll[cl],fl=ll[cl+1],Al=ll[cl+2],bl=ll[cl+3],kl=hl[dl],Dl=hl[dl+1],Wl=hl[dl+2],Ql=hl[dl+3];return F[Da]=pl*Ql+bl*kl+fl*Wl-Al*Dl,F[Da+1]=fl*Ql+bl*Dl+Al*kl-pl*Wl,F[Da+2]=Al*Ql+bl*Wl+pl*Dl-fl*kl,F[Da+3]=bl*Ql-pl*kl-fl*Dl-Al*Wl,F}get x(){return this._x}set x(F){this._x=F,this._onChangeCallback()}get y(){return this._y}set y(F){this._y=F,this._onChangeCallback()}get z(){return this._z}set z(F){this._z=F,this._onChangeCallback()}get w(){return this._w}set w(F){this._w=F,this._onChangeCallback()}set(F,Da,ll,cl){return this._x=F,this._y=Da,this._z=ll,this._w=cl,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(F){return this._x=F.x,this._y=F.y,this._z=F.z,this._w=F.w,this._onChangeCallback(),this}setFromEuler(F,Da){void 0===Da&&(Da=!0);const ll=F._x,cl=F._y,hl=F._z,dl=F._order,pl=Math.cos,fl=Math.sin,Al=pl(ll/2),bl=pl(cl/2),kl=pl(hl/2),Dl=fl(ll/2),Wl=fl(cl/2),Ql=fl(hl/2);switch(dl){case"XYZ":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"YXZ":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;case"ZXY":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"ZYX":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;case"YZX":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"XZY":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+dl)}return!0===Da&&this._onChangeCallback(),this}setFromAxisAngle(F,Da){const ll=Da/2,cl=Math.sin(ll);return this._x=F.x*cl,this._y=F.y*cl,this._z=F.z*cl,this._w=Math.cos(ll),this._onChangeCallback(),this}setFromRotationMatrix(F){const Da=F.elements,ll=Da[0],cl=Da[4],hl=Da[8],dl=Da[1],pl=Da[5],fl=Da[9],Al=Da[2],bl=Da[6],kl=Da[10],Dl=ll+pl+kl;if(Dl>0){const F=.5/Math.sqrt(Dl+1);this._w=.25/F,this._x=(bl-fl)*F,this._y=(hl-Al)*F,this._z=(dl-cl)*F}else if(ll>pl&&ll>kl){const F=2*Math.sqrt(1+ll-pl-kl);this._w=(bl-fl)/F,this._x=.25*F,this._y=(cl+dl)/F,this._z=(hl+Al)/F}else if(pl>kl){const F=2*Math.sqrt(1+pl-ll-kl);this._w=(hl-Al)/F,this._x=(cl+dl)/F,this._y=.25*F,this._z=(fl+bl)/F}else{const F=2*Math.sqrt(1+kl-ll-pl);this._w=(dl-cl)/F,this._x=(hl+Al)/F,this._y=(fl+bl)/F,this._z=.25*F}return this._onChangeCallback(),this}setFromUnitVectors(F,Da){let ll=F.dot(Da)+1;return ll<Number.EPSILON?(ll=0,Math.abs(F.x)>Math.abs(F.z)?(this._x=-F.y,this._y=F.x,this._z=0,this._w=ll):(this._x=0,this._y=-F.z,this._z=F.y,this._w=ll)):(this._x=F.y*Da.z-F.z*Da.y,this._y=F.z*Da.x-F.x*Da.z,this._z=F.x*Da.y-F.y*Da.x,this._w=ll),this.normalize()}angleTo(F){return 2*Math.acos(Math.abs(clamp(this.dot(F),-1,1)))}rotateTowards(F,Da){const ll=this.angleTo(F);if(0===ll)return this;const cl=Math.min(1,Da/ll);return this.slerp(F,cl),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(F){return this._x*F._x+this._y*F._y+this._z*F._z+this._w*F._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 F=this.length();return 0===F?(this._x=0,this._y=0,this._z=0,this._w=1):(F=1/F,this._x=this._x*F,this._y=this._y*F,this._z=this._z*F,this._w=this._w*F),this._onChangeCallback(),this}multiply(F){return this.multiplyQuaternions(this,F)}premultiply(F){return this.multiplyQuaternions(F,this)}multiplyQuaternions(F,Da){const ll=F._x,cl=F._y,hl=F._z,dl=F._w,pl=Da._x,fl=Da._y,Al=Da._z,bl=Da._w;return this._x=ll*bl+dl*pl+cl*Al-hl*fl,this._y=cl*bl+dl*fl+hl*pl-ll*Al,this._z=hl*bl+dl*Al+ll*fl-cl*pl,this._w=dl*bl-ll*pl-cl*fl-hl*Al,this._onChangeCallback(),this}slerp(F,Da){if(0===Da)return this;if(1===Da)return this.copy(F);const ll=this._x,cl=this._y,hl=this._z,dl=this._w;let pl=dl*F._w+ll*F._x+cl*F._y+hl*F._z;if(pl<0?(this._w=-F._w,this._x=-F._x,this._y=-F._y,this._z=-F._z,pl=-pl):this.copy(F),pl>=1)return this._w=dl,this._x=ll,this._y=cl,this._z=hl,this;const fl=1-pl*pl;if(fl<=Number.EPSILON){const F=1-Da;return this._w=F*dl+Da*this._w,this._x=F*ll+Da*this._x,this._y=F*cl+Da*this._y,this._z=F*hl+Da*this._z,this.normalize(),this}const Al=Math.sqrt(fl),bl=Math.atan2(Al,pl),kl=Math.sin((1-Da)*bl)/Al,Dl=Math.sin(Da*bl)/Al;return this._w=dl*kl+this._w*Dl,this._x=ll*kl+this._x*Dl,this._y=cl*kl+this._y*Dl,this._z=hl*kl+this._z*Dl,this._onChangeCallback(),this}slerpQuaternions(F,Da,ll){return this.copy(F).slerp(Da,ll)}random(){const F=2*Math.PI*Math.random(),Da=2*Math.PI*Math.random(),ll=Math.random(),cl=Math.sqrt(1-ll),hl=Math.sqrt(ll);return this.set(cl*Math.sin(F),cl*Math.cos(F),hl*Math.sin(Da),hl*Math.cos(Da))}equals(F){return F._x===this._x&&F._y===this._y&&F._z===this._z&&F._w===this._w}fromArray(F,Da){return void 0===Da&&(Da=0),this._x=F[Da],this._y=F[Da+1],this._z=F[Da+2],this._w=F[Da+3],this._onChangeCallback(),this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this._x,F[Da+1]=this._y,F[Da+2]=this._z,F[Da+3]=this._w,F}fromBufferAttribute(F,Da){return this._x=F.getX(Da),this._y=F.getY(Da),this._z=F.getZ(Da),this._w=F.getW(Da),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(F){return this._onChangeCallback=F,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(F,Da,ll){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),Vector3.prototype.isVector3=!0,this.x=F,this.y=Da,this.z=ll}set(F,Da,ll){return void 0===ll&&(ll=this.z),this.x=F,this.y=Da,this.z=ll,this}setScalar(F){return this.x=F,this.y=F,this.z=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setZ(F){return this.z=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;case 2:this.z=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+F)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(F){return this.x=F.x,this.y=F.y,this.z=F.z,this}add(F){return this.x+=F.x,this.y+=F.y,this.z+=F.z,this}addScalar(F){return this.x+=F,this.y+=F,this.z+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this.z=F.z+Da.z,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this.z+=F.z*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this.z-=F.z,this}subScalar(F){return this.x-=F,this.y-=F,this.z-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this.z=F.z-Da.z,this}multiply(F){return this.x*=F.x,this.y*=F.y,this.z*=F.z,this}multiplyScalar(F){return this.x*=F,this.y*=F,this.z*=F,this}multiplyVectors(F,Da){return this.x=F.x*Da.x,this.y=F.y*Da.y,this.z=F.z*Da.z,this}applyEuler(F){return this.applyQuaternion(hm.setFromEuler(F))}applyAxisAngle(F,Da){return this.applyQuaternion(hm.setFromAxisAngle(F,Da))}applyMatrix3(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements;return this.x=hl[0]*Da+hl[3]*ll+hl[6]*cl,this.y=hl[1]*Da+hl[4]*ll+hl[7]*cl,this.z=hl[2]*Da+hl[5]*ll+hl[8]*cl,this}applyNormalMatrix(F){return this.applyMatrix3(F).normalize()}applyMatrix4(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements,dl=1/(hl[3]*Da+hl[7]*ll+hl[11]*cl+hl[15]);return this.x=(hl[0]*Da+hl[4]*ll+hl[8]*cl+hl[12])*dl,this.y=(hl[1]*Da+hl[5]*ll+hl[9]*cl+hl[13])*dl,this.z=(hl[2]*Da+hl[6]*ll+hl[10]*cl+hl[14])*dl,this}applyQuaternion(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.x,dl=F.y,pl=F.z,fl=F.w,Al=2*(dl*cl-pl*ll),bl=2*(pl*Da-hl*cl),kl=2*(hl*ll-dl*Da);return this.x=Da+fl*Al+dl*kl-pl*bl,this.y=ll+fl*bl+pl*Al-hl*kl,this.z=cl+fl*kl+hl*bl-dl*Al,this}project(F){return this.applyMatrix4(F.matrixWorldInverse).applyMatrix4(F.projectionMatrix)}unproject(F){return this.applyMatrix4(F.projectionMatrixInverse).applyMatrix4(F.matrixWorld)}transformDirection(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements;return this.x=hl[0]*Da+hl[4]*ll+hl[8]*cl,this.y=hl[1]*Da+hl[5]*ll+hl[9]*cl,this.z=hl[2]*Da+hl[6]*ll+hl[10]*cl,this.normalize()}divide(F){return this.x/=F.x,this.y/=F.y,this.z/=F.z,this}divideScalar(F){return this.multiplyScalar(1/F)}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this.z=Math.min(this.z,F.z),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this.z=Math.max(this.z,F.z),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this.z=Math.max(F.z,Math.min(Da.z,this.z)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this.z=Math.max(F,Math.min(Da,this.z)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y+this.z*F.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(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this.z+=(F.z-this.z)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this.z=F.z+(Da.z-F.z)*ll,this}cross(F){return this.crossVectors(this,F)}crossVectors(F,Da){const ll=F.x,cl=F.y,hl=F.z,dl=Da.x,pl=Da.y,fl=Da.z;return this.x=cl*fl-hl*pl,this.y=hl*dl-ll*fl,this.z=ll*pl-cl*dl,this}projectOnVector(F){const Da=F.lengthSq();if(0===Da)return this.set(0,0,0);const ll=F.dot(this)/Da;return this.copy(F).multiplyScalar(ll)}projectOnPlane(F){return um.copy(this).projectOnVector(F),this.sub(um)}reflect(F){return this.sub(um.copy(F).multiplyScalar(2*this.dot(F)))}angleTo(F){const Da=Math.sqrt(this.lengthSq()*F.lengthSq());if(0===Da)return Math.PI/2;const ll=this.dot(F)/Da;return Math.acos(clamp(ll,-1,1))}distanceTo(F){return Math.sqrt(this.distanceToSquared(F))}distanceToSquared(F){const Da=this.x-F.x,ll=this.y-F.y,cl=this.z-F.z;return Da*Da+ll*ll+cl*cl}manhattanDistanceTo(F){return Math.abs(this.x-F.x)+Math.abs(this.y-F.y)+Math.abs(this.z-F.z)}setFromSpherical(F){return this.setFromSphericalCoords(F.radius,F.phi,F.theta)}setFromSphericalCoords(F,Da,ll){const cl=Math.sin(Da)*F;return this.x=cl*Math.sin(ll),this.y=Math.cos(Da)*F,this.z=cl*Math.cos(ll),this}setFromCylindrical(F){return this.setFromCylindricalCoords(F.radius,F.theta,F.y)}setFromCylindricalCoords(F,Da,ll){return this.x=F*Math.sin(Da),this.y=ll,this.z=F*Math.cos(Da),this}setFromMatrixPosition(F){const Da=F.elements;return this.x=Da[12],this.y=Da[13],this.z=Da[14],this}setFromMatrixScale(F){const Da=this.setFromMatrixColumn(F,0).length(),ll=this.setFromMatrixColumn(F,1).length(),cl=this.setFromMatrixColumn(F,2).length();return this.x=Da,this.y=ll,this.z=cl,this}setFromMatrixColumn(F,Da){return this.fromArray(F.elements,4*Da)}setFromMatrix3Column(F,Da){return this.fromArray(F.elements,3*Da)}setFromEuler(F){return this.x=F._x,this.y=F._y,this.z=F._z,this}setFromColor(F){return this.x=F.r,this.y=F.g,this.z=F.b,this}equals(F){return F.x===this.x&&F.y===this.y&&F.z===this.z}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this.z=F[Da+2],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F[Da+2]=this.z,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this.z=F.getZ(Da),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const F=Math.random()*Math.PI*2,Da=2*Math.random()-1,ll=Math.sqrt(1-Da*Da);return this.x=ll*Math.cos(F),this.y=Da,this.z=ll*Math.sin(F),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const um=new Vector3,hm=new Quaternion;class Box3{constructor(F,Da){void 0===F&&(F=new Vector3(1/0,1/0,1/0)),void 0===Da&&(Da=new Vector3(-1/0,-1/0,-1/0)),this.isBox3=!0,this.min=F,this.max=Da}set(F,Da){return this.min.copy(F),this.max.copy(Da),this}setFromArray(F){this.makeEmpty();for(let Da=0,ll=F.length;Da<ll;Da+=3)this.expandByPoint(pm.fromArray(F,Da));return this}setFromBufferAttribute(F){this.makeEmpty();for(let Da=0,ll=F.count;Da<ll;Da++)this.expandByPoint(pm.fromBufferAttribute(F,Da));return this}setFromPoints(F){this.makeEmpty();for(let Da=0,ll=F.length;Da<ll;Da++)this.expandByPoint(F[Da]);return this}setFromCenterAndSize(F,Da){const ll=pm.copy(Da).multiplyScalar(.5);return this.min.copy(F).sub(ll),this.max.copy(F).add(ll),this}setFromObject(F,Da){return void 0===Da&&(Da=!1),this.makeEmpty(),this.expandByObject(F,Da)}clone(){return(new this.constructor).copy(this)}copy(F){return this.min.copy(F.min),this.max.copy(F.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(F){return this.isEmpty()?F.set(0,0,0):F.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(F){return this.isEmpty()?F.set(0,0,0):F.subVectors(this.max,this.min)}expandByPoint(F){return this.min.min(F),this.max.max(F),this}expandByVector(F){return this.min.sub(F),this.max.add(F),this}expandByScalar(F){return this.min.addScalar(-F),this.max.addScalar(F),this}expandByObject(F,Da){void 0===Da&&(Da=!1),F.updateWorldMatrix(!1,!1);const ll=F.geometry;if(void 0!==ll){const cl=ll.getAttribute("position");if(!0===Da&&void 0!==cl&&!0!==F.isInstancedMesh)for(let Da=0,ll=cl.count;Da<ll;Da++)!0===F.isMesh?F.getVertexPosition(Da,pm):pm.fromBufferAttribute(cl,Da),pm.applyMatrix4(F.matrixWorld),this.expandByPoint(pm);else void 0!==F.boundingBox?(null===F.boundingBox&&F.computeBoundingBox(),mm.copy(F.boundingBox)):(null===ll.boundingBox&&ll.computeBoundingBox(),mm.copy(ll.boundingBox)),mm.applyMatrix4(F.matrixWorld),this.union(mm)}const cl=F.children;for(let hl=0,dl=cl.length;hl<dl;hl++)this.expandByObject(cl[hl],Da);return this}containsPoint(F){return F.x>=this.min.x&&F.x<=this.max.x&&F.y>=this.min.y&&F.y<=this.max.y&&F.z>=this.min.z&&F.z<=this.max.z}containsBox(F){return this.min.x<=F.min.x&&F.max.x<=this.max.x&&this.min.y<=F.min.y&&F.max.y<=this.max.y&&this.min.z<=F.min.z&&F.max.z<=this.max.z}getParameter(F,Da){return Da.set((F.x-this.min.x)/(this.max.x-this.min.x),(F.y-this.min.y)/(this.max.y-this.min.y),(F.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(F){return F.max.x>=this.min.x&&F.min.x<=this.max.x&&F.max.y>=this.min.y&&F.min.y<=this.max.y&&F.max.z>=this.min.z&&F.min.z<=this.max.z}intersectsSphere(F){return this.clampPoint(F.center,pm),pm.distanceToSquared(F.center)<=F.radius*F.radius}intersectsPlane(F){let Da,ll;return F.normal.x>0?(Da=F.normal.x*this.min.x,ll=F.normal.x*this.max.x):(Da=F.normal.x*this.max.x,ll=F.normal.x*this.min.x),F.normal.y>0?(Da+=F.normal.y*this.min.y,ll+=F.normal.y*this.max.y):(Da+=F.normal.y*this.max.y,ll+=F.normal.y*this.min.y),F.normal.z>0?(Da+=F.normal.z*this.min.z,ll+=F.normal.z*this.max.z):(Da+=F.normal.z*this.max.z,ll+=F.normal.z*this.min.z),Da<=-F.constant&&ll>=-F.constant}intersectsTriangle(F){if(this.isEmpty())return!1;this.getCenter(xm),bm.subVectors(this.max,xm),fm.subVectors(F.a,xm),gm.subVectors(F.b,xm),Am.subVectors(F.c,xm),ym.subVectors(gm,fm),vm.subVectors(Am,gm),_m.subVectors(fm,Am);let Da=[0,-ym.z,ym.y,0,-vm.z,vm.y,0,-_m.z,_m.y,ym.z,0,-ym.x,vm.z,0,-vm.x,_m.z,0,-_m.x,-ym.y,ym.x,0,-vm.y,vm.x,0,-_m.y,_m.x,0];return!!satForAxes(Da,fm,gm,Am,bm)&&(Da=[1,0,0,0,1,0,0,0,1],!!satForAxes(Da,fm,gm,Am,bm)&&(wm.crossVectors(ym,vm),Da=[wm.x,wm.y,wm.z],satForAxes(Da,fm,gm,Am,bm)))}clampPoint(F,Da){return Da.copy(F).clamp(this.min,this.max)}distanceToPoint(F){return this.clampPoint(F,pm).distanceTo(F)}getBoundingSphere(F){return this.isEmpty()?F.makeEmpty():(this.getCenter(F.center),F.radius=.5*this.getSize(pm).length()),F}intersect(F){return this.min.max(F.min),this.max.min(F.max),this.isEmpty()&&this.makeEmpty(),this}union(F){return this.min.min(F.min),this.max.max(F.max),this}applyMatrix4(F){return this.isEmpty()||(dm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(F),dm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(F),dm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(F),dm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(F),dm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(F),dm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(F),dm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(F),dm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(F),this.setFromPoints(dm)),this}translate(F){return this.min.add(F),this.max.add(F),this}equals(F){return F.min.equals(this.min)&&F.max.equals(this.max)}}const dm=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],pm=new Vector3,mm=new Box3,fm=new Vector3,gm=new Vector3,Am=new Vector3,ym=new Vector3,vm=new Vector3,_m=new Vector3,xm=new Vector3,bm=new Vector3,wm=new Vector3,Em=new Vector3;function satForAxes(F,Da,ll,cl,hl){for(let dl=0,pl=F.length-3;dl<=pl;dl+=3){Em.fromArray(F,dl);const pl=hl.x*Math.abs(Em.x)+hl.y*Math.abs(Em.y)+hl.z*Math.abs(Em.z),fl=Da.dot(Em),Al=ll.dot(Em),bl=cl.dot(Em);if(Math.max(-Math.max(fl,Al,bl),Math.min(fl,Al,bl))>pl)return!1}return!0}const Mm=new Box3,Sm=new Vector3,km=new Vector3;class Sphere{constructor(F,Da){void 0===F&&(F=new Vector3),void 0===Da&&(Da=-1),this.isSphere=!0,this.center=F,this.radius=Da}set(F,Da){return this.center.copy(F),this.radius=Da,this}setFromPoints(F,Da){const ll=this.center;void 0!==Da?ll.copy(Da):Mm.setFromPoints(F).getCenter(ll);let cl=0;for(let hl=0,dl=F.length;hl<dl;hl++)cl=Math.max(cl,ll.distanceToSquared(F[hl]));return this.radius=Math.sqrt(cl),this}copy(F){return this.center.copy(F.center),this.radius=F.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(F){return F.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(F){return F.distanceTo(this.center)-this.radius}intersectsSphere(F){const Da=this.radius+F.radius;return F.center.distanceToSquared(this.center)<=Da*Da}intersectsBox(F){return F.intersectsSphere(this)}intersectsPlane(F){return Math.abs(F.distanceToPoint(this.center))<=this.radius}clampPoint(F,Da){const ll=this.center.distanceToSquared(F);return Da.copy(F),ll>this.radius*this.radius&&(Da.sub(this.center).normalize(),Da.multiplyScalar(this.radius).add(this.center)),Da}getBoundingBox(F){return this.isEmpty()?(F.makeEmpty(),F):(F.set(this.center,this.center),F.expandByScalar(this.radius),F)}applyMatrix4(F){return this.center.applyMatrix4(F),this.radius=this.radius*F.getMaxScaleOnAxis(),this}translate(F){return this.center.add(F),this}expandByPoint(F){if(this.isEmpty())return this.center.copy(F),this.radius=0,this;Sm.subVectors(F,this.center);const Da=Sm.lengthSq();if(Da>this.radius*this.radius){const F=Math.sqrt(Da),ll=.5*(F-this.radius);this.center.addScaledVector(Sm,ll/F),this.radius+=ll}return this}union(F){return F.isEmpty()?this:this.isEmpty()?(this.copy(F),this):(!0===this.center.equals(F.center)?this.radius=Math.max(this.radius,F.radius):(km.subVectors(F.center,this.center).setLength(F.radius),this.expandByPoint(Sm.copy(F.center).add(km)),this.expandByPoint(Sm.copy(F.center).sub(km))),this)}equals(F){return F.center.equals(this.center)&&F.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Tm=new Vector3,Im=new Vector3,Cm=new Vector3,Lm=new Vector3,zm=new Vector3,Pm=new Vector3,Dm=new Vector3;class Ray{constructor(F,Da){void 0===F&&(F=new Vector3),void 0===Da&&(Da=new Vector3(0,0,-1)),this.origin=F,this.direction=Da}set(F,Da){return this.origin.copy(F),this.direction.copy(Da),this}copy(F){return this.origin.copy(F.origin),this.direction.copy(F.direction),this}at(F,Da){return Da.copy(this.origin).addScaledVector(this.direction,F)}lookAt(F){return this.direction.copy(F).sub(this.origin).normalize(),this}recast(F){return this.origin.copy(this.at(F,Tm)),this}closestPointToPoint(F,Da){Da.subVectors(F,this.origin);const ll=Da.dot(this.direction);return ll<0?Da.copy(this.origin):Da.copy(this.origin).addScaledVector(this.direction,ll)}distanceToPoint(F){return Math.sqrt(this.distanceSqToPoint(F))}distanceSqToPoint(F){const Da=Tm.subVectors(F,this.origin).dot(this.direction);return Da<0?this.origin.distanceToSquared(F):(Tm.copy(this.origin).addScaledVector(this.direction,Da),Tm.distanceToSquared(F))}distanceSqToSegment(F,Da,ll,cl){Im.copy(F).add(Da).multiplyScalar(.5),Cm.copy(Da).sub(F).normalize(),Lm.copy(this.origin).sub(Im);const hl=.5*F.distanceTo(Da),dl=-this.direction.dot(Cm),pl=Lm.dot(this.direction),fl=-Lm.dot(Cm),Al=Lm.lengthSq(),bl=Math.abs(1-dl*dl);let kl,Dl,Wl,Ql;if(bl>0)if(kl=dl*fl-pl,Dl=dl*pl-fl,Ql=hl*bl,kl>=0)if(Dl>=-Ql)if(Dl<=Ql){const F=1/bl;kl*=F,Dl*=F,Wl=kl*(kl+dl*Dl+2*pl)+Dl*(dl*kl+Dl+2*fl)+Al}else Dl=hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;else Dl=-hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;else Dl<=-Ql?(kl=Math.max(0,-(-dl*hl+pl)),Dl=kl>0?-hl:Math.min(Math.max(-hl,-fl),hl),Wl=-kl*kl+Dl*(Dl+2*fl)+Al):Dl<=Ql?(kl=0,Dl=Math.min(Math.max(-hl,-fl),hl),Wl=Dl*(Dl+2*fl)+Al):(kl=Math.max(0,-(dl*hl+pl)),Dl=kl>0?hl:Math.min(Math.max(-hl,-fl),hl),Wl=-kl*kl+Dl*(Dl+2*fl)+Al);else Dl=dl>0?-hl:hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;return ll&&ll.copy(this.origin).addScaledVector(this.direction,kl),cl&&cl.copy(Im).addScaledVector(Cm,Dl),Wl}intersectSphere(F,Da){Tm.subVectors(F.center,this.origin);const ll=Tm.dot(this.direction),cl=Tm.dot(Tm)-ll*ll,hl=F.radius*F.radius;if(cl>hl)return null;const dl=Math.sqrt(hl-cl),pl=ll-dl,fl=ll+dl;return fl<0?null:pl<0?this.at(fl,Da):this.at(pl,Da)}intersectsSphere(F){return this.distanceSqToPoint(F.center)<=F.radius*F.radius}distanceToPlane(F){const Da=F.normal.dot(this.direction);if(0===Da)return 0===F.distanceToPoint(this.origin)?0:null;const ll=-(this.origin.dot(F.normal)+F.constant)/Da;return ll>=0?ll:null}intersectPlane(F,Da){const ll=this.distanceToPlane(F);return null===ll?null:this.at(ll,Da)}intersectsPlane(F){const Da=F.distanceToPoint(this.origin);if(0===Da)return!0;return F.normal.dot(this.direction)*Da<0}intersectBox(F,Da){let ll,cl,hl,dl,pl,fl;const Al=1/this.direction.x,bl=1/this.direction.y,kl=1/this.direction.z,Dl=this.origin;return Al>=0?(ll=(F.min.x-Dl.x)*Al,cl=(F.max.x-Dl.x)*Al):(ll=(F.max.x-Dl.x)*Al,cl=(F.min.x-Dl.x)*Al),bl>=0?(hl=(F.min.y-Dl.y)*bl,dl=(F.max.y-Dl.y)*bl):(hl=(F.max.y-Dl.y)*bl,dl=(F.min.y-Dl.y)*bl),ll>dl||hl>cl?null:((hl>ll||isNaN(ll))&&(ll=hl),(dl<cl||isNaN(cl))&&(cl=dl),kl>=0?(pl=(F.min.z-Dl.z)*kl,fl=(F.max.z-Dl.z)*kl):(pl=(F.max.z-Dl.z)*kl,fl=(F.min.z-Dl.z)*kl),ll>fl||pl>cl?null:((pl>ll||ll!==ll)&&(ll=pl),(fl<cl||cl!==cl)&&(cl=fl),cl<0?null:this.at(ll>=0?ll:cl,Da)))}intersectsBox(F){return null!==this.intersectBox(F,Tm)}intersectTriangle(F,Da,ll,cl,hl){zm.subVectors(Da,F),Pm.subVectors(ll,F),Dm.crossVectors(zm,Pm);let dl,pl=this.direction.dot(Dm);if(pl>0){if(cl)return null;dl=1}else{if(!(pl<0))return null;dl=-1,pl=-pl}Lm.subVectors(this.origin,F);const fl=dl*this.direction.dot(Pm.crossVectors(Lm,Pm));if(fl<0)return null;const Al=dl*this.direction.dot(zm.cross(Lm));if(Al<0)return null;if(fl+Al>pl)return null;const bl=-dl*Lm.dot(Dm);return bl<0?null:this.at(bl/pl,hl)}applyMatrix4(F){return this.origin.applyMatrix4(F),this.direction.transformDirection(F),this}equals(F){return F.origin.equals(this.origin)&&F.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==F&&this.set(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc)}set(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc){const eu=this.elements;return eu[0]=F,eu[4]=Da,eu[8]=ll,eu[12]=cl,eu[1]=hl,eu[5]=dl,eu[9]=pl,eu[13]=fl,eu[2]=Al,eu[6]=bl,eu[10]=kl,eu[14]=Dl,eu[3]=Wl,eu[7]=Ql,eu[11]=wc,eu[15]=Sc,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 Matrix4).fromArray(this.elements)}copy(F){const Da=this.elements,ll=F.elements;return Da[0]=ll[0],Da[1]=ll[1],Da[2]=ll[2],Da[3]=ll[3],Da[4]=ll[4],Da[5]=ll[5],Da[6]=ll[6],Da[7]=ll[7],Da[8]=ll[8],Da[9]=ll[9],Da[10]=ll[10],Da[11]=ll[11],Da[12]=ll[12],Da[13]=ll[13],Da[14]=ll[14],Da[15]=ll[15],this}copyPosition(F){const Da=this.elements,ll=F.elements;return Da[12]=ll[12],Da[13]=ll[13],Da[14]=ll[14],this}setFromMatrix3(F){const Da=F.elements;return this.set(Da[0],Da[3],Da[6],0,Da[1],Da[4],Da[7],0,Da[2],Da[5],Da[8],0,0,0,0,1),this}extractBasis(F,Da,ll){return F.setFromMatrixColumn(this,0),Da.setFromMatrixColumn(this,1),ll.setFromMatrixColumn(this,2),this}makeBasis(F,Da,ll){return this.set(F.x,Da.x,ll.x,0,F.y,Da.y,ll.y,0,F.z,Da.z,ll.z,0,0,0,0,1),this}extractRotation(F){const Da=this.elements,ll=F.elements,cl=1/Rm.setFromMatrixColumn(F,0).length(),hl=1/Rm.setFromMatrixColumn(F,1).length(),dl=1/Rm.setFromMatrixColumn(F,2).length();return Da[0]=ll[0]*cl,Da[1]=ll[1]*cl,Da[2]=ll[2]*cl,Da[3]=0,Da[4]=ll[4]*hl,Da[5]=ll[5]*hl,Da[6]=ll[6]*hl,Da[7]=0,Da[8]=ll[8]*dl,Da[9]=ll[9]*dl,Da[10]=ll[10]*dl,Da[11]=0,Da[12]=0,Da[13]=0,Da[14]=0,Da[15]=1,this}makeRotationFromEuler(F){const Da=this.elements,ll=F.x,cl=F.y,hl=F.z,dl=Math.cos(ll),pl=Math.sin(ll),fl=Math.cos(cl),Al=Math.sin(cl),bl=Math.cos(hl),kl=Math.sin(hl);if("XYZ"===F.order){const F=dl*bl,ll=dl*kl,cl=pl*bl,hl=pl*kl;Da[0]=fl*bl,Da[4]=-fl*kl,Da[8]=Al,Da[1]=ll+cl*Al,Da[5]=F-hl*Al,Da[9]=-pl*fl,Da[2]=hl-F*Al,Da[6]=cl+ll*Al,Da[10]=dl*fl}else if("YXZ"===F.order){const F=fl*bl,ll=fl*kl,cl=Al*bl,hl=Al*kl;Da[0]=F+hl*pl,Da[4]=cl*pl-ll,Da[8]=dl*Al,Da[1]=dl*kl,Da[5]=dl*bl,Da[9]=-pl,Da[2]=ll*pl-cl,Da[6]=hl+F*pl,Da[10]=dl*fl}else if("ZXY"===F.order){const F=fl*bl,ll=fl*kl,cl=Al*bl,hl=Al*kl;Da[0]=F-hl*pl,Da[4]=-dl*kl,Da[8]=cl+ll*pl,Da[1]=ll+cl*pl,Da[5]=dl*bl,Da[9]=hl-F*pl,Da[2]=-dl*Al,Da[6]=pl,Da[10]=dl*fl}else if("ZYX"===F.order){const F=dl*bl,ll=dl*kl,cl=pl*bl,hl=pl*kl;Da[0]=fl*bl,Da[4]=cl*Al-ll,Da[8]=F*Al+hl,Da[1]=fl*kl,Da[5]=hl*Al+F,Da[9]=ll*Al-cl,Da[2]=-Al,Da[6]=pl*fl,Da[10]=dl*fl}else if("YZX"===F.order){const F=dl*fl,ll=dl*Al,cl=pl*fl,hl=pl*Al;Da[0]=fl*bl,Da[4]=hl-F*kl,Da[8]=cl*kl+ll,Da[1]=kl,Da[5]=dl*bl,Da[9]=-pl*bl,Da[2]=-Al*bl,Da[6]=ll*kl+cl,Da[10]=F-hl*kl}else if("XZY"===F.order){const F=dl*fl,ll=dl*Al,cl=pl*fl,hl=pl*Al;Da[0]=fl*bl,Da[4]=-kl,Da[8]=Al*bl,Da[1]=F*kl+hl,Da[5]=dl*bl,Da[9]=ll*kl-cl,Da[2]=cl*kl-ll,Da[6]=pl*bl,Da[10]=hl*kl+F}return Da[3]=0,Da[7]=0,Da[11]=0,Da[12]=0,Da[13]=0,Da[14]=0,Da[15]=1,this}makeRotationFromQuaternion(F){return this.compose(Um,F,Bm)}lookAt(F,Da,ll){const cl=this.elements;return jm.subVectors(F,Da),0===jm.lengthSq()&&(jm.z=1),jm.normalize(),Om.crossVectors(ll,jm),0===Om.lengthSq()&&(1===Math.abs(ll.z)?jm.x+=1e-4:jm.z+=1e-4,jm.normalize(),Om.crossVectors(ll,jm)),Om.normalize(),Fm.crossVectors(jm,Om),cl[0]=Om.x,cl[4]=Fm.x,cl[8]=jm.x,cl[1]=Om.y,cl[5]=Fm.y,cl[9]=jm.y,cl[2]=Om.z,cl[6]=Fm.z,cl[10]=jm.z,this}multiply(F){return this.multiplyMatrices(this,F)}premultiply(F){return this.multiplyMatrices(F,this)}multiplyMatrices(F,Da){const ll=F.elements,cl=Da.elements,hl=this.elements,dl=ll[0],pl=ll[4],fl=ll[8],Al=ll[12],bl=ll[1],kl=ll[5],Dl=ll[9],Wl=ll[13],Ql=ll[2],wc=ll[6],Sc=ll[10],eu=ll[14],iu=ll[3],su=ll[7],cu=ll[11],uu=ll[15],hu=cl[0],Lu=cl[4],zu=cl[8],Du=cl[12],Nu=cl[1],qu=cl[5],ih=cl[9],gh=cl[13],ed=cl[2],td=cl[6],id=cl[10],nd=cl[14],rd=cl[3],ad=cl[7],sd=cl[11],od=cl[15];return hl[0]=dl*hu+pl*Nu+fl*ed+Al*rd,hl[4]=dl*Lu+pl*qu+fl*td+Al*ad,hl[8]=dl*zu+pl*ih+fl*id+Al*sd,hl[12]=dl*Du+pl*gh+fl*nd+Al*od,hl[1]=bl*hu+kl*Nu+Dl*ed+Wl*rd,hl[5]=bl*Lu+kl*qu+Dl*td+Wl*ad,hl[9]=bl*zu+kl*ih+Dl*id+Wl*sd,hl[13]=bl*Du+kl*gh+Dl*nd+Wl*od,hl[2]=Ql*hu+wc*Nu+Sc*ed+eu*rd,hl[6]=Ql*Lu+wc*qu+Sc*td+eu*ad,hl[10]=Ql*zu+wc*ih+Sc*id+eu*sd,hl[14]=Ql*Du+wc*gh+Sc*nd+eu*od,hl[3]=iu*hu+su*Nu+cu*ed+uu*rd,hl[7]=iu*Lu+su*qu+cu*td+uu*ad,hl[11]=iu*zu+su*ih+cu*id+uu*sd,hl[15]=iu*Du+su*gh+cu*nd+uu*od,this}multiplyScalar(F){const Da=this.elements;return Da[0]*=F,Da[4]*=F,Da[8]*=F,Da[12]*=F,Da[1]*=F,Da[5]*=F,Da[9]*=F,Da[13]*=F,Da[2]*=F,Da[6]*=F,Da[10]*=F,Da[14]*=F,Da[3]*=F,Da[7]*=F,Da[11]*=F,Da[15]*=F,this}determinant(){const F=this.elements,Da=F[0],ll=F[4],cl=F[8],hl=F[12],dl=F[1],pl=F[5],fl=F[9],Al=F[13],bl=F[2],kl=F[6],Dl=F[10],Wl=F[14];return F[3]*(+hl*fl*kl-cl*Al*kl-hl*pl*Dl+ll*Al*Dl+cl*pl*Wl-ll*fl*Wl)+F[7]*(+Da*fl*Wl-Da*Al*Dl+hl*dl*Dl-cl*dl*Wl+cl*Al*bl-hl*fl*bl)+F[11]*(+Da*Al*kl-Da*pl*Wl-hl*dl*kl+ll*dl*Wl+hl*pl*bl-ll*Al*bl)+F[15]*(-cl*pl*bl-Da*fl*kl+Da*pl*Dl+cl*dl*kl-ll*dl*Dl+ll*fl*bl)}transpose(){const F=this.elements;let Da;return Da=F[1],F[1]=F[4],F[4]=Da,Da=F[2],F[2]=F[8],F[8]=Da,Da=F[6],F[6]=F[9],F[9]=Da,Da=F[3],F[3]=F[12],F[12]=Da,Da=F[7],F[7]=F[13],F[13]=Da,Da=F[11],F[11]=F[14],F[14]=Da,this}setPosition(F,Da,ll){const cl=this.elements;return F.isVector3?(cl[12]=F.x,cl[13]=F.y,cl[14]=F.z):(cl[12]=F,cl[13]=Da,cl[14]=ll),this}invert(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8],kl=F[9],Dl=F[10],Wl=F[11],Ql=F[12],wc=F[13],Sc=F[14],eu=F[15],iu=kl*Sc*Al-wc*Dl*Al+wc*fl*Wl-pl*Sc*Wl-kl*fl*eu+pl*Dl*eu,su=Ql*Dl*Al-bl*Sc*Al-Ql*fl*Wl+dl*Sc*Wl+bl*fl*eu-dl*Dl*eu,cu=bl*wc*Al-Ql*kl*Al+Ql*pl*Wl-dl*wc*Wl-bl*pl*eu+dl*kl*eu,uu=Ql*kl*fl-bl*wc*fl-Ql*pl*Dl+dl*wc*Dl+bl*pl*Sc-dl*kl*Sc,hu=Da*iu+ll*su+cl*cu+hl*uu;if(0===hu)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const Lu=1/hu;return F[0]=iu*Lu,F[1]=(wc*Dl*hl-kl*Sc*hl-wc*cl*Wl+ll*Sc*Wl+kl*cl*eu-ll*Dl*eu)*Lu,F[2]=(pl*Sc*hl-wc*fl*hl+wc*cl*Al-ll*Sc*Al-pl*cl*eu+ll*fl*eu)*Lu,F[3]=(kl*fl*hl-pl*Dl*hl-kl*cl*Al+ll*Dl*Al+pl*cl*Wl-ll*fl*Wl)*Lu,F[4]=su*Lu,F[5]=(bl*Sc*hl-Ql*Dl*hl+Ql*cl*Wl-Da*Sc*Wl-bl*cl*eu+Da*Dl*eu)*Lu,F[6]=(Ql*fl*hl-dl*Sc*hl-Ql*cl*Al+Da*Sc*Al+dl*cl*eu-Da*fl*eu)*Lu,F[7]=(dl*Dl*hl-bl*fl*hl+bl*cl*Al-Da*Dl*Al-dl*cl*Wl+Da*fl*Wl)*Lu,F[8]=cu*Lu,F[9]=(Ql*kl*hl-bl*wc*hl-Ql*ll*Wl+Da*wc*Wl+bl*ll*eu-Da*kl*eu)*Lu,F[10]=(dl*wc*hl-Ql*pl*hl+Ql*ll*Al-Da*wc*Al-dl*ll*eu+Da*pl*eu)*Lu,F[11]=(bl*pl*hl-dl*kl*hl-bl*ll*Al+Da*kl*Al+dl*ll*Wl-Da*pl*Wl)*Lu,F[12]=uu*Lu,F[13]=(bl*wc*cl-Ql*kl*cl+Ql*ll*Dl-Da*wc*Dl-bl*ll*Sc+Da*kl*Sc)*Lu,F[14]=(Ql*pl*cl-dl*wc*cl-Ql*ll*fl+Da*wc*fl+dl*ll*Sc-Da*pl*Sc)*Lu,F[15]=(dl*kl*cl-bl*pl*cl+bl*ll*fl-Da*kl*fl-dl*ll*Dl+Da*pl*Dl)*Lu,this}scale(F){const Da=this.elements,ll=F.x,cl=F.y,hl=F.z;return Da[0]*=ll,Da[4]*=cl,Da[8]*=hl,Da[1]*=ll,Da[5]*=cl,Da[9]*=hl,Da[2]*=ll,Da[6]*=cl,Da[10]*=hl,Da[3]*=ll,Da[7]*=cl,Da[11]*=hl,this}getMaxScaleOnAxis(){const F=this.elements,Da=F[0]*F[0]+F[1]*F[1]+F[2]*F[2],ll=F[4]*F[4]+F[5]*F[5]+F[6]*F[6],cl=F[8]*F[8]+F[9]*F[9]+F[10]*F[10];return Math.sqrt(Math.max(Da,ll,cl))}makeTranslation(F,Da,ll){return F.isVector3?this.set(1,0,0,F.x,0,1,0,F.y,0,0,1,F.z,0,0,0,1):this.set(1,0,0,F,0,1,0,Da,0,0,1,ll,0,0,0,1),this}makeRotationX(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(1,0,0,0,0,Da,-ll,0,0,ll,Da,0,0,0,0,1),this}makeRotationY(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,0,ll,0,0,1,0,0,-ll,0,Da,0,0,0,0,1),this}makeRotationZ(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,-ll,0,0,ll,Da,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(F,Da){const ll=Math.cos(Da),cl=Math.sin(Da),hl=1-ll,dl=F.x,pl=F.y,fl=F.z,Al=hl*dl,bl=hl*pl;return this.set(Al*dl+ll,Al*pl-cl*fl,Al*fl+cl*pl,0,Al*pl+cl*fl,bl*pl+ll,bl*fl-cl*dl,0,Al*fl-cl*pl,bl*fl+cl*dl,hl*fl*fl+ll,0,0,0,0,1),this}makeScale(F,Da,ll){return this.set(F,0,0,0,0,Da,0,0,0,0,ll,0,0,0,0,1),this}makeShear(F,Da,ll,cl,hl,dl){return this.set(1,ll,hl,0,F,1,dl,0,Da,cl,1,0,0,0,0,1),this}compose(F,Da,ll){const cl=this.elements,hl=Da._x,dl=Da._y,pl=Da._z,fl=Da._w,Al=hl+hl,bl=dl+dl,kl=pl+pl,Dl=hl*Al,Wl=hl*bl,Ql=hl*kl,wc=dl*bl,Sc=dl*kl,eu=pl*kl,iu=fl*Al,su=fl*bl,cu=fl*kl,uu=ll.x,hu=ll.y,Lu=ll.z;return cl[0]=(1-(wc+eu))*uu,cl[1]=(Wl+cu)*uu,cl[2]=(Ql-su)*uu,cl[3]=0,cl[4]=(Wl-cu)*hu,cl[5]=(1-(Dl+eu))*hu,cl[6]=(Sc+iu)*hu,cl[7]=0,cl[8]=(Ql+su)*Lu,cl[9]=(Sc-iu)*Lu,cl[10]=(1-(Dl+wc))*Lu,cl[11]=0,cl[12]=F.x,cl[13]=F.y,cl[14]=F.z,cl[15]=1,this}decompose(F,Da,ll){const cl=this.elements;let hl=Rm.set(cl[0],cl[1],cl[2]).length();const dl=Rm.set(cl[4],cl[5],cl[6]).length(),pl=Rm.set(cl[8],cl[9],cl[10]).length();this.determinant()<0&&(hl=-hl),F.x=cl[12],F.y=cl[13],F.z=cl[14],Nm.copy(this);const fl=1/hl,Al=1/dl,bl=1/pl;return Nm.elements[0]*=fl,Nm.elements[1]*=fl,Nm.elements[2]*=fl,Nm.elements[4]*=Al,Nm.elements[5]*=Al,Nm.elements[6]*=Al,Nm.elements[8]*=bl,Nm.elements[9]*=bl,Nm.elements[10]*=bl,Da.setFromRotationMatrix(Nm),ll.x=hl,ll.y=dl,ll.z=pl,this}makePerspective(F,Da,ll,cl,hl,dl,pl){void 0===pl&&(pl=Wp);const fl=this.elements,Al=2*hl/(Da-F),bl=2*hl/(ll-cl),kl=(Da+F)/(Da-F),Dl=(ll+cl)/(ll-cl);let Wl,Ql;if(pl===Wp)Wl=-(dl+hl)/(dl-hl),Ql=-2*dl*hl/(dl-hl);else{if(pl!==Kp)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+pl);Wl=-dl/(dl-hl),Ql=-dl*hl/(dl-hl)}return fl[0]=Al,fl[4]=0,fl[8]=kl,fl[12]=0,fl[1]=0,fl[5]=bl,fl[9]=Dl,fl[13]=0,fl[2]=0,fl[6]=0,fl[10]=Wl,fl[14]=Ql,fl[3]=0,fl[7]=0,fl[11]=-1,fl[15]=0,this}makeOrthographic(F,Da,ll,cl,hl,dl,pl){void 0===pl&&(pl=Wp);const fl=this.elements,Al=1/(Da-F),bl=1/(ll-cl),kl=1/(dl-hl),Dl=(Da+F)*Al,Wl=(ll+cl)*bl;let Ql,wc;if(pl===Wp)Ql=(dl+hl)*kl,wc=-2*kl;else{if(pl!==Kp)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+pl);Ql=hl*kl,wc=-1*kl}return fl[0]=2*Al,fl[4]=0,fl[8]=0,fl[12]=-Dl,fl[1]=0,fl[5]=2*bl,fl[9]=0,fl[13]=-Wl,fl[2]=0,fl[6]=0,fl[10]=wc,fl[14]=-Ql,fl[3]=0,fl[7]=0,fl[11]=0,fl[15]=1,this}equals(F){const Da=this.elements,ll=F.elements;for(let cl=0;cl<16;cl++)if(Da[cl]!==ll[cl])return!1;return!0}fromArray(F,Da){void 0===Da&&(Da=0);for(let ll=0;ll<16;ll++)this.elements[ll]=F[ll+Da];return this}toArray(F,Da){void 0===F&&(F=[]),void 0===Da&&(Da=0);const ll=this.elements;return F[Da]=ll[0],F[Da+1]=ll[1],F[Da+2]=ll[2],F[Da+3]=ll[3],F[Da+4]=ll[4],F[Da+5]=ll[5],F[Da+6]=ll[6],F[Da+7]=ll[7],F[Da+8]=ll[8],F[Da+9]=ll[9],F[Da+10]=ll[10],F[Da+11]=ll[11],F[Da+12]=ll[12],F[Da+13]=ll[13],F[Da+14]=ll[14],F[Da+15]=ll[15],F}}const Rm=new Vector3,Nm=new Matrix4,Um=new Vector3(0,0,0),Bm=new Vector3(1,1,1),Om=new Vector3,Fm=new Vector3,jm=new Vector3,Vm=new Matrix4,Gm=new Quaternion;class Euler{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=Euler.DEFAULT_ORDER),this.isEuler=!0,this._x=F,this._y=Da,this._z=ll,this._order=cl}get x(){return this._x}set x(F){this._x=F,this._onChangeCallback()}get y(){return this._y}set y(F){this._y=F,this._onChangeCallback()}get z(){return this._z}set z(F){this._z=F,this._onChangeCallback()}get order(){return this._order}set order(F){this._order=F,this._onChangeCallback()}set(F,Da,ll,cl){return void 0===cl&&(cl=this._order),this._x=F,this._y=Da,this._z=ll,this._order=cl,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(F){return this._x=F._x,this._y=F._y,this._z=F._z,this._order=F._order,this._onChangeCallback(),this}setFromRotationMatrix(F,Da,ll){void 0===Da&&(Da=this._order),void 0===ll&&(ll=!0);const cl=F.elements,hl=cl[0],dl=cl[4],pl=cl[8],fl=cl[1],Al=cl[5],bl=cl[9],kl=cl[2],Dl=cl[6],Wl=cl[10];switch(Da){case"XYZ":this._y=Math.asin(clamp(pl,-1,1)),Math.abs(pl)<.9999999?(this._x=Math.atan2(-bl,Wl),this._z=Math.atan2(-dl,hl)):(this._x=Math.atan2(Dl,Al),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(bl,-1,1)),Math.abs(bl)<.9999999?(this._y=Math.atan2(pl,Wl),this._z=Math.atan2(fl,Al)):(this._y=Math.atan2(-kl,hl),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(Dl,-1,1)),Math.abs(Dl)<.9999999?(this._y=Math.atan2(-kl,Wl),this._z=Math.atan2(-dl,Al)):(this._y=0,this._z=Math.atan2(fl,hl));break;case"ZYX":this._y=Math.asin(-clamp(kl,-1,1)),Math.abs(kl)<.9999999?(this._x=Math.atan2(Dl,Wl),this._z=Math.atan2(fl,hl)):(this._x=0,this._z=Math.atan2(-dl,Al));break;case"YZX":this._z=Math.asin(clamp(fl,-1,1)),Math.abs(fl)<.9999999?(this._x=Math.atan2(-bl,Al),this._y=Math.atan2(-kl,hl)):(this._x=0,this._y=Math.atan2(pl,Wl));break;case"XZY":this._z=Math.asin(-clamp(dl,-1,1)),Math.abs(dl)<.9999999?(this._x=Math.atan2(Dl,Al),this._y=Math.atan2(pl,hl)):(this._x=Math.atan2(-bl,Wl),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+Da)}return this._order=Da,!0===ll&&this._onChangeCallback(),this}setFromQuaternion(F,Da,ll){return Vm.makeRotationFromQuaternion(F),this.setFromRotationMatrix(Vm,Da,ll)}setFromVector3(F,Da){return void 0===Da&&(Da=this._order),this.set(F.x,F.y,F.z,Da)}reorder(F){return Gm.setFromEuler(this),this.setFromQuaternion(Gm,F)}equals(F){return F._x===this._x&&F._y===this._y&&F._z===this._z&&F._order===this._order}fromArray(F){return this._x=F[0],this._y=F[1],this._z=F[2],void 0!==F[3]&&(this._order=F[3]),this._onChangeCallback(),this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this._x,F[Da+1]=this._y,F[Da+2]=this._z,F[Da+3]=this._order,F}_onChange(F){return this._onChangeCallback=F,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(F){this.mask=1<<F>>>0}enable(F){this.mask|=1<<F}enableAll(){this.mask=-1}toggle(F){this.mask^=1<<F}disable(F){this.mask&=~(1<<F)}disableAll(){this.mask=0}test(F){return 0!==(this.mask&F.mask)}isEnabled(F){return 0!==(this.mask&1<<F)}}let Hm=0;const qm=new Vector3,Zm=new Quaternion,Wm=new Matrix4,Km=new Vector3,Qm=new Vector3,Xm=new Vector3,Ym=new Quaternion,Jm=new Vector3(1,0,0),$m=new Vector3(0,1,0),ef=new Vector3(0,0,1),tf={type:"added"},nf={type:"removed"},rf={type:"childadded",child:null},af={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Hm++}),this.uuid=generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const F=new Vector3,Da=new Euler,ll=new Quaternion,cl=new Vector3(1,1,1);Da._onChange((function(){ll.setFromEuler(Da,!1)})),ll._onChange((function(){Da.setFromQuaternion(ll,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:F},rotation:{configurable:!0,enumerable:!0,value:Da},quaternion:{configurable:!0,enumerable:!0,value:ll},scale:{configurable:!0,enumerable:!0,value:cl},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(F){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(F),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(F){return this.quaternion.premultiply(F),this}setRotationFromAxisAngle(F,Da){this.quaternion.setFromAxisAngle(F,Da)}setRotationFromEuler(F){this.quaternion.setFromEuler(F,!0)}setRotationFromMatrix(F){this.quaternion.setFromRotationMatrix(F)}setRotationFromQuaternion(F){this.quaternion.copy(F)}rotateOnAxis(F,Da){return Zm.setFromAxisAngle(F,Da),this.quaternion.multiply(Zm),this}rotateOnWorldAxis(F,Da){return Zm.setFromAxisAngle(F,Da),this.quaternion.premultiply(Zm),this}rotateX(F){return this.rotateOnAxis(Jm,F)}rotateY(F){return this.rotateOnAxis($m,F)}rotateZ(F){return this.rotateOnAxis(ef,F)}translateOnAxis(F,Da){return qm.copy(F).applyQuaternion(this.quaternion),this.position.add(qm.multiplyScalar(Da)),this}translateX(F){return this.translateOnAxis(Jm,F)}translateY(F){return this.translateOnAxis($m,F)}translateZ(F){return this.translateOnAxis(ef,F)}localToWorld(F){return this.updateWorldMatrix(!0,!1),F.applyMatrix4(this.matrixWorld)}worldToLocal(F){return this.updateWorldMatrix(!0,!1),F.applyMatrix4(Wm.copy(this.matrixWorld).invert())}lookAt(F,Da,ll){F.isVector3?Km.copy(F):Km.set(F,Da,ll);const cl=this.parent;this.updateWorldMatrix(!0,!1),Qm.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Wm.lookAt(Qm,Km,this.up):Wm.lookAt(Km,Qm,this.up),this.quaternion.setFromRotationMatrix(Wm),cl&&(Wm.extractRotation(cl.matrixWorld),Zm.setFromRotationMatrix(Wm),this.quaternion.premultiply(Zm.invert()))}add(F){if(arguments.length>1){for(let F=0;F<arguments.length;F++)this.add(arguments[F]);return this}return F===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",F),this):(F&&F.isObject3D?(F.removeFromParent(),F.parent=this,this.children.push(F),F.dispatchEvent(tf),rf.child=F,this.dispatchEvent(rf),rf.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",F),this)}remove(F){if(arguments.length>1){for(let F=0;F<arguments.length;F++)this.remove(arguments[F]);return this}const Da=this.children.indexOf(F);return-1!==Da&&(F.parent=null,this.children.splice(Da,1),F.dispatchEvent(nf),af.child=F,this.dispatchEvent(af),af.child=null),this}removeFromParent(){const F=this.parent;return null!==F&&F.remove(this),this}clear(){return this.remove(...this.children)}attach(F){return this.updateWorldMatrix(!0,!1),Wm.copy(this.matrixWorld).invert(),null!==F.parent&&(F.parent.updateWorldMatrix(!0,!1),Wm.multiply(F.parent.matrixWorld)),F.applyMatrix4(Wm),F.removeFromParent(),F.parent=this,this.children.push(F),F.updateWorldMatrix(!1,!0),F.dispatchEvent(tf),rf.child=F,this.dispatchEvent(rf),rf.child=null,this}getObjectById(F){return this.getObjectByProperty("id",F)}getObjectByName(F){return this.getObjectByProperty("name",F)}getObjectByProperty(F,Da){if(this[F]===Da)return this;for(let ll=0,cl=this.children.length;ll<cl;ll++){const cl=this.children[ll].getObjectByProperty(F,Da);if(void 0!==cl)return cl}}getObjectsByProperty(F,Da,ll){void 0===ll&&(ll=[]),this[F]===Da&&ll.push(this);const cl=this.children;for(let hl=0,dl=cl.length;hl<dl;hl++)cl[hl].getObjectsByProperty(F,Da,ll);return ll}getWorldPosition(F){return this.updateWorldMatrix(!0,!1),F.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(F){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qm,F,Xm),F}getWorldScale(F){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qm,Ym,F),F}getWorldDirection(F){this.updateWorldMatrix(!0,!1);const Da=this.matrixWorld.elements;return F.set(Da[8],Da[9],Da[10]).normalize()}raycast(){}traverse(F){F(this);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++)Da[ll].traverse(F)}traverseVisible(F){if(!1===this.visible)return;F(this);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++)Da[ll].traverseVisible(F)}traverseAncestors(F){const Da=this.parent;null!==Da&&(F(Da),Da.traverseAncestors(F))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(F){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||F)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,F=!0);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++){Da[ll].updateMatrixWorld(F)}}updateWorldMatrix(F,Da){const ll=this.parent;if(!0===F&&null!==ll&&ll.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===Da){const F=this.children;for(let Da=0,ll=F.length;Da<ll;Da++){F[Da].updateWorldMatrix(!1,!0)}}}toJSON(F){const Da=void 0===F||"string"===typeof F,ll={};Da&&(F={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},ll.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const cl={};function serialize(Da,ll){return void 0===Da[ll.uuid]&&(Da[ll.uuid]=ll.toJSON(F)),ll.uuid}if(cl.uuid=this.uuid,cl.type=this.type,""!==this.name&&(cl.name=this.name),!0===this.castShadow&&(cl.castShadow=!0),!0===this.receiveShadow&&(cl.receiveShadow=!0),!1===this.visible&&(cl.visible=!1),!1===this.frustumCulled&&(cl.frustumCulled=!1),0!==this.renderOrder&&(cl.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(cl.userData=this.userData),cl.layers=this.layers.mask,cl.matrix=this.matrix.toArray(),cl.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(cl.matrixAutoUpdate=!1),this.isInstancedMesh&&(cl.type="InstancedMesh",cl.count=this.count,cl.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(cl.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(cl.type="BatchedMesh",cl.perObjectFrustumCulled=this.perObjectFrustumCulled,cl.sortObjects=this.sortObjects,cl.drawRanges=this._drawRanges,cl.reservedRanges=this._reservedRanges,cl.visibility=this._visibility,cl.active=this._active,cl.bounds=this._bounds.map((F=>({boxInitialized:F.boxInitialized,boxMin:F.box.min.toArray(),boxMax:F.box.max.toArray(),sphereInitialized:F.sphereInitialized,sphereRadius:F.sphere.radius,sphereCenter:F.sphere.center.toArray()}))),cl.maxInstanceCount=this._maxInstanceCount,cl.maxVertexCount=this._maxVertexCount,cl.maxIndexCount=this._maxIndexCount,cl.geometryInitialized=this._geometryInitialized,cl.geometryCount=this._geometryCount,cl.matricesTexture=this._matricesTexture.toJSON(F),null!==this._colorsTexture&&(cl.colorsTexture=this._colorsTexture.toJSON(F)),null!==this.boundingSphere&&(cl.boundingSphere={center:cl.boundingSphere.center.toArray(),radius:cl.boundingSphere.radius}),null!==this.boundingBox&&(cl.boundingBox={min:cl.boundingBox.min.toArray(),max:cl.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?cl.background=this.background.toJSON():this.background.isTexture&&(cl.background=this.background.toJSON(F).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(cl.environment=this.environment.toJSON(F).uuid);else if(this.isMesh||this.isLine||this.isPoints){cl.geometry=serialize(F.geometries,this.geometry);const Da=this.geometry.parameters;if(void 0!==Da&&void 0!==Da.shapes){const ll=Da.shapes;if(Array.isArray(ll))for(let Da=0,cl=ll.length;Da<cl;Da++){const cl=ll[Da];serialize(F.shapes,cl)}else serialize(F.shapes,ll)}}if(this.isSkinnedMesh&&(cl.bindMode=this.bindMode,cl.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(serialize(F.skeletons,this.skeleton),cl.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const Da=[];for(let ll=0,cl=this.material.length;ll<cl;ll++)Da.push(serialize(F.materials,this.material[ll]));cl.material=Da}else cl.material=serialize(F.materials,this.material);if(this.children.length>0){cl.children=[];for(let Da=0;Da<this.children.length;Da++)cl.children.push(this.children[Da].toJSON(F).object)}if(this.animations.length>0){cl.animations=[];for(let Da=0;Da<this.animations.length;Da++){const ll=this.animations[Da];cl.animations.push(serialize(F.animations,ll))}}if(Da){const Da=extractFromCache(F.geometries),cl=extractFromCache(F.materials),hl=extractFromCache(F.textures),dl=extractFromCache(F.images),pl=extractFromCache(F.shapes),fl=extractFromCache(F.skeletons),Al=extractFromCache(F.animations),bl=extractFromCache(F.nodes);Da.length>0&&(ll.geometries=Da),cl.length>0&&(ll.materials=cl),hl.length>0&&(ll.textures=hl),dl.length>0&&(ll.images=dl),pl.length>0&&(ll.shapes=pl),fl.length>0&&(ll.skeletons=fl),Al.length>0&&(ll.animations=Al),bl.length>0&&(ll.nodes=bl)}return ll.object=cl,ll;function extractFromCache(F){const Da=[];for(const ll in F){const cl=F[ll];delete cl.metadata,Da.push(cl)}return Da}}clone(F){return(new this.constructor).copy(this,F)}copy(F,Da){if(void 0===Da&&(Da=!0),this.name=F.name,this.up.copy(F.up),this.position.copy(F.position),this.rotation.order=F.rotation.order,this.quaternion.copy(F.quaternion),this.scale.copy(F.scale),this.matrix.copy(F.matrix),this.matrixWorld.copy(F.matrixWorld),this.matrixAutoUpdate=F.matrixAutoUpdate,this.matrixWorldAutoUpdate=F.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=F.matrixWorldNeedsUpdate,this.layers.mask=F.layers.mask,this.visible=F.visible,this.castShadow=F.castShadow,this.receiveShadow=F.receiveShadow,this.frustumCulled=F.frustumCulled,this.renderOrder=F.renderOrder,this.animations=F.animations.slice(),this.userData=JSON.parse(JSON.stringify(F.userData)),!0===Da)for(let ll=0;ll<F.children.length;ll++){const Da=F.children[ll];this.add(Da.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0),Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0,Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const sf=new Vector3,of=new Vector3,lf=new Vector3,cf=new Vector3,uf=new Vector3,hf=new Vector3,df=new Vector3,pf=new Vector3,mf=new Vector3,ff=new Vector3;class Triangle{constructor(F,Da,ll){void 0===F&&(F=new Vector3),void 0===Da&&(Da=new Vector3),void 0===ll&&(ll=new Vector3),this.a=F,this.b=Da,this.c=ll}static getNormal(F,Da,ll,cl){cl.subVectors(ll,Da),sf.subVectors(F,Da),cl.cross(sf);const hl=cl.lengthSq();return hl>0?cl.multiplyScalar(1/Math.sqrt(hl)):cl.set(0,0,0)}static getBarycoord(F,Da,ll,cl,hl){sf.subVectors(cl,Da),of.subVectors(ll,Da),lf.subVectors(F,Da);const dl=sf.dot(sf),pl=sf.dot(of),fl=sf.dot(lf),Al=of.dot(of),bl=of.dot(lf),kl=dl*Al-pl*pl;if(0===kl)return hl.set(0,0,0),null;const Dl=1/kl,Wl=(Al*fl-pl*bl)*Dl,Ql=(dl*bl-pl*fl)*Dl;return hl.set(1-Wl-Ql,Ql,Wl)}static containsPoint(F,Da,ll,cl){return null!==this.getBarycoord(F,Da,ll,cl,cf)&&(cf.x>=0&&cf.y>=0&&cf.x+cf.y<=1)}static getInterpolation(F,Da,ll,cl,hl,dl,pl,fl){return null===this.getBarycoord(F,Da,ll,cl,cf)?(fl.x=0,fl.y=0,"z"in fl&&(fl.z=0),"w"in fl&&(fl.w=0),null):(fl.setScalar(0),fl.addScaledVector(hl,cf.x),fl.addScaledVector(dl,cf.y),fl.addScaledVector(pl,cf.z),fl)}static isFrontFacing(F,Da,ll,cl){return sf.subVectors(ll,Da),of.subVectors(F,Da),sf.cross(of).dot(cl)<0}set(F,Da,ll){return this.a.copy(F),this.b.copy(Da),this.c.copy(ll),this}setFromPointsAndIndices(F,Da,ll,cl){return this.a.copy(F[Da]),this.b.copy(F[ll]),this.c.copy(F[cl]),this}setFromAttributeAndIndices(F,Da,ll,cl){return this.a.fromBufferAttribute(F,Da),this.b.fromBufferAttribute(F,ll),this.c.fromBufferAttribute(F,cl),this}clone(){return(new this.constructor).copy(this)}copy(F){return this.a.copy(F.a),this.b.copy(F.b),this.c.copy(F.c),this}getArea(){return sf.subVectors(this.c,this.b),of.subVectors(this.a,this.b),.5*sf.cross(of).length()}getMidpoint(F){return F.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(F){return Triangle.getNormal(this.a,this.b,this.c,F)}getPlane(F){return F.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(F,Da){return Triangle.getBarycoord(F,this.a,this.b,this.c,Da)}getInterpolation(F,Da,ll,cl,hl){return Triangle.getInterpolation(F,this.a,this.b,this.c,Da,ll,cl,hl)}containsPoint(F){return Triangle.containsPoint(F,this.a,this.b,this.c)}isFrontFacing(F){return Triangle.isFrontFacing(this.a,this.b,this.c,F)}intersectsBox(F){return F.intersectsTriangle(this)}closestPointToPoint(F,Da){const ll=this.a,cl=this.b,hl=this.c;let dl,pl;uf.subVectors(cl,ll),hf.subVectors(hl,ll),pf.subVectors(F,ll);const fl=uf.dot(pf),Al=hf.dot(pf);if(fl<=0&&Al<=0)return Da.copy(ll);mf.subVectors(F,cl);const bl=uf.dot(mf),kl=hf.dot(mf);if(bl>=0&&kl<=bl)return Da.copy(cl);const Dl=fl*kl-bl*Al;if(Dl<=0&&fl>=0&&bl<=0)return dl=fl/(fl-bl),Da.copy(ll).addScaledVector(uf,dl);ff.subVectors(F,hl);const Wl=uf.dot(ff),Ql=hf.dot(ff);if(Ql>=0&&Wl<=Ql)return Da.copy(hl);const wc=Wl*Al-fl*Ql;if(wc<=0&&Al>=0&&Ql<=0)return pl=Al/(Al-Ql),Da.copy(ll).addScaledVector(hf,pl);const Sc=bl*Ql-Wl*kl;if(Sc<=0&&kl-bl>=0&&Wl-Ql>=0)return df.subVectors(hl,cl),pl=(kl-bl)/(kl-bl+(Wl-Ql)),Da.copy(cl).addScaledVector(df,pl);const eu=1/(Sc+wc+Dl);return dl=wc*eu,pl=Dl*eu,Da.copy(ll).addScaledVector(uf,dl).addScaledVector(hf,pl)}equals(F){return F.a.equals(this.a)&&F.b.equals(this.b)&&F.c.equals(this.c)}}const gf={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},Af={h:0,s:0,l:0},yf={h:0,s:0,l:0};function hue2rgb(F,Da,ll){return ll<0&&(ll+=1),ll>1&&(ll-=1),ll<1/6?F+6*(Da-F)*ll:ll<.5?Da:ll<2/3?F+6*(Da-F)*(2/3-ll):F}class Color{constructor(F,Da,ll){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(F,Da,ll)}set(F,Da,ll){if(void 0===Da&&void 0===ll){const Da=F;Da&&Da.isColor?this.copy(Da):"number"===typeof Da?this.setHex(Da):"string"===typeof Da&&this.setStyle(Da)}else this.setRGB(F,Da,ll);return this}setScalar(F){return this.r=F,this.g=F,this.b=F,this}setHex(F,Da){return void 0===Da&&(Da=Tp),F=Math.floor(F),this.r=(F>>16&255)/255,this.g=(F>>8&255)/255,this.b=(255&F)/255,sm.toWorkingColorSpace(this,Da),this}setRGB(F,Da,ll,cl){return void 0===cl&&(cl=sm.workingColorSpace),this.r=F,this.g=Da,this.b=ll,sm.toWorkingColorSpace(this,cl),this}setHSL(F,Da,ll,cl){if(void 0===cl&&(cl=sm.workingColorSpace),F=euclideanModulo(F,1),Da=clamp(Da,0,1),ll=clamp(ll,0,1),0===Da)this.r=this.g=this.b=ll;else{const cl=ll<=.5?ll*(1+Da):ll+Da-ll*Da,hl=2*ll-cl;this.r=hue2rgb(hl,cl,F+1/3),this.g=hue2rgb(hl,cl,F),this.b=hue2rgb(hl,cl,F-1/3)}return sm.toWorkingColorSpace(this,cl),this}setStyle(F,Da){function handleAlpha(Da){void 0!==Da&&parseFloat(Da)<1&&console.warn("THREE.Color: Alpha component of "+F+" will be ignored.")}let ll;if(void 0===Da&&(Da=Tp),ll=/^(\w+)\(([^\)]*)\)/.exec(F)){let cl;const hl=ll[1],dl=ll[2];switch(hl){case"rgb":case"rgba":if(cl=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setRGB(Math.min(255,parseInt(cl[1],10))/255,Math.min(255,parseInt(cl[2],10))/255,Math.min(255,parseInt(cl[3],10))/255,Da);if(cl=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setRGB(Math.min(100,parseInt(cl[1],10))/100,Math.min(100,parseInt(cl[2],10))/100,Math.min(100,parseInt(cl[3],10))/100,Da);break;case"hsl":case"hsla":if(cl=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setHSL(parseFloat(cl[1])/360,parseFloat(cl[2])/100,parseFloat(cl[3])/100,Da);break;default:console.warn("THREE.Color: Unknown color model "+F)}}else if(ll=/^\#([A-Fa-f\d]+)$/.exec(F)){const cl=ll[1],hl=cl.length;if(3===hl)return this.setRGB(parseInt(cl.charAt(0),16)/15,parseInt(cl.charAt(1),16)/15,parseInt(cl.charAt(2),16)/15,Da);if(6===hl)return this.setHex(parseInt(cl,16),Da);console.warn("THREE.Color: Invalid hex color "+F)}else if(F&&F.length>0)return this.setColorName(F,Da);return this}setColorName(F,Da){void 0===Da&&(Da=Tp);const ll=gf[F.toLowerCase()];return void 0!==ll?this.setHex(ll,Da):console.warn("THREE.Color: Unknown color "+F),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(F){return this.r=F.r,this.g=F.g,this.b=F.b,this}copySRGBToLinear(F){return this.r=SRGBToLinear(F.r),this.g=SRGBToLinear(F.g),this.b=SRGBToLinear(F.b),this}copyLinearToSRGB(F){return this.r=LinearToSRGB(F.r),this.g=LinearToSRGB(F.g),this.b=LinearToSRGB(F.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(F){return void 0===F&&(F=Tp),sm.fromWorkingColorSpace(vf.copy(this),F),65536*Math.round(clamp(255*vf.r,0,255))+256*Math.round(clamp(255*vf.g,0,255))+Math.round(clamp(255*vf.b,0,255))}getHexString(F){return void 0===F&&(F=Tp),("000000"+this.getHex(F).toString(16)).slice(-6)}getHSL(F,Da){void 0===Da&&(Da=sm.workingColorSpace),sm.fromWorkingColorSpace(vf.copy(this),Da);const ll=vf.r,cl=vf.g,hl=vf.b,dl=Math.max(ll,cl,hl),pl=Math.min(ll,cl,hl);let fl,Al;const bl=(pl+dl)/2;if(pl===dl)fl=0,Al=0;else{const F=dl-pl;switch(Al=bl<=.5?F/(dl+pl):F/(2-dl-pl),dl){case ll:fl=(cl-hl)/F+(cl<hl?6:0);break;case cl:fl=(hl-ll)/F+2;break;case hl:fl=(ll-cl)/F+4}fl/=6}return F.h=fl,F.s=Al,F.l=bl,F}getRGB(F,Da){return void 0===Da&&(Da=sm.workingColorSpace),sm.fromWorkingColorSpace(vf.copy(this),Da),F.r=vf.r,F.g=vf.g,F.b=vf.b,F}getStyle(F){void 0===F&&(F=Tp),sm.fromWorkingColorSpace(vf.copy(this),F);const Da=vf.r,ll=vf.g,cl=vf.b;return F!==Tp?`color(${F} ${Da.toFixed(3)} ${ll.toFixed(3)} ${cl.toFixed(3)})`:`rgb(${Math.round(255*Da)},${Math.round(255*ll)},${Math.round(255*cl)})`}offsetHSL(F,Da,ll){return this.getHSL(Af),this.setHSL(Af.h+F,Af.s+Da,Af.l+ll)}add(F){return this.r+=F.r,this.g+=F.g,this.b+=F.b,this}addColors(F,Da){return this.r=F.r+Da.r,this.g=F.g+Da.g,this.b=F.b+Da.b,this}addScalar(F){return this.r+=F,this.g+=F,this.b+=F,this}sub(F){return this.r=Math.max(0,this.r-F.r),this.g=Math.max(0,this.g-F.g),this.b=Math.max(0,this.b-F.b),this}multiply(F){return this.r*=F.r,this.g*=F.g,this.b*=F.b,this}multiplyScalar(F){return this.r*=F,this.g*=F,this.b*=F,this}lerp(F,Da){return this.r+=(F.r-this.r)*Da,this.g+=(F.g-this.g)*Da,this.b+=(F.b-this.b)*Da,this}lerpColors(F,Da,ll){return this.r=F.r+(Da.r-F.r)*ll,this.g=F.g+(Da.g-F.g)*ll,this.b=F.b+(Da.b-F.b)*ll,this}lerpHSL(F,Da){this.getHSL(Af),F.getHSL(yf);const ll=lerp(Af.h,yf.h,Da),cl=lerp(Af.s,yf.s,Da),hl=lerp(Af.l,yf.l,Da);return this.setHSL(ll,cl,hl),this}setFromVector3(F){return this.r=F.x,this.g=F.y,this.b=F.z,this}applyMatrix3(F){const Da=this.r,ll=this.g,cl=this.b,hl=F.elements;return this.r=hl[0]*Da+hl[3]*ll+hl[6]*cl,this.g=hl[1]*Da+hl[4]*ll+hl[7]*cl,this.b=hl[2]*Da+hl[5]*ll+hl[8]*cl,this}equals(F){return F.r===this.r&&F.g===this.g&&F.b===this.b}fromArray(F,Da){return void 0===Da&&(Da=0),this.r=F[Da],this.g=F[Da+1],this.b=F[Da+2],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.r,F[Da+1]=this.g,F[Da+2]=this.b,F}fromBufferAttribute(F,Da){return this.r=F.getX(Da),this.g=F.getY(Da),this.b=F.getZ(Da),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vf=new Color;Color.NAMES=gf;let _f=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:_f++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=fl,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Np,this.stencilZFail=Np,this.stencilZPass=Np,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(F){this._alphaTest>0!==F>0&&this.version++,this._alphaTest=F}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(F){if(void 0!==F)for(const Da in F){const ll=F[Da];if(void 0===ll){console.warn(`THREE.Material: parameter '${Da}' has value of undefined.`);continue}const cl=this[Da];void 0!==cl?cl&&cl.isColor?cl.set(ll):cl&&cl.isVector3&&ll&&ll.isVector3?cl.copy(ll):this[Da]=ll:console.warn(`THREE.Material: '${Da}' is not a property of THREE.${this.type}.`)}}toJSON(F){const Da=void 0===F||"string"===typeof F;Da&&(F={textures:{},images:{}});const ll={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(F){const Da=[];for(const ll in F){const cl=F[ll];delete cl.metadata,Da.push(cl)}return Da}if(ll.uuid=this.uuid,ll.type=this.type,""!==this.name&&(ll.name=this.name),this.color&&this.color.isColor&&(ll.color=this.color.getHex()),void 0!==this.roughness&&(ll.roughness=this.roughness),void 0!==this.metalness&&(ll.metalness=this.metalness),void 0!==this.sheen&&(ll.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(ll.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(ll.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(ll.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(ll.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(ll.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(ll.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(ll.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(ll.shininess=this.shininess),void 0!==this.clearcoat&&(ll.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(ll.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(ll.clearcoatMap=this.clearcoatMap.toJSON(F).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(ll.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(F).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(ll.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(F).uuid,ll.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(ll.dispersion=this.dispersion),void 0!==this.iridescence&&(ll.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(ll.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(ll.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(ll.iridescenceMap=this.iridescenceMap.toJSON(F).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(ll.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(F).uuid),void 0!==this.anisotropy&&(ll.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(ll.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(ll.anisotropyMap=this.anisotropyMap.toJSON(F).uuid),this.map&&this.map.isTexture&&(ll.map=this.map.toJSON(F).uuid),this.matcap&&this.matcap.isTexture&&(ll.matcap=this.matcap.toJSON(F).uuid),this.alphaMap&&this.alphaMap.isTexture&&(ll.alphaMap=this.alphaMap.toJSON(F).uuid),this.lightMap&&this.lightMap.isTexture&&(ll.lightMap=this.lightMap.toJSON(F).uuid,ll.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(ll.aoMap=this.aoMap.toJSON(F).uuid,ll.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(ll.bumpMap=this.bumpMap.toJSON(F).uuid,ll.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(ll.normalMap=this.normalMap.toJSON(F).uuid,ll.normalMapType=this.normalMapType,ll.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(ll.displacementMap=this.displacementMap.toJSON(F).uuid,ll.displacementScale=this.displacementScale,ll.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(ll.roughnessMap=this.roughnessMap.toJSON(F).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(ll.metalnessMap=this.metalnessMap.toJSON(F).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(ll.emissiveMap=this.emissiveMap.toJSON(F).uuid),this.specularMap&&this.specularMap.isTexture&&(ll.specularMap=this.specularMap.toJSON(F).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(ll.specularIntensityMap=this.specularIntensityMap.toJSON(F).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(ll.specularColorMap=this.specularColorMap.toJSON(F).uuid),this.envMap&&this.envMap.isTexture&&(ll.envMap=this.envMap.toJSON(F).uuid,void 0!==this.combine&&(ll.combine=this.combine)),void 0!==this.envMapRotation&&(ll.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(ll.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(ll.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(ll.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(ll.gradientMap=this.gradientMap.toJSON(F).uuid),void 0!==this.transmission&&(ll.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(ll.transmissionMap=this.transmissionMap.toJSON(F).uuid),void 0!==this.thickness&&(ll.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(ll.thicknessMap=this.thicknessMap.toJSON(F).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(ll.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(ll.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(ll.size=this.size),null!==this.shadowSide&&(ll.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(ll.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(ll.blending=this.blending),0!==this.side&&(ll.side=this.side),!0===this.vertexColors&&(ll.vertexColors=!0),this.opacity<1&&(ll.opacity=this.opacity),!0===this.transparent&&(ll.transparent=!0),204!==this.blendSrc&&(ll.blendSrc=this.blendSrc),205!==this.blendDst&&(ll.blendDst=this.blendDst),this.blendEquation!==fl&&(ll.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(ll.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(ll.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(ll.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(ll.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(ll.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(ll.depthFunc=this.depthFunc),!1===this.depthTest&&(ll.depthTest=this.depthTest),!1===this.depthWrite&&(ll.depthWrite=this.depthWrite),!1===this.colorWrite&&(ll.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(ll.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(ll.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(ll.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(ll.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Np&&(ll.stencilFail=this.stencilFail),this.stencilZFail!==Np&&(ll.stencilZFail=this.stencilZFail),this.stencilZPass!==Np&&(ll.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(ll.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(ll.rotation=this.rotation),!0===this.polygonOffset&&(ll.polygonOffset=!0),0!==this.polygonOffsetFactor&&(ll.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(ll.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(ll.linewidth=this.linewidth),void 0!==this.dashSize&&(ll.dashSize=this.dashSize),void 0!==this.gapSize&&(ll.gapSize=this.gapSize),void 0!==this.scale&&(ll.scale=this.scale),!0===this.dithering&&(ll.dithering=!0),this.alphaTest>0&&(ll.alphaTest=this.alphaTest),!0===this.alphaHash&&(ll.alphaHash=!0),!0===this.alphaToCoverage&&(ll.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(ll.premultipliedAlpha=!0),!0===this.forceSinglePass&&(ll.forceSinglePass=!0),!0===this.wireframe&&(ll.wireframe=!0),this.wireframeLinewidth>1&&(ll.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(ll.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(ll.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(ll.flatShading=!0),!1===this.visible&&(ll.visible=!1),!1===this.toneMapped&&(ll.toneMapped=!1),!1===this.fog&&(ll.fog=!1),Object.keys(this.userData).length>0&&(ll.userData=this.userData),Da){const Da=extractFromCache(F.textures),cl=extractFromCache(F.images);Da.length>0&&(ll.textures=Da),cl.length>0&&(ll.images=cl)}return ll}clone(){return(new this.constructor).copy(this)}copy(F){this.name=F.name,this.blending=F.blending,this.side=F.side,this.vertexColors=F.vertexColors,this.opacity=F.opacity,this.transparent=F.transparent,this.blendSrc=F.blendSrc,this.blendDst=F.blendDst,this.blendEquation=F.blendEquation,this.blendSrcAlpha=F.blendSrcAlpha,this.blendDstAlpha=F.blendDstAlpha,this.blendEquationAlpha=F.blendEquationAlpha,this.blendColor.copy(F.blendColor),this.blendAlpha=F.blendAlpha,this.depthFunc=F.depthFunc,this.depthTest=F.depthTest,this.depthWrite=F.depthWrite,this.stencilWriteMask=F.stencilWriteMask,this.stencilFunc=F.stencilFunc,this.stencilRef=F.stencilRef,this.stencilFuncMask=F.stencilFuncMask,this.stencilFail=F.stencilFail,this.stencilZFail=F.stencilZFail,this.stencilZPass=F.stencilZPass,this.stencilWrite=F.stencilWrite;const Da=F.clippingPlanes;let ll=null;if(null!==Da){const F=Da.length;ll=new Array(F);for(let cl=0;cl!==F;++cl)ll[cl]=Da[cl].clone()}return this.clippingPlanes=ll,this.clipIntersection=F.clipIntersection,this.clipShadows=F.clipShadows,this.shadowSide=F.shadowSide,this.colorWrite=F.colorWrite,this.precision=F.precision,this.polygonOffset=F.polygonOffset,this.polygonOffsetFactor=F.polygonOffsetFactor,this.polygonOffsetUnits=F.polygonOffsetUnits,this.dithering=F.dithering,this.alphaTest=F.alphaTest,this.alphaHash=F.alphaHash,this.alphaToCoverage=F.alphaToCoverage,this.premultipliedAlpha=F.premultipliedAlpha,this.forceSinglePass=F.forceSinglePass,this.visible=F.visible,this.toneMapped=F.toneMapped,this.userData=JSON.parse(JSON.stringify(F.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(F){!0===F&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class MeshBasicMaterial extends Material{constructor(F){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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 Euler,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(F)}copy(F){return super.copy(F),this.color.copy(F.color),this.map=F.map,this.lightMap=F.lightMap,this.lightMapIntensity=F.lightMapIntensity,this.aoMap=F.aoMap,this.aoMapIntensity=F.aoMapIntensity,this.specularMap=F.specularMap,this.alphaMap=F.alphaMap,this.envMap=F.envMap,this.envMapRotation.copy(F.envMapRotation),this.combine=F.combine,this.reflectivity=F.reflectivity,this.refractionRatio=F.refractionRatio,this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this.wireframeLinecap=F.wireframeLinecap,this.wireframeLinejoin=F.wireframeLinejoin,this.fog=F.fog,this}}const xf=new Vector3,bf=new Vector2;class BufferAttribute{constructor(F,Da,ll){if(void 0===ll&&(ll=!1),Array.isArray(F))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=F,this.itemSize=Da,this.count=void 0!==F?F.length/Da:0,this.normalized=ll,this.usage=qp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=gd,this.version=0}onUploadCallback(){}set needsUpdate(F){!0===F&&this.version++}get updateRange(){return warnOnce("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(F){return this.usage=F,this}addUpdateRange(F,Da){this.updateRanges.push({start:F,count:Da})}clearUpdateRanges(){this.updateRanges.length=0}copy(F){return this.name=F.name,this.array=new F.array.constructor(F.array),this.itemSize=F.itemSize,this.count=F.count,this.normalized=F.normalized,this.usage=F.usage,this.gpuType=F.gpuType,this}copyAt(F,Da,ll){F*=this.itemSize,ll*=Da.itemSize;for(let cl=0,hl=this.itemSize;cl<hl;cl++)this.array[F+cl]=Da.array[ll+cl];return this}copyArray(F){return this.array.set(F),this}applyMatrix3(F){if(2===this.itemSize)for(let Da=0,ll=this.count;Da<ll;Da++)bf.fromBufferAttribute(this,Da),bf.applyMatrix3(F),this.setXY(Da,bf.x,bf.y);else if(3===this.itemSize)for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyMatrix3(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}applyMatrix4(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyMatrix4(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}applyNormalMatrix(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyNormalMatrix(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}transformDirection(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.transformDirection(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}set(F,Da){return void 0===Da&&(Da=0),this.array.set(F,Da),this}getComponent(F,Da){let ll=this.array[F*this.itemSize+Da];return this.normalized&&(ll=denormalize(ll,this.array)),ll}setComponent(F,Da,ll){return this.normalized&&(ll=normalize(ll,this.array)),this.array[F*this.itemSize+Da]=ll,this}getX(F){let Da=this.array[F*this.itemSize];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setX(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize]=Da,this}getY(F){let Da=this.array[F*this.itemSize+1];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setY(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+1]=Da,this}getZ(F){let Da=this.array[F*this.itemSize+2];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setZ(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+2]=Da,this}getW(F){let Da=this.array[F*this.itemSize+3];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setW(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+3]=Da,this}setXY(F,Da,ll){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this}setXYZ(F,Da,ll,cl){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array),cl=normalize(cl,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this.array[F+2]=cl,this}setXYZW(F,Da,ll,cl,hl){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array),cl=normalize(cl,this.array),hl=normalize(hl,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this.array[F+2]=cl,this.array[F+3]=hl,this}onUpload(F){return this.onUploadCallback=F,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const F={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(F.name=this.name),this.usage!==qp&&(F.usage=this.usage),F}}class Uint16BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Uint16Array(F),Da,ll)}}class Uint32BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Uint32Array(F),Da,ll)}}class Float32BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Float32Array(F),Da,ll)}}let wf=0;const Ef=new Matrix4,Mf=new Object3D,Sf=new Vector3,kf=new Box3,Tf=new Box3,If=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:wf++}),this.uuid=generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(F){return Array.isArray(F)?this.index=new(arrayNeedsUint32(F)?Uint32BufferAttribute:Uint16BufferAttribute)(F,1):this.index=F,this}getAttribute(F){return this.attributes[F]}setAttribute(F,Da){return this.attributes[F]=Da,this}deleteAttribute(F){return delete this.attributes[F],this}hasAttribute(F){return void 0!==this.attributes[F]}addGroup(F,Da,ll){void 0===ll&&(ll=0),this.groups.push({start:F,count:Da,materialIndex:ll})}clearGroups(){this.groups=[]}setDrawRange(F,Da){this.drawRange.start=F,this.drawRange.count=Da}applyMatrix4(F){const Da=this.attributes.position;void 0!==Da&&(Da.applyMatrix4(F),Da.needsUpdate=!0);const ll=this.attributes.normal;if(void 0!==ll){const Da=(new Matrix3).getNormalMatrix(F);ll.applyNormalMatrix(Da),ll.needsUpdate=!0}const cl=this.attributes.tangent;return void 0!==cl&&(cl.transformDirection(F),cl.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(F){return Ef.makeRotationFromQuaternion(F),this.applyMatrix4(Ef),this}rotateX(F){return Ef.makeRotationX(F),this.applyMatrix4(Ef),this}rotateY(F){return Ef.makeRotationY(F),this.applyMatrix4(Ef),this}rotateZ(F){return Ef.makeRotationZ(F),this.applyMatrix4(Ef),this}translate(F,Da,ll){return Ef.makeTranslation(F,Da,ll),this.applyMatrix4(Ef),this}scale(F,Da,ll){return Ef.makeScale(F,Da,ll),this.applyMatrix4(Ef),this}lookAt(F){return Mf.lookAt(F),Mf.updateMatrix(),this.applyMatrix4(Mf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sf).negate(),this.translate(Sf.x,Sf.y,Sf.z),this}setFromPoints(F){const Da=[];for(let ll=0,cl=F.length;ll<cl;ll++){const cl=F[ll];Da.push(cl.x,cl.y,cl.z||0)}return this.setAttribute("position",new Float32BufferAttribute(Da,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const F=this.attributes.position,Da=this.morphAttributes.position;if(F&&F.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));if(void 0!==F){if(this.boundingBox.setFromBufferAttribute(F),Da)for(let ll=0,cl=Da.length;ll<cl;ll++){const F=Da[ll];kf.setFromBufferAttribute(F),this.morphTargetsRelative?(If.addVectors(this.boundingBox.min,kf.min),this.boundingBox.expandByPoint(If),If.addVectors(this.boundingBox.max,kf.max),this.boundingBox.expandByPoint(If)):(this.boundingBox.expandByPoint(kf.min),this.boundingBox.expandByPoint(kf.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(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);const F=this.attributes.position,Da=this.morphAttributes.position;if(F&&F.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Vector3,1/0);if(F){const ll=this.boundingSphere.center;if(kf.setFromBufferAttribute(F),Da)for(let F=0,hl=Da.length;F<hl;F++){const ll=Da[F];Tf.setFromBufferAttribute(ll),this.morphTargetsRelative?(If.addVectors(kf.min,Tf.min),kf.expandByPoint(If),If.addVectors(kf.max,Tf.max),kf.expandByPoint(If)):(kf.expandByPoint(Tf.min),kf.expandByPoint(Tf.max))}kf.getCenter(ll);let cl=0;for(let Da=0,hl=F.count;Da<hl;Da++)If.fromBufferAttribute(F,Da),cl=Math.max(cl,ll.distanceToSquared(If));if(Da)for(let hl=0,dl=Da.length;hl<dl;hl++){const dl=Da[hl],pl=this.morphTargetsRelative;for(let Da=0,hl=dl.count;Da<hl;Da++)If.fromBufferAttribute(dl,Da),pl&&(Sf.fromBufferAttribute(F,Da),If.add(Sf)),cl=Math.max(cl,ll.distanceToSquared(If))}this.boundingSphere.radius=Math.sqrt(cl),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 F=this.index,Da=this.attributes;if(null===F||void 0===Da.position||void 0===Da.normal||void 0===Da.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const ll=Da.position,cl=Da.normal,hl=Da.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*ll.count),4));const dl=this.getAttribute("tangent"),pl=[],fl=[];for(let hu=0;hu<ll.count;hu++)pl[hu]=new Vector3,fl[hu]=new Vector3;const Al=new Vector3,bl=new Vector3,kl=new Vector3,Dl=new Vector2,Wl=new Vector2,Ql=new Vector2,wc=new Vector3,Sc=new Vector3;function handleTriangle(F,Da,cl){Al.fromBufferAttribute(ll,F),bl.fromBufferAttribute(ll,Da),kl.fromBufferAttribute(ll,cl),Dl.fromBufferAttribute(hl,F),Wl.fromBufferAttribute(hl,Da),Ql.fromBufferAttribute(hl,cl),bl.sub(Al),kl.sub(Al),Wl.sub(Dl),Ql.sub(Dl);const dl=1/(Wl.x*Ql.y-Ql.x*Wl.y);isFinite(dl)&&(wc.copy(bl).multiplyScalar(Ql.y).addScaledVector(kl,-Wl.y).multiplyScalar(dl),Sc.copy(kl).multiplyScalar(Wl.x).addScaledVector(bl,-Ql.x).multiplyScalar(dl),pl[F].add(wc),pl[Da].add(wc),pl[cl].add(wc),fl[F].add(Sc),fl[Da].add(Sc),fl[cl].add(Sc))}let eu=this.groups;0===eu.length&&(eu=[{start:0,count:F.count}]);for(let hu=0,Lu=eu.length;hu<Lu;++hu){const Da=eu[hu],ll=Da.start;for(let cl=ll,hl=ll+Da.count;cl<hl;cl+=3)handleTriangle(F.getX(cl+0),F.getX(cl+1),F.getX(cl+2))}const iu=new Vector3,su=new Vector3,cu=new Vector3,uu=new Vector3;function handleVertex(F){cu.fromBufferAttribute(cl,F),uu.copy(cu);const Da=pl[F];iu.copy(Da),iu.sub(cu.multiplyScalar(cu.dot(Da))).normalize(),su.crossVectors(uu,Da);const ll=su.dot(fl[F])<0?-1:1;dl.setXYZW(F,iu.x,iu.y,iu.z,ll)}for(let hu=0,Lu=eu.length;hu<Lu;++hu){const Da=eu[hu],ll=Da.start;for(let cl=ll,hl=ll+Da.count;cl<hl;cl+=3)handleVertex(F.getX(cl+0)),handleVertex(F.getX(cl+1)),handleVertex(F.getX(cl+2))}}computeVertexNormals(){const F=this.index,Da=this.getAttribute("position");if(void 0!==Da){let ll=this.getAttribute("normal");if(void 0===ll)ll=new BufferAttribute(new Float32Array(3*Da.count),3),this.setAttribute("normal",ll);else for(let F=0,Da=ll.count;F<Da;F++)ll.setXYZ(F,0,0,0);const cl=new Vector3,hl=new Vector3,dl=new Vector3,pl=new Vector3,fl=new Vector3,Al=new Vector3,bl=new Vector3,kl=new Vector3;if(F)for(let Dl=0,Wl=F.count;Dl<Wl;Dl+=3){const Wl=F.getX(Dl+0),Ql=F.getX(Dl+1),wc=F.getX(Dl+2);cl.fromBufferAttribute(Da,Wl),hl.fromBufferAttribute(Da,Ql),dl.fromBufferAttribute(Da,wc),bl.subVectors(dl,hl),kl.subVectors(cl,hl),bl.cross(kl),pl.fromBufferAttribute(ll,Wl),fl.fromBufferAttribute(ll,Ql),Al.fromBufferAttribute(ll,wc),pl.add(bl),fl.add(bl),Al.add(bl),ll.setXYZ(Wl,pl.x,pl.y,pl.z),ll.setXYZ(Ql,fl.x,fl.y,fl.z),ll.setXYZ(wc,Al.x,Al.y,Al.z)}else for(let F=0,Dl=Da.count;F<Dl;F+=3)cl.fromBufferAttribute(Da,F+0),hl.fromBufferAttribute(Da,F+1),dl.fromBufferAttribute(Da,F+2),bl.subVectors(dl,hl),kl.subVectors(cl,hl),bl.cross(kl),ll.setXYZ(F+0,bl.x,bl.y,bl.z),ll.setXYZ(F+1,bl.x,bl.y,bl.z),ll.setXYZ(F+2,bl.x,bl.y,bl.z);this.normalizeNormals(),ll.needsUpdate=!0}}normalizeNormals(){const F=this.attributes.normal;for(let Da=0,ll=F.count;Da<ll;Da++)If.fromBufferAttribute(F,Da),If.normalize(),F.setXYZ(Da,If.x,If.y,If.z)}toNonIndexed(){function convertBufferAttribute(F,Da){const ll=F.array,cl=F.itemSize,hl=F.normalized,dl=new ll.constructor(Da.length*cl);let pl=0,fl=0;for(let Al=0,bl=Da.length;Al<bl;Al++){pl=F.isInterleavedBufferAttribute?Da[Al]*F.data.stride+F.offset:Da[Al]*cl;for(let F=0;F<cl;F++)dl[fl++]=ll[pl++]}return new BufferAttribute(dl,cl,hl)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const F=new BufferGeometry,Da=this.index.array,ll=this.attributes;for(const dl in ll){const cl=convertBufferAttribute(ll[dl],Da);F.setAttribute(dl,cl)}const cl=this.morphAttributes;for(const dl in cl){const ll=[],hl=cl[dl];for(let F=0,cl=hl.length;F<cl;F++){const cl=convertBufferAttribute(hl[F],Da);ll.push(cl)}F.morphAttributes[dl]=ll}F.morphTargetsRelative=this.morphTargetsRelative;const hl=this.groups;for(let dl=0,pl=hl.length;dl<pl;dl++){const Da=hl[dl];F.addGroup(Da.start,Da.count,Da.materialIndex)}return F}toJSON(){const F={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(F.uuid=this.uuid,F.type=this.type,""!==this.name&&(F.name=this.name),Object.keys(this.userData).length>0&&(F.userData=this.userData),void 0!==this.parameters){const Da=this.parameters;for(const ll in Da)void 0!==Da[ll]&&(F[ll]=Da[ll]);return F}F.data={attributes:{}};const Da=this.index;null!==Da&&(F.data.index={type:Da.array.constructor.name,array:Array.prototype.slice.call(Da.array)});const ll=this.attributes;for(const fl in ll){const Da=ll[fl];F.data.attributes[fl]=Da.toJSON(F.data)}const cl={};let hl=!1;for(const fl in this.morphAttributes){const Da=this.morphAttributes[fl],ll=[];for(let cl=0,hl=Da.length;cl<hl;cl++){const hl=Da[cl];ll.push(hl.toJSON(F.data))}ll.length>0&&(cl[fl]=ll,hl=!0)}hl&&(F.data.morphAttributes=cl,F.data.morphTargetsRelative=this.morphTargetsRelative);const dl=this.groups;dl.length>0&&(F.data.groups=JSON.parse(JSON.stringify(dl)));const pl=this.boundingSphere;return null!==pl&&(F.data.boundingSphere={center:pl.center.toArray(),radius:pl.radius}),F}clone(){return(new this.constructor).copy(this)}copy(F){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const Da={};this.name=F.name;const ll=F.index;null!==ll&&this.setIndex(ll.clone(Da));const cl=F.attributes;for(const Al in cl){const F=cl[Al];this.setAttribute(Al,F.clone(Da))}const hl=F.morphAttributes;for(const Al in hl){const F=[],ll=hl[Al];for(let cl=0,hl=ll.length;cl<hl;cl++)F.push(ll[cl].clone(Da));this.morphAttributes[Al]=F}this.morphTargetsRelative=F.morphTargetsRelative;const dl=F.groups;for(let Al=0,bl=dl.length;Al<bl;Al++){const F=dl[Al];this.addGroup(F.start,F.count,F.materialIndex)}const pl=F.boundingBox;null!==pl&&(this.boundingBox=pl.clone());const fl=F.boundingSphere;return null!==fl&&(this.boundingSphere=fl.clone()),this.drawRange.start=F.drawRange.start,this.drawRange.count=F.drawRange.count,this.userData=F.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Cf=new Matrix4,Lf=new Ray,zf=new Sphere,Pf=new Vector3,Df=new Vector3,Rf=new Vector3,Nf=new Vector3,Uf=new Vector3,Bf=new Vector3,Of=new Vector2,Ff=new Vector2,jf=new Vector2,Vf=new Vector3,Gf=new Vector3,Hf=new Vector3,qf=new Vector3,Zf=new Vector3;class Mesh extends Object3D{constructor(F,Da){void 0===F&&(F=new BufferGeometry),void 0===Da&&(Da=new MeshBasicMaterial),super(),this.isMesh=!0,this.type="Mesh",this.geometry=F,this.material=Da,this.updateMorphTargets()}copy(F,Da){return super.copy(F,Da),void 0!==F.morphTargetInfluences&&(this.morphTargetInfluences=F.morphTargetInfluences.slice()),void 0!==F.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},F.morphTargetDictionary)),this.material=Array.isArray(F.material)?F.material.slice():F.material,this.geometry=F.geometry,this}updateMorphTargets(){const F=this.geometry.morphAttributes,Da=Object.keys(F);if(Da.length>0){const ll=F[Da[0]];if(void 0!==ll){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let F=0,Da=ll.length;F<Da;F++){const Da=ll[F].name||String(F);this.morphTargetInfluences.push(0),this.morphTargetDictionary[Da]=F}}}}getVertexPosition(F,Da){const ll=this.geometry,cl=ll.attributes.position,hl=ll.morphAttributes.position,dl=ll.morphTargetsRelative;Da.fromBufferAttribute(cl,F);const pl=this.morphTargetInfluences;if(hl&&pl){Bf.set(0,0,0);for(let ll=0,cl=hl.length;ll<cl;ll++){const cl=pl[ll],fl=hl[ll];0!==cl&&(Uf.fromBufferAttribute(fl,F),dl?Bf.addScaledVector(Uf,cl):Bf.addScaledVector(Uf.sub(Da),cl))}Da.add(Bf)}return Da}raycast(F,Da){const ll=this.geometry,cl=this.material,hl=this.matrixWorld;if(void 0!==cl){if(null===ll.boundingSphere&&ll.computeBoundingSphere(),zf.copy(ll.boundingSphere),zf.applyMatrix4(hl),Lf.copy(F.ray).recast(F.near),!1===zf.containsPoint(Lf.origin)){if(null===Lf.intersectSphere(zf,Pf))return;if(Lf.origin.distanceToSquared(Pf)>(F.far-F.near)**2)return}Cf.copy(hl).invert(),Lf.copy(F.ray).applyMatrix4(Cf),null!==ll.boundingBox&&!1===Lf.intersectsBox(ll.boundingBox)||this._computeIntersections(F,Da,Lf)}}_computeIntersections(F,Da,ll){let cl;const hl=this.geometry,dl=this.material,pl=hl.index,fl=hl.attributes.position,Al=hl.attributes.uv,bl=hl.attributes.uv1,kl=hl.attributes.normal,Dl=hl.groups,Wl=hl.drawRange;if(null!==pl)if(Array.isArray(dl))for(let Ql=0,wc=Dl.length;Ql<wc;Ql++){const hl=Dl[Ql],fl=dl[hl.materialIndex];for(let dl=Math.max(hl.start,Wl.start),Dl=Math.min(pl.count,Math.min(hl.start+hl.count,Wl.start+Wl.count));dl<Dl;dl+=3){cl=checkGeometryIntersection(this,fl,F,ll,Al,bl,kl,pl.getX(dl),pl.getX(dl+1),pl.getX(dl+2)),cl&&(cl.faceIndex=Math.floor(dl/3),cl.face.materialIndex=hl.materialIndex,Da.push(cl))}}else{for(let hl=Math.max(0,Wl.start),fl=Math.min(pl.count,Wl.start+Wl.count);hl<fl;hl+=3){cl=checkGeometryIntersection(this,dl,F,ll,Al,bl,kl,pl.getX(hl),pl.getX(hl+1),pl.getX(hl+2)),cl&&(cl.faceIndex=Math.floor(hl/3),Da.push(cl))}}else if(void 0!==fl)if(Array.isArray(dl))for(let Ql=0,wc=Dl.length;Ql<wc;Ql++){const hl=Dl[Ql],pl=dl[hl.materialIndex];for(let dl=Math.max(hl.start,Wl.start),Dl=Math.min(fl.count,Math.min(hl.start+hl.count,Wl.start+Wl.count));dl<Dl;dl+=3){cl=checkGeometryIntersection(this,pl,F,ll,Al,bl,kl,dl,dl+1,dl+2),cl&&(cl.faceIndex=Math.floor(dl/3),cl.face.materialIndex=hl.materialIndex,Da.push(cl))}}else{for(let hl=Math.max(0,Wl.start),pl=Math.min(fl.count,Wl.start+Wl.count);hl<pl;hl+=3){cl=checkGeometryIntersection(this,dl,F,ll,Al,bl,kl,hl,hl+1,hl+2),cl&&(cl.faceIndex=Math.floor(hl/3),Da.push(cl))}}}}function checkGeometryIntersection(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){F.getVertexPosition(fl,Df),F.getVertexPosition(Al,Rf),F.getVertexPosition(bl,Nf);const kl=function(F,Da,ll,cl,hl,dl,pl,fl){let Al;if(Al=1===Da.side?cl.intersectTriangle(pl,dl,hl,!0,fl):cl.intersectTriangle(hl,dl,pl,0===Da.side,fl),null===Al)return null;Zf.copy(fl),Zf.applyMatrix4(F.matrixWorld);const bl=ll.ray.origin.distanceTo(Zf);return bl<ll.near||bl>ll.far?null:{distance:bl,point:Zf.clone(),object:F}}(F,Da,ll,cl,Df,Rf,Nf,qf);if(kl){hl&&(Of.fromBufferAttribute(hl,fl),Ff.fromBufferAttribute(hl,Al),jf.fromBufferAttribute(hl,bl),kl.uv=Triangle.getInterpolation(qf,Df,Rf,Nf,Of,Ff,jf,new Vector2)),dl&&(Of.fromBufferAttribute(dl,fl),Ff.fromBufferAttribute(dl,Al),jf.fromBufferAttribute(dl,bl),kl.uv1=Triangle.getInterpolation(qf,Df,Rf,Nf,Of,Ff,jf,new Vector2)),pl&&(Vf.fromBufferAttribute(pl,fl),Gf.fromBufferAttribute(pl,Al),Hf.fromBufferAttribute(pl,bl),kl.normal=Triangle.getInterpolation(qf,Df,Rf,Nf,Vf,Gf,Hf,new Vector3),kl.normal.dot(cl.direction)>0&&kl.normal.multiplyScalar(-1));const F={a:fl,b:Al,c:bl,normal:new Vector3,materialIndex:0};Triangle.getNormal(Df,Rf,Nf,F.normal),kl.face=F}return kl}class BoxGeometry extends BufferGeometry{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),void 0===hl&&(hl=1),void 0===dl&&(dl=1),super(),this.type="BoxGeometry",this.parameters={width:F,height:Da,depth:ll,widthSegments:cl,heightSegments:hl,depthSegments:dl};const pl=this;cl=Math.floor(cl),hl=Math.floor(hl),dl=Math.floor(dl);const fl=[],Al=[],bl=[],kl=[];let Dl=0,Wl=0;function buildPlane(F,Da,ll,cl,hl,dl,Ql,wc,Sc,eu,iu){const su=dl/Sc,cu=Ql/eu,uu=dl/2,hu=Ql/2,Lu=wc/2,zu=Sc+1,Du=eu+1;let Nu=0,qu=0;const ih=new Vector3;for(let pl=0;pl<Du;pl++){const dl=pl*cu-hu;for(let fl=0;fl<zu;fl++){const Dl=fl*su-uu;ih[F]=Dl*cl,ih[Da]=dl*hl,ih[ll]=Lu,Al.push(ih.x,ih.y,ih.z),ih[F]=0,ih[Da]=0,ih[ll]=wc>0?1:-1,bl.push(ih.x,ih.y,ih.z),kl.push(fl/Sc),kl.push(1-pl/eu),Nu+=1}}for(let pl=0;pl<eu;pl++)for(let F=0;F<Sc;F++){const Da=Dl+F+zu*pl,ll=Dl+F+zu*(pl+1),cl=Dl+(F+1)+zu*(pl+1),hl=Dl+(F+1)+zu*pl;fl.push(Da,ll,hl),fl.push(ll,cl,hl),qu+=6}pl.addGroup(Wl,qu,iu),Wl+=qu,Dl+=Nu}buildPlane("z","y","x",-1,-1,ll,Da,F,dl,hl,0),buildPlane("z","y","x",1,-1,ll,Da,-F,dl,hl,1),buildPlane("x","z","y",1,1,F,ll,Da,cl,dl,2),buildPlane("x","z","y",1,-1,F,ll,-Da,cl,dl,3),buildPlane("x","y","z",1,-1,F,Da,ll,cl,hl,4),buildPlane("x","y","z",-1,-1,F,Da,-ll,cl,hl,5),this.setIndex(fl),this.setAttribute("position",new Float32BufferAttribute(Al,3)),this.setAttribute("normal",new Float32BufferAttribute(bl,3)),this.setAttribute("uv",new Float32BufferAttribute(kl,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new BoxGeometry(F.width,F.height,F.depth,F.widthSegments,F.heightSegments,F.depthSegments)}}function cloneUniforms(F){const Da={};for(const ll in F){Da[ll]={};for(const cl in F[ll]){const hl=F[ll][cl];hl&&(hl.isColor||hl.isMatrix3||hl.isMatrix4||hl.isVector2||hl.isVector3||hl.isVector4||hl.isTexture||hl.isQuaternion)?hl.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),Da[ll][cl]=null):Da[ll][cl]=hl.clone():Array.isArray(hl)?Da[ll][cl]=hl.slice():Da[ll][cl]=hl}}return Da}function mergeUniforms(F){const Da={};for(let ll=0;ll<F.length;ll++){const cl=cloneUniforms(F[ll]);for(const F in cl)Da[F]=cl[F]}return Da}function getUnlitUniformColorSpace(F){const Da=F.getRenderTarget();return null===Da?F.outputColorSpace:!0===Da.isXRRenderTarget?Da.texture.colorSpace:sm.workingColorSpace}const Wf={clone:cloneUniforms,merge:mergeUniforms};class ShaderMaterial extends Material{constructor(F){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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,void 0!==F&&this.setValues(F)}copy(F){return super.copy(F),this.fragmentShader=F.fragmentShader,this.vertexShader=F.vertexShader,this.uniforms=cloneUniforms(F.uniforms),this.uniformsGroups=function(F){const Da=[];for(let ll=0;ll<F.length;ll++)Da.push(F[ll].clone());return Da}(F.uniformsGroups),this.defines=Object.assign({},F.defines),this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this.fog=F.fog,this.lights=F.lights,this.clipping=F.clipping,this.extensions=Object.assign({},F.extensions),this.glslVersion=F.glslVersion,this}toJSON(F){const Da=super.toJSON(F);Da.glslVersion=this.glslVersion,Da.uniforms={};for(const cl in this.uniforms){const ll=this.uniforms[cl].value;ll&&ll.isTexture?Da.uniforms[cl]={type:"t",value:ll.toJSON(F).uuid}:ll&&ll.isColor?Da.uniforms[cl]={type:"c",value:ll.getHex()}:ll&&ll.isVector2?Da.uniforms[cl]={type:"v2",value:ll.toArray()}:ll&&ll.isVector3?Da.uniforms[cl]={type:"v3",value:ll.toArray()}:ll&&ll.isVector4?Da.uniforms[cl]={type:"v4",value:ll.toArray()}:ll&&ll.isMatrix3?Da.uniforms[cl]={type:"m3",value:ll.toArray()}:ll&&ll.isMatrix4?Da.uniforms[cl]={type:"m4",value:ll.toArray()}:Da.uniforms[cl]={value:ll}}Object.keys(this.defines).length>0&&(Da.defines=this.defines),Da.vertexShader=this.vertexShader,Da.fragmentShader=this.fragmentShader,Da.lights=this.lights,Da.clipping=this.clipping;const ll={};for(const cl in this.extensions)!0===this.extensions[cl]&&(ll[cl]=!0);return Object.keys(ll).length>0&&(Da.extensions=ll),Da}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=Wp}copy(F,Da){return super.copy(F,Da),this.matrixWorldInverse.copy(F.matrixWorldInverse),this.projectionMatrix.copy(F.projectionMatrix),this.projectionMatrixInverse.copy(F.projectionMatrixInverse),this.coordinateSystem=F.coordinateSystem,this}getWorldDirection(F){return super.getWorldDirection(F).negate()}updateMatrixWorld(F){super.updateMatrixWorld(F),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(F,Da){super.updateWorldMatrix(F,Da),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Kf=new Vector3,Qf=new Vector2,Xf=new Vector2;class PerspectiveCamera extends Camera{constructor(F,Da,ll,cl){void 0===F&&(F=50),void 0===Da&&(Da=1),void 0===ll&&(ll=.1),void 0===cl&&(cl=2e3),super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=F,this.zoom=1,this.near=ll,this.far=cl,this.focus=10,this.aspect=Da,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(F,Da){return super.copy(F,Da),this.fov=F.fov,this.zoom=F.zoom,this.near=F.near,this.far=F.far,this.focus=F.focus,this.aspect=F.aspect,this.view=null===F.view?null:Object.assign({},F.view),this.filmGauge=F.filmGauge,this.filmOffset=F.filmOffset,this}setFocalLength(F){const Da=.5*this.getFilmHeight()/F;this.fov=2*Jp*Math.atan(Da),this.updateProjectionMatrix()}getFocalLength(){const F=Math.tan(.5*Yp*this.fov);return.5*this.getFilmHeight()/F}getEffectiveFOV(){return 2*Jp*Math.atan(Math.tan(.5*Yp*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(F,Da,ll){Kf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),Da.set(Kf.x,Kf.y).multiplyScalar(-F/Kf.z),Kf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),ll.set(Kf.x,Kf.y).multiplyScalar(-F/Kf.z)}getViewSize(F,Da){return this.getViewBounds(F,Qf,Xf),Da.subVectors(Xf,Qf)}setViewOffset(F,Da,ll,cl,hl,dl){this.aspect=F/Da,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=F,this.view.fullHeight=Da,this.view.offsetX=ll,this.view.offsetY=cl,this.view.width=hl,this.view.height=dl,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const F=this.near;let Da=F*Math.tan(.5*Yp*this.fov)/this.zoom,ll=2*Da,cl=this.aspect*ll,hl=-.5*cl;const dl=this.view;if(null!==this.view&&this.view.enabled){const F=dl.fullWidth,pl=dl.fullHeight;hl+=dl.offsetX*cl/F,Da-=dl.offsetY*ll/pl,cl*=dl.width/F,ll*=dl.height/pl}const pl=this.filmOffset;0!==pl&&(hl+=F*pl/this.getFilmWidth()),this.projectionMatrix.makePerspective(hl,hl+cl,Da,Da-ll,F,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(F){const Da=super.toJSON(F);return Da.object.fov=this.fov,Da.object.zoom=this.zoom,Da.object.near=this.near,Da.object.far=this.far,Da.object.focus=this.focus,Da.object.aspect=this.aspect,null!==this.view&&(Da.object.view=Object.assign({},this.view)),Da.object.filmGauge=this.filmGauge,Da.object.filmOffset=this.filmOffset,Da}}const Yf=-90;class CubeCamera extends Object3D{constructor(F,Da,ll){super(),this.type="CubeCamera",this.renderTarget=ll,this.coordinateSystem=null,this.activeMipmapLevel=0;const cl=new PerspectiveCamera(Yf,1,F,Da);cl.layers=this.layers,this.add(cl);const hl=new PerspectiveCamera(Yf,1,F,Da);hl.layers=this.layers,this.add(hl);const dl=new PerspectiveCamera(Yf,1,F,Da);dl.layers=this.layers,this.add(dl);const pl=new PerspectiveCamera(Yf,1,F,Da);pl.layers=this.layers,this.add(pl);const fl=new PerspectiveCamera(Yf,1,F,Da);fl.layers=this.layers,this.add(fl);const Al=new PerspectiveCamera(Yf,1,F,Da);Al.layers=this.layers,this.add(Al)}updateCoordinateSystem(){const F=this.coordinateSystem,Da=this.children.concat(),[ll,cl,hl,dl,pl,fl]=Da;for(const Al of Da)this.remove(Al);if(F===Wp)ll.up.set(0,1,0),ll.lookAt(1,0,0),cl.up.set(0,1,0),cl.lookAt(-1,0,0),hl.up.set(0,0,-1),hl.lookAt(0,1,0),dl.up.set(0,0,1),dl.lookAt(0,-1,0),pl.up.set(0,1,0),pl.lookAt(0,0,1),fl.up.set(0,1,0),fl.lookAt(0,0,-1);else{if(F!==Kp)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+F);ll.up.set(0,-1,0),ll.lookAt(-1,0,0),cl.up.set(0,-1,0),cl.lookAt(1,0,0),hl.up.set(0,0,1),hl.lookAt(0,1,0),dl.up.set(0,0,-1),dl.lookAt(0,-1,0),pl.up.set(0,-1,0),pl.lookAt(0,0,1),fl.up.set(0,-1,0),fl.lookAt(0,0,-1)}for(const Al of Da)this.add(Al),Al.updateMatrixWorld()}update(F,Da){null===this.parent&&this.updateMatrixWorld();const{renderTarget:ll,activeMipmapLevel:cl}=this;this.coordinateSystem!==F.coordinateSystem&&(this.coordinateSystem=F.coordinateSystem,this.updateCoordinateSystem());const[hl,dl,pl,fl,Al,bl]=this.children,kl=F.getRenderTarget(),Dl=F.getActiveCubeFace(),Wl=F.getActiveMipmapLevel(),Ql=F.xr.enabled;F.xr.enabled=!1;const wc=ll.texture.generateMipmaps;ll.texture.generateMipmaps=!1,F.setRenderTarget(ll,0,cl),F.render(Da,hl),F.setRenderTarget(ll,1,cl),F.render(Da,dl),F.setRenderTarget(ll,2,cl),F.render(Da,pl),F.setRenderTarget(ll,3,cl),F.render(Da,fl),F.setRenderTarget(ll,4,cl),F.render(Da,Al),ll.texture.generateMipmaps=wc,F.setRenderTarget(ll,5,cl),F.render(Da,bl),F.setRenderTarget(kl,Dl,Wl),F.xr.enabled=Ql,ll.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){super(F=void 0!==F?F:[],Da=void 0!==Da?Da:Nu,ll,cl,hl,dl,pl,fl,Al,bl),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(F){this.image=F}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(F,Da){void 0===F&&(F=1),void 0===Da&&(Da={}),super(F,F,Da),this.isWebGLCubeRenderTarget=!0;const ll={width:F,height:F,depth:1},cl=[ll,ll,ll,ll,ll,ll];this.texture=new CubeTexture(cl,Da.mapping,Da.wrapS,Da.wrapT,Da.magFilter,Da.minFilter,Da.format,Da.type,Da.anisotropy,Da.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==Da.generateMipmaps&&Da.generateMipmaps,this.texture.minFilter=void 0!==Da.minFilter?Da.minFilter:od}fromEquirectangularTexture(F,Da){this.texture.type=Da.type,this.texture.colorSpace=Da.colorSpace,this.texture.generateMipmaps=Da.generateMipmaps,this.texture.minFilter=Da.minFilter,this.texture.magFilter=Da.magFilter;const ll={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},cl=new BoxGeometry(5,5,5),hl=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(ll.uniforms),vertexShader:ll.vertexShader,fragmentShader:ll.fragmentShader,side:1,blending:0});hl.uniforms.tEquirect.value=Da;const dl=new Mesh(cl,hl),pl=Da.minFilter;Da.minFilter===cd&&(Da.minFilter=od);return new CubeCamera(1,10,this).update(F,dl),Da.minFilter=pl,dl.geometry.dispose(),dl.material.dispose(),this}clear(F,Da,ll,cl){const hl=F.getRenderTarget();for(let dl=0;dl<6;dl++)F.setRenderTarget(this,dl),F.clear(Da,ll,cl);F.setRenderTarget(hl)}}const Jf=new Vector3,$f=new Vector3,eg=new Matrix3;class Plane{constructor(F,Da){void 0===F&&(F=new Vector3(1,0,0)),void 0===Da&&(Da=0),this.isPlane=!0,this.normal=F,this.constant=Da}set(F,Da){return this.normal.copy(F),this.constant=Da,this}setComponents(F,Da,ll,cl){return this.normal.set(F,Da,ll),this.constant=cl,this}setFromNormalAndCoplanarPoint(F,Da){return this.normal.copy(F),this.constant=-Da.dot(this.normal),this}setFromCoplanarPoints(F,Da,ll){const cl=Jf.subVectors(ll,Da).cross($f.subVectors(F,Da)).normalize();return this.setFromNormalAndCoplanarPoint(cl,F),this}copy(F){return this.normal.copy(F.normal),this.constant=F.constant,this}normalize(){const F=1/this.normal.length();return this.normal.multiplyScalar(F),this.constant*=F,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(F){return this.normal.dot(F)+this.constant}distanceToSphere(F){return this.distanceToPoint(F.center)-F.radius}projectPoint(F,Da){return Da.copy(F).addScaledVector(this.normal,-this.distanceToPoint(F))}intersectLine(F,Da){const ll=F.delta(Jf),cl=this.normal.dot(ll);if(0===cl)return 0===this.distanceToPoint(F.start)?Da.copy(F.start):null;const hl=-(F.start.dot(this.normal)+this.constant)/cl;return hl<0||hl>1?null:Da.copy(F.start).addScaledVector(ll,hl)}intersectsLine(F){const Da=this.distanceToPoint(F.start),ll=this.distanceToPoint(F.end);return Da<0&&ll>0||ll<0&&Da>0}intersectsBox(F){return F.intersectsPlane(this)}intersectsSphere(F){return F.intersectsPlane(this)}coplanarPoint(F){return F.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(F,Da){const ll=Da||eg.getNormalMatrix(F),cl=this.coplanarPoint(Jf).applyMatrix4(F),hl=this.normal.applyMatrix3(ll).normalize();return this.constant=-cl.dot(hl),this}translate(F){return this.constant-=F.dot(this.normal),this}equals(F){return F.normal.equals(this.normal)&&F.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const tg=new Sphere,ig=new Vector3;class Frustum{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=new Plane),void 0===Da&&(Da=new Plane),void 0===ll&&(ll=new Plane),void 0===cl&&(cl=new Plane),void 0===hl&&(hl=new Plane),void 0===dl&&(dl=new Plane),this.planes=[F,Da,ll,cl,hl,dl]}set(F,Da,ll,cl,hl,dl){const pl=this.planes;return pl[0].copy(F),pl[1].copy(Da),pl[2].copy(ll),pl[3].copy(cl),pl[4].copy(hl),pl[5].copy(dl),this}copy(F){const Da=this.planes;for(let ll=0;ll<6;ll++)Da[ll].copy(F.planes[ll]);return this}setFromProjectionMatrix(F,Da){void 0===Da&&(Da=Wp);const ll=this.planes,cl=F.elements,hl=cl[0],dl=cl[1],pl=cl[2],fl=cl[3],Al=cl[4],bl=cl[5],kl=cl[6],Dl=cl[7],Wl=cl[8],Ql=cl[9],wc=cl[10],Sc=cl[11],eu=cl[12],iu=cl[13],su=cl[14],cu=cl[15];if(ll[0].setComponents(fl-hl,Dl-Al,Sc-Wl,cu-eu).normalize(),ll[1].setComponents(fl+hl,Dl+Al,Sc+Wl,cu+eu).normalize(),ll[2].setComponents(fl+dl,Dl+bl,Sc+Ql,cu+iu).normalize(),ll[3].setComponents(fl-dl,Dl-bl,Sc-Ql,cu-iu).normalize(),ll[4].setComponents(fl-pl,Dl-kl,Sc-wc,cu-su).normalize(),Da===Wp)ll[5].setComponents(fl+pl,Dl+kl,Sc+wc,cu+su).normalize();else{if(Da!==Kp)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+Da);ll[5].setComponents(pl,kl,wc,su).normalize()}return this}intersectsObject(F){if(void 0!==F.boundingSphere)null===F.boundingSphere&&F.computeBoundingSphere(),tg.copy(F.boundingSphere).applyMatrix4(F.matrixWorld);else{const Da=F.geometry;null===Da.boundingSphere&&Da.computeBoundingSphere(),tg.copy(Da.boundingSphere).applyMatrix4(F.matrixWorld)}return this.intersectsSphere(tg)}intersectsSprite(F){return tg.center.set(0,0,0),tg.radius=.7071067811865476,tg.applyMatrix4(F.matrixWorld),this.intersectsSphere(tg)}intersectsSphere(F){const Da=this.planes,ll=F.center,cl=-F.radius;for(let hl=0;hl<6;hl++){if(Da[hl].distanceToPoint(ll)<cl)return!1}return!0}intersectsBox(F){const Da=this.planes;for(let ll=0;ll<6;ll++){const cl=Da[ll];if(ig.x=cl.normal.x>0?F.max.x:F.min.x,ig.y=cl.normal.y>0?F.max.y:F.min.y,ig.z=cl.normal.z>0?F.max.z:F.min.z,cl.distanceToPoint(ig)<0)return!1}return!0}containsPoint(F){const Da=this.planes;for(let ll=0;ll<6;ll++)if(Da[ll].distanceToPoint(F)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let F=null,Da=!1,ll=null,cl=null;function onAnimationFrame(Da,hl){ll(Da,hl),cl=F.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==Da&&null!==ll&&(cl=F.requestAnimationFrame(onAnimationFrame),Da=!0)},stop:function(){F.cancelAnimationFrame(cl),Da=!1},setAnimationLoop:function(F){ll=F},setContext:function(Da){F=Da}}}function WebGLAttributes(F){const Da=new WeakMap;return{get:function(F){return F.isInterleavedBufferAttribute&&(F=F.data),Da.get(F)},remove:function(ll){ll.isInterleavedBufferAttribute&&(ll=ll.data);const cl=Da.get(ll);cl&&(F.deleteBuffer(cl.buffer),Da.delete(ll))},update:function(ll,cl){if(ll.isInterleavedBufferAttribute&&(ll=ll.data),ll.isGLBufferAttribute){const F=Da.get(ll);return void((!F||F.version<ll.version)&&Da.set(ll,{buffer:ll.buffer,type:ll.type,bytesPerElement:ll.elementSize,version:ll.version}))}const hl=Da.get(ll);if(void 0===hl)Da.set(ll,function(Da,ll){const cl=Da.array,hl=Da.usage,dl=cl.byteLength,pl=F.createBuffer();let fl;if(F.bindBuffer(ll,pl),F.bufferData(ll,cl,hl),Da.onUploadCallback(),cl instanceof Float32Array)fl=F.FLOAT;else if(cl instanceof Uint16Array)fl=Da.isFloat16BufferAttribute?F.HALF_FLOAT:F.UNSIGNED_SHORT;else if(cl instanceof Int16Array)fl=F.SHORT;else if(cl instanceof Uint32Array)fl=F.UNSIGNED_INT;else if(cl instanceof Int32Array)fl=F.INT;else if(cl instanceof Int8Array)fl=F.BYTE;else if(cl instanceof Uint8Array)fl=F.UNSIGNED_BYTE;else{if(!(cl instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+cl);fl=F.UNSIGNED_BYTE}return{buffer:pl,type:fl,bytesPerElement:cl.BYTES_PER_ELEMENT,version:Da.version,size:dl}}(ll,cl));else if(hl.version<ll.version){if(hl.size!==ll.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.");!function(Da,ll,cl){const hl=ll.array,dl=ll._updateRange,pl=ll.updateRanges;if(F.bindBuffer(cl,Da),-1===dl.count&&0===pl.length&&F.bufferSubData(cl,0,hl),0!==pl.length){for(let Da=0,ll=pl.length;Da<ll;Da++){const ll=pl[Da];F.bufferSubData(cl,ll.start*hl.BYTES_PER_ELEMENT,hl,ll.start,ll.count)}ll.clearUpdateRanges()}-1!==dl.count&&(F.bufferSubData(cl,dl.offset*hl.BYTES_PER_ELEMENT,hl,dl.offset,dl.count),dl.count=-1),ll.onUploadCallback()}(hl.buffer,ll,cl),hl.version=ll.version}}}}class PlaneGeometry extends BufferGeometry{constructor(F,Da,ll,cl){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(),this.type="PlaneGeometry",this.parameters={width:F,height:Da,widthSegments:ll,heightSegments:cl};const hl=F/2,dl=Da/2,pl=Math.floor(ll),fl=Math.floor(cl),Al=pl+1,bl=fl+1,kl=F/pl,Dl=Da/fl,Wl=[],Ql=[],wc=[],Sc=[];for(let eu=0;eu<bl;eu++){const F=eu*Dl-dl;for(let Da=0;Da<Al;Da++){const ll=Da*kl-hl;Ql.push(ll,-F,0),wc.push(0,0,1),Sc.push(Da/pl),Sc.push(1-eu/fl)}}for(let eu=0;eu<fl;eu++)for(let F=0;F<pl;F++){const Da=F+Al*eu,ll=F+Al*(eu+1),cl=F+1+Al*(eu+1),hl=F+1+Al*eu;Wl.push(Da,ll,hl),Wl.push(ll,cl,hl)}this.setIndex(Wl),this.setAttribute("position",new Float32BufferAttribute(Ql,3)),this.setAttribute("normal",new Float32BufferAttribute(wc,3)),this.setAttribute("uv",new Float32BufferAttribute(Sc,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new PlaneGeometry(F.width,F.height,F.widthSegments,F.heightSegments)}}const ng={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},rg={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(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 Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ag={basic:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.fog]),vertexShader:ng.meshbasic_vert,fragmentShader:ng.meshbasic_frag},lambert:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,rg.lights,{emissive:{value:new Color(0)}}]),vertexShader:ng.meshlambert_vert,fragmentShader:ng.meshlambert_frag},phong:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,rg.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ng.meshphong_vert,fragmentShader:ng.meshphong_frag},standard:{uniforms:mergeUniforms([rg.common,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.roughnessmap,rg.metalnessmap,rg.fog,rg.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ng.meshphysical_vert,fragmentShader:ng.meshphysical_frag},toon:{uniforms:mergeUniforms([rg.common,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.gradientmap,rg.fog,rg.lights,{emissive:{value:new Color(0)}}]),vertexShader:ng.meshtoon_vert,fragmentShader:ng.meshtoon_frag},matcap:{uniforms:mergeUniforms([rg.common,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,{matcap:{value:null}}]),vertexShader:ng.meshmatcap_vert,fragmentShader:ng.meshmatcap_frag},points:{uniforms:mergeUniforms([rg.points,rg.fog]),vertexShader:ng.points_vert,fragmentShader:ng.points_frag},dashed:{uniforms:mergeUniforms([rg.common,rg.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ng.linedashed_vert,fragmentShader:ng.linedashed_frag},depth:{uniforms:mergeUniforms([rg.common,rg.displacementmap]),vertexShader:ng.depth_vert,fragmentShader:ng.depth_frag},normal:{uniforms:mergeUniforms([rg.common,rg.bumpmap,rg.normalmap,rg.displacementmap,{opacity:{value:1}}]),vertexShader:ng.meshnormal_vert,fragmentShader:ng.meshnormal_frag},sprite:{uniforms:mergeUniforms([rg.sprite,rg.fog]),vertexShader:ng.sprite_vert,fragmentShader:ng.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ng.background_vert,fragmentShader:ng.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:ng.backgroundCube_vert,fragmentShader:ng.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ng.cube_vert,fragmentShader:ng.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ng.equirect_vert,fragmentShader:ng.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([rg.common,rg.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ng.distanceRGBA_vert,fragmentShader:ng.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([rg.lights,rg.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ng.shadow_vert,fragmentShader:ng.shadow_frag}};ag.physical={uniforms:mergeUniforms([ag.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ng.meshphysical_vert,fragmentShader:ng.meshphysical_frag};const sg={r:0,b:0,g:0},og=new Euler,lg=new Matrix4;function WebGLBackground(F,Da,ll,cl,hl,dl,pl){const fl=new Color(0);let Al,bl,kl=!0===dl?0:1,Dl=null,Wl=0,Ql=null;function getBackground(F){let cl=!0===F.isScene?F.background:null;if(cl&&cl.isTexture){cl=(F.backgroundBlurriness>0?ll:Da).get(cl)}return cl}function setClear(Da,ll){Da.getRGB(sg,getUnlitUniformColorSpace(F)),cl.buffers.color.setClear(sg.r,sg.g,sg.b,ll,pl)}return{getClearColor:function(){return fl},setClearColor:function(F,Da){void 0===Da&&(Da=1),fl.set(F),kl=Da,setClear(fl,kl)},getClearAlpha:function(){return kl},setClearAlpha:function(F){kl=F,setClear(fl,kl)},render:function(Da){let ll=!1;const hl=getBackground(Da);null===hl?setClear(fl,kl):hl&&hl.isColor&&(setClear(hl,1),ll=!0);const dl=F.xr.getEnvironmentBlendMode();"additive"===dl?cl.buffers.color.setClear(0,0,0,1,pl):"alpha-blend"===dl&&cl.buffers.color.setClear(0,0,0,0,pl),(F.autoClear||ll)&&(cl.buffers.depth.setTest(!0),cl.buffers.depth.setMask(!0),cl.buffers.color.setMask(!0),F.clear(F.autoClearColor,F.autoClearDepth,F.autoClearStencil))},addToRenderList:function(Da,ll){const cl=getBackground(ll);cl&&(cl.isCubeTexture||cl.mapping===ed)?(void 0===bl&&(bl=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ag.backgroundCube.uniforms),vertexShader:ag.backgroundCube.vertexShader,fragmentShader:ag.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),bl.geometry.deleteAttribute("normal"),bl.geometry.deleteAttribute("uv"),bl.onBeforeRender=function(F,Da,ll){this.matrixWorld.copyPosition(ll.matrixWorld)},Object.defineProperty(bl.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),hl.update(bl)),og.copy(ll.backgroundRotation),og.x*=-1,og.y*=-1,og.z*=-1,cl.isCubeTexture&&!1===cl.isRenderTargetTexture&&(og.y*=-1,og.z*=-1),bl.material.uniforms.envMap.value=cl,bl.material.uniforms.flipEnvMap.value=cl.isCubeTexture&&!1===cl.isRenderTargetTexture?-1:1,bl.material.uniforms.backgroundBlurriness.value=ll.backgroundBlurriness,bl.material.uniforms.backgroundIntensity.value=ll.backgroundIntensity,bl.material.uniforms.backgroundRotation.value.setFromMatrix4(lg.makeRotationFromEuler(og)),bl.material.toneMapped=sm.getTransfer(cl.colorSpace)!==Pp,Dl===cl&&Wl===cl.version&&Ql===F.toneMapping||(bl.material.needsUpdate=!0,Dl=cl,Wl=cl.version,Ql=F.toneMapping),bl.layers.enableAll(),Da.unshift(bl,bl.geometry,bl.material,0,0,null)):cl&&cl.isTexture&&(void 0===Al&&(Al=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ag.background.uniforms),vertexShader:ag.background.vertexShader,fragmentShader:ag.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),Al.geometry.deleteAttribute("normal"),Object.defineProperty(Al.material,"map",{get:function(){return this.uniforms.t2D.value}}),hl.update(Al)),Al.material.uniforms.t2D.value=cl,Al.material.uniforms.backgroundIntensity.value=ll.backgroundIntensity,Al.material.toneMapped=sm.getTransfer(cl.colorSpace)!==Pp,!0===cl.matrixAutoUpdate&&cl.updateMatrix(),Al.material.uniforms.uvTransform.value.copy(cl.matrix),Dl===cl&&Wl===cl.version&&Ql===F.toneMapping||(Al.material.needsUpdate=!0,Dl=cl,Wl=cl.version,Ql=F.toneMapping),Al.layers.enableAll(),Da.unshift(Al,Al.geometry,Al.material,0,0,null))}}}function WebGLBindingStates(F,Da){const ll=F.getParameter(F.MAX_VERTEX_ATTRIBS),cl={},hl=createBindingState(null);let dl=hl,pl=!1;function bindVertexArrayObject(Da){return F.bindVertexArray(Da)}function deleteVertexArrayObject(Da){return F.deleteVertexArray(Da)}function createBindingState(F){const Da=[],cl=[],hl=[];for(let dl=0;dl<ll;dl++)Da[dl]=0,cl[dl]=0,hl[dl]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Da,enabledAttributes:cl,attributeDivisors:hl,object:F,attributes:{},index:null}}function initAttributes(){const F=dl.newAttributes;for(let Da=0,ll=F.length;Da<ll;Da++)F[Da]=0}function enableAttribute(F){enableAttributeAndDivisor(F,0)}function enableAttributeAndDivisor(Da,ll){const cl=dl.newAttributes,hl=dl.enabledAttributes,pl=dl.attributeDivisors;cl[Da]=1,0===hl[Da]&&(F.enableVertexAttribArray(Da),hl[Da]=1),pl[Da]!==ll&&(F.vertexAttribDivisor(Da,ll),pl[Da]=ll)}function disableUnusedAttributes(){const Da=dl.newAttributes,ll=dl.enabledAttributes;for(let cl=0,hl=ll.length;cl<hl;cl++)ll[cl]!==Da[cl]&&(F.disableVertexAttribArray(cl),ll[cl]=0)}function vertexAttribPointer(Da,ll,cl,hl,dl,pl,fl){!0===fl?F.vertexAttribIPointer(Da,ll,cl,dl,pl):F.vertexAttribPointer(Da,ll,cl,hl,dl,pl)}function reset(){resetDefaultState(),pl=!0,dl!==hl&&(dl=hl,bindVertexArrayObject(dl.object))}function resetDefaultState(){hl.geometry=null,hl.program=null,hl.wireframe=!1}return{setup:function(ll,hl,fl,Al,bl){let kl=!1;const Dl=function(Da,ll,hl){const dl=!0===hl.wireframe;let pl=cl[Da.id];void 0===pl&&(pl={},cl[Da.id]=pl);let fl=pl[ll.id];void 0===fl&&(fl={},pl[ll.id]=fl);let Al=fl[dl];void 0===Al&&(Al=createBindingState(F.createVertexArray()),fl[dl]=Al);return Al}(Al,fl,hl);dl!==Dl&&(dl=Dl,bindVertexArrayObject(dl.object)),kl=function(F,Da,ll,cl){const hl=dl.attributes,pl=Da.attributes;let fl=0;const Al=ll.getAttributes();for(const dl in Al){if(Al[dl].location>=0){const Da=hl[dl];let ll=pl[dl];if(void 0===ll&&("instanceMatrix"===dl&&F.instanceMatrix&&(ll=F.instanceMatrix),"instanceColor"===dl&&F.instanceColor&&(ll=F.instanceColor)),void 0===Da)return!0;if(Da.attribute!==ll)return!0;if(ll&&Da.data!==ll.data)return!0;fl++}}return dl.attributesNum!==fl||dl.index!==cl}(ll,Al,fl,bl),kl&&function(F,Da,ll,cl){const hl={},pl=Da.attributes;let fl=0;const Al=ll.getAttributes();for(const dl in Al){if(Al[dl].location>=0){let Da=pl[dl];void 0===Da&&("instanceMatrix"===dl&&F.instanceMatrix&&(Da=F.instanceMatrix),"instanceColor"===dl&&F.instanceColor&&(Da=F.instanceColor));const ll={};ll.attribute=Da,Da&&Da.data&&(ll.data=Da.data),hl[dl]=ll,fl++}}dl.attributes=hl,dl.attributesNum=fl,dl.index=cl}(ll,Al,fl,bl),null!==bl&&Da.update(bl,F.ELEMENT_ARRAY_BUFFER),(kl||pl)&&(pl=!1,function(ll,cl,hl,dl){initAttributes();const pl=dl.attributes,fl=hl.getAttributes(),Al=cl.defaultAttributeValues;for(const bl in fl){const cl=fl[bl];if(cl.location>=0){let hl=pl[bl];if(void 0===hl&&("instanceMatrix"===bl&&ll.instanceMatrix&&(hl=ll.instanceMatrix),"instanceColor"===bl&&ll.instanceColor&&(hl=ll.instanceColor)),void 0!==hl){const pl=hl.normalized,fl=hl.itemSize,Al=Da.get(hl);if(void 0===Al)continue;const bl=Al.buffer,kl=Al.type,Dl=Al.bytesPerElement,Wl=kl===F.INT||kl===F.UNSIGNED_INT||hl.gpuType===md;if(hl.isInterleavedBufferAttribute){const Da=hl.data,Al=Da.stride,Ql=hl.offset;if(Da.isInstancedInterleavedBuffer){for(let F=0;F<cl.locationSize;F++)enableAttributeAndDivisor(cl.location+F,Da.meshPerAttribute);!0!==ll.isInstancedMesh&&void 0===dl._maxInstanceCount&&(dl._maxInstanceCount=Da.meshPerAttribute*Da.count)}else for(let F=0;F<cl.locationSize;F++)enableAttribute(cl.location+F);F.bindBuffer(F.ARRAY_BUFFER,bl);for(let F=0;F<cl.locationSize;F++)vertexAttribPointer(cl.location+F,fl/cl.locationSize,kl,pl,Al*Dl,(Ql+fl/cl.locationSize*F)*Dl,Wl)}else{if(hl.isInstancedBufferAttribute){for(let F=0;F<cl.locationSize;F++)enableAttributeAndDivisor(cl.location+F,hl.meshPerAttribute);!0!==ll.isInstancedMesh&&void 0===dl._maxInstanceCount&&(dl._maxInstanceCount=hl.meshPerAttribute*hl.count)}else for(let F=0;F<cl.locationSize;F++)enableAttribute(cl.location+F);F.bindBuffer(F.ARRAY_BUFFER,bl);for(let F=0;F<cl.locationSize;F++)vertexAttribPointer(cl.location+F,fl/cl.locationSize,kl,pl,fl*Dl,fl/cl.locationSize*F*Dl,Wl)}}else if(void 0!==Al){const Da=Al[bl];if(void 0!==Da)switch(Da.length){case 2:F.vertexAttrib2fv(cl.location,Da);break;case 3:F.vertexAttrib3fv(cl.location,Da);break;case 4:F.vertexAttrib4fv(cl.location,Da);break;default:F.vertexAttrib1fv(cl.location,Da)}}}}disableUnusedAttributes()}(ll,hl,fl,Al),null!==bl&&F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,Da.get(bl).buffer))},reset:reset,resetDefaultState:resetDefaultState,dispose:function(){reset();for(const F in cl){const Da=cl[F];for(const F in Da){const ll=Da[F];for(const F in ll)deleteVertexArrayObject(ll[F].object),delete ll[F];delete Da[F]}delete cl[F]}},releaseStatesOfGeometry:function(F){if(void 0===cl[F.id])return;const Da=cl[F.id];for(const ll in Da){const F=Da[ll];for(const Da in F)deleteVertexArrayObject(F[Da].object),delete F[Da];delete Da[ll]}delete cl[F.id]},releaseStatesOfProgram:function(F){for(const Da in cl){const ll=cl[Da];if(void 0===ll[F.id])continue;const hl=ll[F.id];for(const F in hl)deleteVertexArrayObject(hl[F].object),delete hl[F];delete ll[F.id]}},initAttributes:initAttributes,enableAttribute:enableAttribute,disableUnusedAttributes:disableUnusedAttributes}}function WebGLBufferRenderer(F,Da,ll){let cl;function renderInstances(Da,hl,dl){0!==dl&&(F.drawArraysInstanced(cl,Da,hl,dl),ll.update(hl,cl,dl))}this.setMode=function(F){cl=F},this.render=function(Da,hl){F.drawArrays(cl,Da,hl),ll.update(hl,cl,1)},this.renderInstances=renderInstances,this.renderMultiDraw=function(F,hl,dl){if(0===dl)return;Da.get("WEBGL_multi_draw").multiDrawArraysWEBGL(cl,F,0,hl,0,dl);let pl=0;for(let Da=0;Da<dl;Da++)pl+=hl[Da];ll.update(pl,cl,1)},this.renderMultiDrawInstances=function(F,hl,dl,pl){if(0===dl)return;const fl=Da.get("WEBGL_multi_draw");if(null===fl)for(let Da=0;Da<F.length;Da++)renderInstances(F[Da],hl[Da],pl[Da]);else{fl.multiDrawArraysInstancedWEBGL(cl,F,0,hl,0,pl,0,dl);let Da=0;for(let F=0;F<dl;F++)Da+=hl[F];for(let F=0;F<pl.length;F++)ll.update(Da,cl,pl[F])}}}function WebGLCapabilities(F,Da,ll,cl){let hl;function getMaxPrecision(Da){if("highp"===Da){if(F.getShaderPrecisionFormat(F.VERTEX_SHADER,F.HIGH_FLOAT).precision>0&&F.getShaderPrecisionFormat(F.FRAGMENT_SHADER,F.HIGH_FLOAT).precision>0)return"highp";Da="mediump"}return"mediump"===Da&&F.getShaderPrecisionFormat(F.VERTEX_SHADER,F.MEDIUM_FLOAT).precision>0&&F.getShaderPrecisionFormat(F.FRAGMENT_SHADER,F.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let dl=void 0!==ll.precision?ll.precision:"highp";const pl=getMaxPrecision(dl);pl!==dl&&(console.warn("THREE.WebGLRenderer:",dl,"not supported, using",pl,"instead."),dl=pl);const fl=!0===ll.logarithmicDepthBuffer,Al=F.getParameter(F.MAX_TEXTURE_IMAGE_UNITS),bl=F.getParameter(F.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==hl)return hl;if(!0===Da.has("EXT_texture_filter_anisotropic")){const ll=Da.get("EXT_texture_filter_anisotropic");hl=F.getParameter(ll.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else hl=0;return hl},getMaxPrecision:getMaxPrecision,textureFormatReadable:function(Da){return Da===bd||cl.convert(Da)===F.getParameter(F.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(ll){const hl=ll===Ad&&(Da.has("EXT_color_buffer_half_float")||Da.has("EXT_color_buffer_float"));return!(ll!==ud&&cl.convert(ll)!==F.getParameter(F.IMPLEMENTATION_COLOR_READ_TYPE)&&ll!==gd&&!hl)},precision:dl,logarithmicDepthBuffer:fl,maxTextures:Al,maxVertexTextures:bl,maxTextureSize:F.getParameter(F.MAX_TEXTURE_SIZE),maxCubemapSize:F.getParameter(F.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:F.getParameter(F.MAX_VERTEX_ATTRIBS),maxVertexUniforms:F.getParameter(F.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:F.getParameter(F.MAX_VARYING_VECTORS),maxFragmentUniforms:F.getParameter(F.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:bl>0,maxSamples:F.getParameter(F.MAX_SAMPLES)}}function WebGLClipping(F){const Da=this;let ll=null,cl=0,hl=!1,dl=!1;const pl=new Plane,fl=new Matrix3,Al={value:null,needsUpdate:!1};function projectPlanes(F,ll,cl,hl){const dl=null!==F?F.length:0;let bl=null;if(0!==dl){if(bl=Al.value,!0!==hl||null===bl){const Da=cl+4*dl,hl=ll.matrixWorldInverse;fl.getNormalMatrix(hl),(null===bl||bl.length<Da)&&(bl=new Float32Array(Da));for(let ll=0,Al=cl;ll!==dl;++ll,Al+=4)pl.copy(F[ll]).applyMatrix4(hl,fl),pl.normal.toArray(bl,Al),bl[Al+3]=pl.constant}Al.value=bl,Al.needsUpdate=!0}return Da.numPlanes=dl,Da.numIntersection=0,bl}this.uniform=Al,this.numPlanes=0,this.numIntersection=0,this.init=function(F,Da){const ll=0!==F.length||Da||0!==cl||hl;return hl=Da,cl=F.length,ll},this.beginShadows=function(){dl=!0,projectPlanes(null)},this.endShadows=function(){dl=!1},this.setGlobalState=function(F,Da){ll=projectPlanes(F,Da,0)},this.setState=function(pl,fl,bl){const kl=pl.clippingPlanes,Dl=pl.clipIntersection,Wl=pl.clipShadows,Ql=F.get(pl);if(!hl||null===kl||0===kl.length||dl&&!Wl)dl?projectPlanes(null):function(){Al.value!==ll&&(Al.value=ll,Al.needsUpdate=cl>0);Da.numPlanes=cl,Da.numIntersection=0}();else{const F=dl?0:cl,Da=4*F;let hl=Ql.clippingState||null;Al.value=hl,hl=projectPlanes(kl,fl,Da,bl);for(let cl=0;cl!==Da;++cl)hl[cl]=ll[cl];Ql.clippingState=hl,this.numIntersection=Dl?this.numPlanes:0,this.numPlanes+=F}}}function WebGLCubeMaps(F){let Da=new WeakMap;function mapTextureMapping(F,Da){return Da===ih?F.mapping=Nu:Da===gh&&(F.mapping=qu),F}function onTextureDispose(F){const ll=F.target;ll.removeEventListener("dispose",onTextureDispose);const cl=Da.get(ll);void 0!==cl&&(Da.delete(ll),cl.dispose())}return{get:function(ll){if(ll&&ll.isTexture){const cl=ll.mapping;if(cl===ih||cl===gh){if(Da.has(ll)){return mapTextureMapping(Da.get(ll).texture,ll.mapping)}{const cl=ll.image;if(cl&&cl.height>0){const hl=new WebGLCubeRenderTarget(cl.height);return hl.fromEquirectangularTexture(F,ll),Da.set(ll,hl),ll.addEventListener("dispose",onTextureDispose),mapTextureMapping(hl.texture,ll.mapping)}return null}}}return ll},dispose:function(){Da=new WeakMap}}}class OrthographicCamera extends Camera{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=-1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=-1),void 0===hl&&(hl=.1),void 0===dl&&(dl=2e3),super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=F,this.right=Da,this.top=ll,this.bottom=cl,this.near=hl,this.far=dl,this.updateProjectionMatrix()}copy(F,Da){return super.copy(F,Da),this.left=F.left,this.right=F.right,this.top=F.top,this.bottom=F.bottom,this.near=F.near,this.far=F.far,this.zoom=F.zoom,this.view=null===F.view?null:Object.assign({},F.view),this}setViewOffset(F,Da,ll,cl,hl,dl){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=F,this.view.fullHeight=Da,this.view.offsetX=ll,this.view.offsetY=cl,this.view.width=hl,this.view.height=dl,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const F=(this.right-this.left)/(2*this.zoom),Da=(this.top-this.bottom)/(2*this.zoom),ll=(this.right+this.left)/2,cl=(this.top+this.bottom)/2;let hl=ll-F,dl=ll+F,pl=cl+Da,fl=cl-Da;if(null!==this.view&&this.view.enabled){const F=(this.right-this.left)/this.view.fullWidth/this.zoom,Da=(this.top-this.bottom)/this.view.fullHeight/this.zoom;hl+=F*this.view.offsetX,dl=hl+F*this.view.width,pl-=Da*this.view.offsetY,fl=pl-Da*this.view.height}this.projectionMatrix.makeOrthographic(hl,dl,pl,fl,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(F){const Da=super.toJSON(F);return Da.object.zoom=this.zoom,Da.object.left=this.left,Da.object.right=this.right,Da.object.top=this.top,Da.object.bottom=this.bottom,Da.object.near=this.near,Da.object.far=this.far,null!==this.view&&(Da.object.view=Object.assign({},this.view)),Da}}const cg=[.125,.215,.35,.446,.526,.582],ug=20,hg=new OrthographicCamera,dg=new Color;let pg=null,mg=0,fg=0,gg=!1;const Ag=(1+Math.sqrt(5))/2,yg=1/Ag,vg=[new Vector3(-Ag,yg,0),new Vector3(Ag,yg,0),new Vector3(-yg,0,Ag),new Vector3(yg,0,Ag),new Vector3(0,Ag,-yg),new Vector3(0,Ag,yg),new Vector3(-1,1,-1),new Vector3(1,1,-1),new Vector3(-1,1,1),new Vector3(1,1,1)];class PMREMGenerator{constructor(F){this._renderer=F,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(F,Da,ll,cl){void 0===Da&&(Da=0),void 0===ll&&(ll=.1),void 0===cl&&(cl=100),pg=this._renderer.getRenderTarget(),mg=this._renderer.getActiveCubeFace(),fg=this._renderer.getActiveMipmapLevel(),gg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const hl=this._allocateTargets();return hl.depthBuffer=!0,this._sceneToCubeUV(F,ll,cl,hl),Da>0&&this._blur(hl,0,0,Da),this._applyPMREM(hl),this._cleanup(hl),hl}fromEquirectangular(F,Da){return void 0===Da&&(Da=null),this._fromTexture(F,Da)}fromCubemap(F,Da){return void 0===Da&&(Da=null),this._fromTexture(F,Da)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(F){this._lodMax=Math.floor(Math.log2(F)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let F=0;F<this._lodPlanes.length;F++)this._lodPlanes[F].dispose()}_cleanup(F){this._renderer.setRenderTarget(pg,mg,fg),this._renderer.xr.enabled=gg,F.scissorTest=!1,_setViewport(F,0,0,F.width,F.height)}_fromTexture(F,Da){F.mapping===Nu||F.mapping===qu?this._setSize(0===F.image.length?16:F.image[0].width||F.image[0].image.width):this._setSize(F.image.width/4),pg=this._renderer.getRenderTarget(),mg=this._renderer.getActiveCubeFace(),fg=this._renderer.getActiveMipmapLevel(),gg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const ll=Da||this._allocateTargets();return this._textureToCubeUV(F,ll),this._applyPMREM(ll),this._cleanup(ll),ll}_allocateTargets(){const F=3*Math.max(this._cubeSize,112),Da=4*this._cubeSize,ll={magFilter:od,minFilter:od,generateMipmaps:!1,type:Ad,format:bd,colorSpace:Ip,depthBuffer:!1},cl=_createRenderTarget(F,Da,ll);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==F||this._pingPongRenderTarget.height!==Da){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(F,Da,ll);const{_lodMax:cl}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(F){const Da=[],ll=[],cl=[];let hl=F;const dl=F-4+1+cg.length;for(let pl=0;pl<dl;pl++){const dl=Math.pow(2,hl);ll.push(dl);let fl=1/dl;pl>F-4?fl=cg[pl-F+4-1]:0===pl&&(fl=0),cl.push(fl);const Al=1/(dl-2),bl=-Al,kl=1+Al,Dl=[bl,bl,kl,bl,kl,kl,bl,bl,kl,kl,bl,kl],Wl=6,Ql=6,wc=3,Sc=2,eu=1,iu=new Float32Array(wc*Ql*Wl),su=new Float32Array(Sc*Ql*Wl),cu=new Float32Array(eu*Ql*Wl);for(let F=0;F<Wl;F++){const Da=F%3*2/3-1,ll=F>2?0:-1,cl=[Da,ll,0,Da+2/3,ll,0,Da+2/3,ll+1,0,Da,ll,0,Da+2/3,ll+1,0,Da,ll+1,0];iu.set(cl,wc*Ql*F),su.set(Dl,Sc*Ql*F);const hl=[F,F,F,F,F,F];cu.set(hl,eu*Ql*F)}const uu=new BufferGeometry;uu.setAttribute("position",new BufferAttribute(iu,wc)),uu.setAttribute("uv",new BufferAttribute(su,Sc)),uu.setAttribute("faceIndex",new BufferAttribute(cu,eu)),Da.push(uu),hl>4&&hl--}return{lodPlanes:Da,sizeLods:ll,sigmas:cl}}(cl)),this._blurMaterial=function(F,Da,ll){const cl=new Float32Array(ug),hl=new Vector3(0,1,0),dl=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:ug,CUBEUV_TEXEL_WIDTH:1/Da,CUBEUV_TEXEL_HEIGHT:1/ll,CUBEUV_MAX_MIP:`${F}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:cl},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:hl}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return dl}(cl,F,Da)}return cl}_compileMaterial(F){const Da=new Mesh(this._lodPlanes[0],F);this._renderer.compile(Da,hg)}_sceneToCubeUV(F,Da,ll,cl){const hl=new PerspectiveCamera(90,1,Da,ll),dl=[1,-1,1,1,1,1],pl=[1,1,1,-1,-1,-1],fl=this._renderer,Al=fl.autoClear,bl=fl.toneMapping;fl.getClearColor(dg),fl.toneMapping=0,fl.autoClear=!1;const kl=new MeshBasicMaterial({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),Dl=new Mesh(new BoxGeometry,kl);let Wl=!1;const Ql=F.background;Ql?Ql.isColor&&(kl.color.copy(Ql),F.background=null,Wl=!0):(kl.color.copy(dg),Wl=!0);for(let wc=0;wc<6;wc++){const Da=wc%3;0===Da?(hl.up.set(0,dl[wc],0),hl.lookAt(pl[wc],0,0)):1===Da?(hl.up.set(0,0,dl[wc]),hl.lookAt(0,pl[wc],0)):(hl.up.set(0,dl[wc],0),hl.lookAt(0,0,pl[wc]));const ll=this._cubeSize;_setViewport(cl,Da*ll,wc>2?ll:0,ll,ll),fl.setRenderTarget(cl),Wl&&fl.render(Dl,hl),fl.render(F,hl)}Dl.geometry.dispose(),Dl.material.dispose(),fl.toneMapping=bl,fl.autoClear=Al,F.background=Ql}_textureToCubeUV(F,Da){const ll=this._renderer,cl=F.mapping===Nu||F.mapping===qu;cl?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===F.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const hl=cl?this._cubemapMaterial:this._equirectMaterial,dl=new Mesh(this._lodPlanes[0],hl);hl.uniforms.envMap.value=F;const pl=this._cubeSize;_setViewport(Da,0,0,3*pl,2*pl),ll.setRenderTarget(Da),ll.render(dl,hg)}_applyPMREM(F){const Da=this._renderer,ll=Da.autoClear;Da.autoClear=!1;const cl=this._lodPlanes.length;for(let hl=1;hl<cl;hl++){const Da=Math.sqrt(this._sigmas[hl]*this._sigmas[hl]-this._sigmas[hl-1]*this._sigmas[hl-1]),ll=vg[(cl-hl-1)%vg.length];this._blur(F,hl-1,hl,Da,ll)}Da.autoClear=ll}_blur(F,Da,ll,cl,hl){const dl=this._pingPongRenderTarget;this._halfBlur(F,dl,Da,ll,cl,"latitudinal",hl),this._halfBlur(dl,F,ll,ll,cl,"longitudinal",hl)}_halfBlur(F,Da,ll,cl,hl,dl,pl){const fl=this._renderer,Al=this._blurMaterial;"latitudinal"!==dl&&"longitudinal"!==dl&&console.error("blur direction must be either latitudinal or longitudinal!");const bl=new Mesh(this._lodPlanes[cl],Al),kl=Al.uniforms,Dl=this._sizeLods[ll]-1,Wl=isFinite(hl)?Math.PI/(2*Dl):2*Math.PI/39,Ql=hl/Wl,wc=isFinite(hl)?1+Math.floor(3*Ql):ug;wc>ug&&console.warn(`sigmaRadians, ${hl}, is too large and will clip, as it requested ${wc} samples when the maximum is set to 20`);const Sc=[];let eu=0;for(let cu=0;cu<ug;++cu){const F=cu/Ql,Da=Math.exp(-F*F/2);Sc.push(Da),0===cu?eu+=Da:cu<wc&&(eu+=2*Da)}for(let cu=0;cu<Sc.length;cu++)Sc[cu]=Sc[cu]/eu;kl.envMap.value=F.texture,kl.samples.value=wc,kl.weights.value=Sc,kl.latitudinal.value="latitudinal"===dl,pl&&(kl.poleAxis.value=pl);const{_lodMax:iu}=this;kl.dTheta.value=Wl,kl.mipInt.value=iu-ll;const su=this._sizeLods[cl];_setViewport(Da,3*su*(cl>iu-4?cl-iu+4:0),4*(this._cubeSize-su),3*su,2*su),fl.setRenderTarget(Da),fl.render(bl,hg)}}function _createRenderTarget(F,Da,ll){const cl=new WebGLRenderTarget(F,Da,ll);return cl.texture.mapping=ed,cl.texture.name="PMREM.cubeUv",cl.scissorTest=!0,cl}function _setViewport(F,Da,ll,cl,hl){F.viewport.set(Da,ll,cl,hl),F.scissor.set(Da,ll,cl,hl)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function WebGLCubeUVMaps(F){let Da=new WeakMap,ll=null;function onTextureDispose(F){const ll=F.target;ll.removeEventListener("dispose",onTextureDispose);const cl=Da.get(ll);void 0!==cl&&(Da.delete(ll),cl.dispose())}return{get:function(cl){if(cl&&cl.isTexture){const hl=cl.mapping,dl=hl===ih||hl===gh,pl=hl===Nu||hl===qu;if(dl||pl){let hl=Da.get(cl);const fl=void 0!==hl?hl.texture.pmremVersion:0;if(cl.isRenderTargetTexture&&cl.pmremVersion!==fl)return null===ll&&(ll=new PMREMGenerator(F)),hl=dl?ll.fromEquirectangular(cl,hl):ll.fromCubemap(cl,hl),hl.texture.pmremVersion=cl.pmremVersion,Da.set(cl,hl),hl.texture;if(void 0!==hl)return hl.texture;{const fl=cl.image;return dl&&fl&&fl.height>0||pl&&fl&&function(F){let Da=0;const ll=6;for(let cl=0;cl<ll;cl++)void 0!==F[cl]&&Da++;return Da===ll}(fl)?(null===ll&&(ll=new PMREMGenerator(F)),hl=dl?ll.fromEquirectangular(cl):ll.fromCubemap(cl),hl.texture.pmremVersion=cl.pmremVersion,Da.set(cl,hl),cl.addEventListener("dispose",onTextureDispose),hl.texture):null}}}return cl},dispose:function(){Da=new WeakMap,null!==ll&&(ll.dispose(),ll=null)}}}function WebGLExtensions(F){const Da={};function getExtension(ll){if(void 0!==Da[ll])return Da[ll];let cl;switch(ll){case"WEBGL_depth_texture":cl=F.getExtension("WEBGL_depth_texture")||F.getExtension("MOZ_WEBGL_depth_texture")||F.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":cl=F.getExtension("EXT_texture_filter_anisotropic")||F.getExtension("MOZ_EXT_texture_filter_anisotropic")||F.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":cl=F.getExtension("WEBGL_compressed_texture_s3tc")||F.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||F.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":cl=F.getExtension("WEBGL_compressed_texture_pvrtc")||F.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:cl=F.getExtension(ll)}return Da[ll]=cl,cl}return{has:function(F){return null!==getExtension(F)},init:function(){getExtension("EXT_color_buffer_float"),getExtension("WEBGL_clip_cull_distance"),getExtension("OES_texture_float_linear"),getExtension("EXT_color_buffer_half_float"),getExtension("WEBGL_multisampled_render_to_texture"),getExtension("WEBGL_render_shared_exponent")},get:function(F){const Da=getExtension(F);return null===Da&&warnOnce("THREE.WebGLRenderer: "+F+" extension not supported."),Da}}}function WebGLGeometries(F,Da,ll,cl){const hl={},dl=new WeakMap;function onGeometryDispose(F){const pl=F.target;null!==pl.index&&Da.remove(pl.index);for(const ll in pl.attributes)Da.remove(pl.attributes[ll]);for(const ll in pl.morphAttributes){const F=pl.morphAttributes[ll];for(let ll=0,cl=F.length;ll<cl;ll++)Da.remove(F[ll])}pl.removeEventListener("dispose",onGeometryDispose),delete hl[pl.id];const fl=dl.get(pl);fl&&(Da.remove(fl),dl.delete(pl)),cl.releaseStatesOfGeometry(pl),!0===pl.isInstancedBufferGeometry&&delete pl._maxInstanceCount,ll.memory.geometries--}function updateWireframeAttribute(F){const ll=[],cl=F.index,hl=F.attributes.position;let pl=0;if(null!==cl){const F=cl.array;pl=cl.version;for(let Da=0,cl=F.length;Da<cl;Da+=3){const cl=F[Da+0],hl=F[Da+1],dl=F[Da+2];ll.push(cl,hl,hl,dl,dl,cl)}}else{if(void 0===hl)return;{const F=hl.array;pl=hl.version;for(let Da=0,cl=F.length/3-1;Da<cl;Da+=3){const F=Da+0,cl=Da+1,hl=Da+2;ll.push(F,cl,cl,hl,hl,F)}}}const fl=new(arrayNeedsUint32(ll)?Uint32BufferAttribute:Uint16BufferAttribute)(ll,1);fl.version=pl;const Al=dl.get(F);Al&&Da.remove(Al),dl.set(F,fl)}return{get:function(F,Da){return!0===hl[Da.id]||(Da.addEventListener("dispose",onGeometryDispose),hl[Da.id]=!0,ll.memory.geometries++),Da},update:function(ll){const cl=ll.attributes;for(const dl in cl)Da.update(cl[dl],F.ARRAY_BUFFER);const hl=ll.morphAttributes;for(const dl in hl){const ll=hl[dl];for(let cl=0,hl=ll.length;cl<hl;cl++)Da.update(ll[cl],F.ARRAY_BUFFER)}},getWireframeAttribute:function(F){const Da=dl.get(F);if(Da){const ll=F.index;null!==ll&&Da.version<ll.version&&updateWireframeAttribute(F)}else updateWireframeAttribute(F);return dl.get(F)}}}function WebGLIndexedBufferRenderer(F,Da,ll){let cl,hl,dl;function renderInstances(Da,pl,fl){0!==fl&&(F.drawElementsInstanced(cl,pl,hl,Da*dl,fl),ll.update(pl,cl,fl))}this.setMode=function(F){cl=F},this.setIndex=function(F){hl=F.type,dl=F.bytesPerElement},this.render=function(Da,pl){F.drawElements(cl,pl,hl,Da*dl),ll.update(pl,cl,1)},this.renderInstances=renderInstances,this.renderMultiDraw=function(F,dl,pl){if(0===pl)return;Da.get("WEBGL_multi_draw").multiDrawElementsWEBGL(cl,dl,0,hl,F,0,pl);let fl=0;for(let Da=0;Da<pl;Da++)fl+=dl[Da];ll.update(fl,cl,1)},this.renderMultiDrawInstances=function(F,pl,fl,Al){if(0===fl)return;const bl=Da.get("WEBGL_multi_draw");if(null===bl)for(let Da=0;Da<F.length;Da++)renderInstances(F[Da]/dl,pl[Da],Al[Da]);else{bl.multiDrawElementsInstancedWEBGL(cl,pl,0,hl,F,0,Al,0,fl);let Da=0;for(let F=0;F<fl;F++)Da+=pl[F];for(let F=0;F<Al.length;F++)ll.update(Da,cl,Al[F])}}}function WebGLInfo(F){const Da={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:Da,programs:null,autoReset:!0,reset:function(){Da.calls=0,Da.triangles=0,Da.points=0,Da.lines=0},update:function(ll,cl,hl){switch(Da.calls++,cl){case F.TRIANGLES:Da.triangles+=hl*(ll/3);break;case F.LINES:Da.lines+=hl*(ll/2);break;case F.LINE_STRIP:Da.lines+=hl*(ll-1);break;case F.LINE_LOOP:Da.lines+=hl*ll;break;case F.POINTS:Da.points+=hl*ll;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",cl)}}}}function WebGLMorphtargets(F,Da,ll){const cl=new WeakMap,hl=new Vector4;return{update:function(dl,pl,fl){const Al=dl.morphTargetInfluences,bl=pl.morphAttributes.position||pl.morphAttributes.normal||pl.morphAttributes.color,kl=void 0!==bl?bl.length:0;let Dl=cl.get(pl);if(void 0===Dl||Dl.count!==kl){void 0!==Dl&&Dl.texture.dispose();const Wl=void 0!==pl.morphAttributes.position,Ql=void 0!==pl.morphAttributes.normal,wc=void 0!==pl.morphAttributes.color,Sc=pl.morphAttributes.position||[],eu=pl.morphAttributes.normal||[],iu=pl.morphAttributes.color||[];let su=0;!0===Wl&&(su=1),!0===Ql&&(su=2),!0===wc&&(su=3);let cu=pl.attributes.position.count*su,uu=1;cu>Da.maxTextureSize&&(uu=Math.ceil(cu/Da.maxTextureSize),cu=Da.maxTextureSize);const hu=new Float32Array(cu*uu*4*kl),Lu=new DataArrayTexture(hu,cu,uu,kl);Lu.type=gd,Lu.needsUpdate=!0;const zu=4*su;for(let Du=0;Du<kl;Du++){const Nu=Sc[Du],qu=eu[Du],ih=iu[Du],gh=cu*uu*4*Du;for(let ed=0;ed<Nu.count;ed++){const td=ed*zu;!0===Wl&&(hl.fromBufferAttribute(Nu,ed),hu[gh+td+0]=hl.x,hu[gh+td+1]=hl.y,hu[gh+td+2]=hl.z,hu[gh+td+3]=0),!0===Ql&&(hl.fromBufferAttribute(qu,ed),hu[gh+td+4]=hl.x,hu[gh+td+5]=hl.y,hu[gh+td+6]=hl.z,hu[gh+td+7]=0),!0===wc&&(hl.fromBufferAttribute(ih,ed),hu[gh+td+8]=hl.x,hu[gh+td+9]=hl.y,hu[gh+td+10]=hl.z,hu[gh+td+11]=4===ih.itemSize?hl.w:1)}}function disposeTexture(){Lu.dispose(),cl.delete(pl),pl.removeEventListener("dispose",disposeTexture)}Dl={count:kl,texture:Lu,size:new Vector2(cu,uu)},cl.set(pl,Dl),pl.addEventListener("dispose",disposeTexture)}if(!0===dl.isInstancedMesh&&null!==dl.morphTexture)fl.getUniforms().setValue(F,"morphTexture",dl.morphTexture,ll);else{let id=0;for(let rd=0;rd<Al.length;rd++)id+=Al[rd];const nd=pl.morphTargetsRelative?1:1-id;fl.getUniforms().setValue(F,"morphTargetBaseInfluence",nd),fl.getUniforms().setValue(F,"morphTargetInfluences",Al)}fl.getUniforms().setValue(F,"morphTargetsTexture",Dl.texture,ll),fl.getUniforms().setValue(F,"morphTargetsTextureSize",Dl.size)}}}function WebGLObjects(F,Da,ll,cl){let hl=new WeakMap;function onInstancedMeshDispose(F){const Da=F.target;Da.removeEventListener("dispose",onInstancedMeshDispose),ll.remove(Da.instanceMatrix),null!==Da.instanceColor&&ll.remove(Da.instanceColor)}return{update:function(dl){const pl=cl.render.frame,fl=dl.geometry,Al=Da.get(dl,fl);if(hl.get(Al)!==pl&&(Da.update(Al),hl.set(Al,pl)),dl.isInstancedMesh&&(!1===dl.hasEventListener("dispose",onInstancedMeshDispose)&&dl.addEventListener("dispose",onInstancedMeshDispose),hl.get(dl)!==pl&&(ll.update(dl.instanceMatrix,F.ARRAY_BUFFER),null!==dl.instanceColor&&ll.update(dl.instanceColor,F.ARRAY_BUFFER),hl.set(dl,pl))),dl.isSkinnedMesh){const F=dl.skeleton;hl.get(F)!==pl&&(F.update(),hl.set(F,pl))}return Al},dispose:function(){hl=new WeakMap}}}class DepthTexture extends Texture{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){if(void 0===bl&&(bl=wd),bl!==wd&&bl!==Ed)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===ll&&bl===wd&&(ll=fd),void 0===ll&&bl===Ed&&(ll=_d),super(null,cl,hl,dl,pl,fl,bl,ll,Al),this.isDepthTexture=!0,this.image={width:F,height:Da},this.magFilter=void 0!==pl?pl:rd,this.minFilter=void 0!==fl?fl:rd,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(F){return super.copy(F),this.compareFunction=F.compareFunction,this}toJSON(F){const Da=super.toJSON(F);return null!==this.compareFunction&&(Da.compareFunction=this.compareFunction),Da}}const _g=new Texture,xg=new DepthTexture(1,1),bg=new DataArrayTexture,wg=new Data3DTexture,Eg=new CubeTexture,Mg=[],Sg=[],kg=new Float32Array(16),Tg=new Float32Array(9),Ig=new Float32Array(4);function flatten(F,Da,ll){const cl=F[0];if(cl<=0||cl>0)return F;const hl=Da*ll;let dl=Mg[hl];if(void 0===dl&&(dl=new Float32Array(hl),Mg[hl]=dl),0!==Da){cl.toArray(dl,0);for(let cl=1,hl=0;cl!==Da;++cl)hl+=ll,F[cl].toArray(dl,hl)}return dl}function arraysEqual(F,Da){if(F.length!==Da.length)return!1;for(let ll=0,cl=F.length;ll<cl;ll++)if(F[ll]!==Da[ll])return!1;return!0}function copyArray(F,Da){for(let ll=0,cl=Da.length;ll<cl;ll++)F[ll]=Da[ll]}function allocTexUnits(F,Da){let ll=Sg[Da];void 0===ll&&(ll=new Int32Array(Da),Sg[Da]=ll);for(let cl=0;cl!==Da;++cl)ll[cl]=F.allocateTextureUnit();return ll}function setValueV1f(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1f(this.addr,Da),ll[0]=Da)}function setValueV2f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2f(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2fv(this.addr,Da),copyArray(ll,Da)}}function setValueV3f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3f(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else if(void 0!==Da.r)ll[0]===Da.r&&ll[1]===Da.g&&ll[2]===Da.b||(F.uniform3f(this.addr,Da.r,Da.g,Da.b),ll[0]=Da.r,ll[1]=Da.g,ll[2]=Da.b);else{if(arraysEqual(ll,Da))return;F.uniform3fv(this.addr,Da),copyArray(ll,Da)}}function setValueV4f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4f(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4fv(this.addr,Da),copyArray(ll,Da)}}function setValueM2(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix2fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;Ig.set(cl),F.uniformMatrix2fv(this.addr,!1,Ig),copyArray(ll,cl)}}function setValueM3(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix3fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;Tg.set(cl),F.uniformMatrix3fv(this.addr,!1,Tg),copyArray(ll,cl)}}function setValueM4(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix4fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;kg.set(cl),F.uniformMatrix4fv(this.addr,!1,kg),copyArray(ll,cl)}}function setValueV1i(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1i(this.addr,Da),ll[0]=Da)}function setValueV2i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2i(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2iv(this.addr,Da),copyArray(ll,Da)}}function setValueV3i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3i(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else{if(arraysEqual(ll,Da))return;F.uniform3iv(this.addr,Da),copyArray(ll,Da)}}function setValueV4i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4i(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4iv(this.addr,Da),copyArray(ll,Da)}}function setValueV1ui(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1ui(this.addr,Da),ll[0]=Da)}function setValueV2ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2ui(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2uiv(this.addr,Da),copyArray(ll,Da)}}function setValueV3ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3ui(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else{if(arraysEqual(ll,Da))return;F.uniform3uiv(this.addr,Da),copyArray(ll,Da)}}function setValueV4ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4ui(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4uiv(this.addr,Da),copyArray(ll,Da)}}function setValueT1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();let dl;cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),this.type===F.SAMPLER_2D_SHADOW?(xg.compareFunction=515,dl=xg):dl=_g,ll.setTexture2D(Da||dl,hl)}function setValueT3D1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTexture3D(Da||wg,hl)}function setValueT6(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTextureCube(Da||Eg,hl)}function setValueT2DArray1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTexture2DArray(Da||bg,hl)}function setValueV1fArray(F,Da){F.uniform1fv(this.addr,Da)}function setValueV2fArray(F,Da){const ll=flatten(Da,this.size,2);F.uniform2fv(this.addr,ll)}function setValueV3fArray(F,Da){const ll=flatten(Da,this.size,3);F.uniform3fv(this.addr,ll)}function setValueV4fArray(F,Da){const ll=flatten(Da,this.size,4);F.uniform4fv(this.addr,ll)}function setValueM2Array(F,Da){const ll=flatten(Da,this.size,4);F.uniformMatrix2fv(this.addr,!1,ll)}function setValueM3Array(F,Da){const ll=flatten(Da,this.size,9);F.uniformMatrix3fv(this.addr,!1,ll)}function setValueM4Array(F,Da){const ll=flatten(Da,this.size,16);F.uniformMatrix4fv(this.addr,!1,ll)}function setValueV1iArray(F,Da){F.uniform1iv(this.addr,Da)}function setValueV2iArray(F,Da){F.uniform2iv(this.addr,Da)}function setValueV3iArray(F,Da){F.uniform3iv(this.addr,Da)}function setValueV4iArray(F,Da){F.uniform4iv(this.addr,Da)}function setValueV1uiArray(F,Da){F.uniform1uiv(this.addr,Da)}function setValueV2uiArray(F,Da){F.uniform2uiv(this.addr,Da)}function setValueV3uiArray(F,Da){F.uniform3uiv(this.addr,Da)}function setValueV4uiArray(F,Da){F.uniform4uiv(this.addr,Da)}function setValueT1Array(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture2D(Da[pl]||_g,dl[pl])}function setValueT3DArray(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture3D(Da[pl]||wg,dl[pl])}function setValueT6Array(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTextureCube(Da[pl]||Eg,dl[pl])}function setValueT2DArrayArray(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture2DArray(Da[pl]||bg,dl[pl])}class SingleUniform{constructor(F,Da,ll){this.id=F,this.addr=ll,this.cache=[],this.type=Da.type,this.setValue=function(F){switch(F){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}(Da.type)}}class PureArrayUniform{constructor(F,Da,ll){this.id=F,this.addr=ll,this.cache=[],this.type=Da.type,this.size=Da.size,this.setValue=function(F){switch(F){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}(Da.type)}}class StructuredUniform{constructor(F){this.id=F,this.seq=[],this.map={}}setValue(F,Da,ll){const cl=this.seq;for(let hl=0,dl=cl.length;hl!==dl;++hl){const dl=cl[hl];dl.setValue(F,Da[dl.id],ll)}}}const Cg=/(\w+)(\])?(\[|\.)?/g;function addUniform(F,Da){F.seq.push(Da),F.map[Da.id]=Da}function parseUniform(F,Da,ll){const cl=F.name,hl=cl.length;for(Cg.lastIndex=0;;){const dl=Cg.exec(cl),pl=Cg.lastIndex;let fl=dl[1];const Al="]"===dl[2],bl=dl[3];if(Al&&(fl|=0),void 0===bl||"["===bl&&pl+2===hl){addUniform(ll,void 0===bl?new SingleUniform(fl,F,Da):new PureArrayUniform(fl,F,Da));break}{let F=ll.map[fl];void 0===F&&(F=new StructuredUniform(fl),addUniform(ll,F)),ll=F}}}class WebGLUniforms{constructor(F,Da){this.seq=[],this.map={};const ll=F.getProgramParameter(Da,F.ACTIVE_UNIFORMS);for(let cl=0;cl<ll;++cl){const ll=F.getActiveUniform(Da,cl);parseUniform(ll,F.getUniformLocation(Da,ll.name),this)}}setValue(F,Da,ll,cl){const hl=this.map[Da];void 0!==hl&&hl.setValue(F,ll,cl)}setOptional(F,Da,ll){const cl=Da[ll];void 0!==cl&&this.setValue(F,ll,cl)}static upload(F,Da,ll,cl){for(let hl=0,dl=Da.length;hl!==dl;++hl){const dl=Da[hl],pl=ll[dl.id];!1!==pl.needsUpdate&&dl.setValue(F,pl.value,cl)}}static seqWithValue(F,Da){const ll=[];for(let cl=0,hl=F.length;cl!==hl;++cl){const hl=F[cl];hl.id in Da&&ll.push(hl)}return ll}}function WebGLShader(F,Da,ll){const cl=F.createShader(Da);return F.shaderSource(cl,ll),F.compileShader(cl),cl}let Lg=0;function getShaderErrors(F,Da,ll){const cl=F.getShaderParameter(Da,F.COMPILE_STATUS),hl=F.getShaderInfoLog(Da).trim();if(cl&&""===hl)return"";const dl=/ERROR: 0:(\d+)/.exec(hl);if(dl){const cl=parseInt(dl[1]);return ll.toUpperCase()+"\n\n"+hl+"\n\n"+function(F,Da){const ll=F.split("\n"),cl=[],hl=Math.max(Da-6,0),dl=Math.min(Da+6,ll.length);for(let pl=hl;pl<dl;pl++){const F=pl+1;cl.push(`${F===Da?">":" "} ${F}: ${ll[pl]}`)}return cl.join("\n")}(F.getShaderSource(Da),cl)}return hl}function getTexelEncodingFunction(F,Da){const ll=function(F){const Da=sm.getPrimaries(sm.workingColorSpace),ll=sm.getPrimaries(F);let cl;switch(Da===ll?cl="":Da===Rp&&ll===Dp?cl="LinearDisplayP3ToLinearSRGB":Da===Dp&&ll===Rp&&(cl="LinearSRGBToLinearDisplayP3"),F){case Ip:case Lp:return[cl,"LinearTransferOETF"];case Tp:case Cp:return[cl,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",F),[cl,"LinearTransferOETF"]}}(Da);return`vec4 ${F}( vec4 value ) { return ${ll[0]}( ${ll[1]}( value ) ); }`}function getToneMappingFunction(F,Da){let ll;switch(Da){case 1:ll="Linear";break;case 2:ll="Reinhard";break;case 3:ll="Cineon";break;case 4:ll="ACESFilmic";break;case 6:ll="AgX";break;case 7:ll="Neutral";break;case 5:ll="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",Da),ll="Linear"}return"vec3 "+F+"( vec3 color ) { return "+ll+"ToneMapping( color ); }"}const zg=new Vector3;function getLuminanceFunction(){sm.getLuminanceCoefficients(zg);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${zg.x.toFixed(4)}, ${zg.y.toFixed(4)}, ${zg.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function filterEmptyLine(F){return""!==F}function replaceLightNums(F,Da){const ll=Da.numSpotLightShadows+Da.numSpotLightMaps-Da.numSpotLightShadowsWithMaps;return F.replace(/NUM_DIR_LIGHTS/g,Da.numDirLights).replace(/NUM_SPOT_LIGHTS/g,Da.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,Da.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,ll).replace(/NUM_RECT_AREA_LIGHTS/g,Da.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,Da.numPointLights).replace(/NUM_HEMI_LIGHTS/g,Da.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,Da.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,Da.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,Da.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,Da.numPointLightShadows)}function replaceClippingPlaneNums(F,Da){return F.replace(/NUM_CLIPPING_PLANES/g,Da.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,Da.numClippingPlanes-Da.numClipIntersection)}const Pg=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(F){return F.replace(Pg,includeReplacer)}const Dg=new Map;function includeReplacer(F,Da){let ll=ng[Da];if(void 0===ll){const F=Dg.get(Da);if(void 0===F)throw new Error("Can not resolve #include <"+Da+">");ll=ng[F],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',Da,F)}return resolveIncludes(ll)}const Rg=/#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 unrollLoops(F){return F.replace(Rg,loopReplacer)}function loopReplacer(F,Da,ll,cl){let hl="";for(let dl=parseInt(Da);dl<parseInt(ll);dl++)hl+=cl.replace(/\[\s*i\s*\]/g,"[ "+dl+" ]").replace(/UNROLLED_LOOP_INDEX/g,dl);return hl}function generatePrecision(F){let Da=`precision ${F.precision} float;\n\tprecision ${F.precision} int;\n\tprecision ${F.precision} sampler2D;\n\tprecision ${F.precision} samplerCube;\n\tprecision ${F.precision} sampler3D;\n\tprecision ${F.precision} sampler2DArray;\n\tprecision ${F.precision} sampler2DShadow;\n\tprecision ${F.precision} samplerCubeShadow;\n\tprecision ${F.precision} sampler2DArrayShadow;\n\tprecision ${F.precision} isampler2D;\n\tprecision ${F.precision} isampler3D;\n\tprecision ${F.precision} isamplerCube;\n\tprecision ${F.precision} isampler2DArray;\n\tprecision ${F.precision} usampler2D;\n\tprecision ${F.precision} usampler3D;\n\tprecision ${F.precision} usamplerCube;\n\tprecision ${F.precision} usampler2DArray;\n\t`;return"highp"===F.precision?Da+="\n#define HIGH_PRECISION":"mediump"===F.precision?Da+="\n#define MEDIUM_PRECISION":"lowp"===F.precision&&(Da+="\n#define LOW_PRECISION"),Da}function WebGLProgram(F,Da,ll,cl){const hl=F.getContext(),dl=ll.defines;let pl=ll.vertexShader,fl=ll.fragmentShader;const Al=function(F){let Da="SHADOWMAP_TYPE_BASIC";return 1===F.shadowMapType?Da="SHADOWMAP_TYPE_PCF":2===F.shadowMapType?Da="SHADOWMAP_TYPE_PCF_SOFT":3===F.shadowMapType&&(Da="SHADOWMAP_TYPE_VSM"),Da}(ll),bl=function(F){let Da="ENVMAP_TYPE_CUBE";if(F.envMap)switch(F.envMapMode){case Nu:case qu:Da="ENVMAP_TYPE_CUBE";break;case ed:Da="ENVMAP_TYPE_CUBE_UV"}return Da}(ll),kl=function(F){let Da="ENVMAP_MODE_REFLECTION";F.envMap&&F.envMapMode===qu&&(Da="ENVMAP_MODE_REFRACTION");return Da}(ll),Dl=function(F){let Da="ENVMAP_BLENDING_NONE";if(F.envMap)switch(F.combine){case 0:Da="ENVMAP_BLENDING_MULTIPLY";break;case 1:Da="ENVMAP_BLENDING_MIX";break;case 2:Da="ENVMAP_BLENDING_ADD"}return Da}(ll),Wl=function(F){const Da=F.envMapCubeUVHeight;if(null===Da)return null;const ll=Math.log2(Da)-2,cl=1/Da;return{texelWidth:1/(3*Math.max(Math.pow(2,ll),112)),texelHeight:cl,maxMip:ll}}(ll),Ql=function(F){return[F.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",F.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(filterEmptyLine).join("\n")}(ll),wc=function(F){const Da=[];for(const ll in F){const cl=F[ll];!1!==cl&&Da.push("#define "+ll+" "+cl)}return Da.join("\n")}(dl),Sc=hl.createProgram();let eu,iu,su=ll.glslVersion?"#version "+ll.glslVersion+"\n":"";ll.isRawShaderMaterial?(eu=["#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc].filter(filterEmptyLine).join("\n"),eu.length>0&&(eu+="\n"),iu=["#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc].filter(filterEmptyLine).join("\n"),iu.length>0&&(iu+="\n")):(eu=[generatePrecision(ll),"#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc,ll.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",ll.batching?"#define USE_BATCHING":"",ll.batchingColor?"#define USE_BATCHING_COLOR":"",ll.instancing?"#define USE_INSTANCING":"",ll.instancingColor?"#define USE_INSTANCING_COLOR":"",ll.instancingMorph?"#define USE_INSTANCING_MORPH":"",ll.useFog&&ll.fog?"#define USE_FOG":"",ll.useFog&&ll.fogExp2?"#define FOG_EXP2":"",ll.map?"#define USE_MAP":"",ll.envMap?"#define USE_ENVMAP":"",ll.envMap?"#define "+kl:"",ll.lightMap?"#define USE_LIGHTMAP":"",ll.aoMap?"#define USE_AOMAP":"",ll.bumpMap?"#define USE_BUMPMAP":"",ll.normalMap?"#define USE_NORMALMAP":"",ll.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",ll.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",ll.displacementMap?"#define USE_DISPLACEMENTMAP":"",ll.emissiveMap?"#define USE_EMISSIVEMAP":"",ll.anisotropy?"#define USE_ANISOTROPY":"",ll.anisotropyMap?"#define USE_ANISOTROPYMAP":"",ll.clearcoatMap?"#define USE_CLEARCOATMAP":"",ll.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",ll.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",ll.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",ll.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",ll.specularMap?"#define USE_SPECULARMAP":"",ll.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",ll.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",ll.roughnessMap?"#define USE_ROUGHNESSMAP":"",ll.metalnessMap?"#define USE_METALNESSMAP":"",ll.alphaMap?"#define USE_ALPHAMAP":"",ll.alphaHash?"#define USE_ALPHAHASH":"",ll.transmission?"#define USE_TRANSMISSION":"",ll.transmissionMap?"#define USE_TRANSMISSIONMAP":"",ll.thicknessMap?"#define USE_THICKNESSMAP":"",ll.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",ll.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",ll.mapUv?"#define MAP_UV "+ll.mapUv:"",ll.alphaMapUv?"#define ALPHAMAP_UV "+ll.alphaMapUv:"",ll.lightMapUv?"#define LIGHTMAP_UV "+ll.lightMapUv:"",ll.aoMapUv?"#define AOMAP_UV "+ll.aoMapUv:"",ll.emissiveMapUv?"#define EMISSIVEMAP_UV "+ll.emissiveMapUv:"",ll.bumpMapUv?"#define BUMPMAP_UV "+ll.bumpMapUv:"",ll.normalMapUv?"#define NORMALMAP_UV "+ll.normalMapUv:"",ll.displacementMapUv?"#define DISPLACEMENTMAP_UV "+ll.displacementMapUv:"",ll.metalnessMapUv?"#define METALNESSMAP_UV "+ll.metalnessMapUv:"",ll.roughnessMapUv?"#define ROUGHNESSMAP_UV "+ll.roughnessMapUv:"",ll.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+ll.anisotropyMapUv:"",ll.clearcoatMapUv?"#define CLEARCOATMAP_UV "+ll.clearcoatMapUv:"",ll.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+ll.clearcoatNormalMapUv:"",ll.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+ll.clearcoatRoughnessMapUv:"",ll.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+ll.iridescenceMapUv:"",ll.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+ll.iridescenceThicknessMapUv:"",ll.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+ll.sheenColorMapUv:"",ll.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+ll.sheenRoughnessMapUv:"",ll.specularMapUv?"#define SPECULARMAP_UV "+ll.specularMapUv:"",ll.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+ll.specularColorMapUv:"",ll.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+ll.specularIntensityMapUv:"",ll.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+ll.transmissionMapUv:"",ll.thicknessMapUv?"#define THICKNESSMAP_UV "+ll.thicknessMapUv:"",ll.vertexTangents&&!1===ll.flatShading?"#define USE_TANGENT":"",ll.vertexColors?"#define USE_COLOR":"",ll.vertexAlphas?"#define USE_COLOR_ALPHA":"",ll.vertexUv1s?"#define USE_UV1":"",ll.vertexUv2s?"#define USE_UV2":"",ll.vertexUv3s?"#define USE_UV3":"",ll.pointsUvs?"#define USE_POINTS_UV":"",ll.flatShading?"#define FLAT_SHADED":"",ll.skinning?"#define USE_SKINNING":"",ll.morphTargets?"#define USE_MORPHTARGETS":"",ll.morphNormals&&!1===ll.flatShading?"#define USE_MORPHNORMALS":"",ll.morphColors?"#define USE_MORPHCOLORS":"",ll.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+ll.morphTextureStride:"",ll.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+ll.morphTargetsCount:"",ll.doubleSided?"#define DOUBLE_SIDED":"",ll.flipSided?"#define FLIP_SIDED":"",ll.shadowMapEnabled?"#define USE_SHADOWMAP":"",ll.shadowMapEnabled?"#define "+Al:"",ll.sizeAttenuation?"#define USE_SIZEATTENUATION":"",ll.numLightProbes>0?"#define USE_LIGHT_PROBES":"",ll.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),iu=[generatePrecision(ll),"#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc,ll.useFog&&ll.fog?"#define USE_FOG":"",ll.useFog&&ll.fogExp2?"#define FOG_EXP2":"",ll.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",ll.map?"#define USE_MAP":"",ll.matcap?"#define USE_MATCAP":"",ll.envMap?"#define USE_ENVMAP":"",ll.envMap?"#define "+bl:"",ll.envMap?"#define "+kl:"",ll.envMap?"#define "+Dl:"",Wl?"#define CUBEUV_TEXEL_WIDTH "+Wl.texelWidth:"",Wl?"#define CUBEUV_TEXEL_HEIGHT "+Wl.texelHeight:"",Wl?"#define CUBEUV_MAX_MIP "+Wl.maxMip+".0":"",ll.lightMap?"#define USE_LIGHTMAP":"",ll.aoMap?"#define USE_AOMAP":"",ll.bumpMap?"#define USE_BUMPMAP":"",ll.normalMap?"#define USE_NORMALMAP":"",ll.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",ll.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",ll.emissiveMap?"#define USE_EMISSIVEMAP":"",ll.anisotropy?"#define USE_ANISOTROPY":"",ll.anisotropyMap?"#define USE_ANISOTROPYMAP":"",ll.clearcoat?"#define USE_CLEARCOAT":"",ll.clearcoatMap?"#define USE_CLEARCOATMAP":"",ll.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",ll.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",ll.dispersion?"#define USE_DISPERSION":"",ll.iridescence?"#define USE_IRIDESCENCE":"",ll.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",ll.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",ll.specularMap?"#define USE_SPECULARMAP":"",ll.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",ll.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",ll.roughnessMap?"#define USE_ROUGHNESSMAP":"",ll.metalnessMap?"#define USE_METALNESSMAP":"",ll.alphaMap?"#define USE_ALPHAMAP":"",ll.alphaTest?"#define USE_ALPHATEST":"",ll.alphaHash?"#define USE_ALPHAHASH":"",ll.sheen?"#define USE_SHEEN":"",ll.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",ll.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",ll.transmission?"#define USE_TRANSMISSION":"",ll.transmissionMap?"#define USE_TRANSMISSIONMAP":"",ll.thicknessMap?"#define USE_THICKNESSMAP":"",ll.vertexTangents&&!1===ll.flatShading?"#define USE_TANGENT":"",ll.vertexColors||ll.instancingColor||ll.batchingColor?"#define USE_COLOR":"",ll.vertexAlphas?"#define USE_COLOR_ALPHA":"",ll.vertexUv1s?"#define USE_UV1":"",ll.vertexUv2s?"#define USE_UV2":"",ll.vertexUv3s?"#define USE_UV3":"",ll.pointsUvs?"#define USE_POINTS_UV":"",ll.gradientMap?"#define USE_GRADIENTMAP":"",ll.flatShading?"#define FLAT_SHADED":"",ll.doubleSided?"#define DOUBLE_SIDED":"",ll.flipSided?"#define FLIP_SIDED":"",ll.shadowMapEnabled?"#define USE_SHADOWMAP":"",ll.shadowMapEnabled?"#define "+Al:"",ll.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",ll.numLightProbes>0?"#define USE_LIGHT_PROBES":"",ll.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",ll.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==ll.toneMapping?"#define TONE_MAPPING":"",0!==ll.toneMapping?ng.tonemapping_pars_fragment:"",0!==ll.toneMapping?getToneMappingFunction("toneMapping",ll.toneMapping):"",ll.dithering?"#define DITHERING":"",ll.opaque?"#define OPAQUE":"",ng.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",ll.outputColorSpace),getLuminanceFunction(),ll.useDepthPacking?"#define DEPTH_PACKING "+ll.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),pl=resolveIncludes(pl),pl=replaceLightNums(pl,ll),pl=replaceClippingPlaneNums(pl,ll),fl=resolveIncludes(fl),fl=replaceLightNums(fl,ll),fl=replaceClippingPlaneNums(fl,ll),pl=unrollLoops(pl),fl=unrollLoops(fl),!0!==ll.isRawShaderMaterial&&(su="#version 300 es\n",eu=[Ql,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+eu,iu=["#define varying in",ll.glslVersion===Zp?"":"layout(location = 0) out highp vec4 pc_fragColor;",ll.glslVersion===Zp?"":"#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("\n")+"\n"+iu);const cu=su+eu+pl,uu=su+iu+fl,hu=WebGLShader(hl,hl.VERTEX_SHADER,cu),Lu=WebGLShader(hl,hl.FRAGMENT_SHADER,uu);function onFirstUse(Da){if(F.debug.checkShaderErrors){const ll=hl.getProgramInfoLog(Sc).trim(),cl=hl.getShaderInfoLog(hu).trim(),dl=hl.getShaderInfoLog(Lu).trim();let pl=!0,fl=!0;if(!1===hl.getProgramParameter(Sc,hl.LINK_STATUS))if(pl=!1,"function"===typeof F.debug.onShaderError)F.debug.onShaderError(hl,Sc,hu,Lu);else{const F=getShaderErrors(hl,hu,"vertex"),cl=getShaderErrors(hl,Lu,"fragment");console.error("THREE.WebGLProgram: Shader Error "+hl.getError()+" - VALIDATE_STATUS "+hl.getProgramParameter(Sc,hl.VALIDATE_STATUS)+"\n\nMaterial Name: "+Da.name+"\nMaterial Type: "+Da.type+"\n\nProgram Info Log: "+ll+"\n"+F+"\n"+cl)}else""!==ll?console.warn("THREE.WebGLProgram: Program Info Log:",ll):""!==cl&&""!==dl||(fl=!1);fl&&(Da.diagnostics={runnable:pl,programLog:ll,vertexShader:{log:cl,prefix:eu},fragmentShader:{log:dl,prefix:iu}})}hl.deleteShader(hu),hl.deleteShader(Lu),zu=new WebGLUniforms(hl,Sc),Du=function(F,Da){const ll={},cl=F.getProgramParameter(Da,F.ACTIVE_ATTRIBUTES);for(let hl=0;hl<cl;hl++){const cl=F.getActiveAttrib(Da,hl),dl=cl.name;let pl=1;cl.type===F.FLOAT_MAT2&&(pl=2),cl.type===F.FLOAT_MAT3&&(pl=3),cl.type===F.FLOAT_MAT4&&(pl=4),ll[dl]={type:cl.type,location:F.getAttribLocation(Da,dl),locationSize:pl}}return ll}(hl,Sc)}let zu,Du;hl.attachShader(Sc,hu),hl.attachShader(Sc,Lu),void 0!==ll.index0AttributeName?hl.bindAttribLocation(Sc,0,ll.index0AttributeName):!0===ll.morphTargets&&hl.bindAttribLocation(Sc,0,"position"),hl.linkProgram(Sc),this.getUniforms=function(){return void 0===zu&&onFirstUse(this),zu},this.getAttributes=function(){return void 0===Du&&onFirstUse(this),Du};let ih=!1===ll.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===ih&&(ih=hl.getProgramParameter(Sc,37297)),ih},this.destroy=function(){cl.releaseStatesOfProgram(this),hl.deleteProgram(Sc),this.program=void 0},this.type=ll.shaderType,this.name=ll.shaderName,this.id=Lg++,this.cacheKey=Da,this.usedTimes=1,this.program=Sc,this.vertexShader=hu,this.fragmentShader=Lu,this}let Ng=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(F){const Da=F.vertexShader,ll=F.fragmentShader,cl=this._getShaderStage(Da),hl=this._getShaderStage(ll),dl=this._getShaderCacheForMaterial(F);return!1===dl.has(cl)&&(dl.add(cl),cl.usedTimes++),!1===dl.has(hl)&&(dl.add(hl),hl.usedTimes++),this}remove(F){const Da=this.materialCache.get(F);for(const ll of Da)ll.usedTimes--,0===ll.usedTimes&&this.shaderCache.delete(ll.code);return this.materialCache.delete(F),this}getVertexShaderID(F){return this._getShaderStage(F.vertexShader).id}getFragmentShaderID(F){return this._getShaderStage(F.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(F){const Da=this.materialCache;let ll=Da.get(F);return void 0===ll&&(ll=new Set,Da.set(F,ll)),ll}_getShaderStage(F){const Da=this.shaderCache;let ll=Da.get(F);return void 0===ll&&(ll=new WebGLShaderStage(F),Da.set(F,ll)),ll}}class WebGLShaderStage{constructor(F){this.id=Ng++,this.code=F,this.usedTimes=0}}function WebGLPrograms(F,Da,ll,cl,hl,dl,pl){const fl=new Layers,Al=new WebGLShaderCache,bl=new Set,kl=[],Dl=hl.logarithmicDepthBuffer,Wl=hl.vertexTextures;let Ql=hl.precision;const wc={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 getChannel(F){return bl.add(F),0===F?"uv":`uv${F}`}return{getParameters:function(dl,fl,kl,Sc,eu){const iu=Sc.fog,su=eu.geometry,cu=dl.isMeshStandardMaterial?Sc.environment:null,uu=(dl.isMeshStandardMaterial?ll:Da).get(dl.envMap||cu),hu=uu&&uu.mapping===ed?uu.image.height:null,Lu=wc[dl.type];null!==dl.precision&&(Ql=hl.getMaxPrecision(dl.precision),Ql!==dl.precision&&console.warn("THREE.WebGLProgram.getParameters:",dl.precision,"not supported, using",Ql,"instead."));const zu=su.morphAttributes.position||su.morphAttributes.normal||su.morphAttributes.color,Du=void 0!==zu?zu.length:0;let Nu,qu,ih,gh,td=0;if(void 0!==su.morphAttributes.position&&(td=1),void 0!==su.morphAttributes.normal&&(td=2),void 0!==su.morphAttributes.color&&(td=3),Lu){const F=ag[Lu];Nu=F.vertexShader,qu=F.fragmentShader}else Nu=dl.vertexShader,qu=dl.fragmentShader,Al.update(dl),ih=Al.getVertexShaderID(dl),gh=Al.getFragmentShaderID(dl);const id=F.getRenderTarget(),nd=!0===eu.isInstancedMesh,rd=!0===eu.isBatchedMesh,ad=!!dl.map,sd=!!dl.matcap,od=!!uu,ld=!!dl.aoMap,cd=!!dl.lightMap,ud=!!dl.bumpMap,hd=!!dl.normalMap,dd=!!dl.displacementMap,pd=!!dl.emissiveMap,md=!!dl.metalnessMap,fd=!!dl.roughnessMap,gd=dl.anisotropy>0,Ad=dl.clearcoat>0,yd=dl.dispersion>0,vd=dl.iridescence>0,_d=dl.sheen>0,xd=dl.transmission>0,bd=gd&&!!dl.anisotropyMap,wd=Ad&&!!dl.clearcoatMap,Ed=Ad&&!!dl.clearcoatNormalMap,Md=Ad&&!!dl.clearcoatRoughnessMap,Sd=vd&&!!dl.iridescenceMap,kd=vd&&!!dl.iridescenceThicknessMap,Td=_d&&!!dl.sheenColorMap,Id=_d&&!!dl.sheenRoughnessMap,Cd=!!dl.specularMap,Ld=!!dl.specularColorMap,zd=!!dl.specularIntensityMap,Pd=xd&&!!dl.transmissionMap,Dd=xd&&!!dl.thicknessMap,Rd=!!dl.gradientMap,Nd=!!dl.alphaMap,Ud=dl.alphaTest>0,Bd=!!dl.alphaHash,Od=!!dl.extensions;let Fd=0;dl.toneMapped&&(null!==id&&!0!==id.isXRRenderTarget||(Fd=F.toneMapping));const jd={shaderID:Lu,shaderType:dl.type,shaderName:dl.name,vertexShader:Nu,fragmentShader:qu,defines:dl.defines,customVertexShaderID:ih,customFragmentShaderID:gh,isRawShaderMaterial:!0===dl.isRawShaderMaterial,glslVersion:dl.glslVersion,precision:Ql,batching:rd,batchingColor:rd&&null!==eu._colorsTexture,instancing:nd,instancingColor:nd&&null!==eu.instanceColor,instancingMorph:nd&&null!==eu.morphTexture,supportsVertexTextures:Wl,outputColorSpace:null===id?F.outputColorSpace:!0===id.isXRRenderTarget?id.texture.colorSpace:Ip,alphaToCoverage:!!dl.alphaToCoverage,map:ad,matcap:sd,envMap:od,envMapMode:od&&uu.mapping,envMapCubeUVHeight:hu,aoMap:ld,lightMap:cd,bumpMap:ud,normalMap:hd,displacementMap:Wl&&dd,emissiveMap:pd,normalMapObjectSpace:hd&&1===dl.normalMapType,normalMapTangentSpace:hd&&0===dl.normalMapType,metalnessMap:md,roughnessMap:fd,anisotropy:gd,anisotropyMap:bd,clearcoat:Ad,clearcoatMap:wd,clearcoatNormalMap:Ed,clearcoatRoughnessMap:Md,dispersion:yd,iridescence:vd,iridescenceMap:Sd,iridescenceThicknessMap:kd,sheen:_d,sheenColorMap:Td,sheenRoughnessMap:Id,specularMap:Cd,specularColorMap:Ld,specularIntensityMap:zd,transmission:xd,transmissionMap:Pd,thicknessMap:Dd,gradientMap:Rd,opaque:!1===dl.transparent&&1===dl.blending&&!1===dl.alphaToCoverage,alphaMap:Nd,alphaTest:Ud,alphaHash:Bd,combine:dl.combine,mapUv:ad&&getChannel(dl.map.channel),aoMapUv:ld&&getChannel(dl.aoMap.channel),lightMapUv:cd&&getChannel(dl.lightMap.channel),bumpMapUv:ud&&getChannel(dl.bumpMap.channel),normalMapUv:hd&&getChannel(dl.normalMap.channel),displacementMapUv:dd&&getChannel(dl.displacementMap.channel),emissiveMapUv:pd&&getChannel(dl.emissiveMap.channel),metalnessMapUv:md&&getChannel(dl.metalnessMap.channel),roughnessMapUv:fd&&getChannel(dl.roughnessMap.channel),anisotropyMapUv:bd&&getChannel(dl.anisotropyMap.channel),clearcoatMapUv:wd&&getChannel(dl.clearcoatMap.channel),clearcoatNormalMapUv:Ed&&getChannel(dl.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Md&&getChannel(dl.clearcoatRoughnessMap.channel),iridescenceMapUv:Sd&&getChannel(dl.iridescenceMap.channel),iridescenceThicknessMapUv:kd&&getChannel(dl.iridescenceThicknessMap.channel),sheenColorMapUv:Td&&getChannel(dl.sheenColorMap.channel),sheenRoughnessMapUv:Id&&getChannel(dl.sheenRoughnessMap.channel),specularMapUv:Cd&&getChannel(dl.specularMap.channel),specularColorMapUv:Ld&&getChannel(dl.specularColorMap.channel),specularIntensityMapUv:zd&&getChannel(dl.specularIntensityMap.channel),transmissionMapUv:Pd&&getChannel(dl.transmissionMap.channel),thicknessMapUv:Dd&&getChannel(dl.thicknessMap.channel),alphaMapUv:Nd&&getChannel(dl.alphaMap.channel),vertexTangents:!!su.attributes.tangent&&(hd||gd),vertexColors:dl.vertexColors,vertexAlphas:!0===dl.vertexColors&&!!su.attributes.color&&4===su.attributes.color.itemSize,pointsUvs:!0===eu.isPoints&&!!su.attributes.uv&&(ad||Nd),fog:!!iu,useFog:!0===dl.fog,fogExp2:!!iu&&iu.isFogExp2,flatShading:!0===dl.flatShading,sizeAttenuation:!0===dl.sizeAttenuation,logarithmicDepthBuffer:Dl,skinning:!0===eu.isSkinnedMesh,morphTargets:void 0!==su.morphAttributes.position,morphNormals:void 0!==su.morphAttributes.normal,morphColors:void 0!==su.morphAttributes.color,morphTargetsCount:Du,morphTextureStride:td,numDirLights:fl.directional.length,numPointLights:fl.point.length,numSpotLights:fl.spot.length,numSpotLightMaps:fl.spotLightMap.length,numRectAreaLights:fl.rectArea.length,numHemiLights:fl.hemi.length,numDirLightShadows:fl.directionalShadowMap.length,numPointLightShadows:fl.pointShadowMap.length,numSpotLightShadows:fl.spotShadowMap.length,numSpotLightShadowsWithMaps:fl.numSpotLightShadowsWithMaps,numLightProbes:fl.numLightProbes,numClippingPlanes:pl.numPlanes,numClipIntersection:pl.numIntersection,dithering:dl.dithering,shadowMapEnabled:F.shadowMap.enabled&&kl.length>0,shadowMapType:F.shadowMap.type,toneMapping:Fd,decodeVideoTexture:ad&&!0===dl.map.isVideoTexture&&sm.getTransfer(dl.map.colorSpace)===Pp,premultipliedAlpha:dl.premultipliedAlpha,doubleSided:2===dl.side,flipSided:1===dl.side,useDepthPacking:dl.depthPacking>=0,depthPacking:dl.depthPacking||0,index0AttributeName:dl.index0AttributeName,extensionClipCullDistance:Od&&!0===dl.extensions.clipCullDistance&&cl.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Od&&!0===dl.extensions.multiDraw||rd)&&cl.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:cl.has("KHR_parallel_shader_compile"),customProgramCacheKey:dl.customProgramCacheKey()};return jd.vertexUv1s=bl.has(1),jd.vertexUv2s=bl.has(2),jd.vertexUv3s=bl.has(3),bl.clear(),jd},getProgramCacheKey:function(Da){const ll=[];if(Da.shaderID?ll.push(Da.shaderID):(ll.push(Da.customVertexShaderID),ll.push(Da.customFragmentShaderID)),void 0!==Da.defines)for(const F in Da.defines)ll.push(F),ll.push(Da.defines[F]);return!1===Da.isRawShaderMaterial&&(!function(F,Da){F.push(Da.precision),F.push(Da.outputColorSpace),F.push(Da.envMapMode),F.push(Da.envMapCubeUVHeight),F.push(Da.mapUv),F.push(Da.alphaMapUv),F.push(Da.lightMapUv),F.push(Da.aoMapUv),F.push(Da.bumpMapUv),F.push(Da.normalMapUv),F.push(Da.displacementMapUv),F.push(Da.emissiveMapUv),F.push(Da.metalnessMapUv),F.push(Da.roughnessMapUv),F.push(Da.anisotropyMapUv),F.push(Da.clearcoatMapUv),F.push(Da.clearcoatNormalMapUv),F.push(Da.clearcoatRoughnessMapUv),F.push(Da.iridescenceMapUv),F.push(Da.iridescenceThicknessMapUv),F.push(Da.sheenColorMapUv),F.push(Da.sheenRoughnessMapUv),F.push(Da.specularMapUv),F.push(Da.specularColorMapUv),F.push(Da.specularIntensityMapUv),F.push(Da.transmissionMapUv),F.push(Da.thicknessMapUv),F.push(Da.combine),F.push(Da.fogExp2),F.push(Da.sizeAttenuation),F.push(Da.morphTargetsCount),F.push(Da.morphAttributeCount),F.push(Da.numDirLights),F.push(Da.numPointLights),F.push(Da.numSpotLights),F.push(Da.numSpotLightMaps),F.push(Da.numHemiLights),F.push(Da.numRectAreaLights),F.push(Da.numDirLightShadows),F.push(Da.numPointLightShadows),F.push(Da.numSpotLightShadows),F.push(Da.numSpotLightShadowsWithMaps),F.push(Da.numLightProbes),F.push(Da.shadowMapType),F.push(Da.toneMapping),F.push(Da.numClippingPlanes),F.push(Da.numClipIntersection),F.push(Da.depthPacking)}(ll,Da),function(F,Da){fl.disableAll(),Da.supportsVertexTextures&&fl.enable(0);Da.instancing&&fl.enable(1);Da.instancingColor&&fl.enable(2);Da.instancingMorph&&fl.enable(3);Da.matcap&&fl.enable(4);Da.envMap&&fl.enable(5);Da.normalMapObjectSpace&&fl.enable(6);Da.normalMapTangentSpace&&fl.enable(7);Da.clearcoat&&fl.enable(8);Da.iridescence&&fl.enable(9);Da.alphaTest&&fl.enable(10);Da.vertexColors&&fl.enable(11);Da.vertexAlphas&&fl.enable(12);Da.vertexUv1s&&fl.enable(13);Da.vertexUv2s&&fl.enable(14);Da.vertexUv3s&&fl.enable(15);Da.vertexTangents&&fl.enable(16);Da.anisotropy&&fl.enable(17);Da.alphaHash&&fl.enable(18);Da.batching&&fl.enable(19);Da.dispersion&&fl.enable(20);Da.batchingColor&&fl.enable(21);F.push(fl.mask),fl.disableAll(),Da.fog&&fl.enable(0);Da.useFog&&fl.enable(1);Da.flatShading&&fl.enable(2);Da.logarithmicDepthBuffer&&fl.enable(3);Da.skinning&&fl.enable(4);Da.morphTargets&&fl.enable(5);Da.morphNormals&&fl.enable(6);Da.morphColors&&fl.enable(7);Da.premultipliedAlpha&&fl.enable(8);Da.shadowMapEnabled&&fl.enable(9);Da.doubleSided&&fl.enable(10);Da.flipSided&&fl.enable(11);Da.useDepthPacking&&fl.enable(12);Da.dithering&&fl.enable(13);Da.transmission&&fl.enable(14);Da.sheen&&fl.enable(15);Da.opaque&&fl.enable(16);Da.pointsUvs&&fl.enable(17);Da.decodeVideoTexture&&fl.enable(18);Da.alphaToCoverage&&fl.enable(19);F.push(fl.mask)}(ll,Da),ll.push(F.outputColorSpace)),ll.push(Da.customProgramCacheKey),ll.join()},getUniforms:function(F){const Da=wc[F.type];let ll;if(Da){const F=ag[Da];ll=Wf.clone(F.uniforms)}else ll=F.uniforms;return ll},acquireProgram:function(Da,ll){let cl;for(let F=0,hl=kl.length;F<hl;F++){const Da=kl[F];if(Da.cacheKey===ll){cl=Da,++cl.usedTimes;break}}return void 0===cl&&(cl=new WebGLProgram(F,ll,Da,dl),kl.push(cl)),cl},releaseProgram:function(F){if(0===--F.usedTimes){const Da=kl.indexOf(F);kl[Da]=kl[kl.length-1],kl.pop(),F.destroy()}},releaseShaderCache:function(F){Al.remove(F)},programs:kl,dispose:function(){Al.dispose()}}}function WebGLProperties(){let F=new WeakMap;return{has:function(Da){return F.has(Da)},get:function(Da){let ll=F.get(Da);return void 0===ll&&(ll={},F.set(Da,ll)),ll},remove:function(Da){F.delete(Da)},update:function(Da,ll,cl){F.get(Da)[ll]=cl},dispose:function(){F=new WeakMap}}}function painterSortStable(F,Da){return F.groupOrder!==Da.groupOrder?F.groupOrder-Da.groupOrder:F.renderOrder!==Da.renderOrder?F.renderOrder-Da.renderOrder:F.material.id!==Da.material.id?F.material.id-Da.material.id:F.z!==Da.z?F.z-Da.z:F.id-Da.id}function reversePainterSortStable(F,Da){return F.groupOrder!==Da.groupOrder?F.groupOrder-Da.groupOrder:F.renderOrder!==Da.renderOrder?F.renderOrder-Da.renderOrder:F.z!==Da.z?Da.z-F.z:F.id-Da.id}function WebGLRenderList(){const F=[];let Da=0;const ll=[],cl=[],hl=[];function getNextRenderItem(ll,cl,hl,dl,pl,fl){let Al=F[Da];return void 0===Al?(Al={id:ll.id,object:ll,geometry:cl,material:hl,groupOrder:dl,renderOrder:ll.renderOrder,z:pl,group:fl},F[Da]=Al):(Al.id=ll.id,Al.object=ll,Al.geometry=cl,Al.material=hl,Al.groupOrder=dl,Al.renderOrder=ll.renderOrder,Al.z=pl,Al.group=fl),Da++,Al}return{opaque:ll,transmissive:cl,transparent:hl,init:function(){Da=0,ll.length=0,cl.length=0,hl.length=0},push:function(F,Da,dl,pl,fl,Al){const bl=getNextRenderItem(F,Da,dl,pl,fl,Al);dl.transmission>0?cl.push(bl):!0===dl.transparent?hl.push(bl):ll.push(bl)},unshift:function(F,Da,dl,pl,fl,Al){const bl=getNextRenderItem(F,Da,dl,pl,fl,Al);dl.transmission>0?cl.unshift(bl):!0===dl.transparent?hl.unshift(bl):ll.unshift(bl)},finish:function(){for(let ll=Da,cl=F.length;ll<cl;ll++){const Da=F[ll];if(null===Da.id)break;Da.id=null,Da.object=null,Da.geometry=null,Da.material=null,Da.group=null}},sort:function(F,Da){ll.length>1&&ll.sort(F||painterSortStable),cl.length>1&&cl.sort(Da||reversePainterSortStable),hl.length>1&&hl.sort(Da||reversePainterSortStable)}}}function WebGLRenderLists(){let F=new WeakMap;return{get:function(Da,ll){const cl=F.get(Da);let hl;return void 0===cl?(hl=new WebGLRenderList,F.set(Da,[hl])):ll>=cl.length?(hl=new WebGLRenderList,cl.push(hl)):hl=cl[ll],hl},dispose:function(){F=new WeakMap}}}function UniformsCache(){const F={};return{get:function(Da){if(void 0!==F[Da.id])return F[Da.id];let ll;switch(Da.type){case"DirectionalLight":ll={direction:new Vector3,color:new Color};break;case"SpotLight":ll={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":ll={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":ll={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":ll={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return F[Da.id]=ll,ll}}}let Ug=0;function shadowCastingAndTexturingLightsFirst(F,Da){return(Da.castShadow?2:0)-(F.castShadow?2:0)+(Da.map?1:0)-(F.map?1:0)}function WebGLLights(F){const Da=new UniformsCache,ll=function(){const F={};return{get:function(Da){if(void 0!==F[Da.id])return F[Da.id];let ll;switch(Da.type){case"DirectionalLight":case"SpotLight":ll={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":ll={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return F[Da.id]=ll,ll}}}(),cl={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 fl=0;fl<9;fl++)cl.probe.push(new Vector3);const hl=new Vector3,dl=new Matrix4,pl=new Matrix4;return{setup:function(hl){let dl=0,pl=0,fl=0;for(let F=0;F<9;F++)cl.probe[F].set(0,0,0);let Al=0,bl=0,kl=0,Dl=0,Wl=0,Ql=0,wc=0,Sc=0,eu=0,iu=0,su=0;hl.sort(shadowCastingAndTexturingLightsFirst);for(let F=0,uu=hl.length;F<uu;F++){const cu=hl[F],uu=cu.color,hu=cu.intensity,Lu=cu.distance,zu=cu.shadow&&cu.shadow.map?cu.shadow.map.texture:null;if(cu.isAmbientLight)dl+=uu.r*hu,pl+=uu.g*hu,fl+=uu.b*hu;else if(cu.isLightProbe){for(let F=0;F<9;F++)cl.probe[F].addScaledVector(cu.sh.coefficients[F],hu);su++}else if(cu.isDirectionalLight){const F=Da.get(cu);if(F.color.copy(cu.color).multiplyScalar(cu.intensity),cu.castShadow){const F=cu.shadow,Da=ll.get(cu);Da.shadowIntensity=F.intensity,Da.shadowBias=F.bias,Da.shadowNormalBias=F.normalBias,Da.shadowRadius=F.radius,Da.shadowMapSize=F.mapSize,cl.directionalShadow[Al]=Da,cl.directionalShadowMap[Al]=zu,cl.directionalShadowMatrix[Al]=cu.shadow.matrix,Ql++}cl.directional[Al]=F,Al++}else if(cu.isSpotLight){const F=Da.get(cu);F.position.setFromMatrixPosition(cu.matrixWorld),F.color.copy(uu).multiplyScalar(hu),F.distance=Lu,F.coneCos=Math.cos(cu.angle),F.penumbraCos=Math.cos(cu.angle*(1-cu.penumbra)),F.decay=cu.decay,cl.spot[kl]=F;const hl=cu.shadow;if(cu.map&&(cl.spotLightMap[eu]=cu.map,eu++,hl.updateMatrices(cu),cu.castShadow&&iu++),cl.spotLightMatrix[kl]=hl.matrix,cu.castShadow){const F=ll.get(cu);F.shadowIntensity=hl.intensity,F.shadowBias=hl.bias,F.shadowNormalBias=hl.normalBias,F.shadowRadius=hl.radius,F.shadowMapSize=hl.mapSize,cl.spotShadow[kl]=F,cl.spotShadowMap[kl]=zu,Sc++}kl++}else if(cu.isRectAreaLight){const F=Da.get(cu);F.color.copy(uu).multiplyScalar(hu),F.halfWidth.set(.5*cu.width,0,0),F.halfHeight.set(0,.5*cu.height,0),cl.rectArea[Dl]=F,Dl++}else if(cu.isPointLight){const F=Da.get(cu);if(F.color.copy(cu.color).multiplyScalar(cu.intensity),F.distance=cu.distance,F.decay=cu.decay,cu.castShadow){const F=cu.shadow,Da=ll.get(cu);Da.shadowIntensity=F.intensity,Da.shadowBias=F.bias,Da.shadowNormalBias=F.normalBias,Da.shadowRadius=F.radius,Da.shadowMapSize=F.mapSize,Da.shadowCameraNear=F.camera.near,Da.shadowCameraFar=F.camera.far,cl.pointShadow[bl]=Da,cl.pointShadowMap[bl]=zu,cl.pointShadowMatrix[bl]=cu.shadow.matrix,wc++}cl.point[bl]=F,bl++}else if(cu.isHemisphereLight){const F=Da.get(cu);F.skyColor.copy(cu.color).multiplyScalar(hu),F.groundColor.copy(cu.groundColor).multiplyScalar(hu),cl.hemi[Wl]=F,Wl++}}Dl>0&&(!0===F.has("OES_texture_float_linear")?(cl.rectAreaLTC1=rg.LTC_FLOAT_1,cl.rectAreaLTC2=rg.LTC_FLOAT_2):(cl.rectAreaLTC1=rg.LTC_HALF_1,cl.rectAreaLTC2=rg.LTC_HALF_2)),cl.ambient[0]=dl,cl.ambient[1]=pl,cl.ambient[2]=fl;const cu=cl.hash;cu.directionalLength===Al&&cu.pointLength===bl&&cu.spotLength===kl&&cu.rectAreaLength===Dl&&cu.hemiLength===Wl&&cu.numDirectionalShadows===Ql&&cu.numPointShadows===wc&&cu.numSpotShadows===Sc&&cu.numSpotMaps===eu&&cu.numLightProbes===su||(cl.directional.length=Al,cl.spot.length=kl,cl.rectArea.length=Dl,cl.point.length=bl,cl.hemi.length=Wl,cl.directionalShadow.length=Ql,cl.directionalShadowMap.length=Ql,cl.pointShadow.length=wc,cl.pointShadowMap.length=wc,cl.spotShadow.length=Sc,cl.spotShadowMap.length=Sc,cl.directionalShadowMatrix.length=Ql,cl.pointShadowMatrix.length=wc,cl.spotLightMatrix.length=Sc+eu-iu,cl.spotLightMap.length=eu,cl.numSpotLightShadowsWithMaps=iu,cl.numLightProbes=su,cu.directionalLength=Al,cu.pointLength=bl,cu.spotLength=kl,cu.rectAreaLength=Dl,cu.hemiLength=Wl,cu.numDirectionalShadows=Ql,cu.numPointShadows=wc,cu.numSpotShadows=Sc,cu.numSpotMaps=eu,cu.numLightProbes=su,cl.version=Ug++)},setupView:function(F,Da){let ll=0,fl=0,Al=0,bl=0,kl=0;const Dl=Da.matrixWorldInverse;for(let Wl=0,Ql=F.length;Wl<Ql;Wl++){const Da=F[Wl];if(Da.isDirectionalLight){const F=cl.directional[ll];F.direction.setFromMatrixPosition(Da.matrixWorld),hl.setFromMatrixPosition(Da.target.matrixWorld),F.direction.sub(hl),F.direction.transformDirection(Dl),ll++}else if(Da.isSpotLight){const F=cl.spot[Al];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),F.direction.setFromMatrixPosition(Da.matrixWorld),hl.setFromMatrixPosition(Da.target.matrixWorld),F.direction.sub(hl),F.direction.transformDirection(Dl),Al++}else if(Da.isRectAreaLight){const F=cl.rectArea[bl];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),pl.identity(),dl.copy(Da.matrixWorld),dl.premultiply(Dl),pl.extractRotation(dl),F.halfWidth.set(.5*Da.width,0,0),F.halfHeight.set(0,.5*Da.height,0),F.halfWidth.applyMatrix4(pl),F.halfHeight.applyMatrix4(pl),bl++}else if(Da.isPointLight){const F=cl.point[fl];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),fl++}else if(Da.isHemisphereLight){const F=cl.hemi[kl];F.direction.setFromMatrixPosition(Da.matrixWorld),F.direction.transformDirection(Dl),kl++}}},state:cl}}function WebGLRenderState(F){const Da=new WebGLLights(F),ll=[],cl=[];const hl={lightsArray:ll,shadowsArray:cl,camera:null,lights:Da,transmissionRenderTarget:{}};return{init:function(F){hl.camera=F,ll.length=0,cl.length=0},state:hl,setupLights:function(){Da.setup(ll)},setupLightsView:function(F){Da.setupView(ll,F)},pushLight:function(F){ll.push(F)},pushShadow:function(F){cl.push(F)}}}function WebGLRenderStates(F){let Da=new WeakMap;return{get:function(ll,cl){void 0===cl&&(cl=0);const hl=Da.get(ll);let dl;return void 0===hl?(dl=new WebGLRenderState(F),Da.set(ll,[dl])):cl>=hl.length?(dl=new WebGLRenderState(F),hl.push(dl)):dl=hl[cl],dl},dispose:function(){Da=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(F){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(F)}copy(F){return super.copy(F),this.depthPacking=F.depthPacking,this.map=F.map,this.alphaMap=F.alphaMap,this.displacementMap=F.displacementMap,this.displacementScale=F.displacementScale,this.displacementBias=F.displacementBias,this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(F){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(F)}copy(F){return super.copy(F),this.map=F.map,this.alphaMap=F.alphaMap,this.displacementMap=F.displacementMap,this.displacementScale=F.displacementScale,this.displacementBias=F.displacementBias,this}}function WebGLShadowMap(F,Da,ll){let cl=new Frustum;const fl=new Vector2,Al=new Vector2,bl=new Vector4,kl=new MeshDepthMaterial({depthPacking:3201}),Dl=new MeshDistanceMaterial,Wl={},Ql=ll.maxTextureSize,wc={[hl]:1,[dl]:0,[pl]:2},Sc=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),eu=Sc.clone();eu.defines.HORIZONTAL_PASS=1;const iu=new BufferGeometry;iu.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const su=new Mesh(iu,Sc),cu=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let uu=this.type;function VSMPass(ll,cl){const hl=Da.update(su);Sc.defines.VSM_SAMPLES!==ll.blurSamples&&(Sc.defines.VSM_SAMPLES=ll.blurSamples,eu.defines.VSM_SAMPLES=ll.blurSamples,Sc.needsUpdate=!0,eu.needsUpdate=!0),null===ll.mapPass&&(ll.mapPass=new WebGLRenderTarget(fl.x,fl.y)),Sc.uniforms.shadow_pass.value=ll.map.texture,Sc.uniforms.resolution.value=ll.mapSize,Sc.uniforms.radius.value=ll.radius,F.setRenderTarget(ll.mapPass),F.clear(),F.renderBufferDirect(cl,null,hl,Sc,su,null),eu.uniforms.shadow_pass.value=ll.mapPass.texture,eu.uniforms.resolution.value=ll.mapSize,eu.uniforms.radius.value=ll.radius,F.setRenderTarget(ll.map),F.clear(),F.renderBufferDirect(cl,null,hl,eu,su,null)}function getDepthMaterial(Da,ll,cl,hl){let dl=null;const pl=!0===cl.isPointLight?Da.customDistanceMaterial:Da.customDepthMaterial;if(void 0!==pl)dl=pl;else if(dl=!0===cl.isPointLight?Dl:kl,F.localClippingEnabled&&!0===ll.clipShadows&&Array.isArray(ll.clippingPlanes)&&0!==ll.clippingPlanes.length||ll.displacementMap&&0!==ll.displacementScale||ll.alphaMap&&ll.alphaTest>0||ll.map&&ll.alphaTest>0){const F=dl.uuid,Da=ll.uuid;let cl=Wl[F];void 0===cl&&(cl={},Wl[F]=cl);let hl=cl[Da];void 0===hl&&(hl=dl.clone(),cl[Da]=hl,ll.addEventListener("dispose",onMaterialDispose)),dl=hl}if(dl.visible=ll.visible,dl.wireframe=ll.wireframe,dl.side=3===hl?null!==ll.shadowSide?ll.shadowSide:ll.side:null!==ll.shadowSide?ll.shadowSide:wc[ll.side],dl.alphaMap=ll.alphaMap,dl.alphaTest=ll.alphaTest,dl.map=ll.map,dl.clipShadows=ll.clipShadows,dl.clippingPlanes=ll.clippingPlanes,dl.clipIntersection=ll.clipIntersection,dl.displacementMap=ll.displacementMap,dl.displacementScale=ll.displacementScale,dl.displacementBias=ll.displacementBias,dl.wireframeLinewidth=ll.wireframeLinewidth,dl.linewidth=ll.linewidth,!0===cl.isPointLight&&!0===dl.isMeshDistanceMaterial){F.properties.get(dl).light=cl}return dl}function renderObject(ll,hl,dl,pl,fl){if(!1===ll.visible)return;if(ll.layers.test(hl.layers)&&(ll.isMesh||ll.isLine||ll.isPoints)&&(ll.castShadow||ll.receiveShadow&&3===fl)&&(!ll.frustumCulled||cl.intersectsObject(ll))){ll.modelViewMatrix.multiplyMatrices(dl.matrixWorldInverse,ll.matrixWorld);const cl=Da.update(ll),Al=ll.material;if(Array.isArray(Al)){const Da=cl.groups;for(let bl=0,kl=Da.length;bl<kl;bl++){const kl=Da[bl],Dl=Al[kl.materialIndex];if(Dl&&Dl.visible){const Da=getDepthMaterial(ll,Dl,pl,fl);ll.onBeforeShadow(F,ll,hl,dl,cl,Da,kl),F.renderBufferDirect(dl,null,cl,Da,ll,kl),ll.onAfterShadow(F,ll,hl,dl,cl,Da,kl)}}}else if(Al.visible){const Da=getDepthMaterial(ll,Al,pl,fl);ll.onBeforeShadow(F,ll,hl,dl,cl,Da,null),F.renderBufferDirect(dl,null,cl,Da,ll,null),ll.onAfterShadow(F,ll,hl,dl,cl,Da,null)}}const Al=ll.children;for(let F=0,Da=Al.length;F<Da;F++)renderObject(Al[F],hl,dl,pl,fl)}function onMaterialDispose(F){F.target.removeEventListener("dispose",onMaterialDispose);for(const Da in Wl){const ll=Wl[Da],cl=F.target.uuid;if(cl in ll){ll[cl].dispose(),delete ll[cl]}}}this.render=function(Da,ll,hl){if(!1===cu.enabled)return;if(!1===cu.autoUpdate&&!1===cu.needsUpdate)return;if(0===Da.length)return;const dl=F.getRenderTarget(),pl=F.getActiveCubeFace(),kl=F.getActiveMipmapLevel(),Dl=F.state;Dl.setBlending(0),Dl.buffers.color.setClear(1,1,1,1),Dl.buffers.depth.setTest(!0),Dl.setScissorTest(!1);const Wl=3!==uu&&3===this.type,wc=3===uu&&3!==this.type;for(let Sc=0,eu=Da.length;Sc<eu;Sc++){const dl=Da[Sc],pl=dl.shadow;if(void 0===pl){console.warn("THREE.WebGLShadowMap:",dl,"has no shadow.");continue}if(!1===pl.autoUpdate&&!1===pl.needsUpdate)continue;fl.copy(pl.mapSize);const kl=pl.getFrameExtents();if(fl.multiply(kl),Al.copy(pl.mapSize),(fl.x>Ql||fl.y>Ql)&&(fl.x>Ql&&(Al.x=Math.floor(Ql/kl.x),fl.x=Al.x*kl.x,pl.mapSize.x=Al.x),fl.y>Ql&&(Al.y=Math.floor(Ql/kl.y),fl.y=Al.y*kl.y,pl.mapSize.y=Al.y)),null===pl.map||!0===Wl||!0===wc){const F=3!==this.type?{minFilter:rd,magFilter:rd}:{};null!==pl.map&&pl.map.dispose(),pl.map=new WebGLRenderTarget(fl.x,fl.y,F),pl.map.texture.name=dl.name+".shadowMap",pl.camera.updateProjectionMatrix()}F.setRenderTarget(pl.map),F.clear();const eu=pl.getViewportCount();for(let F=0;F<eu;F++){const Da=pl.getViewport(F);bl.set(Al.x*Da.x,Al.y*Da.y,Al.x*Da.z,Al.y*Da.w),Dl.viewport(bl),pl.updateMatrices(dl,F),cl=pl.getFrustum(),renderObject(ll,hl,pl.camera,dl,this.type)}!0!==pl.isPointLightShadow&&3===this.type&&VSMPass(pl,hl),pl.needsUpdate=!1}uu=this.type,cu.needsUpdate=!1,F.setRenderTarget(dl,pl,kl)}}function WebGLState(F){const Da=new function(){let Da=!1;const ll=new Vector4;let cl=null;const hl=new Vector4(0,0,0,0);return{setMask:function(ll){cl===ll||Da||(F.colorMask(ll,ll,ll,ll),cl=ll)},setLocked:function(F){Da=F},setClear:function(Da,cl,dl,pl,fl){!0===fl&&(Da*=pl,cl*=pl,dl*=pl),ll.set(Da,cl,dl,pl),!1===hl.equals(ll)&&(F.clearColor(Da,cl,dl,pl),hl.copy(ll))},reset:function(){Da=!1,cl=null,hl.set(-1,0,0,0)}}},ll=new function(){let Da=!1,ll=null,cl=null,hl=null;return{setTest:function(Da){Da?enable(F.DEPTH_TEST):disable(F.DEPTH_TEST)},setMask:function(cl){ll===cl||Da||(F.depthMask(cl),ll=cl)},setFunc:function(Da){if(cl!==Da){switch(Da){case 0:F.depthFunc(F.NEVER);break;case 1:F.depthFunc(F.ALWAYS);break;case 2:F.depthFunc(F.LESS);break;case 3:default:F.depthFunc(F.LEQUAL);break;case 4:F.depthFunc(F.EQUAL);break;case 5:F.depthFunc(F.GEQUAL);break;case 6:F.depthFunc(F.GREATER);break;case 7:F.depthFunc(F.NOTEQUAL)}cl=Da}},setLocked:function(F){Da=F},setClear:function(Da){hl!==Da&&(F.clearDepth(Da),hl=Da)},reset:function(){Da=!1,ll=null,cl=null,hl=null}}},cl=new function(){let Da=!1,ll=null,cl=null,hl=null,dl=null,pl=null,fl=null,Al=null,bl=null;return{setTest:function(ll){Da||(ll?enable(F.STENCIL_TEST):disable(F.STENCIL_TEST))},setMask:function(cl){ll===cl||Da||(F.stencilMask(cl),ll=cl)},setFunc:function(Da,ll,pl){cl===Da&&hl===ll&&dl===pl||(F.stencilFunc(Da,ll,pl),cl=Da,hl=ll,dl=pl)},setOp:function(Da,ll,cl){pl===Da&&fl===ll&&Al===cl||(F.stencilOp(Da,ll,cl),pl=Da,fl=ll,Al=cl)},setLocked:function(F){Da=F},setClear:function(Da){bl!==Da&&(F.clearStencil(Da),bl=Da)},reset:function(){Da=!1,ll=null,cl=null,hl=null,dl=null,pl=null,fl=null,Al=null,bl=null}}},hl=new WeakMap,dl=new WeakMap;let pl={},Nu={},qu=new WeakMap,ih=[],gh=null,ed=!1,td=null,id=null,nd=null,rd=null,ad=null,sd=null,od=null,ld=new Color(0,0,0),cd=0,ud=!1,hd=null,dd=null,pd=null,md=null,fd=null;const gd=F.getParameter(F.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Ad=!1,yd=0;const vd=F.getParameter(F.VERSION);-1!==vd.indexOf("WebGL")?(yd=parseFloat(/^WebGL (\d)/.exec(vd)[1]),Ad=yd>=1):-1!==vd.indexOf("OpenGL ES")&&(yd=parseFloat(/^OpenGL ES (\d)/.exec(vd)[1]),Ad=yd>=2);let _d=null,xd={};const bd=F.getParameter(F.SCISSOR_BOX),wd=F.getParameter(F.VIEWPORT),Ed=(new Vector4).fromArray(bd),Md=(new Vector4).fromArray(wd);function createTexture(Da,ll,cl,hl){const dl=new Uint8Array(4),pl=F.createTexture();F.bindTexture(Da,pl),F.texParameteri(Da,F.TEXTURE_MIN_FILTER,F.NEAREST),F.texParameteri(Da,F.TEXTURE_MAG_FILTER,F.NEAREST);for(let fl=0;fl<cl;fl++)Da===F.TEXTURE_3D||Da===F.TEXTURE_2D_ARRAY?F.texImage3D(ll,0,F.RGBA,1,1,hl,0,F.RGBA,F.UNSIGNED_BYTE,dl):F.texImage2D(ll+fl,0,F.RGBA,1,1,0,F.RGBA,F.UNSIGNED_BYTE,dl);return pl}const Sd={};function enable(Da){!0!==pl[Da]&&(F.enable(Da),pl[Da]=!0)}function disable(Da){!1!==pl[Da]&&(F.disable(Da),pl[Da]=!1)}Sd[F.TEXTURE_2D]=createTexture(F.TEXTURE_2D,F.TEXTURE_2D,1),Sd[F.TEXTURE_CUBE_MAP]=createTexture(F.TEXTURE_CUBE_MAP,F.TEXTURE_CUBE_MAP_POSITIVE_X,6),Sd[F.TEXTURE_2D_ARRAY]=createTexture(F.TEXTURE_2D_ARRAY,F.TEXTURE_2D_ARRAY,1,1),Sd[F.TEXTURE_3D]=createTexture(F.TEXTURE_3D,F.TEXTURE_3D,1,1),Da.setClear(0,0,0,1),ll.setClear(1),cl.setClear(0),enable(F.DEPTH_TEST),ll.setFunc(3),setFlipSided(!1),setCullFace(1),enable(F.CULL_FACE),setBlending(0);const kd={[fl]:F.FUNC_ADD,[Al]:F.FUNC_SUBTRACT,[bl]:F.FUNC_REVERSE_SUBTRACT};kd[103]=F.MIN,kd[104]=F.MAX;const Td={[kl]:F.ZERO,[Dl]:F.ONE,[Wl]:F.SRC_COLOR,[wc]:F.SRC_ALPHA,[uu]:F.SRC_ALPHA_SATURATE,[su]:F.DST_COLOR,[eu]:F.DST_ALPHA,[Ql]:F.ONE_MINUS_SRC_COLOR,[Sc]:F.ONE_MINUS_SRC_ALPHA,[cu]:F.ONE_MINUS_DST_COLOR,[iu]:F.ONE_MINUS_DST_ALPHA,[hu]:F.CONSTANT_COLOR,[Lu]:F.ONE_MINUS_CONSTANT_COLOR,[zu]:F.CONSTANT_ALPHA,[Du]:F.ONE_MINUS_CONSTANT_ALPHA};function setBlending(Da,ll,cl,hl,dl,pl,Al,bl,kl,Dl){if(0!==Da){if(!1===ed&&(enable(F.BLEND),ed=!0),5===Da)dl=dl||ll,pl=pl||cl,Al=Al||hl,ll===id&&dl===ad||(F.blendEquationSeparate(kd[ll],kd[dl]),id=ll,ad=dl),cl===nd&&hl===rd&&pl===sd&&Al===od||(F.blendFuncSeparate(Td[cl],Td[hl],Td[pl],Td[Al]),nd=cl,rd=hl,sd=pl,od=Al),!1!==bl.equals(ld)&&kl===cd||(F.blendColor(bl.r,bl.g,bl.b,kl),ld.copy(bl),cd=kl),td=Da,ud=!1;else if(Da!==td||Dl!==ud){if(id===fl&&ad===fl||(F.blendEquation(F.FUNC_ADD),id=fl,ad=fl),Dl)switch(Da){case 1:F.blendFuncSeparate(F.ONE,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA);break;case 2:F.blendFunc(F.ONE,F.ONE);break;case 3:F.blendFuncSeparate(F.ZERO,F.ONE_MINUS_SRC_COLOR,F.ZERO,F.ONE);break;case 4:F.blendFuncSeparate(F.ZERO,F.SRC_COLOR,F.ZERO,F.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",Da)}else switch(Da){case 1:F.blendFuncSeparate(F.SRC_ALPHA,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA);break;case 2:F.blendFunc(F.SRC_ALPHA,F.ONE);break;case 3:F.blendFuncSeparate(F.ZERO,F.ONE_MINUS_SRC_COLOR,F.ZERO,F.ONE);break;case 4:F.blendFunc(F.ZERO,F.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",Da)}nd=null,rd=null,sd=null,od=null,ld.set(0,0,0),cd=0,td=Da,ud=Dl}}else!0===ed&&(disable(F.BLEND),ed=!1)}function setFlipSided(Da){hd!==Da&&(Da?F.frontFace(F.CW):F.frontFace(F.CCW),hd=Da)}function setCullFace(Da){0!==Da?(enable(F.CULL_FACE),Da!==dd&&(1===Da?F.cullFace(F.BACK):2===Da?F.cullFace(F.FRONT):F.cullFace(F.FRONT_AND_BACK))):disable(F.CULL_FACE),dd=Da}function setPolygonOffset(Da,ll,cl){Da?(enable(F.POLYGON_OFFSET_FILL),md===ll&&fd===cl||(F.polygonOffset(ll,cl),md=ll,fd=cl)):disable(F.POLYGON_OFFSET_FILL)}return{buffers:{color:Da,depth:ll,stencil:cl},enable:enable,disable:disable,bindFramebuffer:function(Da,ll){return Nu[Da]!==ll&&(F.bindFramebuffer(Da,ll),Nu[Da]=ll,Da===F.DRAW_FRAMEBUFFER&&(Nu[F.FRAMEBUFFER]=ll),Da===F.FRAMEBUFFER&&(Nu[F.DRAW_FRAMEBUFFER]=ll),!0)},drawBuffers:function(Da,ll){let cl=ih,hl=!1;if(Da){cl=qu.get(ll),void 0===cl&&(cl=[],qu.set(ll,cl));const dl=Da.textures;if(cl.length!==dl.length||cl[0]!==F.COLOR_ATTACHMENT0){for(let Da=0,ll=dl.length;Da<ll;Da++)cl[Da]=F.COLOR_ATTACHMENT0+Da;cl.length=dl.length,hl=!0}}else cl[0]!==F.BACK&&(cl[0]=F.BACK,hl=!0);hl&&F.drawBuffers(cl)},useProgram:function(Da){return gh!==Da&&(F.useProgram(Da),gh=Da,!0)},setBlending:setBlending,setMaterial:function(hl,dl){2===hl.side?disable(F.CULL_FACE):enable(F.CULL_FACE);let pl=1===hl.side;dl&&(pl=!pl),setFlipSided(pl),1===hl.blending&&!1===hl.transparent?setBlending(0):setBlending(hl.blending,hl.blendEquation,hl.blendSrc,hl.blendDst,hl.blendEquationAlpha,hl.blendSrcAlpha,hl.blendDstAlpha,hl.blendColor,hl.blendAlpha,hl.premultipliedAlpha),ll.setFunc(hl.depthFunc),ll.setTest(hl.depthTest),ll.setMask(hl.depthWrite),Da.setMask(hl.colorWrite);const fl=hl.stencilWrite;cl.setTest(fl),fl&&(cl.setMask(hl.stencilWriteMask),cl.setFunc(hl.stencilFunc,hl.stencilRef,hl.stencilFuncMask),cl.setOp(hl.stencilFail,hl.stencilZFail,hl.stencilZPass)),setPolygonOffset(hl.polygonOffset,hl.polygonOffsetFactor,hl.polygonOffsetUnits),!0===hl.alphaToCoverage?enable(F.SAMPLE_ALPHA_TO_COVERAGE):disable(F.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:setFlipSided,setCullFace:setCullFace,setLineWidth:function(Da){Da!==pd&&(Ad&&F.lineWidth(Da),pd=Da)},setPolygonOffset:setPolygonOffset,setScissorTest:function(Da){Da?enable(F.SCISSOR_TEST):disable(F.SCISSOR_TEST)},activeTexture:function(Da){void 0===Da&&(Da=F.TEXTURE0+gd-1),_d!==Da&&(F.activeTexture(Da),_d=Da)},bindTexture:function(Da,ll,cl){void 0===cl&&(cl=null===_d?F.TEXTURE0+gd-1:_d);let hl=xd[cl];void 0===hl&&(hl={type:void 0,texture:void 0},xd[cl]=hl),hl.type===Da&&hl.texture===ll||(_d!==cl&&(F.activeTexture(cl),_d=cl),F.bindTexture(Da,ll||Sd[Da]),hl.type=Da,hl.texture=ll)},unbindTexture:function(){const Da=xd[_d];void 0!==Da&&void 0!==Da.type&&(F.bindTexture(Da.type,null),Da.type=void 0,Da.texture=void 0)},compressedTexImage2D:function(){try{F.compressedTexImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexImage3D:function(){try{F.compressedTexImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texImage2D:function(){try{F.texImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texImage3D:function(){try{F.texImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},updateUBOMapping:function(Da,ll){let cl=dl.get(ll);void 0===cl&&(cl=new WeakMap,dl.set(ll,cl));let hl=cl.get(Da);void 0===hl&&(hl=F.getUniformBlockIndex(ll,Da.name),cl.set(Da,hl))},uniformBlockBinding:function(Da,ll){const cl=dl.get(ll).get(Da);hl.get(ll)!==cl&&(F.uniformBlockBinding(ll,cl,Da.__bindingPointIndex),hl.set(ll,cl))},texStorage2D:function(){try{F.texStorage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texStorage3D:function(){try{F.texStorage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texSubImage2D:function(){try{F.texSubImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texSubImage3D:function(){try{F.texSubImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexSubImage2D:function(){try{F.compressedTexSubImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexSubImage3D:function(){try{F.compressedTexSubImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},scissor:function(Da){!1===Ed.equals(Da)&&(F.scissor(Da.x,Da.y,Da.z,Da.w),Ed.copy(Da))},viewport:function(Da){!1===Md.equals(Da)&&(F.viewport(Da.x,Da.y,Da.z,Da.w),Md.copy(Da))},reset:function(){F.disable(F.BLEND),F.disable(F.CULL_FACE),F.disable(F.DEPTH_TEST),F.disable(F.POLYGON_OFFSET_FILL),F.disable(F.SCISSOR_TEST),F.disable(F.STENCIL_TEST),F.disable(F.SAMPLE_ALPHA_TO_COVERAGE),F.blendEquation(F.FUNC_ADD),F.blendFunc(F.ONE,F.ZERO),F.blendFuncSeparate(F.ONE,F.ZERO,F.ONE,F.ZERO),F.blendColor(0,0,0,0),F.colorMask(!0,!0,!0,!0),F.clearColor(0,0,0,0),F.depthMask(!0),F.depthFunc(F.LESS),F.clearDepth(1),F.stencilMask(4294967295),F.stencilFunc(F.ALWAYS,0,4294967295),F.stencilOp(F.KEEP,F.KEEP,F.KEEP),F.clearStencil(0),F.cullFace(F.BACK),F.frontFace(F.CCW),F.polygonOffset(0,0),F.activeTexture(F.TEXTURE0),F.bindFramebuffer(F.FRAMEBUFFER,null),F.bindFramebuffer(F.DRAW_FRAMEBUFFER,null),F.bindFramebuffer(F.READ_FRAMEBUFFER,null),F.useProgram(null),F.lineWidth(1),F.scissor(0,0,F.canvas.width,F.canvas.height),F.viewport(0,0,F.canvas.width,F.canvas.height),pl={},_d=null,xd={},Nu={},qu=new WeakMap,ih=[],gh=null,ed=!1,td=null,id=null,nd=null,rd=null,ad=null,sd=null,od=null,ld=new Color(0,0,0),cd=0,ud=!1,hd=null,dd=null,pd=null,md=null,fd=null,Ed.set(0,0,F.canvas.width,F.canvas.height),Md.set(0,0,F.canvas.width,F.canvas.height),Da.reset(),ll.reset(),cl.reset()}}}function getByteLength(F,Da,ll,cl){const hl=function(F){switch(F){case ud:case hd:return{byteLength:1,components:1};case pd:case dd:case Ad:return{byteLength:2,components:1};case yd:case vd:return{byteLength:2,components:4};case fd:case md:case gd:return{byteLength:4,components:1};case xd:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${F}.`)}(cl);switch(ll){case 1021:case 1024:return F*Da;case 1025:return F*Da*2;case Md:case Sd:return F*Da/hl.components*hl.byteLength;case 1030:case kd:return F*Da*2/hl.components*hl.byteLength;case 1022:return F*Da*3/hl.components*hl.byteLength;case bd:case Td:return F*Da*4/hl.components*hl.byteLength;case Id:case Cd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*8;case Ld:case zd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*16;case Dd:case Nd:return Math.max(F,16)*Math.max(Da,8)/4;case Pd:case Rd:return Math.max(F,8)*Math.max(Da,8)/2;case Ud:case Bd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*8;case Od:case Fd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*16;case jd:return Math.floor((F+4)/5)*Math.floor((Da+3)/4)*16;case Vd:return Math.floor((F+4)/5)*Math.floor((Da+4)/5)*16;case Gd:return Math.floor((F+5)/6)*Math.floor((Da+4)/5)*16;case Hd:return Math.floor((F+5)/6)*Math.floor((Da+5)/6)*16;case qd:return Math.floor((F+7)/8)*Math.floor((Da+4)/5)*16;case Zd:return Math.floor((F+7)/8)*Math.floor((Da+5)/6)*16;case Wd:return Math.floor((F+7)/8)*Math.floor((Da+7)/8)*16;case Kd:return Math.floor((F+9)/10)*Math.floor((Da+4)/5)*16;case Qd:return Math.floor((F+9)/10)*Math.floor((Da+5)/6)*16;case Xd:return Math.floor((F+9)/10)*Math.floor((Da+7)/8)*16;case Yd:return Math.floor((F+9)/10)*Math.floor((Da+9)/10)*16;case Jd:return Math.floor((F+11)/12)*Math.floor((Da+9)/10)*16;case $d:return Math.floor((F+11)/12)*Math.floor((Da+11)/12)*16;case lp:case mp:case gp:return Math.ceil(F/4)*Math.ceil(Da/4)*16;case 36283:case Ap:return Math.ceil(F/4)*Math.ceil(Da/4)*8;case vp:case _p:return Math.ceil(F/4)*Math.ceil(Da/4)*16}throw new Error(`Unable to determine texture byte length for ${ll} format.`)}function WebGLTextures(F,Da,ll,cl,hl,dl,pl){const fl=Da.has("WEBGL_multisampled_render_to_texture")?Da.get("WEBGL_multisampled_render_to_texture"):null,Al="undefined"!==typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),bl=new Vector2,kl=new WeakMap;let Dl;const Wl=new WeakMap;let Ql=!1;try{Ql="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(uu){}function createCanvas(F,Da){return Ql?new OffscreenCanvas(F,Da):createElementNS("canvas")}function resizeImage(F,Da,ll){let cl=1;const hl=getDimensions(F);if((hl.width>ll||hl.height>ll)&&(cl=ll/Math.max(hl.width,hl.height)),cl<1){if("undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap||"undefined"!==typeof VideoFrame&&F instanceof VideoFrame){const ll=Math.floor(cl*hl.width),dl=Math.floor(cl*hl.height);void 0===Dl&&(Dl=createCanvas(ll,dl));const pl=Da?createCanvas(ll,dl):Dl;pl.width=ll,pl.height=dl;return pl.getContext("2d").drawImage(F,0,0,ll,dl),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+hl.width+"x"+hl.height+") to ("+ll+"x"+dl+")."),pl}return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+hl.width+"x"+hl.height+")."),F}return F}function textureNeedsGenerateMipmaps(F){return F.generateMipmaps&&F.minFilter!==rd&&F.minFilter!==od}function generateMipmap(Da){F.generateMipmap(Da)}function getInternalFormat(ll,cl,hl,dl,pl){if(void 0===pl&&(pl=!1),null!==ll){if(void 0!==F[ll])return F[ll];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ll+"'")}let fl=cl;if(cl===F.RED&&(hl===F.FLOAT&&(fl=F.R32F),hl===F.HALF_FLOAT&&(fl=F.R16F),hl===F.UNSIGNED_BYTE&&(fl=F.R8)),cl===F.RED_INTEGER&&(hl===F.UNSIGNED_BYTE&&(fl=F.R8UI),hl===F.UNSIGNED_SHORT&&(fl=F.R16UI),hl===F.UNSIGNED_INT&&(fl=F.R32UI),hl===F.BYTE&&(fl=F.R8I),hl===F.SHORT&&(fl=F.R16I),hl===F.INT&&(fl=F.R32I)),cl===F.RG&&(hl===F.FLOAT&&(fl=F.RG32F),hl===F.HALF_FLOAT&&(fl=F.RG16F),hl===F.UNSIGNED_BYTE&&(fl=F.RG8)),cl===F.RG_INTEGER&&(hl===F.UNSIGNED_BYTE&&(fl=F.RG8UI),hl===F.UNSIGNED_SHORT&&(fl=F.RG16UI),hl===F.UNSIGNED_INT&&(fl=F.RG32UI),hl===F.BYTE&&(fl=F.RG8I),hl===F.SHORT&&(fl=F.RG16I),hl===F.INT&&(fl=F.RG32I)),cl===F.RGB&&hl===F.UNSIGNED_INT_5_9_9_9_REV&&(fl=F.RGB9_E5),cl===F.RGBA){const Da=pl?zp:sm.getTransfer(dl);hl===F.FLOAT&&(fl=F.RGBA32F),hl===F.HALF_FLOAT&&(fl=F.RGBA16F),hl===F.UNSIGNED_BYTE&&(fl=Da===Pp?F.SRGB8_ALPHA8:F.RGBA8),hl===F.UNSIGNED_SHORT_4_4_4_4&&(fl=F.RGBA4),hl===F.UNSIGNED_SHORT_5_5_5_1&&(fl=F.RGB5_A1)}return fl!==F.R16F&&fl!==F.R32F&&fl!==F.RG16F&&fl!==F.RG32F&&fl!==F.RGBA16F&&fl!==F.RGBA32F||Da.get("EXT_color_buffer_float"),fl}function getInternalDepthFormat(Da,ll){let cl;return Da?null===ll||ll===fd||ll===_d?cl=F.DEPTH24_STENCIL8:ll===gd?cl=F.DEPTH32F_STENCIL8:ll===pd&&(cl=F.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===ll||ll===fd||ll===_d?cl=F.DEPTH_COMPONENT24:ll===gd?cl=F.DEPTH_COMPONENT32F:ll===pd&&(cl=F.DEPTH_COMPONENT16),cl}function getMipLevels(F,Da){return!0===textureNeedsGenerateMipmaps(F)||F.isFramebufferTexture&&F.minFilter!==rd&&F.minFilter!==od?Math.log2(Math.max(Da.width,Da.height))+1:void 0!==F.mipmaps&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?Da.mipmaps.length:1}function onTextureDispose(F){const Da=F.target;Da.removeEventListener("dispose",onTextureDispose),function(F){const Da=cl.get(F);if(void 0===Da.__webglInit)return;const ll=F.source,hl=Wl.get(ll);if(hl){const cl=hl[Da.__cacheKey];cl.usedTimes--,0===cl.usedTimes&&deleteTexture(F),0===Object.keys(hl).length&&Wl.delete(ll)}cl.remove(F)}(Da),Da.isVideoTexture&&kl.delete(Da)}function onRenderTargetDispose(Da){const ll=Da.target;ll.removeEventListener("dispose",onRenderTargetDispose),function(Da){const ll=cl.get(Da);Da.depthTexture&&Da.depthTexture.dispose();if(Da.isWebGLCubeRenderTarget)for(let cl=0;cl<6;cl++){if(Array.isArray(ll.__webglFramebuffer[cl]))for(let Da=0;Da<ll.__webglFramebuffer[cl].length;Da++)F.deleteFramebuffer(ll.__webglFramebuffer[cl][Da]);else F.deleteFramebuffer(ll.__webglFramebuffer[cl]);ll.__webglDepthbuffer&&F.deleteRenderbuffer(ll.__webglDepthbuffer[cl])}else{if(Array.isArray(ll.__webglFramebuffer))for(let Da=0;Da<ll.__webglFramebuffer.length;Da++)F.deleteFramebuffer(ll.__webglFramebuffer[Da]);else F.deleteFramebuffer(ll.__webglFramebuffer);if(ll.__webglDepthbuffer&&F.deleteRenderbuffer(ll.__webglDepthbuffer),ll.__webglMultisampledFramebuffer&&F.deleteFramebuffer(ll.__webglMultisampledFramebuffer),ll.__webglColorRenderbuffer)for(let Da=0;Da<ll.__webglColorRenderbuffer.length;Da++)ll.__webglColorRenderbuffer[Da]&&F.deleteRenderbuffer(ll.__webglColorRenderbuffer[Da]);ll.__webglDepthRenderbuffer&&F.deleteRenderbuffer(ll.__webglDepthRenderbuffer)}const hl=Da.textures;for(let dl=0,fl=hl.length;dl<fl;dl++){const Da=cl.get(hl[dl]);Da.__webglTexture&&(F.deleteTexture(Da.__webglTexture),pl.memory.textures--),cl.remove(hl[dl])}cl.remove(Da)}(ll)}function deleteTexture(Da){const ll=cl.get(Da);F.deleteTexture(ll.__webglTexture);const hl=Da.source;delete Wl.get(hl)[ll.__cacheKey],pl.memory.textures--}let wc=0;function setTexture2D(Da,hl){const dl=cl.get(Da);if(Da.isVideoTexture&&function(F){const Da=pl.render.frame;kl.get(F)!==Da&&(kl.set(F,Da),F.update())}(Da),!1===Da.isRenderTargetTexture&&Da.version>0&&dl.__version!==Da.version){const F=Da.image;if(null===F)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==F.complete)return void uploadTexture(dl,Da,hl);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}ll.bindTexture(F.TEXTURE_2D,dl.__webglTexture,F.TEXTURE0+hl)}const Sc={[td]:F.REPEAT,[id]:F.CLAMP_TO_EDGE,[nd]:F.MIRRORED_REPEAT},eu={[rd]:F.NEAREST,[ad]:F.NEAREST_MIPMAP_NEAREST,[sd]:F.NEAREST_MIPMAP_LINEAR,[od]:F.LINEAR,[ld]:F.LINEAR_MIPMAP_NEAREST,[cd]:F.LINEAR_MIPMAP_LINEAR},iu={[Up]:F.NEVER,[Hp]:F.ALWAYS,[Bp]:F.LESS,[Fp]:F.LEQUAL,[Op]:F.EQUAL,[Gp]:F.GEQUAL,[jp]:F.GREATER,[Vp]:F.NOTEQUAL};function setTextureParameters(ll,dl){if(dl.type!==gd||!1!==Da.has("OES_texture_float_linear")||dl.magFilter!==od&&dl.magFilter!==ld&&dl.magFilter!==sd&&dl.magFilter!==cd&&dl.minFilter!==od&&dl.minFilter!==ld&&dl.minFilter!==sd&&dl.minFilter!==cd||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),F.texParameteri(ll,F.TEXTURE_WRAP_S,Sc[dl.wrapS]),F.texParameteri(ll,F.TEXTURE_WRAP_T,Sc[dl.wrapT]),ll!==F.TEXTURE_3D&&ll!==F.TEXTURE_2D_ARRAY||F.texParameteri(ll,F.TEXTURE_WRAP_R,Sc[dl.wrapR]),F.texParameteri(ll,F.TEXTURE_MAG_FILTER,eu[dl.magFilter]),F.texParameteri(ll,F.TEXTURE_MIN_FILTER,eu[dl.minFilter]),dl.compareFunction&&(F.texParameteri(ll,F.TEXTURE_COMPARE_MODE,F.COMPARE_REF_TO_TEXTURE),F.texParameteri(ll,F.TEXTURE_COMPARE_FUNC,iu[dl.compareFunction])),!0===Da.has("EXT_texture_filter_anisotropic")){if(dl.magFilter===rd)return;if(dl.minFilter!==sd&&dl.minFilter!==cd)return;if(dl.type===gd&&!1===Da.has("OES_texture_float_linear"))return;if(dl.anisotropy>1||cl.get(dl).__currentAnisotropy){const pl=Da.get("EXT_texture_filter_anisotropic");F.texParameterf(ll,pl.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(dl.anisotropy,hl.getMaxAnisotropy())),cl.get(dl).__currentAnisotropy=dl.anisotropy}}}function initTexture(Da,ll){let cl=!1;void 0===Da.__webglInit&&(Da.__webglInit=!0,ll.addEventListener("dispose",onTextureDispose));const hl=ll.source;let dl=Wl.get(hl);void 0===dl&&(dl={},Wl.set(hl,dl));const fl=function(F){const Da=[];return Da.push(F.wrapS),Da.push(F.wrapT),Da.push(F.wrapR||0),Da.push(F.magFilter),Da.push(F.minFilter),Da.push(F.anisotropy),Da.push(F.internalFormat),Da.push(F.format),Da.push(F.type),Da.push(F.generateMipmaps),Da.push(F.premultiplyAlpha),Da.push(F.flipY),Da.push(F.unpackAlignment),Da.push(F.colorSpace),Da.join()}(ll);if(fl!==Da.__cacheKey){void 0===dl[fl]&&(dl[fl]={texture:F.createTexture(),usedTimes:0},pl.memory.textures++,cl=!0),dl[fl].usedTimes++;const hl=dl[Da.__cacheKey];void 0!==hl&&(dl[Da.__cacheKey].usedTimes--,0===hl.usedTimes&&deleteTexture(ll)),Da.__cacheKey=fl,Da.__webglTexture=dl[fl].texture}return cl}function uploadTexture(Da,pl,fl){let Al=F.TEXTURE_2D;(pl.isDataArrayTexture||pl.isCompressedArrayTexture)&&(Al=F.TEXTURE_2D_ARRAY),pl.isData3DTexture&&(Al=F.TEXTURE_3D);const bl=initTexture(Da,pl),kl=pl.source;ll.bindTexture(Al,Da.__webglTexture,F.TEXTURE0+fl);const Dl=cl.get(kl);if(kl.version!==Dl.__version||!0===bl){ll.activeTexture(F.TEXTURE0+fl);const Da=sm.getPrimaries(sm.workingColorSpace),cl=pl.colorSpace===kp?null:sm.getPrimaries(pl.colorSpace),Wl=pl.colorSpace===kp||Da===cl?F.NONE:F.BROWSER_DEFAULT_WEBGL;F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,pl.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pl.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,pl.unpackAlignment),F.pixelStorei(F.UNPACK_COLORSPACE_CONVERSION_WEBGL,Wl);let Ql=resizeImage(pl.image,!1,hl.maxTextureSize);Ql=verifyColorSpace(pl,Ql);const wc=dl.convert(pl.format,pl.colorSpace),Sc=dl.convert(pl.type);let eu,iu=getInternalFormat(pl.internalFormat,wc,Sc,pl.colorSpace,pl.isVideoTexture);setTextureParameters(Al,pl);const su=pl.mipmaps,cu=!0!==pl.isVideoTexture,uu=void 0===Dl.__version||!0===bl,hu=kl.dataReady,Lu=getMipLevels(pl,Ql);if(pl.isDepthTexture)iu=getInternalDepthFormat(pl.format===Ed,pl.type),uu&&(cu?ll.texStorage2D(F.TEXTURE_2D,1,iu,Ql.width,Ql.height):ll.texImage2D(F.TEXTURE_2D,0,iu,Ql.width,Ql.height,0,wc,Sc,null));else if(pl.isDataTexture)if(su.length>0){cu&&uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,su[0].width,su[0].height);for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,Sc,eu.data):ll.texImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,wc,Sc,eu.data);pl.generateMipmaps=!1}else cu?(uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Ql.width,Ql.height),hu&&ll.texSubImage2D(F.TEXTURE_2D,0,0,0,Ql.width,Ql.height,wc,Sc,Ql.data)):ll.texImage2D(F.TEXTURE_2D,0,iu,Ql.width,Ql.height,0,wc,Sc,Ql.data);else if(pl.isCompressedTexture)if(pl.isCompressedArrayTexture){cu&&uu&&ll.texStorage3D(F.TEXTURE_2D_ARRAY,Lu,iu,su[0].width,su[0].height,Ql.depth);for(let Da=0,cl=su.length;Da<cl;Da++)if(eu=su[Da],pl.format!==bd)if(null!==wc)if(cu){if(hu)if(pl.layerUpdates.size>0){const cl=getByteLength(eu.width,eu.height,pl.format,pl.type);for(const hl of pl.layerUpdates){const dl=eu.data.subarray(hl*cl/eu.data.BYTES_PER_ELEMENT,(hl+1)*cl/eu.data.BYTES_PER_ELEMENT);ll.compressedTexSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,hl,eu.width,eu.height,1,wc,dl,0,0)}pl.clearLayerUpdates()}else ll.compressedTexSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,0,eu.width,eu.height,Ql.depth,wc,eu.data,0,0)}else ll.compressedTexImage3D(F.TEXTURE_2D_ARRAY,Da,iu,eu.width,eu.height,Ql.depth,0,eu.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else cu?hu&&ll.texSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,0,eu.width,eu.height,Ql.depth,wc,Sc,eu.data):ll.texImage3D(F.TEXTURE_2D_ARRAY,Da,iu,eu.width,eu.height,Ql.depth,0,wc,Sc,eu.data)}else{cu&&uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,su[0].width,su[0].height);for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],pl.format!==bd?null!==wc?cu?hu&&ll.compressedTexSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,eu.data):ll.compressedTexImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,eu.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,Sc,eu.data):ll.texImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,wc,Sc,eu.data)}else if(pl.isDataArrayTexture)if(cu){if(uu&&ll.texStorage3D(F.TEXTURE_2D_ARRAY,Lu,iu,Ql.width,Ql.height,Ql.depth),hu)if(pl.layerUpdates.size>0){const Da=getByteLength(Ql.width,Ql.height,pl.format,pl.type);for(const cl of pl.layerUpdates){const hl=Ql.data.subarray(cl*Da/Ql.data.BYTES_PER_ELEMENT,(cl+1)*Da/Ql.data.BYTES_PER_ELEMENT);ll.texSubImage3D(F.TEXTURE_2D_ARRAY,0,0,0,cl,Ql.width,Ql.height,1,wc,Sc,hl)}pl.clearLayerUpdates()}else ll.texSubImage3D(F.TEXTURE_2D_ARRAY,0,0,0,0,Ql.width,Ql.height,Ql.depth,wc,Sc,Ql.data)}else ll.texImage3D(F.TEXTURE_2D_ARRAY,0,iu,Ql.width,Ql.height,Ql.depth,0,wc,Sc,Ql.data);else if(pl.isData3DTexture)cu?(uu&&ll.texStorage3D(F.TEXTURE_3D,Lu,iu,Ql.width,Ql.height,Ql.depth),hu&&ll.texSubImage3D(F.TEXTURE_3D,0,0,0,0,Ql.width,Ql.height,Ql.depth,wc,Sc,Ql.data)):ll.texImage3D(F.TEXTURE_3D,0,iu,Ql.width,Ql.height,Ql.depth,0,wc,Sc,Ql.data);else if(pl.isFramebufferTexture){if(uu)if(cu)ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Ql.width,Ql.height);else{let Da=Ql.width,cl=Ql.height;for(let hl=0;hl<Lu;hl++)ll.texImage2D(F.TEXTURE_2D,hl,iu,Da,cl,0,wc,Sc,null),Da>>=1,cl>>=1}}else if(su.length>0){if(cu&&uu){const Da=getDimensions(su[0]);ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Da.width,Da.height)}for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,wc,Sc,eu):ll.texImage2D(F.TEXTURE_2D,Da,iu,wc,Sc,eu);pl.generateMipmaps=!1}else if(cu){if(uu){const Da=getDimensions(Ql);ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Da.width,Da.height)}hu&&ll.texSubImage2D(F.TEXTURE_2D,0,0,0,wc,Sc,Ql)}else ll.texImage2D(F.TEXTURE_2D,0,iu,wc,Sc,Ql);textureNeedsGenerateMipmaps(pl)&&generateMipmap(Al),Dl.__version=kl.version,pl.onUpdate&&pl.onUpdate(pl)}Da.__version=pl.version}function setupFrameBufferTexture(Da,hl,pl,Al,bl,kl){const Dl=dl.convert(pl.format,pl.colorSpace),Wl=dl.convert(pl.type),Ql=getInternalFormat(pl.internalFormat,Dl,Wl,pl.colorSpace);if(!cl.get(hl).__hasExternalTextures){const Da=Math.max(1,hl.width>>kl),cl=Math.max(1,hl.height>>kl);bl===F.TEXTURE_3D||bl===F.TEXTURE_2D_ARRAY?ll.texImage3D(bl,kl,Ql,Da,cl,hl.depth,0,Dl,Wl,null):ll.texImage2D(bl,kl,Ql,Da,cl,0,Dl,Wl,null)}ll.bindFramebuffer(F.FRAMEBUFFER,Da),useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,Al,bl,cl.get(pl).__webglTexture,0,getRenderTargetSamples(hl)):(bl===F.TEXTURE_2D||bl>=F.TEXTURE_CUBE_MAP_POSITIVE_X&&bl<=F.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&F.framebufferTexture2D(F.FRAMEBUFFER,Al,bl,cl.get(pl).__webglTexture,kl),ll.bindFramebuffer(F.FRAMEBUFFER,null)}function setupRenderBufferStorage(Da,ll,cl){if(F.bindRenderbuffer(F.RENDERBUFFER,Da),ll.depthBuffer){const hl=ll.depthTexture,dl=hl&&hl.isDepthTexture?hl.type:null,pl=getInternalDepthFormat(ll.stencilBuffer,dl),Al=ll.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,bl=getRenderTargetSamples(ll);useMultisampledRTT(ll)?fl.renderbufferStorageMultisampleEXT(F.RENDERBUFFER,bl,pl,ll.width,ll.height):cl?F.renderbufferStorageMultisample(F.RENDERBUFFER,bl,pl,ll.width,ll.height):F.renderbufferStorage(F.RENDERBUFFER,pl,ll.width,ll.height),F.framebufferRenderbuffer(F.FRAMEBUFFER,Al,F.RENDERBUFFER,Da)}else{const Da=ll.textures;for(let hl=0;hl<Da.length;hl++){const pl=Da[hl],Al=dl.convert(pl.format,pl.colorSpace),bl=dl.convert(pl.type),kl=getInternalFormat(pl.internalFormat,Al,bl,pl.colorSpace),Dl=getRenderTargetSamples(ll);cl&&!1===useMultisampledRTT(ll)?F.renderbufferStorageMultisample(F.RENDERBUFFER,Dl,kl,ll.width,ll.height):useMultisampledRTT(ll)?fl.renderbufferStorageMultisampleEXT(F.RENDERBUFFER,Dl,kl,ll.width,ll.height):F.renderbufferStorage(F.RENDERBUFFER,kl,ll.width,ll.height)}}F.bindRenderbuffer(F.RENDERBUFFER,null)}function setupDepthRenderbuffer(Da){const hl=cl.get(Da),dl=!0===Da.isWebGLCubeRenderTarget;if(hl.__boundDepthTexture!==Da.depthTexture){const F=Da.depthTexture;if(hl.__depthDisposeCallback&&hl.__depthDisposeCallback(),F){const disposeEvent=()=>{delete hl.__boundDepthTexture,delete hl.__depthDisposeCallback,F.removeEventListener("dispose",disposeEvent)};F.addEventListener("dispose",disposeEvent),hl.__depthDisposeCallback=disposeEvent}hl.__boundDepthTexture=F}if(Da.depthTexture&&!hl.__autoAllocateDepthBuffer){if(dl)throw new Error("target.depthTexture not supported in Cube render targets");!function(Da,hl){if(hl&&hl.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(ll.bindFramebuffer(F.FRAMEBUFFER,Da),!hl.depthTexture||!hl.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");cl.get(hl.depthTexture).__webglTexture&&hl.depthTexture.image.width===hl.width&&hl.depthTexture.image.height===hl.height||(hl.depthTexture.image.width=hl.width,hl.depthTexture.image.height=hl.height,hl.depthTexture.needsUpdate=!0),setTexture2D(hl.depthTexture,0);const dl=cl.get(hl.depthTexture).__webglTexture,pl=getRenderTargetSamples(hl);if(hl.depthTexture.format===wd)useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,F.DEPTH_ATTACHMENT,F.TEXTURE_2D,dl,0,pl):F.framebufferTexture2D(F.FRAMEBUFFER,F.DEPTH_ATTACHMENT,F.TEXTURE_2D,dl,0);else{if(hl.depthTexture.format!==Ed)throw new Error("Unknown depthTexture format");useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,F.DEPTH_STENCIL_ATTACHMENT,F.TEXTURE_2D,dl,0,pl):F.framebufferTexture2D(F.FRAMEBUFFER,F.DEPTH_STENCIL_ATTACHMENT,F.TEXTURE_2D,dl,0)}}(hl.__webglFramebuffer,Da)}else if(dl){hl.__webglDepthbuffer=[];for(let cl=0;cl<6;cl++)if(ll.bindFramebuffer(F.FRAMEBUFFER,hl.__webglFramebuffer[cl]),void 0===hl.__webglDepthbuffer[cl])hl.__webglDepthbuffer[cl]=F.createRenderbuffer(),setupRenderBufferStorage(hl.__webglDepthbuffer[cl],Da,!1);else{const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,dl=hl.__webglDepthbuffer[cl];F.bindRenderbuffer(F.RENDERBUFFER,dl),F.framebufferRenderbuffer(F.FRAMEBUFFER,ll,F.RENDERBUFFER,dl)}}else if(ll.bindFramebuffer(F.FRAMEBUFFER,hl.__webglFramebuffer),void 0===hl.__webglDepthbuffer)hl.__webglDepthbuffer=F.createRenderbuffer(),setupRenderBufferStorage(hl.__webglDepthbuffer,Da,!1);else{const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,cl=hl.__webglDepthbuffer;F.bindRenderbuffer(F.RENDERBUFFER,cl),F.framebufferRenderbuffer(F.FRAMEBUFFER,ll,F.RENDERBUFFER,cl)}ll.bindFramebuffer(F.FRAMEBUFFER,null)}const su=[],cu=[];function getRenderTargetSamples(F){return Math.min(hl.maxSamples,F.samples)}function useMultisampledRTT(F){const ll=cl.get(F);return F.samples>0&&!0===Da.has("WEBGL_multisampled_render_to_texture")&&!1!==ll.__useRenderToTexture}function verifyColorSpace(F,Da){const ll=F.colorSpace,cl=F.format,hl=F.type;return!0===F.isCompressedTexture||!0===F.isVideoTexture||ll!==Ip&&ll!==kp&&(sm.getTransfer(ll)===Pp?cl===bd&&hl===ud||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ll)),Da}function getDimensions(F){return"undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement?(bl.width=F.naturalWidth||F.width,bl.height=F.naturalHeight||F.height):"undefined"!==typeof VideoFrame&&F instanceof VideoFrame?(bl.width=F.displayWidth,bl.height=F.displayHeight):(bl.width=F.width,bl.height=F.height),bl}this.allocateTextureUnit=function(){const F=wc;return F>=hl.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+hl.maxTextures),wc+=1,F},this.resetTextureUnits=function(){wc=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function(Da,hl){const dl=cl.get(Da);Da.version>0&&dl.__version!==Da.version?uploadTexture(dl,Da,hl):ll.bindTexture(F.TEXTURE_2D_ARRAY,dl.__webglTexture,F.TEXTURE0+hl)},this.setTexture3D=function(Da,hl){const dl=cl.get(Da);Da.version>0&&dl.__version!==Da.version?uploadTexture(dl,Da,hl):ll.bindTexture(F.TEXTURE_3D,dl.__webglTexture,F.TEXTURE0+hl)},this.setTextureCube=function(Da,pl){const fl=cl.get(Da);Da.version>0&&fl.__version!==Da.version?function(Da,pl,fl){if(6!==pl.image.length)return;const Al=initTexture(Da,pl),bl=pl.source;ll.bindTexture(F.TEXTURE_CUBE_MAP,Da.__webglTexture,F.TEXTURE0+fl);const kl=cl.get(bl);if(bl.version!==kl.__version||!0===Al){ll.activeTexture(F.TEXTURE0+fl);const Da=sm.getPrimaries(sm.workingColorSpace),cl=pl.colorSpace===kp?null:sm.getPrimaries(pl.colorSpace),Dl=pl.colorSpace===kp||Da===cl?F.NONE:F.BROWSER_DEFAULT_WEBGL;F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,pl.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pl.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,pl.unpackAlignment),F.pixelStorei(F.UNPACK_COLORSPACE_CONVERSION_WEBGL,Dl);const Wl=pl.isCompressedTexture||pl.image[0].isCompressedTexture,Ql=pl.image[0]&&pl.image[0].isDataTexture,wc=[];for(let F=0;F<6;F++)wc[F]=Wl||Ql?Ql?pl.image[F].image:pl.image[F]:resizeImage(pl.image[F],!0,hl.maxCubemapSize),wc[F]=verifyColorSpace(pl,wc[F]);const Sc=wc[0],eu=dl.convert(pl.format,pl.colorSpace),iu=dl.convert(pl.type),su=getInternalFormat(pl.internalFormat,eu,iu,pl.colorSpace),cu=!0!==pl.isVideoTexture,uu=void 0===kl.__version||!0===Al,hu=bl.dataReady;let Lu,zu=getMipLevels(pl,Sc);if(setTextureParameters(F.TEXTURE_CUBE_MAP,pl),Wl){cu&&uu&&ll.texStorage2D(F.TEXTURE_CUBE_MAP,zu,su,Sc.width,Sc.height);for(let Da=0;Da<6;Da++){Lu=wc[Da].mipmaps;for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl];pl.format!==bd?null!==eu?cu?hu&&ll.compressedTexSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,0,0,hl.width,hl.height,eu,hl.data):ll.compressedTexImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,su,hl.width,hl.height,0,hl.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,0,0,hl.width,hl.height,eu,iu,hl.data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,su,hl.width,hl.height,0,eu,iu,hl.data)}}}else{if(Lu=pl.mipmaps,cu&&uu){Lu.length>0&&zu++;const Da=getDimensions(wc[0]);ll.texStorage2D(F.TEXTURE_CUBE_MAP,zu,su,Da.width,Da.height)}for(let Da=0;Da<6;Da++)if(Ql){cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,0,0,wc[Da].width,wc[Da].height,eu,iu,wc[Da].data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,su,wc[Da].width,wc[Da].height,0,eu,iu,wc[Da].data);for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl].image[Da].image;cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,0,0,hl.width,hl.height,eu,iu,hl.data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,su,hl.width,hl.height,0,eu,iu,hl.data)}}else{cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,0,0,eu,iu,wc[Da]):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,su,eu,iu,wc[Da]);for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl];cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,0,0,eu,iu,hl.image[Da]):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,su,eu,iu,hl.image[Da])}}}textureNeedsGenerateMipmaps(pl)&&generateMipmap(F.TEXTURE_CUBE_MAP),kl.__version=bl.version,pl.onUpdate&&pl.onUpdate(pl)}Da.__version=pl.version}(fl,Da,pl):ll.bindTexture(F.TEXTURE_CUBE_MAP,fl.__webglTexture,F.TEXTURE0+pl)},this.rebindTextures=function(Da,ll,hl){const dl=cl.get(Da);void 0!==ll&&setupFrameBufferTexture(dl.__webglFramebuffer,Da,Da.texture,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,0),void 0!==hl&&setupDepthRenderbuffer(Da)},this.setupRenderTarget=function(Da){const hl=Da.texture,fl=cl.get(Da),Al=cl.get(hl);Da.addEventListener("dispose",onRenderTargetDispose);const bl=Da.textures,kl=!0===Da.isWebGLCubeRenderTarget,Dl=bl.length>1;if(Dl||(void 0===Al.__webglTexture&&(Al.__webglTexture=F.createTexture()),Al.__version=hl.version,pl.memory.textures++),kl){fl.__webglFramebuffer=[];for(let Da=0;Da<6;Da++)if(hl.mipmaps&&hl.mipmaps.length>0){fl.__webglFramebuffer[Da]=[];for(let ll=0;ll<hl.mipmaps.length;ll++)fl.__webglFramebuffer[Da][ll]=F.createFramebuffer()}else fl.__webglFramebuffer[Da]=F.createFramebuffer()}else{if(hl.mipmaps&&hl.mipmaps.length>0){fl.__webglFramebuffer=[];for(let Da=0;Da<hl.mipmaps.length;Da++)fl.__webglFramebuffer[Da]=F.createFramebuffer()}else fl.__webglFramebuffer=F.createFramebuffer();if(Dl)for(let Da=0,ll=bl.length;Da<ll;Da++){const ll=cl.get(bl[Da]);void 0===ll.__webglTexture&&(ll.__webglTexture=F.createTexture(),pl.memory.textures++)}if(Da.samples>0&&!1===useMultisampledRTT(Da)){fl.__webglMultisampledFramebuffer=F.createFramebuffer(),fl.__webglColorRenderbuffer=[],ll.bindFramebuffer(F.FRAMEBUFFER,fl.__webglMultisampledFramebuffer);for(let ll=0;ll<bl.length;ll++){const cl=bl[ll];fl.__webglColorRenderbuffer[ll]=F.createRenderbuffer(),F.bindRenderbuffer(F.RENDERBUFFER,fl.__webglColorRenderbuffer[ll]);const hl=dl.convert(cl.format,cl.colorSpace),pl=dl.convert(cl.type),Al=getInternalFormat(cl.internalFormat,hl,pl,cl.colorSpace,!0===Da.isXRRenderTarget),kl=getRenderTargetSamples(Da);F.renderbufferStorageMultisample(F.RENDERBUFFER,kl,Al,Da.width,Da.height),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+ll,F.RENDERBUFFER,fl.__webglColorRenderbuffer[ll])}F.bindRenderbuffer(F.RENDERBUFFER,null),Da.depthBuffer&&(fl.__webglDepthRenderbuffer=F.createRenderbuffer(),setupRenderBufferStorage(fl.__webglDepthRenderbuffer,Da,!0)),ll.bindFramebuffer(F.FRAMEBUFFER,null)}}if(kl){ll.bindTexture(F.TEXTURE_CUBE_MAP,Al.__webglTexture),setTextureParameters(F.TEXTURE_CUBE_MAP,hl);for(let ll=0;ll<6;ll++)if(hl.mipmaps&&hl.mipmaps.length>0)for(let cl=0;cl<hl.mipmaps.length;cl++)setupFrameBufferTexture(fl.__webglFramebuffer[ll][cl],Da,hl,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+ll,cl);else setupFrameBufferTexture(fl.__webglFramebuffer[ll],Da,hl,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+ll,0);textureNeedsGenerateMipmaps(hl)&&generateMipmap(F.TEXTURE_CUBE_MAP),ll.unbindTexture()}else if(Dl){for(let hl=0,dl=bl.length;hl<dl;hl++){const dl=bl[hl],pl=cl.get(dl);ll.bindTexture(F.TEXTURE_2D,pl.__webglTexture),setTextureParameters(F.TEXTURE_2D,dl),setupFrameBufferTexture(fl.__webglFramebuffer,Da,dl,F.COLOR_ATTACHMENT0+hl,F.TEXTURE_2D,0),textureNeedsGenerateMipmaps(dl)&&generateMipmap(F.TEXTURE_2D)}ll.unbindTexture()}else{let cl=F.TEXTURE_2D;if((Da.isWebGL3DRenderTarget||Da.isWebGLArrayRenderTarget)&&(cl=Da.isWebGL3DRenderTarget?F.TEXTURE_3D:F.TEXTURE_2D_ARRAY),ll.bindTexture(cl,Al.__webglTexture),setTextureParameters(cl,hl),hl.mipmaps&&hl.mipmaps.length>0)for(let ll=0;ll<hl.mipmaps.length;ll++)setupFrameBufferTexture(fl.__webglFramebuffer[ll],Da,hl,F.COLOR_ATTACHMENT0,cl,ll);else setupFrameBufferTexture(fl.__webglFramebuffer,Da,hl,F.COLOR_ATTACHMENT0,cl,0);textureNeedsGenerateMipmaps(hl)&&generateMipmap(cl),ll.unbindTexture()}Da.depthBuffer&&setupDepthRenderbuffer(Da)},this.updateRenderTargetMipmap=function(Da){const hl=Da.textures;for(let dl=0,pl=hl.length;dl<pl;dl++){const pl=hl[dl];if(textureNeedsGenerateMipmaps(pl)){const hl=Da.isWebGLCubeRenderTarget?F.TEXTURE_CUBE_MAP:F.TEXTURE_2D,dl=cl.get(pl).__webglTexture;ll.bindTexture(hl,dl),generateMipmap(hl),ll.unbindTexture()}}},this.updateMultisampleRenderTarget=function(Da){if(Da.samples>0)if(!1===useMultisampledRTT(Da)){const hl=Da.textures,dl=Da.width,pl=Da.height;let fl=F.COLOR_BUFFER_BIT;const bl=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,kl=cl.get(Da),Dl=hl.length>1;if(Dl)for(let Da=0;Da<hl.length;Da++)ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglMultisampledFramebuffer),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.RENDERBUFFER,null),ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglFramebuffer),F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.TEXTURE_2D,null,0);ll.bindFramebuffer(F.READ_FRAMEBUFFER,kl.__webglMultisampledFramebuffer),ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,kl.__webglFramebuffer);for(let ll=0;ll<hl.length;ll++){if(Da.resolveDepthBuffer&&(Da.depthBuffer&&(fl|=F.DEPTH_BUFFER_BIT),Da.stencilBuffer&&Da.resolveStencilBuffer&&(fl|=F.STENCIL_BUFFER_BIT)),Dl){F.framebufferRenderbuffer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.RENDERBUFFER,kl.__webglColorRenderbuffer[ll]);const Da=cl.get(hl[ll]).__webglTexture;F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Da,0)}F.blitFramebuffer(0,0,dl,pl,0,0,dl,pl,fl,F.NEAREST),!0===Al&&(su.length=0,cu.length=0,su.push(F.COLOR_ATTACHMENT0+ll),Da.depthBuffer&&!1===Da.resolveDepthBuffer&&(su.push(bl),cu.push(bl),F.invalidateFramebuffer(F.DRAW_FRAMEBUFFER,cu)),F.invalidateFramebuffer(F.READ_FRAMEBUFFER,su))}if(ll.bindFramebuffer(F.READ_FRAMEBUFFER,null),ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,null),Dl)for(let Da=0;Da<hl.length;Da++){ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglMultisampledFramebuffer),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.RENDERBUFFER,kl.__webglColorRenderbuffer[Da]);const dl=cl.get(hl[Da]).__webglTexture;ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglFramebuffer),F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.TEXTURE_2D,dl,0)}ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,kl.__webglMultisampledFramebuffer)}else if(Da.depthBuffer&&!1===Da.resolveDepthBuffer&&Al){const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT;F.invalidateFramebuffer(F.DRAW_FRAMEBUFFER,[ll])}},this.setupDepthRenderbuffer=setupDepthRenderbuffer,this.setupFrameBufferTexture=setupFrameBufferTexture,this.useMultisampledRTT=useMultisampledRTT}function WebGLUtils(F,Da){return{convert:function(ll,cl){let hl;void 0===cl&&(cl=kp);const dl=sm.getTransfer(cl);if(ll===ud)return F.UNSIGNED_BYTE;if(ll===yd)return F.UNSIGNED_SHORT_4_4_4_4;if(ll===vd)return F.UNSIGNED_SHORT_5_5_5_1;if(ll===xd)return F.UNSIGNED_INT_5_9_9_9_REV;if(ll===hd)return F.BYTE;if(ll===dd)return F.SHORT;if(ll===pd)return F.UNSIGNED_SHORT;if(ll===md)return F.INT;if(ll===fd)return F.UNSIGNED_INT;if(ll===gd)return F.FLOAT;if(ll===Ad)return F.HALF_FLOAT;if(1021===ll)return F.ALPHA;if(1022===ll)return F.RGB;if(ll===bd)return F.RGBA;if(1024===ll)return F.LUMINANCE;if(1025===ll)return F.LUMINANCE_ALPHA;if(ll===wd)return F.DEPTH_COMPONENT;if(ll===Ed)return F.DEPTH_STENCIL;if(ll===Md)return F.RED;if(ll===Sd)return F.RED_INTEGER;if(1030===ll)return F.RG;if(ll===kd)return F.RG_INTEGER;if(ll===Td)return F.RGBA_INTEGER;if(ll===Id||ll===Cd||ll===Ld||ll===zd)if(dl===Pp){if(hl=Da.get("WEBGL_compressed_texture_s3tc_srgb"),null===hl)return null;if(ll===Id)return hl.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ll===Cd)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ll===Ld)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ll===zd)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(hl=Da.get("WEBGL_compressed_texture_s3tc"),null===hl)return null;if(ll===Id)return hl.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ll===Cd)return hl.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ll===Ld)return hl.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ll===zd)return hl.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(ll===Pd||ll===Dd||ll===Rd||ll===Nd){if(hl=Da.get("WEBGL_compressed_texture_pvrtc"),null===hl)return null;if(ll===Pd)return hl.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ll===Dd)return hl.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ll===Rd)return hl.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ll===Nd)return hl.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(ll===Ud||ll===Bd||ll===Od){if(hl=Da.get("WEBGL_compressed_texture_etc"),null===hl)return null;if(ll===Ud||ll===Bd)return dl===Pp?hl.COMPRESSED_SRGB8_ETC2:hl.COMPRESSED_RGB8_ETC2;if(ll===Od)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:hl.COMPRESSED_RGBA8_ETC2_EAC}if(ll===Fd||ll===jd||ll===Vd||ll===Gd||ll===Hd||ll===qd||ll===Zd||ll===Wd||ll===Kd||ll===Qd||ll===Xd||ll===Yd||ll===Jd||ll===$d){if(hl=Da.get("WEBGL_compressed_texture_astc"),null===hl)return null;if(ll===Fd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:hl.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ll===jd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:hl.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ll===Vd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:hl.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ll===Gd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:hl.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ll===Hd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:hl.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ll===qd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:hl.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ll===Zd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:hl.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ll===Wd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:hl.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ll===Kd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:hl.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ll===Qd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:hl.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ll===Xd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:hl.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ll===Yd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:hl.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ll===Jd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:hl.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ll===$d)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:hl.COMPRESSED_RGBA_ASTC_12x12_KHR}if(ll===lp||ll===mp||ll===gp){if(hl=Da.get("EXT_texture_compression_bptc"),null===hl)return null;if(ll===lp)return dl===Pp?hl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:hl.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(ll===mp)return hl.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(ll===gp)return hl.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===ll||ll===Ap||ll===vp||ll===_p){if(hl=Da.get("EXT_texture_compression_rgtc"),null===hl)return null;if(ll===lp)return hl.COMPRESSED_RED_RGTC1_EXT;if(ll===Ap)return hl.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(ll===vp)return hl.COMPRESSED_RED_GREEN_RGTC2_EXT;if(ll===_p)return hl.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return ll===_d?F.UNSIGNED_INT_24_8:void 0!==F[ll]?F[ll]:null}}}class ArrayCamera extends PerspectiveCamera{constructor(F){void 0===F&&(F=[]),super(),this.isArrayCamera=!0,this.cameras=F}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Bg={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(F){return null!==this._targetRay&&this._targetRay.dispatchEvent(F),null!==this._grip&&this._grip.dispatchEvent(F),null!==this._hand&&this._hand.dispatchEvent(F),this}connect(F){if(F&&F.hand){const Da=this._hand;if(Da)for(const ll of F.hand.values())this._getHandJoint(Da,ll)}return this.dispatchEvent({type:"connected",data:F}),this}disconnect(F){return this.dispatchEvent({type:"disconnected",data:F}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(F,Da,ll){let cl=null,hl=null,dl=null;const pl=this._targetRay,fl=this._grip,Al=this._hand;if(F&&"visible-blurred"!==Da.session.visibilityState){if(Al&&F.hand){dl=!0;for(const dl of F.hand.values()){const F=Da.getJointPose(dl,ll),cl=this._getHandJoint(Al,dl);null!==F&&(cl.matrix.fromArray(F.transform.matrix),cl.matrix.decompose(cl.position,cl.rotation,cl.scale),cl.matrixWorldNeedsUpdate=!0,cl.jointRadius=F.radius),cl.visible=null!==F}const cl=Al.joints["index-finger-tip"],hl=Al.joints["thumb-tip"],pl=cl.position.distanceTo(hl.position),fl=.02,bl=.005;Al.inputState.pinching&&pl>fl+bl?(Al.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:F.handedness,target:this})):!Al.inputState.pinching&&pl<=fl-bl&&(Al.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:F.handedness,target:this}))}else null!==fl&&F.gripSpace&&(hl=Da.getPose(F.gripSpace,ll),null!==hl&&(fl.matrix.fromArray(hl.transform.matrix),fl.matrix.decompose(fl.position,fl.rotation,fl.scale),fl.matrixWorldNeedsUpdate=!0,hl.linearVelocity?(fl.hasLinearVelocity=!0,fl.linearVelocity.copy(hl.linearVelocity)):fl.hasLinearVelocity=!1,hl.angularVelocity?(fl.hasAngularVelocity=!0,fl.angularVelocity.copy(hl.angularVelocity)):fl.hasAngularVelocity=!1));null!==pl&&(cl=Da.getPose(F.targetRaySpace,ll),null===cl&&null!==hl&&(cl=hl),null!==cl&&(pl.matrix.fromArray(cl.transform.matrix),pl.matrix.decompose(pl.position,pl.rotation,pl.scale),pl.matrixWorldNeedsUpdate=!0,cl.linearVelocity?(pl.hasLinearVelocity=!0,pl.linearVelocity.copy(cl.linearVelocity)):pl.hasLinearVelocity=!1,cl.angularVelocity?(pl.hasAngularVelocity=!0,pl.angularVelocity.copy(cl.angularVelocity)):pl.hasAngularVelocity=!1,this.dispatchEvent(Bg)))}return null!==pl&&(pl.visible=null!==cl),null!==fl&&(fl.visible=null!==hl),null!==Al&&(Al.visible=null!==dl),this}_getHandJoint(F,Da){if(void 0===F.joints[Da.jointName]){const ll=new Group;ll.matrixAutoUpdate=!1,ll.visible=!1,F.joints[Da.jointName]=ll,F.add(ll)}return F.joints[Da.jointName]}}class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(F,Da,ll){if(null===this.texture){const cl=new Texture;F.properties.get(cl).__webglTexture=Da.texture,Da.depthNear==ll.depthNear&&Da.depthFar==ll.depthFar||(this.depthNear=Da.depthNear,this.depthFar=Da.depthFar),this.texture=cl}}getMesh(F){if(null!==this.texture&&null===this.mesh){const Da=F.cameras[0].viewport,ll=new ShaderMaterial({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:Da.z},depthHeight:{value:Da.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),ll)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class WebXRManager extends EventDispatcher{constructor(F,Da){super();const ll=this;let cl=null,hl=1,dl=null,pl="local-floor",fl=1,Al=null,bl=null,kl=null,Dl=null,Wl=null,Ql=null;const wc=new WebXRDepthSensing,Sc=Da.getContextAttributes();let eu=null,iu=null;const su=[],cu=[],uu=new Vector2;let hu=null;const Lu=new PerspectiveCamera;Lu.layers.enable(1),Lu.viewport=new Vector4;const zu=new PerspectiveCamera;zu.layers.enable(2),zu.viewport=new Vector4;const Du=[Lu,zu],Nu=new ArrayCamera;Nu.layers.enable(1),Nu.layers.enable(2);let qu=null,ih=null;function onSessionEvent(F){const Da=cu.indexOf(F.inputSource);if(-1===Da)return;const ll=su[Da];void 0!==ll&&(ll.update(F.inputSource,F.frame,Al||dl),ll.dispatchEvent({type:F.type,data:F.inputSource}))}function onSessionEnd(){cl.removeEventListener("select",onSessionEvent),cl.removeEventListener("selectstart",onSessionEvent),cl.removeEventListener("selectend",onSessionEvent),cl.removeEventListener("squeeze",onSessionEvent),cl.removeEventListener("squeezestart",onSessionEvent),cl.removeEventListener("squeezeend",onSessionEvent),cl.removeEventListener("end",onSessionEnd),cl.removeEventListener("inputsourceschange",onInputSourcesChange);for(let F=0;F<su.length;F++){const Da=cu[F];null!==Da&&(cu[F]=null,su[F].disconnect(Da))}qu=null,ih=null,wc.reset(),F.setRenderTarget(eu),Wl=null,Dl=null,kl=null,cl=null,iu=null,id.stop(),ll.isPresenting=!1,F.setPixelRatio(hu),F.setSize(uu.width,uu.height,!1),ll.dispatchEvent({type:"sessionend"})}function onInputSourcesChange(F){for(let Da=0;Da<F.removed.length;Da++){const ll=F.removed[Da],cl=cu.indexOf(ll);cl>=0&&(cu[cl]=null,su[cl].disconnect(ll))}for(let Da=0;Da<F.added.length;Da++){const ll=F.added[Da];let cl=cu.indexOf(ll);if(-1===cl){for(let F=0;F<su.length;F++){if(F>=cu.length){cu.push(ll),cl=F;break}if(null===cu[F]){cu[F]=ll,cl=F;break}}if(-1===cl)break}const hl=su[cl];hl&&hl.connect(ll)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getTargetRaySpace()},this.getControllerGrip=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getGripSpace()},this.getHand=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getHandSpace()},this.setFramebufferScaleFactor=function(F){hl=F,!0===ll.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){pl=F,!0===ll.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return Al||dl},this.setReferenceSpace=function(F){Al=F},this.getBaseLayer=function(){return null!==Dl?Dl:Wl},this.getBinding=function(){return kl},this.getFrame=function(){return Ql},this.getSession=function(){return cl},this.setSession=async function(bl){if(cl=bl,null!==cl){if(eu=F.getRenderTarget(),cl.addEventListener("select",onSessionEvent),cl.addEventListener("selectstart",onSessionEvent),cl.addEventListener("selectend",onSessionEvent),cl.addEventListener("squeeze",onSessionEvent),cl.addEventListener("squeezestart",onSessionEvent),cl.addEventListener("squeezeend",onSessionEvent),cl.addEventListener("end",onSessionEnd),cl.addEventListener("inputsourceschange",onInputSourcesChange),!0!==Sc.xrCompatible&&await Da.makeXRCompatible(),hu=F.getPixelRatio(),F.getSize(uu),void 0===cl.renderState.layers){const ll={antialias:Sc.antialias,alpha:!0,depth:Sc.depth,stencil:Sc.stencil,framebufferScaleFactor:hl};Wl=new XRWebGLLayer(cl,Da,ll),cl.updateRenderState({baseLayer:Wl}),F.setPixelRatio(1),F.setSize(Wl.framebufferWidth,Wl.framebufferHeight,!1),iu=new WebGLRenderTarget(Wl.framebufferWidth,Wl.framebufferHeight,{format:bd,type:ud,colorSpace:F.outputColorSpace,stencilBuffer:Sc.stencil})}else{let ll=null,dl=null,pl=null;Sc.depth&&(pl=Sc.stencil?Da.DEPTH24_STENCIL8:Da.DEPTH_COMPONENT24,ll=Sc.stencil?Ed:wd,dl=Sc.stencil?_d:fd);const fl={colorFormat:Da.RGBA8,depthFormat:pl,scaleFactor:hl};kl=new XRWebGLBinding(cl,Da),Dl=kl.createProjectionLayer(fl),cl.updateRenderState({layers:[Dl]}),F.setPixelRatio(1),F.setSize(Dl.textureWidth,Dl.textureHeight,!1),iu=new WebGLRenderTarget(Dl.textureWidth,Dl.textureHeight,{format:bd,type:ud,depthTexture:new DepthTexture(Dl.textureWidth,Dl.textureHeight,dl,void 0,void 0,void 0,void 0,void 0,void 0,ll),stencilBuffer:Sc.stencil,colorSpace:F.outputColorSpace,samples:Sc.antialias?4:0,resolveDepthBuffer:!1===Dl.ignoreDepthValues})}iu.isXRRenderTarget=!0,this.setFoveation(fl),Al=null,dl=await cl.requestReferenceSpace(pl),id.setContext(cl),id.start(),ll.isPresenting=!0,ll.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==cl)return cl.environmentBlendMode},this.getDepthTexture=function(){return wc.getDepthTexture()};const gh=new Vector3,ed=new Vector3;function updateCamera(F,Da){null===Da?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(Da.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(null===cl)return;let Da=F.near,ll=F.far;null!==wc.texture&&(wc.depthNear>0&&(Da=wc.depthNear),wc.depthFar>0&&(ll=wc.depthFar)),Nu.near=zu.near=Lu.near=Da,Nu.far=zu.far=Lu.far=ll,qu===Nu.near&&ih===Nu.far||(cl.updateRenderState({depthNear:Nu.near,depthFar:Nu.far}),qu=Nu.near,ih=Nu.far);const hl=F.parent,dl=Nu.cameras;updateCamera(Nu,hl);for(let cl=0;cl<dl.length;cl++)updateCamera(dl[cl],hl);2===dl.length?function(F,Da,ll){gh.setFromMatrixPosition(Da.matrixWorld),ed.setFromMatrixPosition(ll.matrixWorld);const cl=gh.distanceTo(ed),hl=Da.projectionMatrix.elements,dl=ll.projectionMatrix.elements,pl=hl[14]/(hl[10]-1),fl=hl[14]/(hl[10]+1),Al=(hl[9]+1)/hl[5],bl=(hl[9]-1)/hl[5],kl=(hl[8]-1)/hl[0],Dl=(dl[8]+1)/dl[0],Wl=pl*kl,Ql=pl*Dl,wc=cl/(-kl+Dl),Sc=wc*-kl;if(Da.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(Sc),F.translateZ(wc),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert(),-1===hl[10])F.projectionMatrix.copy(Da.projectionMatrix),F.projectionMatrixInverse.copy(Da.projectionMatrixInverse);else{const Da=pl+wc,ll=fl+wc,hl=Wl-Sc,dl=Ql+(cl-Sc),kl=Al*fl/ll*Da,Dl=bl*fl/ll*Da;F.projectionMatrix.makePerspective(hl,dl,kl,Dl,Da,ll),F.projectionMatrixInverse.copy(F.projectionMatrix).invert()}}(Nu,Lu,zu):Nu.projectionMatrix.copy(Lu.projectionMatrix),function(F,Da,ll){null===ll?F.matrix.copy(Da.matrixWorld):(F.matrix.copy(ll.matrixWorld),F.matrix.invert(),F.matrix.multiply(Da.matrixWorld));F.matrix.decompose(F.position,F.quaternion,F.scale),F.updateMatrixWorld(!0),F.projectionMatrix.copy(Da.projectionMatrix),F.projectionMatrixInverse.copy(Da.projectionMatrixInverse),F.isPerspectiveCamera&&(F.fov=2*Jp*Math.atan(1/F.projectionMatrix.elements[5]),F.zoom=1)}(F,Nu,hl)},this.getCamera=function(){return Nu},this.getFoveation=function(){if(null!==Dl||null!==Wl)return fl},this.setFoveation=function(F){fl=F,null!==Dl&&(Dl.fixedFoveation=F),null!==Wl&&void 0!==Wl.fixedFoveation&&(Wl.fixedFoveation=F)},this.hasDepthSensing=function(){return null!==wc.texture},this.getDepthSensingMesh=function(){return wc.getMesh(Nu)};let td=null;const id=new WebGLAnimation;id.setAnimationLoop((function(Da,hl){if(bl=hl.getViewerPose(Al||dl),Ql=hl,null!==bl){const Da=bl.views;null!==Wl&&(F.setRenderTargetFramebuffer(iu,Wl.framebuffer),F.setRenderTarget(iu));let ll=!1;Da.length!==Nu.cameras.length&&(Nu.cameras.length=0,ll=!0);for(let cl=0;cl<Da.length;cl++){const hl=Da[cl];let dl=null;if(null!==Wl)dl=Wl.getViewport(hl);else{const Da=kl.getViewSubImage(Dl,hl);dl=Da.viewport,0===cl&&(F.setRenderTargetTextures(iu,Da.colorTexture,Dl.ignoreDepthValues?void 0:Da.depthStencilTexture),F.setRenderTarget(iu))}let pl=Du[cl];void 0===pl&&(pl=new PerspectiveCamera,pl.layers.enable(cl),pl.viewport=new Vector4,Du[cl]=pl),pl.matrix.fromArray(hl.transform.matrix),pl.matrix.decompose(pl.position,pl.quaternion,pl.scale),pl.projectionMatrix.fromArray(hl.projectionMatrix),pl.projectionMatrixInverse.copy(pl.projectionMatrix).invert(),pl.viewport.set(dl.x,dl.y,dl.width,dl.height),0===cl&&(Nu.matrix.copy(pl.matrix),Nu.matrix.decompose(Nu.position,Nu.quaternion,Nu.scale)),!0===ll&&Nu.cameras.push(pl)}const hl=cl.enabledFeatures;if(hl&&hl.includes("depth-sensing")){const ll=kl.getDepthInformation(Da[0]);ll&&ll.isValid&&ll.texture&&wc.init(F,ll,cl.renderState)}}for(let F=0;F<su.length;F++){const Da=cu[F],ll=su[F];null!==Da&&void 0!==ll&&ll.update(Da,hl,Al||dl)}td&&td(Da,hl),hl.detectedPlanes&&ll.dispatchEvent({type:"planesdetected",data:hl}),Ql=null})),this.setAnimationLoop=function(F){td=F},this.dispose=function(){}}}const Og=new Euler,Fg=new Matrix4;function WebGLMaterials(F,Da){function refreshTransformUniform(F,Da){!0===F.matrixAutoUpdate&&F.updateMatrix(),Da.value.copy(F.matrix)}function refreshUniformsCommon(F,ll){F.opacity.value=ll.opacity,ll.color&&F.diffuse.value.copy(ll.color),ll.emissive&&F.emissive.value.copy(ll.emissive).multiplyScalar(ll.emissiveIntensity),ll.map&&(F.map.value=ll.map,refreshTransformUniform(ll.map,F.mapTransform)),ll.alphaMap&&(F.alphaMap.value=ll.alphaMap,refreshTransformUniform(ll.alphaMap,F.alphaMapTransform)),ll.bumpMap&&(F.bumpMap.value=ll.bumpMap,refreshTransformUniform(ll.bumpMap,F.bumpMapTransform),F.bumpScale.value=ll.bumpScale,1===ll.side&&(F.bumpScale.value*=-1)),ll.normalMap&&(F.normalMap.value=ll.normalMap,refreshTransformUniform(ll.normalMap,F.normalMapTransform),F.normalScale.value.copy(ll.normalScale),1===ll.side&&F.normalScale.value.negate()),ll.displacementMap&&(F.displacementMap.value=ll.displacementMap,refreshTransformUniform(ll.displacementMap,F.displacementMapTransform),F.displacementScale.value=ll.displacementScale,F.displacementBias.value=ll.displacementBias),ll.emissiveMap&&(F.emissiveMap.value=ll.emissiveMap,refreshTransformUniform(ll.emissiveMap,F.emissiveMapTransform)),ll.specularMap&&(F.specularMap.value=ll.specularMap,refreshTransformUniform(ll.specularMap,F.specularMapTransform)),ll.alphaTest>0&&(F.alphaTest.value=ll.alphaTest);const cl=Da.get(ll),hl=cl.envMap,dl=cl.envMapRotation;hl&&(F.envMap.value=hl,Og.copy(dl),Og.x*=-1,Og.y*=-1,Og.z*=-1,hl.isCubeTexture&&!1===hl.isRenderTargetTexture&&(Og.y*=-1,Og.z*=-1),F.envMapRotation.value.setFromMatrix4(Fg.makeRotationFromEuler(Og)),F.flipEnvMap.value=hl.isCubeTexture&&!1===hl.isRenderTargetTexture?-1:1,F.reflectivity.value=ll.reflectivity,F.ior.value=ll.ior,F.refractionRatio.value=ll.refractionRatio),ll.lightMap&&(F.lightMap.value=ll.lightMap,F.lightMapIntensity.value=ll.lightMapIntensity,refreshTransformUniform(ll.lightMap,F.lightMapTransform)),ll.aoMap&&(F.aoMap.value=ll.aoMap,F.aoMapIntensity.value=ll.aoMapIntensity,refreshTransformUniform(ll.aoMap,F.aoMapTransform))}return{refreshFogUniforms:function(Da,ll){ll.color.getRGB(Da.fogColor.value,getUnlitUniformColorSpace(F)),ll.isFog?(Da.fogNear.value=ll.near,Da.fogFar.value=ll.far):ll.isFogExp2&&(Da.fogDensity.value=ll.density)},refreshMaterialUniforms:function(F,ll,cl,hl,dl){ll.isMeshBasicMaterial||ll.isMeshLambertMaterial?refreshUniformsCommon(F,ll):ll.isMeshToonMaterial?(refreshUniformsCommon(F,ll),function(F,Da){Da.gradientMap&&(F.gradientMap.value=Da.gradientMap)}(F,ll)):ll.isMeshPhongMaterial?(refreshUniformsCommon(F,ll),function(F,Da){F.specular.value.copy(Da.specular),F.shininess.value=Math.max(Da.shininess,1e-4)}(F,ll)):ll.isMeshStandardMaterial?(refreshUniformsCommon(F,ll),function(F,Da){F.metalness.value=Da.metalness,Da.metalnessMap&&(F.metalnessMap.value=Da.metalnessMap,refreshTransformUniform(Da.metalnessMap,F.metalnessMapTransform));F.roughness.value=Da.roughness,Da.roughnessMap&&(F.roughnessMap.value=Da.roughnessMap,refreshTransformUniform(Da.roughnessMap,F.roughnessMapTransform));Da.envMap&&(F.envMapIntensity.value=Da.envMapIntensity)}(F,ll),ll.isMeshPhysicalMaterial&&function(F,Da,ll){F.ior.value=Da.ior,Da.sheen>0&&(F.sheenColor.value.copy(Da.sheenColor).multiplyScalar(Da.sheen),F.sheenRoughness.value=Da.sheenRoughness,Da.sheenColorMap&&(F.sheenColorMap.value=Da.sheenColorMap,refreshTransformUniform(Da.sheenColorMap,F.sheenColorMapTransform)),Da.sheenRoughnessMap&&(F.sheenRoughnessMap.value=Da.sheenRoughnessMap,refreshTransformUniform(Da.sheenRoughnessMap,F.sheenRoughnessMapTransform)));Da.clearcoat>0&&(F.clearcoat.value=Da.clearcoat,F.clearcoatRoughness.value=Da.clearcoatRoughness,Da.clearcoatMap&&(F.clearcoatMap.value=Da.clearcoatMap,refreshTransformUniform(Da.clearcoatMap,F.clearcoatMapTransform)),Da.clearcoatRoughnessMap&&(F.clearcoatRoughnessMap.value=Da.clearcoatRoughnessMap,refreshTransformUniform(Da.clearcoatRoughnessMap,F.clearcoatRoughnessMapTransform)),Da.clearcoatNormalMap&&(F.clearcoatNormalMap.value=Da.clearcoatNormalMap,refreshTransformUniform(Da.clearcoatNormalMap,F.clearcoatNormalMapTransform),F.clearcoatNormalScale.value.copy(Da.clearcoatNormalScale),1===Da.side&&F.clearcoatNormalScale.value.negate()));Da.dispersion>0&&(F.dispersion.value=Da.dispersion);Da.iridescence>0&&(F.iridescence.value=Da.iridescence,F.iridescenceIOR.value=Da.iridescenceIOR,F.iridescenceThicknessMinimum.value=Da.iridescenceThicknessRange[0],F.iridescenceThicknessMaximum.value=Da.iridescenceThicknessRange[1],Da.iridescenceMap&&(F.iridescenceMap.value=Da.iridescenceMap,refreshTransformUniform(Da.iridescenceMap,F.iridescenceMapTransform)),Da.iridescenceThicknessMap&&(F.iridescenceThicknessMap.value=Da.iridescenceThicknessMap,refreshTransformUniform(Da.iridescenceThicknessMap,F.iridescenceThicknessMapTransform)));Da.transmission>0&&(F.transmission.value=Da.transmission,F.transmissionSamplerMap.value=ll.texture,F.transmissionSamplerSize.value.set(ll.width,ll.height),Da.transmissionMap&&(F.transmissionMap.value=Da.transmissionMap,refreshTransformUniform(Da.transmissionMap,F.transmissionMapTransform)),F.thickness.value=Da.thickness,Da.thicknessMap&&(F.thicknessMap.value=Da.thicknessMap,refreshTransformUniform(Da.thicknessMap,F.thicknessMapTransform)),F.attenuationDistance.value=Da.attenuationDistance,F.attenuationColor.value.copy(Da.attenuationColor));Da.anisotropy>0&&(F.anisotropyVector.value.set(Da.anisotropy*Math.cos(Da.anisotropyRotation),Da.anisotropy*Math.sin(Da.anisotropyRotation)),Da.anisotropyMap&&(F.anisotropyMap.value=Da.anisotropyMap,refreshTransformUniform(Da.anisotropyMap,F.anisotropyMapTransform)));F.specularIntensity.value=Da.specularIntensity,F.specularColor.value.copy(Da.specularColor),Da.specularColorMap&&(F.specularColorMap.value=Da.specularColorMap,refreshTransformUniform(Da.specularColorMap,F.specularColorMapTransform));Da.specularIntensityMap&&(F.specularIntensityMap.value=Da.specularIntensityMap,refreshTransformUniform(Da.specularIntensityMap,F.specularIntensityMapTransform))}(F,ll,dl)):ll.isMeshMatcapMaterial?(refreshUniformsCommon(F,ll),function(F,Da){Da.matcap&&(F.matcap.value=Da.matcap)}(F,ll)):ll.isMeshDepthMaterial?refreshUniformsCommon(F,ll):ll.isMeshDistanceMaterial?(refreshUniformsCommon(F,ll),function(F,ll){const cl=Da.get(ll).light;F.referencePosition.value.setFromMatrixPosition(cl.matrixWorld),F.nearDistance.value=cl.shadow.camera.near,F.farDistance.value=cl.shadow.camera.far}(F,ll)):ll.isMeshNormalMaterial?refreshUniformsCommon(F,ll):ll.isLineBasicMaterial?(function(F,Da){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.mapTransform))}(F,ll),ll.isLineDashedMaterial&&function(F,Da){F.dashSize.value=Da.dashSize,F.totalSize.value=Da.dashSize+Da.gapSize,F.scale.value=Da.scale}(F,ll)):ll.isPointsMaterial?function(F,Da,ll,cl){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,F.size.value=Da.size*ll,F.scale.value=.5*cl,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.uvTransform));Da.alphaMap&&(F.alphaMap.value=Da.alphaMap,refreshTransformUniform(Da.alphaMap,F.alphaMapTransform));Da.alphaTest>0&&(F.alphaTest.value=Da.alphaTest)}(F,ll,cl,hl):ll.isSpriteMaterial?function(F,Da){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,F.rotation.value=Da.rotation,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.mapTransform));Da.alphaMap&&(F.alphaMap.value=Da.alphaMap,refreshTransformUniform(Da.alphaMap,F.alphaMapTransform));Da.alphaTest>0&&(F.alphaTest.value=Da.alphaTest)}(F,ll):ll.isShadowMaterial?(F.color.value.copy(ll.color),F.opacity.value=ll.opacity):ll.isShaderMaterial&&(ll.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(F,Da,ll,cl){let hl={},dl={},pl=[];const fl=F.getParameter(F.MAX_UNIFORM_BUFFER_BINDINGS);function hasUniformChanged(F,Da,ll,cl){const hl=F.value,dl=Da+"_"+ll;if(void 0===cl[dl])return cl[dl]="number"===typeof hl||"boolean"===typeof hl?hl:hl.clone(),!0;{const F=cl[dl];if("number"===typeof hl||"boolean"===typeof hl){if(F!==hl)return cl[dl]=hl,!0}else if(!1===F.equals(hl))return F.copy(hl),!0}return!1}function getUniformSize(F){const Da={boundary:0,storage:0};return"number"===typeof F||"boolean"===typeof F?(Da.boundary=4,Da.storage=4):F.isVector2?(Da.boundary=8,Da.storage=8):F.isVector3||F.isColor?(Da.boundary=16,Da.storage=12):F.isVector4?(Da.boundary=16,Da.storage=16):F.isMatrix3?(Da.boundary=48,Da.storage=48):F.isMatrix4?(Da.boundary=64,Da.storage=64):F.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",F),Da}function onUniformsGroupsDispose(Da){const ll=Da.target;ll.removeEventListener("dispose",onUniformsGroupsDispose);const cl=pl.indexOf(ll.__bindingPointIndex);pl.splice(cl,1),F.deleteBuffer(hl[ll.id]),delete hl[ll.id],delete dl[ll.id]}return{bind:function(F,Da){const ll=Da.program;cl.uniformBlockBinding(F,ll)},update:function(ll,Al){let bl=hl[ll.id];void 0===bl&&(!function(F){const Da=F.uniforms;let ll=0;const cl=16;for(let dl=0,pl=Da.length;dl<pl;dl++){const F=Array.isArray(Da[dl])?Da[dl]:[Da[dl]];for(let Da=0,hl=F.length;Da<hl;Da++){const hl=F[Da],dl=Array.isArray(hl.value)?hl.value:[hl.value];for(let F=0,Da=dl.length;F<Da;F++){const Da=getUniformSize(dl[F]),pl=ll%cl,fl=pl%Da.boundary,Al=pl+fl;ll+=fl,0!==Al&&cl-Al<Da.storage&&(ll+=cl-Al),hl.__data=new Float32Array(Da.storage/Float32Array.BYTES_PER_ELEMENT),hl.__offset=ll,ll+=Da.storage}}}const hl=ll%cl;hl>0&&(ll+=cl-hl);F.__size=ll,F.__cache={}}(ll),bl=function(Da){const ll=function(){for(let F=0;F<fl;F++)if(-1===pl.indexOf(F))return pl.push(F),F;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();Da.__bindingPointIndex=ll;const cl=F.createBuffer(),hl=Da.__size,dl=Da.usage;return F.bindBuffer(F.UNIFORM_BUFFER,cl),F.bufferData(F.UNIFORM_BUFFER,hl,dl),F.bindBuffer(F.UNIFORM_BUFFER,null),F.bindBufferBase(F.UNIFORM_BUFFER,ll,cl),cl}(ll),hl[ll.id]=bl,ll.addEventListener("dispose",onUniformsGroupsDispose));const kl=Al.program;cl.updateUBOMapping(ll,kl);const Dl=Da.render.frame;dl[ll.id]!==Dl&&(!function(Da){const ll=hl[Da.id],cl=Da.uniforms,dl=Da.__cache;F.bindBuffer(F.UNIFORM_BUFFER,ll);for(let hl=0,pl=cl.length;hl<pl;hl++){const Da=Array.isArray(cl[hl])?cl[hl]:[cl[hl]];for(let ll=0,cl=Da.length;ll<cl;ll++){const cl=Da[ll];if(!0===hasUniformChanged(cl,hl,ll,dl)){const Da=cl.__offset,ll=Array.isArray(cl.value)?cl.value:[cl.value];let hl=0;for(let dl=0;dl<ll.length;dl++){const pl=ll[dl],fl=getUniformSize(pl);"number"===typeof pl||"boolean"===typeof pl?(cl.__data[0]=pl,F.bufferSubData(F.UNIFORM_BUFFER,Da+hl,cl.__data)):pl.isMatrix3?(cl.__data[0]=pl.elements[0],cl.__data[1]=pl.elements[1],cl.__data[2]=pl.elements[2],cl.__data[3]=0,cl.__data[4]=pl.elements[3],cl.__data[5]=pl.elements[4],cl.__data[6]=pl.elements[5],cl.__data[7]=0,cl.__data[8]=pl.elements[6],cl.__data[9]=pl.elements[7],cl.__data[10]=pl.elements[8],cl.__data[11]=0):(pl.toArray(cl.__data,hl),hl+=fl.storage/Float32Array.BYTES_PER_ELEMENT)}F.bufferSubData(F.UNIFORM_BUFFER,Da,cl.__data)}}}F.bindBuffer(F.UNIFORM_BUFFER,null)}(ll),dl[ll.id]=Dl)},dispose:function(){for(const Da in hl)F.deleteBuffer(hl[Da]);pl=[],hl={},dl={}}}}class WebGLRenderer{constructor(F){void 0===F&&(F={});const{canvas:Da=createCanvasElement(),context:ll=null,depth:hl=!0,stencil:dl=!1,alpha:pl=!1,antialias:fl=!1,premultipliedAlpha:Al=!0,preserveDrawingBuffer:bl=!1,powerPreference:kl="default",failIfMajorPerformanceCaveat:Dl=!1}=F;let Wl;if(this.isWebGLRenderer=!0,null!==ll){if("undefined"!==typeof WebGLRenderingContext&&ll instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");Wl=ll.getContextAttributes().alpha}else Wl=pl;const Ql=new Uint32Array(4),wc=new Int32Array(4);let Sc=null,eu=null;const iu=[],su=[];this.domElement=Da,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Tp,this.toneMapping=0,this.toneMappingExposure=1;const cu=this;let uu=!1,hu=0,Lu=0,zu=null,Du=-1,Nu=null;const qu=new Vector4,ih=new Vector4;let gh=null;const ed=new Color(0);let td=0,id=Da.width,nd=Da.height,rd=1,ad=null,sd=null;const od=new Vector4(0,0,id,nd),ld=new Vector4(0,0,id,nd);let hd=!1;const dd=new Frustum;let md=!1,gd=!1;const xd=new Matrix4,bd=new Vector3,wd=new Vector4,Ed={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Md=!1;function getTargetPixelRatio(){return null===zu?rd:1}let Id,Cd,Ld,zd,Pd,Dd,Rd,Nd,Ud,Bd,Od,Fd,jd,Vd,Gd,Hd,qd,Zd,Wd,Kd,Qd,Xd,Yd,Jd,$d=ll;function getContext(F,ll){return Da.getContext(F,ll)}try{const F={alpha:!0,depth:hl,stencil:dl,antialias:fl,premultipliedAlpha:Al,preserveDrawingBuffer:bl,powerPreference:kl,failIfMajorPerformanceCaveat:Dl};if("setAttribute"in Da&&Da.setAttribute("data-engine",`three.js r${cl}`),Da.addEventListener("webglcontextlost",onContextLost,!1),Da.addEventListener("webglcontextrestored",onContextRestore,!1),Da.addEventListener("webglcontextcreationerror",onContextCreationError,!1),null===$d){const Da="webgl2";if($d=getContext(Da,F),null===$d)throw getContext(Da)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(Ap){throw console.error("THREE.WebGLRenderer: "+Ap.message),Ap}function initGLContext(){Id=new WebGLExtensions($d),Id.init(),Xd=new WebGLUtils($d,Id),Cd=new WebGLCapabilities($d,Id,F,Xd),Ld=new WebGLState($d),zd=new WebGLInfo($d),Pd=new WebGLProperties,Dd=new WebGLTextures($d,Id,Ld,Pd,Cd,Xd,zd),Rd=new WebGLCubeMaps(cu),Nd=new WebGLCubeUVMaps(cu),Ud=new WebGLAttributes($d),Yd=new WebGLBindingStates($d,Ud),Bd=new WebGLGeometries($d,Ud,zd,Yd),Od=new WebGLObjects($d,Bd,Ud,zd),Wd=new WebGLMorphtargets($d,Cd,Dd),Hd=new WebGLClipping(Pd),Fd=new WebGLPrograms(cu,Rd,Nd,Id,Cd,Yd,Hd),jd=new WebGLMaterials(cu,Pd),Vd=new WebGLRenderLists,Gd=new WebGLRenderStates(Id),Zd=new WebGLBackground(cu,Rd,Nd,Ld,Od,Wl,Al),qd=new WebGLShadowMap(cu,Od,Cd),Jd=new WebGLUniformsGroups($d,zd,Cd,Ld),Kd=new WebGLBufferRenderer($d,Id,zd),Qd=new WebGLIndexedBufferRenderer($d,Id,zd),zd.programs=Fd.programs,cu.capabilities=Cd,cu.extensions=Id,cu.properties=Pd,cu.renderLists=Vd,cu.shadowMap=qd,cu.state=Ld,cu.info=zd}initGLContext();const lp=new WebXRManager(cu,$d);function onContextLost(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),uu=!0}function onContextRestore(){console.log("THREE.WebGLRenderer: Context Restored."),uu=!1;const F=zd.autoReset,Da=qd.enabled,ll=qd.autoUpdate,cl=qd.needsUpdate,hl=qd.type;initGLContext(),zd.autoReset=F,qd.enabled=Da,qd.autoUpdate=ll,qd.needsUpdate=cl,qd.type=hl}function onContextCreationError(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function onMaterialDispose(F){const Da=F.target;Da.removeEventListener("dispose",onMaterialDispose),function(F){(function(F){const Da=Pd.get(F).programs;void 0!==Da&&(Da.forEach((function(F){Fd.releaseProgram(F)})),F.isShaderMaterial&&Fd.releaseShaderCache(F))})(F),Pd.remove(F)}(Da)}function prepareMaterial(F,Da,ll){!0===F.transparent&&2===F.side&&!1===F.forceSinglePass?(F.side=1,F.needsUpdate=!0,getProgram(F,Da,ll),F.side=0,F.needsUpdate=!0,getProgram(F,Da,ll),F.side=2):getProgram(F,Da,ll)}this.xr=lp,this.getContext=function(){return $d},this.getContextAttributes=function(){return $d.getContextAttributes()},this.forceContextLoss=function(){const F=Id.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Id.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return rd},this.setPixelRatio=function(F){void 0!==F&&(rd=F,this.setSize(id,nd,!1))},this.getSize=function(F){return F.set(id,nd)},this.setSize=function(F,ll,cl){void 0===cl&&(cl=!0),lp.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(id=F,nd=ll,Da.width=Math.floor(F*rd),Da.height=Math.floor(ll*rd),!0===cl&&(Da.style.width=F+"px",Da.style.height=ll+"px"),this.setViewport(0,0,F,ll))},this.getDrawingBufferSize=function(F){return F.set(id*rd,nd*rd).floor()},this.setDrawingBufferSize=function(F,ll,cl){id=F,nd=ll,rd=cl,Da.width=Math.floor(F*cl),Da.height=Math.floor(ll*cl),this.setViewport(0,0,F,ll)},this.getCurrentViewport=function(F){return F.copy(qu)},this.getViewport=function(F){return F.copy(od)},this.setViewport=function(F,Da,ll,cl){F.isVector4?od.set(F.x,F.y,F.z,F.w):od.set(F,Da,ll,cl),Ld.viewport(qu.copy(od).multiplyScalar(rd).round())},this.getScissor=function(F){return F.copy(ld)},this.setScissor=function(F,Da,ll,cl){F.isVector4?ld.set(F.x,F.y,F.z,F.w):ld.set(F,Da,ll,cl),Ld.scissor(ih.copy(ld).multiplyScalar(rd).round())},this.getScissorTest=function(){return hd},this.setScissorTest=function(F){Ld.setScissorTest(hd=F)},this.setOpaqueSort=function(F){ad=F},this.setTransparentSort=function(F){sd=F},this.getClearColor=function(F){return F.copy(Zd.getClearColor())},this.setClearColor=function(){Zd.setClearColor.apply(Zd,arguments)},this.getClearAlpha=function(){return Zd.getClearAlpha()},this.setClearAlpha=function(){Zd.setClearAlpha.apply(Zd,arguments)},this.clear=function(F,Da,ll){void 0===F&&(F=!0),void 0===Da&&(Da=!0),void 0===ll&&(ll=!0);let cl=0;if(F){let F=!1;if(null!==zu){const Da=zu.texture.format;F=Da===Td||Da===kd||Da===Sd}if(F){const F=zu.texture.type,Da=F===ud||F===fd||F===pd||F===_d||F===yd||F===vd,ll=Zd.getClearColor(),cl=Zd.getClearAlpha(),hl=ll.r,dl=ll.g,pl=ll.b;Da?(Ql[0]=hl,Ql[1]=dl,Ql[2]=pl,Ql[3]=cl,$d.clearBufferuiv($d.COLOR,0,Ql)):(wc[0]=hl,wc[1]=dl,wc[2]=pl,wc[3]=cl,$d.clearBufferiv($d.COLOR,0,wc))}else cl|=$d.COLOR_BUFFER_BIT}Da&&(cl|=$d.DEPTH_BUFFER_BIT),ll&&(cl|=$d.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),$d.clear(cl)},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(){Da.removeEventListener("webglcontextlost",onContextLost,!1),Da.removeEventListener("webglcontextrestored",onContextRestore,!1),Da.removeEventListener("webglcontextcreationerror",onContextCreationError,!1),Vd.dispose(),Gd.dispose(),Pd.dispose(),Rd.dispose(),Nd.dispose(),Od.dispose(),Yd.dispose(),Jd.dispose(),Fd.dispose(),lp.dispose(),lp.removeEventListener("sessionstart",onXRSessionStart),lp.removeEventListener("sessionend",onXRSessionEnd),gp.stop()},this.renderBufferDirect=function(F,Da,ll,cl,hl,dl){null===Da&&(Da=Ed);const pl=hl.isMesh&&hl.matrixWorld.determinant()<0,fl=function(F,Da,ll,cl,hl){!0!==Da.isScene&&(Da=Ed);Dd.resetTextureUnits();const dl=Da.fog,pl=cl.isMeshStandardMaterial?Da.environment:null,fl=null===zu?cu.outputColorSpace:!0===zu.isXRRenderTarget?zu.texture.colorSpace:Ip,Al=(cl.isMeshStandardMaterial?Nd:Rd).get(cl.envMap||pl),bl=!0===cl.vertexColors&&!!ll.attributes.color&&4===ll.attributes.color.itemSize,kl=!!ll.attributes.tangent&&(!!cl.normalMap||cl.anisotropy>0),Dl=!!ll.morphAttributes.position,Wl=!!ll.morphAttributes.normal,Ql=!!ll.morphAttributes.color;let wc=0;cl.toneMapped&&(null!==zu&&!0!==zu.isXRRenderTarget||(wc=cu.toneMapping));const Sc=ll.morphAttributes.position||ll.morphAttributes.normal||ll.morphAttributes.color,iu=void 0!==Sc?Sc.length:0,su=Pd.get(cl),uu=eu.state.lights;if(!0===md&&(!0===gd||F!==Nu)){const Da=F===Nu&&cl.id===Du;Hd.setState(cl,F,Da)}let hu=!1;cl.version===su.__version?su.needsLights&&su.lightsStateVersion!==uu.state.version||su.outputColorSpace!==fl||hl.isBatchedMesh&&!1===su.batching?hu=!0:hl.isBatchedMesh||!0!==su.batching?hl.isBatchedMesh&&!0===su.batchingColor&&null===hl.colorTexture||hl.isBatchedMesh&&!1===su.batchingColor&&null!==hl.colorTexture||hl.isInstancedMesh&&!1===su.instancing?hu=!0:hl.isInstancedMesh||!0!==su.instancing?hl.isSkinnedMesh&&!1===su.skinning?hu=!0:hl.isSkinnedMesh||!0!==su.skinning?hl.isInstancedMesh&&!0===su.instancingColor&&null===hl.instanceColor||hl.isInstancedMesh&&!1===su.instancingColor&&null!==hl.instanceColor||hl.isInstancedMesh&&!0===su.instancingMorph&&null===hl.morphTexture||hl.isInstancedMesh&&!1===su.instancingMorph&&null!==hl.morphTexture||su.envMap!==Al||!0===cl.fog&&su.fog!==dl?hu=!0:void 0===su.numClippingPlanes||su.numClippingPlanes===Hd.numPlanes&&su.numIntersection===Hd.numIntersection?(su.vertexAlphas!==bl||su.vertexTangents!==kl||su.morphTargets!==Dl||su.morphNormals!==Wl||su.morphColors!==Ql||su.toneMapping!==wc||su.morphTargetsCount!==iu)&&(hu=!0):hu=!0:hu=!0:hu=!0:hu=!0:(hu=!0,su.__version=cl.version);let Lu=su.currentProgram;!0===hu&&(Lu=getProgram(cl,Da,hl));let qu=!1,ih=!1,gh=!1;const ed=Lu.getUniforms(),td=su.uniforms;Ld.useProgram(Lu.program)&&(qu=!0,ih=!0,gh=!0);cl.id!==Du&&(Du=cl.id,ih=!0);if(qu||Nu!==F){ed.setValue($d,"projectionMatrix",F.projectionMatrix),ed.setValue($d,"viewMatrix",F.matrixWorldInverse);const Da=ed.map.cameraPosition;void 0!==Da&&Da.setValue($d,bd.setFromMatrixPosition(F.matrixWorld)),Cd.logarithmicDepthBuffer&&ed.setValue($d,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(cl.isMeshPhongMaterial||cl.isMeshToonMaterial||cl.isMeshLambertMaterial||cl.isMeshBasicMaterial||cl.isMeshStandardMaterial||cl.isShaderMaterial)&&ed.setValue($d,"isOrthographic",!0===F.isOrthographicCamera),Nu!==F&&(Nu=F,ih=!0,gh=!0)}if(hl.isSkinnedMesh){ed.setOptional($d,hl,"bindMatrix"),ed.setOptional($d,hl,"bindMatrixInverse");const F=hl.skeleton;F&&(null===F.boneTexture&&F.computeBoneTexture(),ed.setValue($d,"boneTexture",F.boneTexture,Dd))}hl.isBatchedMesh&&(ed.setOptional($d,hl,"batchingTexture"),ed.setValue($d,"batchingTexture",hl._matricesTexture,Dd),ed.setOptional($d,hl,"batchingIdTexture"),ed.setValue($d,"batchingIdTexture",hl._indirectTexture,Dd),ed.setOptional($d,hl,"batchingColorTexture"),null!==hl._colorsTexture&&ed.setValue($d,"batchingColorTexture",hl._colorsTexture,Dd));const id=ll.morphAttributes;void 0===id.position&&void 0===id.normal&&void 0===id.color||Wd.update(hl,ll,Lu);(ih||su.receiveShadow!==hl.receiveShadow)&&(su.receiveShadow=hl.receiveShadow,ed.setValue($d,"receiveShadow",hl.receiveShadow));cl.isMeshGouraudMaterial&&null!==cl.envMap&&(td.envMap.value=Al,td.flipEnvMap.value=Al.isCubeTexture&&!1===Al.isRenderTargetTexture?-1:1);cl.isMeshStandardMaterial&&null===cl.envMap&&null!==Da.environment&&(td.envMapIntensity.value=Da.environmentIntensity);ih&&(ed.setValue($d,"toneMappingExposure",cu.toneMappingExposure),su.needsLights&&(sd=gh,(ad=td).ambientLightColor.needsUpdate=sd,ad.lightProbe.needsUpdate=sd,ad.directionalLights.needsUpdate=sd,ad.directionalLightShadows.needsUpdate=sd,ad.pointLights.needsUpdate=sd,ad.pointLightShadows.needsUpdate=sd,ad.spotLights.needsUpdate=sd,ad.spotLightShadows.needsUpdate=sd,ad.rectAreaLights.needsUpdate=sd,ad.hemisphereLights.needsUpdate=sd),dl&&!0===cl.fog&&jd.refreshFogUniforms(td,dl),jd.refreshMaterialUniforms(td,cl,rd,nd,eu.state.transmissionRenderTarget[F.id]),WebGLUniforms.upload($d,getUniformList(su),td,Dd));var ad,sd;cl.isShaderMaterial&&!0===cl.uniformsNeedUpdate&&(WebGLUniforms.upload($d,getUniformList(su),td,Dd),cl.uniformsNeedUpdate=!1);cl.isSpriteMaterial&&ed.setValue($d,"center",hl.center);if(ed.setValue($d,"modelViewMatrix",hl.modelViewMatrix),ed.setValue($d,"normalMatrix",hl.normalMatrix),ed.setValue($d,"modelMatrix",hl.matrixWorld),cl.isShaderMaterial||cl.isRawShaderMaterial){const F=cl.uniformsGroups;for(let Da=0,ll=F.length;Da<ll;Da++){const ll=F[Da];Jd.update(ll,Lu),Jd.bind(ll,Lu)}}return Lu}(F,Da,ll,cl,hl);Ld.setMaterial(cl,pl);let Al=ll.index,bl=1;if(!0===cl.wireframe){if(Al=Bd.getWireframeAttribute(ll),void 0===Al)return;bl=2}const kl=ll.drawRange,Dl=ll.attributes.position;let Wl=kl.start*bl,Ql=(kl.start+kl.count)*bl;null!==dl&&(Wl=Math.max(Wl,dl.start*bl),Ql=Math.min(Ql,(dl.start+dl.count)*bl)),null!==Al?(Wl=Math.max(Wl,0),Ql=Math.min(Ql,Al.count)):void 0!==Dl&&null!==Dl&&(Wl=Math.max(Wl,0),Ql=Math.min(Ql,Dl.count));const wc=Ql-Wl;if(wc<0||wc===1/0)return;let Sc;Yd.setup(hl,cl,fl,ll,Al);let iu=Kd;if(null!==Al&&(Sc=Ud.get(Al),iu=Qd,iu.setIndex(Sc)),hl.isMesh)!0===cl.wireframe?(Ld.setLineWidth(cl.wireframeLinewidth*getTargetPixelRatio()),iu.setMode($d.LINES)):iu.setMode($d.TRIANGLES);else if(hl.isLine){let F=cl.linewidth;void 0===F&&(F=1),Ld.setLineWidth(F*getTargetPixelRatio()),hl.isLineSegments?iu.setMode($d.LINES):hl.isLineLoop?iu.setMode($d.LINE_LOOP):iu.setMode($d.LINE_STRIP)}else hl.isPoints?iu.setMode($d.POINTS):hl.isSprite&&iu.setMode($d.TRIANGLES);if(hl.isBatchedMesh)if(null!==hl._multiDrawInstances)iu.renderMultiDrawInstances(hl._multiDrawStarts,hl._multiDrawCounts,hl._multiDrawCount,hl._multiDrawInstances);else if(Id.get("WEBGL_multi_draw"))iu.renderMultiDraw(hl._multiDrawStarts,hl._multiDrawCounts,hl._multiDrawCount);else{const F=hl._multiDrawStarts,Da=hl._multiDrawCounts,ll=hl._multiDrawCount,dl=Al?Ud.get(Al).bytesPerElement:1,pl=Pd.get(cl).currentProgram.getUniforms();for(let cl=0;cl<ll;cl++)pl.setValue($d,"_gl_DrawID",cl),iu.render(F[cl]/dl,Da[cl])}else if(hl.isInstancedMesh)iu.renderInstances(Wl,wc,hl.count);else if(ll.isInstancedBufferGeometry){const F=void 0!==ll._maxInstanceCount?ll._maxInstanceCount:1/0,Da=Math.min(ll.instanceCount,F);iu.renderInstances(Wl,wc,Da)}else iu.render(Wl,wc)},this.compile=function(F,Da,ll){void 0===ll&&(ll=null),null===ll&&(ll=F),eu=Gd.get(ll),eu.init(Da),su.push(eu),ll.traverseVisible((function(F){F.isLight&&F.layers.test(Da.layers)&&(eu.pushLight(F),F.castShadow&&eu.pushShadow(F))})),F!==ll&&F.traverseVisible((function(F){F.isLight&&F.layers.test(Da.layers)&&(eu.pushLight(F),F.castShadow&&eu.pushShadow(F))})),eu.setupLights();const cl=new Set;return F.traverse((function(F){const Da=F.material;if(Da)if(Array.isArray(Da))for(let hl=0;hl<Da.length;hl++){const dl=Da[hl];prepareMaterial(dl,ll,F),cl.add(dl)}else prepareMaterial(Da,ll,F),cl.add(Da)})),su.pop(),eu=null,cl},this.compileAsync=function(F,Da,ll){void 0===ll&&(ll=null);const cl=this.compile(F,Da,ll);return new Promise((Da=>{function checkMaterialsReady(){cl.forEach((function(F){Pd.get(F).currentProgram.isReady()&&cl.delete(F)})),0!==cl.size?setTimeout(checkMaterialsReady,10):Da(F)}null!==Id.get("KHR_parallel_shader_compile")?checkMaterialsReady():setTimeout(checkMaterialsReady,10)}))};let mp=null;function onXRSessionStart(){gp.stop()}function onXRSessionEnd(){gp.start()}const gp=new WebGLAnimation;function projectObject(F,Da,ll,cl){if(!1===F.visible)return;if(F.layers.test(Da.layers))if(F.isGroup)ll=F.renderOrder;else if(F.isLOD)!0===F.autoUpdate&&F.update(Da);else if(F.isLight)eu.pushLight(F),F.castShadow&&eu.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||dd.intersectsSprite(F)){cl&&wd.setFromMatrixPosition(F.matrixWorld).applyMatrix4(xd);const Da=Od.update(F),hl=F.material;hl.visible&&Sc.push(F,Da,hl,ll,wd.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||dd.intersectsObject(F))){const Da=Od.update(F),hl=F.material;if(cl&&(void 0!==F.boundingSphere?(null===F.boundingSphere&&F.computeBoundingSphere(),wd.copy(F.boundingSphere.center)):(null===Da.boundingSphere&&Da.computeBoundingSphere(),wd.copy(Da.boundingSphere.center)),wd.applyMatrix4(F.matrixWorld).applyMatrix4(xd)),Array.isArray(hl)){const cl=Da.groups;for(let dl=0,pl=cl.length;dl<pl;dl++){const pl=cl[dl],fl=hl[pl.materialIndex];fl&&fl.visible&&Sc.push(F,Da,fl,ll,wd.z,pl)}}else hl.visible&&Sc.push(F,Da,hl,ll,wd.z,null)}const hl=F.children;for(let dl=0,pl=hl.length;dl<pl;dl++)projectObject(hl[dl],Da,ll,cl)}function renderScene(F,Da,ll,cl){const hl=F.opaque,dl=F.transmissive,pl=F.transparent;eu.setupLightsView(ll),!0===md&&Hd.setGlobalState(cu.clippingPlanes,ll),cl&&Ld.viewport(qu.copy(cl)),hl.length>0&&renderObjects(hl,Da,ll),dl.length>0&&renderObjects(dl,Da,ll),pl.length>0&&renderObjects(pl,Da,ll),Ld.buffers.depth.setTest(!0),Ld.buffers.depth.setMask(!0),Ld.buffers.color.setMask(!0),Ld.setPolygonOffset(!1)}function renderTransmissionPass(F,Da,ll,cl){if(null!==(!0===ll.isScene?ll.overrideMaterial:null))return;void 0===eu.state.transmissionRenderTarget[cl.id]&&(eu.state.transmissionRenderTarget[cl.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:Id.has("EXT_color_buffer_half_float")||Id.has("EXT_color_buffer_float")?Ad:ud,minFilter:cd,samples:4,stencilBuffer:dl,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:sm.workingColorSpace}));const hl=eu.state.transmissionRenderTarget[cl.id],pl=cl.viewport||qu;hl.setSize(pl.z,pl.w);const fl=cu.getRenderTarget();cu.setRenderTarget(hl),cu.getClearColor(ed),td=cu.getClearAlpha(),td<1&&cu.setClearColor(16777215,.5),cu.clear(),Md&&Zd.render(ll);const Al=cu.toneMapping;cu.toneMapping=0;const bl=cl.viewport;if(void 0!==cl.viewport&&(cl.viewport=void 0),eu.setupLightsView(cl),!0===md&&Hd.setGlobalState(cu.clippingPlanes,cl),renderObjects(F,ll,cl),Dd.updateMultisampleRenderTarget(hl),Dd.updateRenderTargetMipmap(hl),!1===Id.has("WEBGL_multisampled_render_to_texture")){let F=!1;for(let hl=0,dl=Da.length;hl<dl;hl++){const dl=Da[hl],pl=dl.object,fl=dl.geometry,Al=dl.material,bl=dl.group;if(2===Al.side&&pl.layers.test(cl.layers)){const Da=Al.side;Al.side=1,Al.needsUpdate=!0,renderObject(pl,ll,cl,fl,Al,bl),Al.side=Da,Al.needsUpdate=!0,F=!0}}!0===F&&(Dd.updateMultisampleRenderTarget(hl),Dd.updateRenderTargetMipmap(hl))}cu.setRenderTarget(fl),cu.setClearColor(ed,td),void 0!==bl&&(cl.viewport=bl),cu.toneMapping=Al}function renderObjects(F,Da,ll){const cl=!0===Da.isScene?Da.overrideMaterial:null;for(let hl=0,dl=F.length;hl<dl;hl++){const dl=F[hl],pl=dl.object,fl=dl.geometry,Al=null===cl?dl.material:cl,bl=dl.group;pl.layers.test(ll.layers)&&renderObject(pl,Da,ll,fl,Al,bl)}}function renderObject(F,Da,ll,cl,hl,dl){F.onBeforeRender(cu,Da,ll,cl,hl,dl),F.modelViewMatrix.multiplyMatrices(ll.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),hl.onBeforeRender(cu,Da,ll,cl,F,dl),!0===hl.transparent&&2===hl.side&&!1===hl.forceSinglePass?(hl.side=1,hl.needsUpdate=!0,cu.renderBufferDirect(ll,Da,cl,hl,F,dl),hl.side=0,hl.needsUpdate=!0,cu.renderBufferDirect(ll,Da,cl,hl,F,dl),hl.side=2):cu.renderBufferDirect(ll,Da,cl,hl,F,dl),F.onAfterRender(cu,Da,ll,cl,hl,dl)}function getProgram(F,Da,ll){!0!==Da.isScene&&(Da=Ed);const cl=Pd.get(F),hl=eu.state.lights,dl=eu.state.shadowsArray,pl=hl.state.version,fl=Fd.getParameters(F,hl.state,dl,Da,ll),Al=Fd.getProgramCacheKey(fl);let bl=cl.programs;cl.environment=F.isMeshStandardMaterial?Da.environment:null,cl.fog=Da.fog,cl.envMap=(F.isMeshStandardMaterial?Nd:Rd).get(F.envMap||cl.environment),cl.envMapRotation=null!==cl.environment&&null===F.envMap?Da.environmentRotation:F.envMapRotation,void 0===bl&&(F.addEventListener("dispose",onMaterialDispose),bl=new Map,cl.programs=bl);let kl=bl.get(Al);if(void 0!==kl){if(cl.currentProgram===kl&&cl.lightsStateVersion===pl)return updateCommonMaterialProperties(F,fl),kl}else fl.uniforms=Fd.getUniforms(F),F.onBeforeCompile(fl,cu),kl=Fd.acquireProgram(fl,Al),bl.set(Al,kl),cl.uniforms=fl.uniforms;const Dl=cl.uniforms;return(F.isShaderMaterial||F.isRawShaderMaterial)&&!0!==F.clipping||(Dl.clippingPlanes=Hd.uniform),updateCommonMaterialProperties(F,fl),cl.needsLights=function(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&!0===F.lights}(F),cl.lightsStateVersion=pl,cl.needsLights&&(Dl.ambientLightColor.value=hl.state.ambient,Dl.lightProbe.value=hl.state.probe,Dl.directionalLights.value=hl.state.directional,Dl.directionalLightShadows.value=hl.state.directionalShadow,Dl.spotLights.value=hl.state.spot,Dl.spotLightShadows.value=hl.state.spotShadow,Dl.rectAreaLights.value=hl.state.rectArea,Dl.ltc_1.value=hl.state.rectAreaLTC1,Dl.ltc_2.value=hl.state.rectAreaLTC2,Dl.pointLights.value=hl.state.point,Dl.pointLightShadows.value=hl.state.pointShadow,Dl.hemisphereLights.value=hl.state.hemi,Dl.directionalShadowMap.value=hl.state.directionalShadowMap,Dl.directionalShadowMatrix.value=hl.state.directionalShadowMatrix,Dl.spotShadowMap.value=hl.state.spotShadowMap,Dl.spotLightMatrix.value=hl.state.spotLightMatrix,Dl.spotLightMap.value=hl.state.spotLightMap,Dl.pointShadowMap.value=hl.state.pointShadowMap,Dl.pointShadowMatrix.value=hl.state.pointShadowMatrix),cl.currentProgram=kl,cl.uniformsList=null,kl}function getUniformList(F){if(null===F.uniformsList){const Da=F.currentProgram.getUniforms();F.uniformsList=WebGLUniforms.seqWithValue(Da.seq,F.uniforms)}return F.uniformsList}function updateCommonMaterialProperties(F,Da){const ll=Pd.get(F);ll.outputColorSpace=Da.outputColorSpace,ll.batching=Da.batching,ll.batchingColor=Da.batchingColor,ll.instancing=Da.instancing,ll.instancingColor=Da.instancingColor,ll.instancingMorph=Da.instancingMorph,ll.skinning=Da.skinning,ll.morphTargets=Da.morphTargets,ll.morphNormals=Da.morphNormals,ll.morphColors=Da.morphColors,ll.morphTargetsCount=Da.morphTargetsCount,ll.numClippingPlanes=Da.numClippingPlanes,ll.numIntersection=Da.numClipIntersection,ll.vertexAlphas=Da.vertexAlphas,ll.vertexTangents=Da.vertexTangents,ll.toneMapping=Da.toneMapping}gp.setAnimationLoop((function(F){mp&&mp(F)})),"undefined"!==typeof self&&gp.setContext(self),this.setAnimationLoop=function(F){mp=F,lp.setAnimationLoop(F),null===F?gp.stop():gp.start()},lp.addEventListener("sessionstart",onXRSessionStart),lp.addEventListener("sessionend",onXRSessionEnd),this.render=function(F,Da){if(void 0!==Da&&!0!==Da.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===uu)return;if(!0===F.matrixWorldAutoUpdate&&F.updateMatrixWorld(),null===Da.parent&&!0===Da.matrixWorldAutoUpdate&&Da.updateMatrixWorld(),!0===lp.enabled&&!0===lp.isPresenting&&(!0===lp.cameraAutoUpdate&&lp.updateCamera(Da),Da=lp.getCamera()),!0===F.isScene&&F.onBeforeRender(cu,F,Da,zu),eu=Gd.get(F,su.length),eu.init(Da),su.push(eu),xd.multiplyMatrices(Da.projectionMatrix,Da.matrixWorldInverse),dd.setFromProjectionMatrix(xd),gd=this.localClippingEnabled,md=Hd.init(this.clippingPlanes,gd),Sc=Vd.get(F,iu.length),Sc.init(),iu.push(Sc),!0===lp.enabled&&!0===lp.isPresenting){const F=cu.xr.getDepthSensingMesh();null!==F&&projectObject(F,Da,-1/0,cu.sortObjects)}projectObject(F,Da,0,cu.sortObjects),Sc.finish(),!0===cu.sortObjects&&Sc.sort(ad,sd),Md=!1===lp.enabled||!1===lp.isPresenting||!1===lp.hasDepthSensing(),Md&&Zd.addToRenderList(Sc,F),this.info.render.frame++,!0===md&&Hd.beginShadows();const ll=eu.state.shadowsArray;qd.render(ll,F,Da),!0===md&&Hd.endShadows(),!0===this.info.autoReset&&this.info.reset();const cl=Sc.opaque,hl=Sc.transmissive;if(eu.setupLights(),Da.isArrayCamera){const ll=Da.cameras;if(hl.length>0)for(let Da=0,dl=ll.length;Da<dl;Da++){renderTransmissionPass(cl,hl,F,ll[Da])}Md&&Zd.render(F);for(let Da=0,cl=ll.length;Da<cl;Da++){const cl=ll[Da];renderScene(Sc,F,cl,cl.viewport)}}else hl.length>0&&renderTransmissionPass(cl,hl,F,Da),Md&&Zd.render(F),renderScene(Sc,F,Da);null!==zu&&(Dd.updateMultisampleRenderTarget(zu),Dd.updateRenderTargetMipmap(zu)),!0===F.isScene&&F.onAfterRender(cu,F,Da),Yd.resetDefaultState(),Du=-1,Nu=null,su.pop(),su.length>0?(eu=su[su.length-1],!0===md&&Hd.setGlobalState(cu.clippingPlanes,eu.state.camera)):eu=null,iu.pop(),Sc=iu.length>0?iu[iu.length-1]:null},this.getActiveCubeFace=function(){return hu},this.getActiveMipmapLevel=function(){return Lu},this.getRenderTarget=function(){return zu},this.setRenderTargetTextures=function(F,Da,ll){Pd.get(F.texture).__webglTexture=Da,Pd.get(F.depthTexture).__webglTexture=ll;const cl=Pd.get(F);cl.__hasExternalTextures=!0,cl.__autoAllocateDepthBuffer=void 0===ll,cl.__autoAllocateDepthBuffer||!0===Id.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),cl.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,Da){const ll=Pd.get(F);ll.__webglFramebuffer=Da,ll.__useDefaultFramebuffer=void 0===Da},this.setRenderTarget=function(F,Da,ll){void 0===Da&&(Da=0),void 0===ll&&(ll=0),zu=F,hu=Da,Lu=ll;let cl=!0,hl=null,dl=!1,pl=!1;if(F){const fl=Pd.get(F);if(void 0!==fl.__useDefaultFramebuffer)Ld.bindFramebuffer($d.FRAMEBUFFER,null),cl=!1;else if(void 0===fl.__webglFramebuffer)Dd.setupRenderTarget(F);else if(fl.__hasExternalTextures)Dd.rebindTextures(F,Pd.get(F.texture).__webglTexture,Pd.get(F.depthTexture).__webglTexture);else if(F.depthBuffer){const Da=F.depthTexture;if(fl.__boundDepthTexture!==Da){if(null!==Da&&Pd.has(Da)&&(F.width!==Da.image.width||F.height!==Da.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Dd.setupDepthRenderbuffer(F)}}const Al=F.texture;(Al.isData3DTexture||Al.isDataArrayTexture||Al.isCompressedArrayTexture)&&(pl=!0);const bl=Pd.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(hl=Array.isArray(bl[Da])?bl[Da][ll]:bl[Da],dl=!0):hl=F.samples>0&&!1===Dd.useMultisampledRTT(F)?Pd.get(F).__webglMultisampledFramebuffer:Array.isArray(bl)?bl[ll]:bl,qu.copy(F.viewport),ih.copy(F.scissor),gh=F.scissorTest}else qu.copy(od).multiplyScalar(rd).floor(),ih.copy(ld).multiplyScalar(rd).floor(),gh=hd;if(Ld.bindFramebuffer($d.FRAMEBUFFER,hl)&&cl&&Ld.drawBuffers(F,hl),Ld.viewport(qu),Ld.scissor(ih),Ld.setScissorTest(gh),dl){const cl=Pd.get(F.texture);$d.framebufferTexture2D($d.FRAMEBUFFER,$d.COLOR_ATTACHMENT0,$d.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl.__webglTexture,ll)}else if(pl){const cl=Pd.get(F.texture),hl=Da||0;$d.framebufferTextureLayer($d.FRAMEBUFFER,$d.COLOR_ATTACHMENT0,cl.__webglTexture,ll||0,hl)}Du=-1},this.readRenderTargetPixels=function(F,Da,ll,cl,hl,dl,pl){if(!F||!F.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let fl=Pd.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&void 0!==pl&&(fl=fl[pl]),fl){Ld.bindFramebuffer($d.FRAMEBUFFER,fl);try{const pl=F.texture,fl=pl.format,Al=pl.type;if(!Cd.textureFormatReadable(fl))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!Cd.textureTypeReadable(Al))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Da>=0&&Da<=F.width-cl&&ll>=0&&ll<=F.height-hl&&$d.readPixels(Da,ll,cl,hl,Xd.convert(fl),Xd.convert(Al),dl)}finally{const F=null!==zu?Pd.get(zu).__webglFramebuffer:null;Ld.bindFramebuffer($d.FRAMEBUFFER,F)}}},this.readRenderTargetPixelsAsync=async function(F,Da,ll,cl,hl,dl,pl){if(!F||!F.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let fl=Pd.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&void 0!==pl&&(fl=fl[pl]),fl){Ld.bindFramebuffer($d.FRAMEBUFFER,fl);try{const pl=F.texture,fl=pl.format,Al=pl.type;if(!Cd.textureFormatReadable(fl))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Cd.textureTypeReadable(Al))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Da>=0&&Da<=F.width-cl&&ll>=0&&ll<=F.height-hl){const F=$d.createBuffer();$d.bindBuffer($d.PIXEL_PACK_BUFFER,F),$d.bufferData($d.PIXEL_PACK_BUFFER,dl.byteLength,$d.STREAM_READ),$d.readPixels(Da,ll,cl,hl,Xd.convert(fl),Xd.convert(Al),0),$d.flush();const pl=$d.fenceSync($d.SYNC_GPU_COMMANDS_COMPLETE,0);await function(F,Da,ll){return new Promise((function(cl,hl){setTimeout((function probe(){switch(F.clientWaitSync(Da,F.SYNC_FLUSH_COMMANDS_BIT,0)){case F.WAIT_FAILED:hl();break;case F.TIMEOUT_EXPIRED:setTimeout(probe,ll);break;default:cl()}}),ll)}))}($d,pl,4);try{$d.bindBuffer($d.PIXEL_PACK_BUFFER,F),$d.getBufferSubData($d.PIXEL_PACK_BUFFER,0,dl)}finally{$d.deleteBuffer(F),$d.deleteSync(pl)}return dl}}finally{const F=null!==zu?Pd.get(zu).__webglFramebuffer:null;Ld.bindFramebuffer($d.FRAMEBUFFER,F)}}},this.copyFramebufferToTexture=function(F,Da,ll){void 0===Da&&(Da=null),void 0===ll&&(ll=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Da=arguments[0]||null,F=arguments[1]);const cl=Math.pow(2,-ll),hl=Math.floor(F.image.width*cl),dl=Math.floor(F.image.height*cl),pl=null!==Da?Da.x:0,fl=null!==Da?Da.y:0;Dd.setTexture2D(F,0),$d.copyTexSubImage2D($d.TEXTURE_2D,ll,0,0,pl,fl,hl,dl),Ld.unbindTexture()},this.copyTextureToTexture=function(F,Da,ll,cl,hl){let dl,pl,fl,Al,bl,kl;void 0===ll&&(ll=null),void 0===cl&&(cl=null),void 0===hl&&(hl=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyTextureToTexture function signature has changed."),cl=arguments[0]||null,F=arguments[1],Da=arguments[2],hl=arguments[3]||0,ll=null),null!==ll?(dl=ll.max.x-ll.min.x,pl=ll.max.y-ll.min.y,fl=ll.min.x,Al=ll.min.y):(dl=F.image.width,pl=F.image.height,fl=0,Al=0),null!==cl?(bl=cl.x,kl=cl.y):(bl=0,kl=0);const Dl=Xd.convert(Da.format),Wl=Xd.convert(Da.type);Dd.setTexture2D(Da,0),$d.pixelStorei($d.UNPACK_FLIP_Y_WEBGL,Da.flipY),$d.pixelStorei($d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Da.premultiplyAlpha),$d.pixelStorei($d.UNPACK_ALIGNMENT,Da.unpackAlignment);const Ql=$d.getParameter($d.UNPACK_ROW_LENGTH),wc=$d.getParameter($d.UNPACK_IMAGE_HEIGHT),Sc=$d.getParameter($d.UNPACK_SKIP_PIXELS),eu=$d.getParameter($d.UNPACK_SKIP_ROWS),iu=$d.getParameter($d.UNPACK_SKIP_IMAGES),su=F.isCompressedTexture?F.mipmaps[hl]:F.image;$d.pixelStorei($d.UNPACK_ROW_LENGTH,su.width),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,su.height),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,fl),$d.pixelStorei($d.UNPACK_SKIP_ROWS,Al),F.isDataTexture?$d.texSubImage2D($d.TEXTURE_2D,hl,bl,kl,dl,pl,Dl,Wl,su.data):F.isCompressedTexture?$d.compressedTexSubImage2D($d.TEXTURE_2D,hl,bl,kl,su.width,su.height,Dl,su.data):$d.texSubImage2D($d.TEXTURE_2D,hl,bl,kl,dl,pl,Dl,Wl,su),$d.pixelStorei($d.UNPACK_ROW_LENGTH,Ql),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,wc),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,Sc),$d.pixelStorei($d.UNPACK_SKIP_ROWS,eu),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,iu),0===hl&&Da.generateMipmaps&&$d.generateMipmap($d.TEXTURE_2D),Ld.unbindTexture()},this.copyTextureToTexture3D=function(F,Da,ll,cl,hl){let dl,pl,fl,Al,bl,kl,Dl,Wl,Ql;void 0===ll&&(ll=null),void 0===cl&&(cl=null),void 0===hl&&(hl=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ll=arguments[0]||null,cl=arguments[1]||null,F=arguments[2],Da=arguments[3],hl=arguments[4]||0);const wc=F.isCompressedTexture?F.mipmaps[hl]:F.image;null!==ll?(dl=ll.max.x-ll.min.x,pl=ll.max.y-ll.min.y,fl=ll.max.z-ll.min.z,Al=ll.min.x,bl=ll.min.y,kl=ll.min.z):(dl=wc.width,pl=wc.height,fl=wc.depth,Al=0,bl=0,kl=0),null!==cl?(Dl=cl.x,Wl=cl.y,Ql=cl.z):(Dl=0,Wl=0,Ql=0);const Sc=Xd.convert(Da.format),eu=Xd.convert(Da.type);let iu;if(Da.isData3DTexture)Dd.setTexture3D(Da,0),iu=$d.TEXTURE_3D;else{if(!Da.isDataArrayTexture&&!Da.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Dd.setTexture2DArray(Da,0),iu=$d.TEXTURE_2D_ARRAY}$d.pixelStorei($d.UNPACK_FLIP_Y_WEBGL,Da.flipY),$d.pixelStorei($d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Da.premultiplyAlpha),$d.pixelStorei($d.UNPACK_ALIGNMENT,Da.unpackAlignment);const su=$d.getParameter($d.UNPACK_ROW_LENGTH),cu=$d.getParameter($d.UNPACK_IMAGE_HEIGHT),uu=$d.getParameter($d.UNPACK_SKIP_PIXELS),hu=$d.getParameter($d.UNPACK_SKIP_ROWS),Lu=$d.getParameter($d.UNPACK_SKIP_IMAGES);$d.pixelStorei($d.UNPACK_ROW_LENGTH,wc.width),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,wc.height),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,Al),$d.pixelStorei($d.UNPACK_SKIP_ROWS,bl),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,kl),F.isDataTexture||F.isData3DTexture?$d.texSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,eu,wc.data):Da.isCompressedArrayTexture?$d.compressedTexSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,wc.data):$d.texSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,eu,wc),$d.pixelStorei($d.UNPACK_ROW_LENGTH,su),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,cu),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,uu),$d.pixelStorei($d.UNPACK_SKIP_ROWS,hu),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,Lu),0===hl&&Da.generateMipmaps&&$d.generateMipmap(iu),Ld.unbindTexture()},this.initRenderTarget=function(F){void 0===Pd.get(F).__webglFramebuffer&&Dd.setupRenderTarget(F)},this.initTexture=function(F){F.isCubeTexture?Dd.setTextureCube(F,0):F.isData3DTexture?Dd.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?Dd.setTexture2DArray(F,0):Dd.setTexture2D(F,0),Ld.unbindTexture()},this.resetState=function(){hu=0,Lu=0,zu=null,Ld.reset(),Yd.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Wp}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(F){this._outputColorSpace=F;const Da=this.getContext();Da.drawingBufferColorSpace=F===Cp?"display-p3":"srgb",Da.unpackColorSpace=sm.workingColorSpace===Lp?"display-p3":"srgb"}}class Scene extends Object3D{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 Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(F,Da){return super.copy(F,Da),null!==F.background&&(this.background=F.background.clone()),null!==F.environment&&(this.environment=F.environment.clone()),null!==F.fog&&(this.fog=F.fog.clone()),this.backgroundBlurriness=F.backgroundBlurriness,this.backgroundIntensity=F.backgroundIntensity,this.backgroundRotation.copy(F.backgroundRotation),this.environmentIntensity=F.environmentIntensity,this.environmentRotation.copy(F.environmentRotation),null!==F.overrideMaterial&&(this.overrideMaterial=F.overrideMaterial.clone()),this.matrixAutoUpdate=F.matrixAutoUpdate,this}toJSON(F){const Da=super.toJSON(F);return null!==this.fog&&(Da.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(Da.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(Da.object.backgroundIntensity=this.backgroundIntensity),Da.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(Da.object.environmentIntensity=this.environmentIntensity),Da.object.environmentRotation=this.environmentRotation.toArray(),Da}}class LineBasicMaterial extends Material{constructor(F){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Color(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(F)}copy(F){return super.copy(F),this.color.copy(F.color),this.map=F.map,this.linewidth=F.linewidth,this.linecap=F.linecap,this.linejoin=F.linejoin,this.fog=F.fog,this}}const jg=new Vector3,Vg=new Vector3,Gg=new Matrix4,Hg=new Ray,qg=new Sphere,Zg=new Vector3,Wg=new Vector3;class Line extends Object3D{constructor(F,Da){void 0===F&&(F=new BufferGeometry),void 0===Da&&(Da=new LineBasicMaterial),super(),this.isLine=!0,this.type="Line",this.geometry=F,this.material=Da,this.updateMorphTargets()}copy(F,Da){return super.copy(F,Da),this.material=Array.isArray(F.material)?F.material.slice():F.material,this.geometry=F.geometry,this}computeLineDistances(){const F=this.geometry;if(null===F.index){const Da=F.attributes.position,ll=[0];for(let F=1,cl=Da.count;F<cl;F++)jg.fromBufferAttribute(Da,F-1),Vg.fromBufferAttribute(Da,F),ll[F]=ll[F-1],ll[F]+=jg.distanceTo(Vg);F.setAttribute("lineDistance",new Float32BufferAttribute(ll,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(F,Da){const ll=this.geometry,cl=this.matrixWorld,hl=F.params.Line.threshold,dl=ll.drawRange;if(null===ll.boundingSphere&&ll.computeBoundingSphere(),qg.copy(ll.boundingSphere),qg.applyMatrix4(cl),qg.radius+=hl,!1===F.ray.intersectsSphere(qg))return;Gg.copy(cl).invert(),Hg.copy(F.ray).applyMatrix4(Gg);const pl=hl/((this.scale.x+this.scale.y+this.scale.z)/3),fl=pl*pl,Al=this.isLineSegments?2:1,bl=ll.index,kl=ll.attributes.position;if(null!==bl){const ll=Math.max(0,dl.start),cl=Math.min(bl.count,dl.start+dl.count);for(let hl=ll,dl=cl-1;hl<dl;hl+=Al){const ll=bl.getX(hl),cl=bl.getX(hl+1),dl=checkIntersection(this,F,Hg,fl,ll,cl);dl&&Da.push(dl)}if(this.isLineLoop){const hl=bl.getX(cl-1),dl=bl.getX(ll),pl=checkIntersection(this,F,Hg,fl,hl,dl);pl&&Da.push(pl)}}else{const ll=Math.max(0,dl.start),cl=Math.min(kl.count,dl.start+dl.count);for(let hl=ll,dl=cl-1;hl<dl;hl+=Al){const ll=checkIntersection(this,F,Hg,fl,hl,hl+1);ll&&Da.push(ll)}if(this.isLineLoop){const hl=checkIntersection(this,F,Hg,fl,cl-1,ll);hl&&Da.push(hl)}}}updateMorphTargets(){const F=this.geometry.morphAttributes,Da=Object.keys(F);if(Da.length>0){const ll=F[Da[0]];if(void 0!==ll){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let F=0,Da=ll.length;F<Da;F++){const Da=ll[F].name||String(F);this.morphTargetInfluences.push(0),this.morphTargetDictionary[Da]=F}}}}}function checkIntersection(F,Da,ll,cl,hl,dl){const pl=F.geometry.attributes.position;jg.fromBufferAttribute(pl,hl),Vg.fromBufferAttribute(pl,dl);if(ll.distanceSqToSegment(jg,Vg,Zg,Wg)>cl)return;Zg.applyMatrix4(F.matrixWorld);const fl=Da.ray.origin.distanceTo(Zg);return fl<Da.near||fl>Da.far?void 0:{distance:fl,point:Wg.clone().applyMatrix4(F.matrixWorld),index:hl,face:null,faceIndex:null,object:F}}const Kg=new Vector3,Qg=new Vector3;class LineSegments extends Line{constructor(F,Da){super(F,Da),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const F=this.geometry;if(null===F.index){const Da=F.attributes.position,ll=[];for(let F=0,cl=Da.count;F<cl;F+=2)Kg.fromBufferAttribute(Da,F),Qg.fromBufferAttribute(Da,F+1),ll[F]=0===F?0:ll[F-1],ll[F+1]=ll[F]+Kg.distanceTo(Qg);F.setAttribute("lineDistance",new Float32BufferAttribute(ll,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class SphereGeometry extends BufferGeometry{constructor(F,Da,ll,cl,hl,dl,pl){void 0===F&&(F=1),void 0===Da&&(Da=32),void 0===ll&&(ll=16),void 0===cl&&(cl=0),void 0===hl&&(hl=2*Math.PI),void 0===dl&&(dl=0),void 0===pl&&(pl=Math.PI),super(),this.type="SphereGeometry",this.parameters={radius:F,widthSegments:Da,heightSegments:ll,phiStart:cl,phiLength:hl,thetaStart:dl,thetaLength:pl},Da=Math.max(3,Math.floor(Da)),ll=Math.max(2,Math.floor(ll));const fl=Math.min(dl+pl,Math.PI);let Al=0;const bl=[],kl=new Vector3,Dl=new Vector3,Wl=[],Ql=[],wc=[],Sc=[];for(let eu=0;eu<=ll;eu++){const Wl=[],iu=eu/ll;let su=0;0===eu&&0===dl?su=.5/Da:eu===ll&&fl===Math.PI&&(su=-.5/Da);for(let ll=0;ll<=Da;ll++){const fl=ll/Da;kl.x=-F*Math.cos(cl+fl*hl)*Math.sin(dl+iu*pl),kl.y=F*Math.cos(dl+iu*pl),kl.z=F*Math.sin(cl+fl*hl)*Math.sin(dl+iu*pl),Ql.push(kl.x,kl.y,kl.z),Dl.copy(kl).normalize(),wc.push(Dl.x,Dl.y,Dl.z),Sc.push(fl+su,1-iu),Wl.push(Al++)}bl.push(Wl)}for(let eu=0;eu<ll;eu++)for(let F=0;F<Da;F++){const Da=bl[eu][F+1],cl=bl[eu][F],hl=bl[eu+1][F],pl=bl[eu+1][F+1];(0!==eu||dl>0)&&Wl.push(Da,cl,pl),(eu!==ll-1||fl<Math.PI)&&Wl.push(cl,hl,pl)}this.setIndex(Wl),this.setAttribute("position",new Float32BufferAttribute(Ql,3)),this.setAttribute("normal",new Float32BufferAttribute(wc,3)),this.setAttribute("uv",new Float32BufferAttribute(Sc,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new SphereGeometry(F.radius,F.widthSegments,F.heightSegments,F.phiStart,F.phiLength,F.thetaStart,F.thetaLength)}}class WireframeGeometry extends BufferGeometry{constructor(F){if(void 0===F&&(F=null),super(),this.type="WireframeGeometry",this.parameters={geometry:F},null!==F){const Da=[],ll=new Set,cl=new Vector3,hl=new Vector3;if(null!==F.index){const dl=F.attributes.position,pl=F.index;let fl=F.groups;0===fl.length&&(fl=[{start:0,count:pl.count,materialIndex:0}]);for(let F=0,Al=fl.length;F<Al;++F){const Al=fl[F],bl=Al.start;for(let F=bl,fl=bl+Al.count;F<fl;F+=3)for(let Al=0;Al<3;Al++){const fl=pl.getX(F+Al),bl=pl.getX(F+(Al+1)%3);cl.fromBufferAttribute(dl,fl),hl.fromBufferAttribute(dl,bl),!0===isUniqueEdge(cl,hl,ll)&&(Da.push(cl.x,cl.y,cl.z),Da.push(hl.x,hl.y,hl.z))}}}else{const dl=F.attributes.position;for(let F=0,pl=dl.count/3;F<pl;F++)for(let fl=0;fl<3;fl++){const pl=3*F+fl,Al=3*F+(fl+1)%3;cl.fromBufferAttribute(dl,pl),hl.fromBufferAttribute(dl,Al),!0===isUniqueEdge(cl,hl,ll)&&(Da.push(cl.x,cl.y,cl.z),Da.push(hl.x,hl.y,hl.z))}}this.setAttribute("position",new Float32BufferAttribute(Da,3))}}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}}function isUniqueEdge(F,Da,ll){const cl=`${F.x},${F.y},${F.z}-${Da.x},${Da.y},${Da.z}`,hl=`${Da.x},${Da.y},${Da.z}-${F.x},${F.y},${F.z}`;return!0!==ll.has(cl)&&!0!==ll.has(hl)&&(ll.add(cl),ll.add(hl),!0)}function convertArray(F,Da,ll){return!F||!ll&&F.constructor===Da?F:"number"===typeof Da.BYTES_PER_ELEMENT?new Da(F):Array.prototype.slice.call(F)}function isTypedArray(F){return ArrayBuffer.isView(F)&&!(F instanceof DataView)}class Interpolant{constructor(F,Da,ll,cl){this.parameterPositions=F,this._cachedIndex=0,this.resultBuffer=void 0!==cl?cl:new Da.constructor(ll),this.sampleValues=Da,this.valueSize=ll,this.settings=null,this.DefaultSettings_={}}evaluate(F){const Da=this.parameterPositions;let ll=this._cachedIndex,cl=Da[ll],hl=Da[ll-1];e:{t:{let dl;i:{n:if(!(F<cl)){for(let dl=ll+2;;){if(void 0===cl){if(F<hl)break n;return ll=Da.length,this._cachedIndex=ll,this.copySampleValue_(ll-1)}if(ll===dl)break;if(hl=cl,cl=Da[++ll],F<cl)break t}dl=Da.length;break i}if(F>=hl)break e;{const pl=Da[1];F<pl&&(ll=2,hl=pl);for(let dl=ll-2;;){if(void 0===hl)return this._cachedIndex=0,this.copySampleValue_(0);if(ll===dl)break;if(cl=hl,hl=Da[--ll-1],F>=hl)break t}dl=ll,ll=0}}for(;ll<dl;){const cl=ll+dl>>>1;F<Da[cl]?dl=cl:ll=cl+1}if(cl=Da[ll],hl=Da[ll-1],void 0===hl)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===cl)return ll=Da.length,this._cachedIndex=ll,this.copySampleValue_(ll-1)}this._cachedIndex=ll,this.intervalChanged_(ll,hl,cl)}return this.interpolate_(ll,hl,F,cl)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(F){const Da=this.resultBuffer,ll=this.sampleValues,cl=this.valueSize,hl=F*cl;for(let dl=0;dl!==cl;++dl)Da[dl]=ll[hl+dl];return Da}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ep,endingEnd:Ep}}intervalChanged_(F,Da,ll){const cl=this.parameterPositions;let hl=F-2,dl=F+1,pl=cl[hl],fl=cl[dl];if(void 0===pl)switch(this.getSettings_().endingStart){case Mp:hl=F,pl=2*Da-ll;break;case Sp:hl=cl.length-2,pl=Da+cl[hl]-cl[hl+1];break;default:hl=F,pl=ll}if(void 0===fl)switch(this.getSettings_().endingEnd){case Mp:dl=F,fl=2*ll-Da;break;case Sp:dl=1,fl=ll+cl[1]-cl[0];break;default:dl=F-1,fl=Da}const Al=.5*(ll-Da),bl=this.valueSize;this._weightPrev=Al/(Da-pl),this._weightNext=Al/(fl-ll),this._offsetPrev=hl*bl,this._offsetNext=dl*bl}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=F*pl,Al=fl-pl,bl=this._offsetPrev,kl=this._offsetNext,Dl=this._weightPrev,Wl=this._weightNext,Ql=(ll-Da)/(cl-Da),wc=Ql*Ql,Sc=wc*Ql,eu=-Dl*Sc+2*Dl*wc-Dl*Ql,iu=(1+Dl)*Sc+(-1.5-2*Dl)*wc+(-.5+Dl)*Ql+1,su=(-1-Wl)*Sc+(1.5+Wl)*wc+.5*Ql,cu=Wl*Sc-Wl*wc;for(let uu=0;uu!==pl;++uu)hl[uu]=eu*dl[bl+uu]+iu*dl[Al+uu]+su*dl[fl+uu]+cu*dl[kl+uu];return hl}}class LinearInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=F*pl,Al=fl-pl,bl=(ll-Da)/(cl-Da),kl=1-bl;for(let Dl=0;Dl!==pl;++Dl)hl[Dl]=dl[Al+Dl]*kl+dl[fl+Dl]*bl;return hl}}class DiscreteInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F){return this.copySampleValue_(F-1)}}class KeyframeTrack{constructor(F,Da,ll,cl){if(void 0===F)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===Da||0===Da.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+F);this.name=F,this.times=convertArray(Da,this.TimeBufferType),this.values=convertArray(ll,this.ValueBufferType),this.setInterpolation(cl||this.DefaultInterpolation)}static toJSON(F){const Da=F.constructor;let ll;if(Da.toJSON!==this.toJSON)ll=Da.toJSON(F);else{ll={name:F.name,times:convertArray(F.times,Array),values:convertArray(F.values,Array)};const Da=F.getInterpolation();Da!==F.DefaultInterpolation&&(ll.interpolation=Da)}return ll.type=F.ValueTypeName,ll}InterpolantFactoryMethodDiscrete(F){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),F)}InterpolantFactoryMethodLinear(F){return new LinearInterpolant(this.times,this.values,this.getValueSize(),F)}InterpolantFactoryMethodSmooth(F){return new CubicInterpolant(this.times,this.values,this.getValueSize(),F)}setInterpolation(F){let Da;switch(F){case xp:Da=this.InterpolantFactoryMethodDiscrete;break;case bp:Da=this.InterpolantFactoryMethodLinear;break;case wp:Da=this.InterpolantFactoryMethodSmooth}if(void 0===Da){const Da="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(F===this.DefaultInterpolation)throw new Error(Da);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",Da),this}return this.createInterpolant=Da,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return xp;case this.InterpolantFactoryMethodLinear:return bp;case this.InterpolantFactoryMethodSmooth:return wp}}getValueSize(){return this.values.length/this.times.length}shift(F){if(0!==F){const Da=this.times;for(let ll=0,cl=Da.length;ll!==cl;++ll)Da[ll]+=F}return this}scale(F){if(1!==F){const Da=this.times;for(let ll=0,cl=Da.length;ll!==cl;++ll)Da[ll]*=F}return this}trim(F,Da){const ll=this.times,cl=ll.length;let hl=0,dl=cl-1;for(;hl!==cl&&ll[hl]<F;)++hl;for(;-1!==dl&&ll[dl]>Da;)--dl;if(++dl,0!==hl||dl!==cl){hl>=dl&&(dl=Math.max(dl,1),hl=dl-1);const F=this.getValueSize();this.times=ll.slice(hl,dl),this.values=this.values.slice(hl*F,dl*F)}return this}validate(){let F=!0;const Da=this.getValueSize();Da-Math.floor(Da)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),F=!1);const ll=this.times,cl=this.values,hl=ll.length;0===hl&&(console.error("THREE.KeyframeTrack: Track is empty.",this),F=!1);let dl=null;for(let pl=0;pl!==hl;pl++){const Da=ll[pl];if("number"===typeof Da&&isNaN(Da)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,pl,Da),F=!1;break}if(null!==dl&&dl>Da){console.error("THREE.KeyframeTrack: Out of order keys.",this,pl,Da,dl),F=!1;break}dl=Da}if(void 0!==cl&&isTypedArray(cl))for(let pl=0,fl=cl.length;pl!==fl;++pl){const Da=cl[pl];if(isNaN(Da)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,pl,Da),F=!1;break}}return F}optimize(){const F=this.times.slice(),Da=this.values.slice(),ll=this.getValueSize(),cl=this.getInterpolation()===wp,hl=F.length-1;let dl=1;for(let pl=1;pl<hl;++pl){let hl=!1;const fl=F[pl];if(fl!==F[pl+1]&&(1!==pl||fl!==F[0]))if(cl)hl=!0;else{const F=pl*ll,cl=F-ll,dl=F+ll;for(let pl=0;pl!==ll;++pl){const ll=Da[F+pl];if(ll!==Da[cl+pl]||ll!==Da[dl+pl]){hl=!0;break}}}if(hl){if(pl!==dl){F[dl]=F[pl];const cl=pl*ll,hl=dl*ll;for(let F=0;F!==ll;++F)Da[hl+F]=Da[cl+F]}++dl}}if(hl>0){F[dl]=F[hl];for(let F=hl*ll,cl=dl*ll,pl=0;pl!==ll;++pl)Da[cl+pl]=Da[F+pl];++dl}return dl!==F.length?(this.times=F.slice(0,dl),this.values=Da.slice(0,dl*ll)):(this.times=F,this.values=Da),this}clone(){const F=this.times.slice(),Da=this.values.slice(),ll=new(0,this.constructor)(this.name,F,Da);return ll.createInterpolant=this.createInterpolant,ll}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=bp;class BooleanKeyframeTrack extends KeyframeTrack{constructor(F,Da,ll){super(F,Da,ll)}}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=xp,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=(ll-Da)/(cl-Da);let Al=F*pl;for(let bl=Al+pl;Al!==bl;Al+=4)Quaternion.slerpFlat(hl,0,dl,Al-pl,dl,Al,fl);return hl}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(F){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),F)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{constructor(F,Da,ll){super(F,Da,ll)}}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=xp,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";const Xg={enabled:!1,files:{},add:function(F,Da){!1!==this.enabled&&(this.files[F]=Da)},get:function(F){if(!1!==this.enabled)return this.files[F]},remove:function(F){delete this.files[F]},clear:function(){this.files={}}};class LoadingManager{constructor(F,Da,ll){const cl=this;let hl,dl=!1,pl=0,fl=0;const Al=[];this.onStart=void 0,this.onLoad=F,this.onProgress=Da,this.onError=ll,this.itemStart=function(F){fl++,!1===dl&&void 0!==cl.onStart&&cl.onStart(F,pl,fl),dl=!0},this.itemEnd=function(F){pl++,void 0!==cl.onProgress&&cl.onProgress(F,pl,fl),pl===fl&&(dl=!1,void 0!==cl.onLoad&&cl.onLoad())},this.itemError=function(F){void 0!==cl.onError&&cl.onError(F)},this.resolveURL=function(F){return hl?hl(F):F},this.setURLModifier=function(F){return hl=F,this},this.addHandler=function(F,Da){return Al.push(F,Da),this},this.removeHandler=function(F){const Da=Al.indexOf(F);return-1!==Da&&Al.splice(Da,2),this},this.getHandler=function(F){for(let Da=0,ll=Al.length;Da<ll;Da+=2){const ll=Al[Da],cl=Al[Da+1];if(ll.global&&(ll.lastIndex=0),ll.test(F))return cl}return null}}}const Yg=new LoadingManager;class Loader{constructor(F){this.manager=void 0!==F?F:Yg,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(F,Da){const ll=this;return new Promise((function(cl,hl){ll.load(F,cl,Da,hl)}))}parse(){}setCrossOrigin(F){return this.crossOrigin=F,this}setWithCredentials(F){return this.withCredentials=F,this}setPath(F){return this.path=F,this}setResourcePath(F){return this.resourcePath=F,this}setRequestHeader(F){return this.requestHeader=F,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";Error;const Jg="\\[\\]\\.:\\/",$g=new RegExp("["+Jg+"]","g"),eA="[^"+Jg+"]",tA="[^"+Jg.replace("\\.","")+"]",iA=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",eA)+/(WCOD+)?/.source.replace("WCOD",tA)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",eA)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",eA)+"$"),nA=["material","materials","bones","map"];class PropertyBinding{constructor(F,Da,ll){this.path=Da,this.parsedPath=ll||PropertyBinding.parseTrackName(Da),this.node=PropertyBinding.findNode(F,this.parsedPath.nodeName),this.rootNode=F,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(F,Da,ll){return F&&F.isAnimationObjectGroup?new PropertyBinding.Composite(F,Da,ll):new PropertyBinding(F,Da,ll)}static sanitizeNodeName(F){return F.replace(/\s/g,"_").replace($g,"")}static parseTrackName(F){const Da=iA.exec(F);if(null===Da)throw new Error("PropertyBinding: Cannot parse trackName: "+F);const ll={nodeName:Da[2],objectName:Da[3],objectIndex:Da[4],propertyName:Da[5],propertyIndex:Da[6]},cl=ll.nodeName&&ll.nodeName.lastIndexOf(".");if(void 0!==cl&&-1!==cl){const F=ll.nodeName.substring(cl+1);-1!==nA.indexOf(F)&&(ll.nodeName=ll.nodeName.substring(0,cl),ll.objectName=F)}if(null===ll.propertyName||0===ll.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+F);return ll}static findNode(F,Da){if(void 0===Da||""===Da||"."===Da||-1===Da||Da===F.name||Da===F.uuid)return F;if(F.skeleton){const ll=F.skeleton.getBoneByName(Da);if(void 0!==ll)return ll}if(F.children){const searchNodeSubtree=function(F){for(let ll=0;ll<F.length;ll++){const cl=F[ll];if(cl.name===Da||cl.uuid===Da)return cl;const hl=searchNodeSubtree(cl.children);if(hl)return hl}return null},ll=searchNodeSubtree(F.children);if(ll)return ll}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(F,Da){F[Da]=this.targetObject[this.propertyName]}_getValue_array(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)F[Da++]=ll[cl]}_getValue_arrayElement(F,Da){F[Da]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(F,Da){this.resolvedProperty.toArray(F,Da)}_setValue_direct(F,Da){this.targetObject[this.propertyName]=F[Da]}_setValue_direct_setNeedsUpdate(F,Da){this.targetObject[this.propertyName]=F[Da],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(F,Da){this.targetObject[this.propertyName]=F[Da],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++]}_setValue_array_setNeedsUpdate(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da]}_setValue_arrayElement_setNeedsUpdate(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(F,Da){this.resolvedProperty.fromArray(F,Da)}_setValue_fromArray_setNeedsUpdate(F,Da){this.resolvedProperty.fromArray(F,Da),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(F,Da){this.resolvedProperty.fromArray(F,Da),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(F,Da){this.bind(),this.getValue(F,Da)}_setValue_unbound(F,Da){this.bind(),this.setValue(F,Da)}bind(){let F=this.node;const Da=this.parsedPath,ll=Da.objectName,cl=Da.propertyName;let hl=Da.propertyIndex;if(F||(F=PropertyBinding.findNode(this.rootNode,Da.nodeName),this.node=F),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!F)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(ll){let cl=Da.objectIndex;switch(ll){case"materials":if(!F.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!F.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);F=F.material.materials;break;case"bones":if(!F.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);F=F.skeleton.bones;for(let Da=0;Da<F.length;Da++)if(F[Da].name===cl){cl=Da;break}break;case"map":if("map"in F){F=F.map;break}if(!F.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!F.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);F=F.material.map;break;default:if(void 0===F[ll])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);F=F[ll]}if(void 0!==cl){if(void 0===F[cl])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,F);F=F[cl]}}const dl=F[cl];if(void 0===dl){const ll=Da.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+ll+"."+cl+" but it wasn't found.",F)}let pl=this.Versioning.None;this.targetObject=F,void 0!==F.needsUpdate?pl=this.Versioning.NeedsUpdate:void 0!==F.matrixWorldNeedsUpdate&&(pl=this.Versioning.MatrixWorldNeedsUpdate);let fl=this.BindingType.Direct;if(void 0!==hl){if("morphTargetInfluences"===cl){if(!F.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!F.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==F.morphTargetDictionary[hl]&&(hl=F.morphTargetDictionary[hl])}fl=this.BindingType.ArrayElement,this.resolvedProperty=dl,this.propertyIndex=hl}else void 0!==dl.fromArray&&void 0!==dl.toArray?(fl=this.BindingType.HasFromToArray,this.resolvedProperty=dl):Array.isArray(dl)?(fl=this.BindingType.EntireArray,this.resolvedProperty=dl):this.propertyName=cl;this.getValue=this.GetterByBindingType[fl],this.setValue=this.SetterByBindingTypeAndVersioning[fl][pl]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=class{constructor(F,Da,ll){const cl=ll||PropertyBinding.parseTrackName(Da);this._targetGroup=F,this._bindings=F.subscribe_(Da,cl)}getValue(F,Da){this.bind();const ll=this._targetGroup.nCachedObjects_,cl=this._bindings[ll];void 0!==cl&&cl.getValue(F,Da)}setValue(F,Da){const ll=this._bindings;for(let cl=this._targetGroup.nCachedObjects_,hl=ll.length;cl!==hl;++cl)ll[cl].setValue(F,Da)}bind(){const F=this._bindings;for(let Da=this._targetGroup.nCachedObjects_,ll=F.length;Da!==ll;++Da)F[Da].bind()}unbind(){const F=this._bindings;for(let Da=this._targetGroup.nCachedObjects_,ll=F.length;Da!==ll;++Da)F[Da].unbind()}},PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray],PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);const rA=new Matrix4;class Raycaster{constructor(F,Da,ll,cl){void 0===ll&&(ll=0),void 0===cl&&(cl=1/0),this.ray=new Ray(F,Da),this.near=ll,this.far=cl,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(F,Da){this.ray.set(F,Da)}setFromCamera(F,Da){Da.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(Da.matrixWorld),this.ray.direction.set(F.x,F.y,.5).unproject(Da).sub(this.ray.origin).normalize(),this.camera=Da):Da.isOrthographicCamera?(this.ray.origin.set(F.x,F.y,(Da.near+Da.far)/(Da.near-Da.far)).unproject(Da),this.ray.direction.set(0,0,-1).transformDirection(Da.matrixWorld),this.camera=Da):console.error("THREE.Raycaster: Unsupported camera type: "+Da.type)}setFromXRController(F){return rA.identity().extractRotation(F.matrixWorld),this.ray.origin.setFromMatrixPosition(F.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(rA),this}intersectObject(F,Da,ll){return void 0===Da&&(Da=!0),void 0===ll&&(ll=[]),intersect(F,this,ll,Da),ll.sort(ascSort),ll}intersectObjects(F,Da,ll){void 0===Da&&(Da=!0),void 0===ll&&(ll=[]);for(let cl=0,hl=F.length;cl<hl;cl++)intersect(F[cl],this,ll,Da);return ll.sort(ascSort),ll}}function ascSort(F,Da){return F.distance-Da.distance}function intersect(F,Da,ll,cl){let hl=!0;if(F.layers.test(Da.layers)){!1===F.raycast(Da,ll)&&(hl=!1)}if(!0===hl&&!0===cl){const cl=F.children;for(let F=0,hl=cl.length;F<hl;F++)intersect(cl[F],Da,ll,!0)}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:cl}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=cl)},8330:F=>{"use strict";F.exports=JSON.parse('{"rE":"3.2.2","Jk":{"O":"https://gitlab.com/panoramax/clients/web-viewer"}}')},4149:F=>{"use strict";F.exports=JSON.parse('{"maplibre":{"GeolocateControl.LocationNotAvailable":"Placering ikke tilg\xe6ngelig","GeolocateControl.FindMyLocation":"Find min placering"},"gvs":{"minimize":"Skjul dette modul, du kan vise det igen ved hj\xe6lp af knappen i nederste venstre hj\xf8rne","share_embed_docs":"L\xe6s mere om indlejringskonfiguration","zoom":"Zoom","zoomOut":"Zoom ud","zoomIn":"Zoom ind","moveUp":"Ryk opad","moveDown":"Ryk nedad","moveLeft":"Ryk til venstre","moveRight":"Ryk til h\xf8jre","moveMiddle":"Centreret visning","expand":"Udvid","expand_info":"F\xe5 modulet til at blive vist p\xe5 hele siden","show_psv":"Vis billedfremviseren","show_map":"Vis kortet","options":"Valgmuligheder","filters":"Filtre","layers":"Lag","search":"S\xf8g","search_empty":"Ingen resultater fundet","search_user":"S\xf8g efter et brugernavn\u2026","share":"Del","share_links":"Links","share_page":"Link til denne side","share_image":"HD-billede","share_rss":"RSS-feed","share_rss_title":"RSS-feed med nye sekvenser i det aktuelt synlige kortomr\xe5de","share_embed":"Indlejr p\xe5 din hjemmeside","share_print":"Udskriv","copy":"Kopi\xe9r","copied":"Kopieret","error_retry":"Pr\xf8v igen senere","sequence_next":"N\xe6ste billede i sekvensen","sequence_play":"Afspil denne sekvens","sequence_more":"Flere afspilningsmuligheder","sequence_speed":"Afspillerens hastighed","legend_license":"Licens: {l}","legend_title":"Vis detaljer om billedet","error_click":"Klik for at forts\xe6tte","error":"Vi har et problem\u2026","search_address":"S\xf8g efter en adresse, by\u2026","sequence_pause":"S\xe6t sekvensen p\xe5 pause","sequence_prev":"Forrige billede i sekvensen","loading_labels_serious":["\ud83d\uddfa\ufe0f Indl\xe6ser kortdata","\ud83d\udda5\ufe0f Anmoder API","\ud83d\uddbc\ufe0f Indl\xe6ser thumbnails","\ud83d\udd0d Analyserer EXIF-metadata","\ud83c\udfd8\ufe0f 3D-rendering","\ud83d\udcf7 Initialiserer 360\xb0-billeder","\ud83d\udfe0 Farveafstemning","\ud83d\udcaf Beregning af kvalitetsscore \xa9"],"edit_osm":"Rediger OSM","josm_live":"Aktiv\xe9r automatisk JOSM-synkronisering ved indl\xe6sning af billeder","loading_labels_fun":["\ud83e\udd8c Registrering af skilte om hjortekrydsning","\ud83d\ude98 S\xf8ger Panoramax Car \xa9","\u2615 Injicerer koffein","\ud83d\ude00 Smil, du er blevet kortlagt!","\ud83d\udc08 Deler kattebilleder","\ud83d\ude34 Reducerer overspringshandlinger","\ud83e\uded6 Brygger te","\ud83d\udc27 \xc5bner kildekode","\ud83d\ude87 Indekser undergrundsstationer","\ud83e\uddf9 Metadata-oprydning","\ud83d\ude92 Sender billeder af brandstation","\ud83d\udeb2 Opdatering af Greenways","\ud83d\ude89 Gennemgang af perron p\xe5 station","\ud83d\udef0\ufe0f S\xf8ger efter satellitter","\ud83d\udc65 Skriver personaer","\ud83d\udc1f Finder fish and chip butik","\ud83e\uddd1\u200d\ud83d\udcbb Gr\xe6nseflade til fejlfinding","\ud83d\udcc8 Inkrementelle statistikker"],"error_psv":"Photo Sphere Viewer indl\xe6ses ikke korrekt","error_nopic":"Intet billede tilg\xe6ngeligt p\xe5 den givne position","error_api":"Billedserveren er ikke tilg\xe6ngelig","error_webgl":"WebGL underst\xf8ttes ikke af din browser","filter_date":"Dato","filter_date_1month":"1 m\xe5ned","filter_date_1year":"1 \xe5r","filter_user":"Bruger","filter_user_mypics":"Mine billeder","filter_picture":"Billedtype","filter_zoom_in":"Zoom ind for at se dette filter","picture_flat":"Klassisk","picture_360":"360\xb0","filter_qualityscore_help":"Klik for at aktivere eller deaktivere","map_background":"Kortbaggrund","map_background_aerial":"Luftfoto","map_background_streets":"Gader","map_theme":"Korttema","error_pic":"Det \xf8nskede billede blev ikke fundet","error_api_compatibility":"Billedserveren er ikke kompatibel med denne version af fremviseren","filter_qualityscore":"Kvalitetsscore","error_josm":"JOSM svarer ikke, k\xf8rer den, og er fjernstyring aktiveret?","metadata_general_seqid_link":"G\xe5 til JSON-beskrivelse af sekvensen","map_theme_default":"Klassisk","map_theme_age_1":"> 2 \xe5r","map_theme_age_2":"< 2 \xe5r","map_theme_age_3":"< 1 \xe5r","map_theme_age_4":"< 1 m\xe5ned","map_theme_type":"Kameratype","map_theme_score":"Kvalitetsscore","contrast":"Aktiv\xe9r h\xf8jere billedkontrast","metadata_general_picid":"Billed-identifikator","metadata_general_seqid":"Sekvens-identifikator","metadata_general_picid_link":"G\xe5 til JSON-beskrivelse af billedet","metadata_general_author":"Forfatter","metadata_general_license":"Licens","metadata_general_license_link":"Se den fulde licensbeskrivelse","metadata_general_date":"Optagelsesdato","metadata_camera":"Kamera","metadata_camera_make":"Fabrikat","metadata_camera_model":"Model","metadata_camera_type":"Type","metadata_camera_resolution":"Opl\xf8sning","metadata_camera_focal_length":"Br\xe6ndvidde","metadata_location_latitude":"Breddegrad","metadata_location_orientation":"Optageretning","metadata_location_precision":"Pr\xe6cision i positionering","metadata_quality":"Kvalitetsscore","metadata_quality_score":"Global score","metadata_quality_gps_score":"Positioneringsscore","metadata_quality_help":"F\xe5 mere at vide om kvalitetsscore","map_theme_age":"Optagelsesdato","metadata_location":"Placering","metadata":"Metadata for billede","metadata_location_longitude":"L\xe6ngdegrad","metadata_quality_resolution_score":"Opl\xf8sningsscore","metadata_quality_missing":"ingen v\xe6rdi indstillet i billedet","metadata_exif":"EXIF / XMP","metadata_exif_name":"Tag","metadata_exif_value":"V\xe6rdi","report":"Indberet billede","report_auth":"Denne indberetning vil blive sendt via din konto \\"{a}\\"","report_nature_label":"Problemets karakter","report_nature":{"":"V\xe6lg problemets art\u2026","blur_missing":"En persons ansigt eller bils nummerplade er synlig","blur_excess":"Et objekt, der ikke har brug for sl\xf8ring, sl\xf8res","inappropriate":"Billedet er upassende (ikke relevant, n\xf8genhed\u2026)","privacy":"En privat sti eller ejendom er synlig","picture_low_quality":"Billedet er af meget d\xe5rlig kvalitet","mislocated":"Billedet er d\xe5rligt placeret p\xe5 kortet","copyright":"Billedet kr\xe6nker ophavsretten","other":"Enhver anden form for problem"},"report_whole_sequence":"Det g\xe6lder hele sekvensen","report_details":"Yderligere detaljer","report_details_placeholder":"Hvis du vil, kan du tilf\xf8je detaljer om problemet, og hvad det drejer sig om","report_email":"Din e-mail","report_email_placeholder":"Valgfri","report_submit":"Indsend","report_wait":"Sender indberetning \u2026","report_success":"Indberetningen er blevet sendt. Den vil blive gennemg\xe5et s\xe5 hurtigt som muligt.","report_failure":"Der opstod en fejl under oprettelse af indberetning: {e}. Pr\xf8v venligst igen senere.","qualityscore_title":"Om kvalitetsscoren","qualityscore_doc_2":"Bed\xf8mmelsen vises for brugerne som en A/B/C/D/E-score (A er den bedste, E den d\xe5rligste) og vises grafisk via denne skala:","qualityscore_doc_3":"Den beregnes ud fra GPS-pr\xe6cision og billedopl\xf8sning. Et professionelt system vil have en A-rating, et 360\xb0 actionkamera vil have en B-rating, og en smartphone vil have en C/D/E-rating.","qualityscore_doc_link":"Yderligere oplysninger om beregningen af kvalitetsscore findes i vores dokumentation.","qualityscore_doc_1":"Panoramax tilbyder en kvalitetsscore for hvert billede. Det giver mulighed for nem kortfiltrering og overskuelig visning af tilg\xe6ngelige billeder af h\xf8j kvalitet.","minimize_short":"Skjul"},"psv":{"loadError":"Panoramaet kan ikke indl\xe6ses","twoFingers":"Brug to fingre til at navigere","ctrlZoom":"Brug ctrl + scroll til at zoome ind p\xe5 billedet"},"map":{"loading":"Indl\xe6ser\u2026","thumbnail":"Miniature af billedet, der holdes","not_public":"Ikke offentligt synlig","slow_loading":"Kortet indl\xe6ses langsomt og kan virke defekt"}}')},369:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"options":"Optionen","filters":"Filter","search":"Suche","layers":"Ebenen","share_links":"Links","share_page":"Link zu dieser Seite","loading_labels_fun":["\ud83e\udd8c Erkennung der \\"Reh kreuzt\\"-Schilder","\ud83d\ude98 Suche Panoramax-Auto \xa9","\u2615 Koffeininjektion","\ud83d\ude00 L\xe4chle, du wirst kartografiert!","\ud83d\udc08 Katzenfotos teilen","\ud83d\ude34 Reduzieren der Prokrastination","\ud83c\udf7a\ufe0f Bier brauen","\ud83d\udc27 Quellcode \xf6ffnen","\ud83d\udee3\ufe0f Indizierung der Autobahnen","\ud83e\uddf9 Metadatenreinigung","\ud83d\ude92 Senden der Fotos der Feuerwehren","\ud83d\udeb2 Gr\xfcne Radwege identifiziert","\ud83d\ude89 Durchgang zum Bahnsteig","\ud83d\udef0\ufe0f Suche Satelliten","\ud83d\udc65 Personas anlegen","\ud83c\udf2d\ufe0f Lokalisierung der Currywurst","\ud83e\uddd1\u200d\ud83d\udcbb Debugging des Interfaces","\ud83d\udcc8 Hochz\xe4hlen der Statistiken"],"search_empty":"Keine Ergebnisse gefunden","share":"Teilen","metadata_general_picid":"Bild-Identifier","zoom":"Zoom","zoomOut":"Herauszoomen","zoomIn":"Hereinzoomen","moveUp":"Nach oben","moveDown":"Nach unten","moveRight":"Nach rechts","moveMiddle":"Sicht zentrieren","map_theme_age":"Aufnahmedatum","expand":"Vergr\xf6\xdfern","expand_info":"Widget im Vollbild anzeigen","show_psv":"Bildbetrachter anzeigen","show_map":"Karte anzeigen","search_user":"Benutzernamen suchen\u2026","filter_zoom_in":"Hereinzoomen um diesen Filter zu sehen","picture_flat":"Klassisch","picture_360":"360\xb0","filter_camera_model":"Nach Kameramodell","map_background":"Kartenhintergrund","map_background_aerial":"Satelliten","map_background_streets":"Stra\xdfen","map_theme":"Karten-Art","metadata_exif_name":"Schlagwort","metadata_exif_value":"Wert","map_theme_age_2":"<2 Jahre","map_theme_age_3":"<1 Jahr","map_theme_type":"Kameratyp","contrast":"H\xf6heren Bildkontrast aktivieren","metadata":"Bildmetadaten","metadata_general_seqid":"Sequenzidentifier","metadata_general_picid_link":"Zur JOSN-Beschreibung des Bildes gehen","loading_labels_serious":["\ud83d\uddfa\ufe0f Laden der Kartendaten","\ud83d\udda5\ufe0f API anfragen","\ud83d\uddbc\ufe0f Vorschaubilder laden","\ud83d\udd0d EXIF Metadaten analysieren","\ud83c\udfd8\ufe0f 3D-Rendering","\ud83d\udcf7 360\xb0 Fotos initialisieren","\ud83d\udfe0 Farben balancieren","\ud83d\udcaf Berechnung der Qualit\xe4tsbewertung \xa9"],"search_address":"Suchen sie eine Adresse, Stadt, \u2026","share_image":"HD Bild","share_rss":"RSS Feed","share_embed":"Auf Webseite einbetten","share_print":"Druck","copy":"Kopieren","copied":"Kopiert","error":"Panoramax ist abgest\xfcrzt\u2026","sequence_next":"N\xe4chstes Foto in der Sequenz","sequence_play":"Sequenz abspielen","sequence_pause":"Sequenz pausieren","sequence_prev":"Vorheriges Foto in der Sequenz","sequence_more":"Mehr Abspieloptionen","sequence_speed":"Abspielgeschwindigkeit","legend_license":"Lizenz: {l}","edit_osm":"OSM editieren","id":"iD","josm":"JOSM","josm_live":"Einschalten der automatischen JOSM-Synchronisierung beim Laden eines Bildes","error_psv":"Betrachter f\xfcr die Photospheres wurde nicht richtig geladen","error_pic":"Gesuchtes Foto wurde nicht gefunden","error_nopic":"Kein Foto verf\xfcgbar an dieser Position","error_api":"Foto-Server ist nicht verf\xfcgbar","error_josm":"JOSM reagiert nicht, ist es ge\xf6ffnet und die Remote eingeschaltet?","error_api_compatibility":"Der Foto-Server ist nicht mit dieser Version des Betrachters kompatibel","filter_date":"Datum","filter_user":"Benutzer","filter_picture":"Foto-Art","map_theme_default":"Klassisch","map_theme_age_1":">2 Jahre","metadata_general_seqid_link":"Zur JSON-Beschreibung der Sequenz gehen","metadata_general_author":"Autor","metadata_general_license":"Lizenz","metadata_general_date":"Aufnahmedatum","metadata_camera":"Kamera","metadata_camera_make":"Hersteller","metadata_camera_model":"Modell","metadata_camera_type":"Typ","metadata_camera_focal_length":"Brennweite","metadata_location":"Ort","metadata_location_longitude":"L\xe4ngengrad","metadata_location_latitude":"Breitengrad","metadata_location_orientation":"Aufnahmerichtung","metadata_location_precision":"Pr\xe4zision der Positionierung","metadata_exif":"EXIF / XMP","minimize":"Widget verbergen, sie k\xf6nnen es \xfcber die Schaltfl\xe4che in der linken unteren Ecke wieder einblenden","map_theme_age_4":"< 1 Monat","error_subtitle":"Bitte versuchen sie es sp\xe4ter erneut, oder schauen sie in die Web-Browser-Konsole f\xfcr mehr Details.","moveLeft":"Nach links","share_rss_title":"RSS Feed neuer Sequenzen auf dem aktuell sichtbaren Kartenbereich","error_webgl":"WebGL wird von ihrem Browser nicht unterst\xfctzt","metadata_general_license_link":"Volle Lizenzbeschreibung ansehen","share_embed_docs":"Mehr \xfcber die Einbettungs-Konfiguration lesen","report_nature":{"":"Art des Problems ausw\xe4hlen\u2026","inappropriate":"Bild ist unangemessen (irrelevant, Nacktheit, ...)","picture_low_quality":"Bild hat eine sehr schlechte Qualit\xe4t","blur_missing":"Das Gesicht einer Person oder ein KFZ-Kennzeichen ist sichtbar","blur_excess":"Ein Objekt das nicht unkenntlich gemacht werden muss wurde unkenntlich gemacht","privacy":"Ein privater Pfad oder ein privates Grundst\xfcck ist sichtbar","mislocated":"Bild ist falsch auf der Karte verortet","copyright":"Bild verletzt das Urheberrecht","other":"Andere Art von Problem"},"report_details_placeholder":"Sie k\xf6nnen optionale Details \xfcber das Problem hinzuf\xfcgen","report_auth":"Dieser Report wird durch ihren Account \\"{a}\\" gesendet","report_nature_label":"Art des Problems","report_whole_sequence":"Dies betrifft die gesamte Sequenz","report_details":"Weitere Details","report_email":"Ihre Email","report_email_placeholder":"Optional","report_submit":"Absenden","report_success":"Ihr Report wurde erfolgreich gesendet. Er wird so schnell wie m\xf6glich \xfcberpr\xfcft.","report_failure":"Ein Fehler ist bei der Erstellung des Reports aufgetreten: {e}. Bitte versuchen sie es erneut.","report":"Foto melden","legend_title":"Zeige Bilderdetails","report_wait":"Bericht senden\u2026","error_click":"Klicken um fortzufahren","error_retry":"Bitte sp\xe4ter erneut versuchen","metadata_camera_resolution":"Aufl\xf6sung","filter_user_mypics":"Meine Fotos","metadata_quality_missing":"kein Wert im Foto gesetzt","filter_date_1month":"1 Monat","filter_date_1year":"1 Jahr","filter_qualityscore":"Qualit\xe4tswert","filter_qualityscore_help":"Klicken, um zu aktivieren oder deaktivieren","map_theme_score":"Qualit\xe4tswert","metadata_quality":"Qualit\xe4tswert","metadata_quality_help":"Erfahre mehr \xfcber den Qualit\xe4tswert","metadata_quality_resolution_score":"Aufl\xf6sungswertung","metadata_quality_gps_score":"Positionswertung","metadata_quality_score":"Gesamtwertung","qualityscore_title":"\xdcber den Qualit\xe4tsfaktor","qualityscore_doc_link":"Weitere Informationen zur Berechnung des Qualit\xe4tsfaktors findest du in unserer Dokumentation.","qualityscore_doc_1":"Panoramax bietet einen Qualit\xe4tsfaktor f\xfcr jedes Bild. Es erm\xf6glicht eine einfache Kartenfilterung und eine umfassende Anzeige der Verf\xfcgbarkeit hochwertiger Bilder.","qualityscore_doc_2":"Die Note wird den Benutzern als A/B/C/D/E-Bewertung angezeigt (A ist die beste, E die schlechteste) und anhand dieser Skala grafisch dargestellt:","qualityscore_doc_3":"Die Berechnung erfolgt auf der Grundlage der GPS-Genauigkeit und der Bildaufl\xf6sung. Ein professionelles System wird mit A bewertet, eine 360-Grad-Action-Kamera mit B und ein Smartphone mit C/D/E.","minimize_short":"Verbergen"},"psv":{"twoFingers":"Nutzen sie zwei Finger zum navigieren","ctrlZoom":"Nutzen sie Strg+Scrollen um das Bild zu zoomen","loadError":"Das Panorama konnte nicht geladen werden"},"map":{"thumbnail":"Vorschau des marktierten Fotos","not_public":"Nicht \xf6ffentlich sichtbar","loading":"Laden\u2026","slow_loading":"Die Karte wird nur langsam geladen und k\xf6nnte fehlerhaft erscheinen"},"maplibre":{"GeolocateControl.FindMyLocation":"Meinen Standort finden","GeolocateControl.LocationNotAvailable":"Standort nicht verf\xfcgbar"}}')},389:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Use two fingers to navigate","ctrlZoom":"Use ctrl + scroll to zoom the image","loadError":"The panorama can\'t be loaded"},"maplibre":{"GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available"},"gvs":{"zoom":"Zoom","zoomOut":"Zoom out","zoomIn":"Zoom in","moveUp":"Move up","moveDown":"Move down","moveLeft":"Move left","moveRight":"Move right","moveMiddle":"Center view","expand":"Expand","expand_info":"Make the widget appear in full page","show_psv":"Show the picture viewer","show_map":"Show the map","minimize":"Hide this widget, you can show it again using button in bottom left corner","minimize_short":"Hide","options":"Options","filters":"Filters","layers":"Layers","search":"Search","search_empty":"No results found","search_address":"Search an address, city\u2026","search_user":"Search a username\u2026","share":"Share","share_links":"Links","share_page":"Link to this page","share_image":"HD Image","share_rss":"RSS feed","share_rss_title":"RSS feed of new sequences in the currently visible map area","share_embed":"Embed on your website","share_embed_docs":"Read more about embed configuration","share_print":"Print","copy":"Copy","copied":"Copied","error":"We have a problem\u2026","error_click":"Click to continue","error_retry":"Please retry later","sequence_next":"Next picture in sequence","sequence_play":"Play along this sequence","sequence_pause":"Pause sequence","sequence_prev":"Previous picture in sequence","sequence_more":"More play options","sequence_speed":"Player speed","legend_license":"License: {l}","legend_title":"Show details of picture","edit_osm":"Edit OSM","id":"iD","josm":"JOSM","josm_live":"Enable JOSM automatic sync on picture loading","loading_labels_serious":["\ud83d\uddfa\ufe0f Loading map data","\ud83d\udda5\ufe0f Querying API","\ud83d\uddbc\ufe0f Loading thumbnails","\ud83d\udd0d Analyzing EXIF metadata","\ud83c\udfd8\ufe0f 3D rendering","\ud83d\udcf7 Initializing 360\xb0 pictures","\ud83d\udfe0 Colour balancing","\ud83d\udcaf Computing Quality Score \xa9"],"loading_labels_fun":["\ud83e\udd8c Detecting deer crossing signs","\ud83d\ude98 Searching Panoramax Car \xa9","\u2615 Injecting caffeine","\ud83d\ude00 Smile, you\'re mapped!","\ud83d\udc08 Sharing cat pictures","\ud83d\ude34 Reducing procrastination","\ud83e\uded6 Brewing tea","\ud83d\udc27 Opening source code","\ud83d\ude87 Indexing Underground stations","\ud83e\uddf9 Metadata cleanup","\ud83d\ude92 Sending fire station photos","\ud83d\udeb2 Greenways update","\ud83d\ude89 Station platform walkthrough","\ud83d\udef0\ufe0f Searching satellites","\ud83d\udc65 Writing personas","\ud83d\udc1f Locating chip shops","\ud83e\uddd1\u200d\ud83d\udcbb Debugging interface","\ud83d\udcc8 Incrementing statistics"],"error_psv":"Photo Sphere Viewer is not loading properly","error_pic":"Requested picture wasn\'t found","error_nopic":"No picture available at given position","error_api":"The pictures server is not available","error_webgl":"WebGL is not supported by your browser","error_josm":"JOSM doesn\'t respond, is it running and is remote enabled?","error_api_compatibility":"The pictures server is not compatible with this viewer version","filter_date":"Date","filter_date_1month":"1 month","filter_date_1year":"1 year","filter_user":"User","filter_user_mypics":"My pictures","filter_picture":"Picture type","filter_zoom_in":"Zoom-in to see this filter","picture_flat":"Classic","picture_360":"360\xb0","filter_qualityscore":"Quality score","filter_qualityscore_help":"Click to enable or disable","qualityscore_title":"About the quality score","qualityscore_doc_1":"Panoramax offers a Quality Score for each picture. It allows easy map filtering and comprehensive display of high-quality pictures availability.","qualityscore_doc_2":"The grade is shown to users as a A/B/C/D/E score (A is the best, E the worst), and shown graphically through this scale:","qualityscore_doc_3":"It is computed based on GPS precision and picture resolution. A professional system will have an A-rating, a 360\xb0 action camera will have a B-rating, and a smartphone will be C/D/E-rated.","qualityscore_doc_link":"More details about the Quality Score computation is available in our documentation.","map_background":"Map background","map_background_aerial":"Aerial","map_background_streets":"Streets","map_theme":"Map theme","map_theme_default":"Classic","map_theme_age":"Capture date","map_theme_age_1":"> 2 years","map_theme_age_2":"< 2 years","map_theme_age_3":"< 1 year","map_theme_age_4":"< 1 month","map_theme_type":"Camera type","map_theme_score":"Quality score","contrast":"Enable higher image contrast","metadata":"Picture metadata","metadata_general_picid":"Picture identifier","metadata_general_seqid":"Sequence identifier","metadata_general_picid_link":"Go to JSON description of the picture","metadata_general_seqid_link":"Go to JSON description of the sequence","metadata_general_author":"Author","metadata_general_license":"License","metadata_general_license_link":"See the full licence description","metadata_general_date":"Capture date","metadata_camera":"Camera","metadata_camera_make":"Make","metadata_camera_model":"Model","metadata_camera_type":"Type","metadata_camera_resolution":"Resolution","metadata_camera_focal_length":"Focal length","metadata_location":"Location","metadata_location_longitude":"Longitude","metadata_location_latitude":"Latitude","metadata_location_orientation":"Capture direction","metadata_location_precision":"Positioning precision","metadata_quality":"Quality score","metadata_quality_help":"Know more about Quality Score","metadata_quality_score":"Global score","metadata_quality_gps_score":"Positioning score","metadata_quality_resolution_score":"Resolution score","metadata_quality_missing":"no value set in picture","metadata_exif":"EXIF / XMP","metadata_exif_name":"Tag","metadata_exif_value":"Value","report":"Report picture","report_auth":"This report will be sent using your account \\"{a}\\"","report_nature_label":"Nature of the issue","report_nature":{"":"Select the nature of issue\u2026","blur_missing":"A person face or car plate is visible","blur_excess":"An object not needing blur is blurred","inappropriate":"Picture is inappropriate (unrelated, nudity\u2026)","privacy":"A private path or property is visible","picture_low_quality":"Picture is of very bad quality","mislocated":"Picture is badly positioned on map","copyright":"Picture infringes copyright","other":"Any other kind of issue"},"report_whole_sequence":"This concerns the entire sequence","report_details":"Additional details","report_details_placeholder":"Optional, you can add details about the issue and how this is concerning","report_email":"Your email","report_email_placeholder":"Optional","report_submit":"Submit","report_wait":"Sending report \u2026","report_success":"Report has been successfully sent. It will be reviewed as soon as possible.","report_failure":"An error occurred when creating report: {e}. Please try again later."},"map":{"loading":"Loading\u2026","thumbnail":"Thumbnail of hovered picture","not_public":"Not publicly visible","slow_loading":"Map is slow to load and could appear broken"}}')},9946:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Uzu du fingrojn por navigi","ctrlZoom":"Uzu ctrl + rulumo por zomi la bildon","loadError":"La bildo ne povas esti \u015dar\u011dita"},"gvs":{"zoom":"Zomo","zoomOut":"Malzomo","zoomIn":"Zomi","moveUp":"Movi supren","moveDown":"Movi malsupren","moveLeft":"Movi maldekstren","moveRight":"Movi dekstren","moveMiddle":"Centri vido","expand":"Pligrandigi","expand_info":"Aperigu la fenestra\u0135on en plena pa\u011do","show_psv":"Montri la bildspektilo","show_map":"Montri la mapo","minimize":"Maski la fenestra\u0135o, vu povas montri \u011din denove kun la butono en malsupra maldekstra angulo","sequence_prev":"Anta\u016da foto en la sekvenco","sequence_more":"Pli da ludopcioj","sequence_speed":"Rapideco de legado","sequence_next":"Sekva foto en la sekvenco","sequence_play":"Foliumi \u0109i tiun sinsekvon","sequence_pause":"Pa\u016dzi la sekvenco","copy":"Kopii","copied":"Kopiita","error":"Ni havas problemon\u2026","error_click":"Alkliku por kontinui","error_retry":"Bonvolu reprovi poste","search_address":"Ser\u0109i adreson, urbon\u2026","filters":"Filtriloj","layers":"Tavoloj","search":"Ser\u0109i","share_embed_docs":"Pli pri enigito sur via retpa\u011daro","search_empty":"Neniu rezulto trovita","search_user":"Ser\u0109i uzantnomon\u2026","share":"Kunhavigi","share_links":"Ligiloj","share_page":"Ligilo de la retpa\u011do","share_image":"HD bildo","share_rss":"RSS abonfluo","share_rss_title":"RSS abonfluo de la novaj sekvecoj en la nuntempe videbla mapzono","share_embed":"Enigita en via retpa\u011daro","share_print":"Presi","edit_osm":"Modifi OSM","legend_license":"Rajtigilo : {l}","josm_live":"Ebligas a\u016dtomatan JOSM-sinkronigon dum \u015dar\u011do de bildo","loading_labels_serious":["\ud83d\uddfa\ufe0f \u015cargo de la bazmapon","\ud83d\udda5\ufe0f API demandado","\ud83d\uddbc\ufe0f \u015car\u011do de miniaturoj","\ud83d\udd0d Analizo de EXIF-metadatumoj","\ud83c\udfd8\ufe0f 3D-rendumo","\ud83d\udcf7 Inico de 360\xb0-bildoj","\ud83d\udfe0 Kolora ekvilibrigo","\ud83d\udcaf Kalkulo de kvalitpoentaro \xa9"],"legend_title":"Montri la detaloj de la bildo","error_api":"La bildservilo ne estas disponebla","error_josm":"JOSM ne respondis. \u0108u \u011di funkcias kaj la regilo estas \u015daltita?","error_webgl":"WebGL ne estas subtenata per via retumilo","loading_labels_fun":["\ud83e\udd8c Detekto de cervinaj vojmontriloj","\ud83d\ude98 Ser\u0109o de Panoramax-a\u016dto \xa9","\u2615 Injekto de kafeino","\ud83d\ude00 Ridetu, vi estas mapita!","\ud83d\udc08 Kunhavigo de katbildoj","\ud83d\ude34 Redukto de prokrastado","\ud83d\udcd6 Lernado de Esperanto","\ud83d\udc27 Malfermo de fontkodo","\ud83d\ude87 Indekso de subteraj stacioj","\ud83e\uddf9 Purigo de metadatumoj","\ud83d\ude92 Sendado de fotoj de fajrostacioj","\ud83d\udeb2 \u011cisdatigo de verdaj vojoj","\ud83d\ude89 Promenado tra stacioplatformoj","\ud83d\udef0\ufe0f Ser\u0109o de satelitoj","\ud83d\udc65 Verkado de roluloj","\u2747\ufe0f Lokalizo de la Esperanto-flagoj","\ud83e\uddd1\u200d\ud83d\udcbb Sencimigado de la interfaco","\ud83d\udcc8 Alkrementi de la statistikoj"],"picture_360":"360\xb0","picture_flat":"Klasika","report_nature_label":"Speco de problemo","report_nature":{"":"Elektu la specon de problemo\u2026","blur_missing":"Viza\u011do a\u016d numerplato estas videbla","copyright":"La bildo malobeas kopirajton","blur_excess":"Objekto kiu ne bezonis malklari\u011don estas malklarigita","inappropriate":"La bildo estas neta\u016dga (nevera, nudeco...)","privacy":"Privata vojo a\u016d poseda\u0135o estas videbla","picture_low_quality":"La bildo estas de tre malbona kvalito","mislocated":"La bildo estas malbone poziciigita sur la mapo","other":"\u0108ia alia speco de problemo"},"report":"Raporti bildon","report_auth":"\u0108i tiu raporto estos sendita per via konto \\"{a}\\"","filter_date":"Dato","filter_user_mypics":"Miaj fotoj","options":"Opcioj","error_api_compatibility":"La fotoservilo ne kongruas kun \u0109i tiu spektilo","filter_qualityscore":"Kvalitpoentaro","filter_qualityscore_help":"Alllaku por aktivigi a\u016d mal\u015dalti","map_theme_age":"Dato de fotado","map_theme_age_1":"> 2 jaroj","map_theme_age_2":"< 2 jaroj","map_theme_age_3":"< 1 jaro","map_theme_age_4":"< 1 monato","map_theme_score":"Kvalitpoentaro","metadata":"Metadatenoj de la bildo","map_theme_type":"Fotiltipo","metadata_general_seqid":"Sekvencidentigilo","metadata_camera_resolution":"Difino","metadata_quality_resolution_score":"Rezolucia poentaro","error_psv":"Foto-Sfera Spektilo ne \u015dar\u011di\u011das \u011duste","error_pic":"La petita bildo ne estis trovita","error_nopic":"Neniu bildo disponeblas \u0109e la donita pozicio","filter_user":"Uzanto","map_theme_default":"Klasika","filter_date_1month":"1 monato","filter_date_1year":"1 jaro","contrast":"Pliigi bildkontraston","metadata_general_picid":"Fotoidentigilo","filter_picture":"Bilda tipo","filter_zoom_in":"Zomu por vidi pli da filtriloj","map_background":"Bazmapo","map_background_aerial":"Aera","map_background_streets":"Stratoj","map_theme":"Mapa etoso","metadata_general_picid_link":"Iru al la JSON-priskribo de la foto","metadata_general_seqid_link":"Iru al la JSON-priskribo de la sekvenco","metadata_general_author":"A\u016dtoro","metadata_general_license":"Rajtigilo","metadata_general_license_link":"Vidi la kompletan rajtigilon en la priskribo","metadata_general_date":"Dato de la fotado","metadata_camera":"Fotilo","metadata_camera_make":"Faristo","metadata_camera_model":"\u015cablono","metadata_camera_type":"Tipo","metadata_camera_focal_length":"Fokuslongo","metadata_location":"Loko","metadata_location_longitude":"Longitudo","metadata_location_latitude":"Latitudo","metadata_location_orientation":"Fotada direkto","metadata_location_precision":"Pozicia precizeco","metadata_quality":"Kvalitpoentaro","metadata_quality_help":"Pli pri la Kvalitapoentaro","metadata_quality_score":"Malloka poentaro","metadata_quality_gps_score":"Pozicia poentaro","metadata_quality_missing":"neniu valoro en la bildo","metadata_exif":"EXIF / XMP","metadata_exif_name":"Etikedo","metadata_exif_value":"Valoro","report_whole_sequence":"\u0108i tio koncernas la tutan sekvencon","report_details":"Aliaj detaloj","report_email":"Via retpo\u015dto","report_submit":"Sendi","report_wait":"Sendante raporton\u2026","report_success":"La raporto estis sukcese sendita. \u011ci estos reviziita balda\u016d.","report_details_placeholder":"Opcie, vi povas aldoni detalojn pri la problemo","report_email_placeholder":"Opcie","report_failure":"Eraro okazis dum kreo de la raporto: {e}. Bonvolu provi denove poste."},"maplibre":{"GeolocateControl.FindMyLocation":"Trovi mian pozicion","GeolocateControl.LocationNotAvailable":"Loko ne disponeblas"},"map":{"slow_loading":"La mapo \u015dar\u011das malrapide kaj povus aperi rompi\u011dinta","loading":"\u015car\u011danto\u2026","thumbnail":"Miniaturo de la surflikta bildo","not_public":"Ne publike videbla"}}')},8302:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"report_auth":"La denuncia se enviar\xe1 usando tu cuenta \xab{a}\xbb","report":"Denunciar imagen","report_nature_label":"Tipo de problema","report_nature":{"":"Selecciona el tipo de problema\u2026","blur_missing":"Se ve el rostro de una persona, o una matr\xedcula","blur_excess":"Est\xe1 borroso un objeto que no hac\xeda falta ocultar","inappropriate":"La imagen no es apropiada (irrelevante, desnudez, \u2026)","privacy":"Se ve un camino privado, o una propiedad privada","mislocated":"La localizaci\xf3n de la imagen en el mapa no es correcta","picture_low_quality":"La calidad de la imagen es pobre","copyright":"La imagen infringe derechos de autor","other":"Otro tipo de problema"},"sequence_more":"M\xe1s opciones de reproducci\xf3n","sequence_speed":"Velocidad de reproducci\xf3n","legend_license":"Licencia: {l}","edit_osm":"Editar OpenStreetMap","id":"iD","josm":"JOSM","josm_live":"Activar la sincronizaci\xf3n autom\xe1tica de JOSM cuando se carga una imagen","loading_labels_serious":["\ud83d\uddfa\ufe0f Cargando datos del mapa","\ud83d\udda5\ufe0f Consultando la API","\ud83d\uddbc\ufe0f Cargando vistas previas","\ud83d\udd0d Analizando metadatos EXIF","\ud83c\udfd8\ufe0f Renderizado 3D","\ud83d\udcf7 Preparando im\xe1genes 360\xb0","\ud83d\udfe0 Ajustando balance de color","\ud83d\udcaf C\xe1lculo del nivel de calidad \xa9"],"metadata":"Metadatos de la imagen","map_theme_type":"Tipo de c\xe1mara","contrast":"Dar m\xe1s contraste a la imagen","zoom":"Acercar/alejar","zoomOut":"Alejar","map_background_streets":"Calles","loading_labels_fun":["\ud83e\udd8c Detectando paneles de cruce de alces","\ud83d\ude98 Buscando el Coche Panoramax \xa9","\u2615 Inyectando cafe\xedna","\ud83d\ude00 \xa1Sonr\xede, est\xe1s siendo mapeado!","\ud83d\udc08 Compartiendo fotos de gatos","\ud83d\ude34 Reduciendo la procrastinaci\xf3n","\ud83e\uded6 Preparando el t\xe9","\ud83d\udc27 Abriendo el c\xf3digo fuente","\ud83d\ude87 Indexando estaciones del metro","\ud83e\uddf9 Limpieza de metadatos","\ud83d\ude92 Enviando fotos de estaciones de bomberos","\ud83d\udeb2 Actualizando v\xedas verdes","\ud83d\ude89 Paseo por el and\xe9n de la estaci\xf3n","\ud83d\udef0\ufe0f Buscando sat\xe9lites","\ud83d\udc65 Describiendo tipolog\xedas de persona","\ud83d\udc1f Localizando tiendas de fish & chips","\ud83e\uddd1\u200d\ud83d\udcbb Buscando gazapos de la interfaz","\ud83d\udcc8 Incrementando estad\xedsticas"],"metadata_general_license_link":"Ir a la descripci\xf3n completa de la licencia","metadata_general_picid":"Identificador de la imagen","metadata_general_license":"Licencia","report_details_placeholder":"Opcional; puedes a\xf1adir m\xe1s detalles sobre el problema y por qu\xe9 te preocupa","expand":"Expandir","expand_info":"Mostrar el elemento ocupando toda la p\xe1gina","show_psv":"Mostrar el visor de im\xe1genes","show_map":"Mostrar el mapa","zoomIn":"Acercar","moveUp":"Desplazar hacia arriba","moveDown":"Desplazar hacia abajo","moveLeft":"Desplazar hacia la izquierda","moveRight":"Desplazar hacia la derecha","moveMiddle":"Centrar la vista","minimize":"Esconder este elemento. Para mostrarlo de nuevo, pulsa el bot\xf3n en la esquina inferior izquierda","options":"Opciones","filters":"Filtros","layers":"Capas","search":"Buscar","search_empty":"No se encontraron resultados","search_address":"Buscar una direcci\xf3n, una ciudad, \u2026","search_user":"Buscar un usuario\u2026","share":"Compartir","share_links":"Enlaces","share_page":"Enlace a esta p\xe1gina","share_image":"Imagen de alta calidad","share_rss":"Flujo RSS","share_rss_title":"Flujo RSS de las nuevas secuencias en el \xe1rea visible del mapa","share_embed":"Incrustar en tu p\xe1gina web","share_embed_docs":"M\xe1s informaci\xf3n sobre c\xf3mo configurar el incrustado","share_print":"Imprimir","copy":"Copiar","copied":"Copiado","error":"Hay un problema\u2026","sequence_next":"Siguiente imagen de la secuencia","sequence_play":"Reproducir esta secuencia","sequence_pause":"Pausar la secuencia","sequence_prev":"Imagen anterior de la secuencia","error_click":"Haz click para continuar","error_retry":"Por favor, int\xe9ntalo m\xe1s tarde","error_psv":"El visor de fotos esf\xe9ricas no se carga correctamente","error_pic":"No se encuentra la imagen que quer\xedamos","error_nopic":"No hay im\xe1genes para la posici\xf3n dada","error_api":"El servidor de im\xe1genes no est\xe1 disponible","error_webgl":"Este navegador no admite WebGL","error_josm":"JOSM no responde. \xbfEst\xe1 abierto, y admite el modo de Control Remoto?","error_api_compatibility":"El servidor de im\xe1genes no es compatible con esta versi\xf3n del visor","filter_date":"Fecha","filter_user":"Usuario","filter_picture":"Tipo de imagen","filter_zoom_in":"Ac\xe9rcate para poder ver filtros","picture_flat":"Cl\xe1sico","picture_360":"360\xb0","filter_camera_model":"Por modelo de c\xe1mara","map_background":"Fondo de mapa","map_background_aerial":"Vista a\xe9rea","map_theme":"Tema de mapa","map_theme_default":"Cl\xe1sico","map_theme_age":"Fecha de toma de imagen","map_theme_age_1":"M\xe1s de dos a\xf1os","map_theme_age_2":"Menos de dos a\xf1os","map_theme_age_3":"Menos de un a\xf1o","map_theme_age_4":"Menos de un mes","metadata_general_seqid":"Identificador de la secuencia","metadata_general_picid_link":"Ir a la descripci\xf3n de la imagen en formato JSON","metadata_general_seqid_link":"Ir a la descripci\xf3n de la secuencia en formato JSON","metadata_general_author":"Autor","metadata_general_date":"Fecha de toma de imagen","metadata_camera":"C\xe1mara","metadata_camera_make":"Marca","metadata_camera_model":"Modelo","metadata_camera_type":"Tipo","metadata_camera_focal_length":"Distancia focal","metadata_location":"Localizaci\xf3n","metadata_location_longitude":"Longitud","metadata_location_latitude":"Latitud","metadata_location_orientation":"Orientaci\xf3n","metadata_location_precision":"Precisi\xf3n de la localizaci\xf3n","metadata_exif":"EXIF / XMP","metadata_exif_name":"Etiqueta","metadata_exif_value":"Valor","report_whole_sequence":"El problema afecta a la secuencia entera","report_details":"M\xe1s detalles","report_email":"Tu direcci\xf3n de correo electr\xf3nico","report_email_placeholder":"Opcional","report_submit":"Enviar","report_success":"La denuncia se ha enviado correctamente. Ser\xe1 revisada lo antes posible.","report_failure":"Ocurri\xf3 un error al crear la denuncia: {e}. Por favor, int\xe9ntalo m\xe1s tarde.","map_theme_score":"Nivel de calidad","filter_qualityscore":"Nivel de calidad","filter_qualityscore_help":"Haga clic para habilitar o deshabilitar","legend_title":"Ver detalles de la imagen","metadata_camera_resolution":"Resoluci\xf3n","metadata_quality":"Puntuaci\xf3n de calidad","metadata_quality_help":"M\xe1s informaci\xf3n sobre el nivel de calidad","metadata_quality_score":"Valoraci\xf3n general","metadata_quality_gps_score":"Puntuaci\xf3n de posicionamiento","metadata_quality_resolution_score":"Puntuaci\xf3n de resoluci\xf3n","metadata_quality_missing":"no hay informaci\xf3n en la imagen","report_wait":"Env\xedo del informe\u2026"},"psv":{"ctrlZoom":"Utiliza Control+rueda de desplazamiento para acercar/alejar","loadError":"Este panorama no se puede cargar","twoFingers":"Desplaza el mapa con dos dedos"},"maplibre":{"GeolocateControl.FindMyLocation":"Local\xedzame","GeolocateControl.LocationNotAvailable":"Localizaci\xf3n no disponible"},"map":{"loading":"Cargando\u2026","thumbnail":"Vista previa de la imagen bajo el cursor","not_public":"No es visible p\xfablicamente","slow_loading":"La mapa tarda mucho en cargarse y puede parecer rota"}}')},5222:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Utilisez deux doigts pour vous d\xe9placer","ctrlZoom":"Utilisez ctrl + scroll pour zoomer dans l\'image","loadError":"L\'image ne peut pas \xeatre charg\xe9e"},"maplibre":{"GeolocateControl.FindMyLocation":"Afficher ma position","GeolocateControl.LocationNotAvailable":"GPS non-disponible"},"gvs":{"zoom":"Zoom","zoomOut":"D\xe9zoomer","zoomIn":"Zoomer","moveUp":"Vers le haut","moveDown":"Vers le bas","moveLeft":"Vers la gauche","moveRight":"Vers la droite","moveMiddle":"Centrer la vue","expand":"Agrandir","expand_info":"Faire appara\xeetre ce widget en pleine page","show_psv":"Afficher la visionneuse de photos","show_map":"Afficher la carte","minimize":"Masquer ce widget, vous pouvez l\'afficher de nouveau gr\xe2ce au bouton dans le coin en bas \xe0 gauche","minimize_short":"Masquer","options":"Options","filters":"Filtres","layers":"Calques","search":"Rechercher","search_empty":"Aucun r\xe9sultat","search_address":"Rechercher une adresse, ville\u2026","search_user":"Rechercher un nom d\'utilisateur\u2026","share":"Partager","share_links":"Liens utiles","share_page":"Lien de la page","share_image":"Image HD","share_rss":"Flux RSS","share_rss_title":"Flux RSS des nouvelles s\xe9quences dans la zone visible sur la carte","share_embed":"Int\xe9gration sur votre site","share_embed_docs":"D\xe9couvrir plus de possibilit\xe9s pour l\'int\xe9gration sur votre site","share_print":"Imprimer","copy":"Copier","copied":"Copi\xe9","error":"On a un probl\xe8me\u2026","error_click":"Cliquez pour continuer","error_retry":"Merci de r\xe9essayer plus tard","sequence_next":"Photo suivante dans la s\xe9quence","sequence_play":"Parcourir cette s\xe9quence","sequence_pause":"Mettre en pause la s\xe9quence","sequence_prev":"Photo pr\xe9c\xe9dente dans la s\xe9quence","sequence_more":"Plus d\'options de lecture","sequence_speed":"Vitesse de lecture","legend_license":"Licence : {l}","legend_title":"Afficher les d\xe9tails de l\'image","edit_osm":"Contribuer sur OSM","id":"iD","josm":"JOSM","josm_live":"Active la synchronisation automatique de JOSM lors du chargement d\'une photo","loading_labels_serious":["\ud83d\uddfa\ufe0f Chargement du fond de carte","\ud83d\udda5\ufe0f Interrogation de l\'API","\ud83d\uddbc\ufe0f Chargement des miniatures","\ud83d\udd0d Analyse des m\xe9tadonn\xe9es EXIF","\ud83c\udfd8\ufe0f Cr\xe9ation du rendu 3D","\ud83d\udcf7 Initialisation des vues 360\xb0","\ud83d\udfe0 \xc9quilibrage des couleurs","\ud83d\udcaf Calcul du score qualit\xe9 \xa9"],"loading_labels_fun":["\ud83e\udd8c D\xe9tection des panneaux biche","\ud83d\ude98 Recherche de la Panoramax Car \xa9","\u2615 Injection de caf\xe9ine","\ud83d\ude00 Souriez, vous \xeates mapp\xe9s !","\ud83d\udc08 Partage de photos de chats","\ud83d\ude34 R\xe9duction de la procrastination","\ud83c\uddf7\ud83c\uddea Chargement : 974%","\ud83d\udc27 Ouverture du code source","\ud83e\udd81 Indexation des traboules","\ud83e\uddf9 Nettoyage des m\xe9tadonn\xe9es","\ud83d\ude92 Envoi des photos du SDIS","\ud83d\udeb2 Mise \xe0 jour des voies vertes","\ud83d\ude89 Remont\xe9e des quais de gare","\ud83d\udef0\ufe0f Recherche de satellites","\ud83d\udc65 \xc9criture des personas","\ud83e\udd5e Localisation des cr\xeaperies","\ud83e\uddd1\u200d\ud83d\udcbb D\xe9boguage de l\'interface","\ud83d\udcc8 Incr\xe9mentation des statistiques"],"error_psv":"Photo Sphere Viewer ne s\'est pas charg\xe9 correctement","error_pic":"La photo demand\xe9e est introuvable","error_nopic":"Aucune photo disponible autour de la localisation recherch\xe9e","error_api":"Le serveur de photos n\'est pas disponible","error_webgl":"WebGL n\'est pas support\xe9 par votre navigateur","error_josm":"JOSM n\'a pas r\xe9pondu, est-il bien lanc\xe9 et la t\xe9l\xe9commande activ\xe9e ?","error_api_compatibility":"Le serveur de photos n\'est pas compatible avec cette visionneuse","filter_date":"Date","filter_date_1month":"1 mois","filter_date_1year":"1 an","filter_user":"Utilisateur","filter_user_mypics":"Mes photos","filter_picture":"Type d\'image","picture_flat":"Classique","picture_360":"360\xb0","filter_qualityscore":"Score de qualit\xe9","filter_qualityscore_help":"Cliquez pour activer ou d\xe9sactiver","qualityscore_title":"\xc0 propos du score qualit\xe9","qualityscore_doc_1":"Panoramax propose un Score de Qualit\xe9 pour chacune de ses photos. Cela facilite le filtre et la recherche de photos de bonne qualit\xe9 sur la carte.","qualityscore_doc_2":"Le score est affich\xe9 sous la forme d\'une lettre A/B/C/D/E (A \xe9tant le meilleur, E le moins bon), et visualisable gr\xe2ce \xe0 cette \xe9chelle :","qualityscore_doc_3":"Il est calcul\xe9 en fonction de la pr\xe9cision du GPS ainsi que la r\xe9solution de la photo. Un mat\xe9riel professionnel aura une note de A, une cam\xe9ra sportive 360\xb0 une note de B, et un smartphone une note de C \xe0 E.","qualityscore_doc_link":"Plus d\'infos sur le calcul du Score Qualit\xe9 dans notre documentation.","filter_zoom_in":"Zoomez plus pour voir ce filtre","map_background":"Fond de carte","map_background_aerial":"Satellite","map_background_streets":"Plan","map_theme":"Rendu de carte","map_theme_default":"Classique","map_theme_age":"Date de prise de vue","map_theme_age_1":"> 2 ans","map_theme_age_2":"< 2 ans","map_theme_age_3":"< 1 an","map_theme_age_4":"< 1 mois","map_theme_type":"Type de cam\xe9ra","map_theme_score":"Score de qualit\xe9","contrast":"Augmenter le contraste de l\'image","metadata":"M\xe9tadonn\xe9es de la photo","metadata_general_picid":"Identifiant de photo","metadata_general_seqid":"Identifiant de s\xe9quence","metadata_general_picid_link":"Aller au descriptif JSON de la photo","metadata_general_seqid_link":"Aller au descriptif JSON de la s\xe9quence","metadata_general_author":"Auteur","metadata_general_license":"Licence","metadata_general_license_link":"Voir la description compl\xe8te de la licence","metadata_general_date":"Date de prise de vue","metadata_camera":"Appareil","metadata_camera_make":"Fabricant","metadata_camera_model":"Mod\xe8le","metadata_camera_type":"Type","metadata_camera_resolution":"R\xe9solution","metadata_camera_focal_length":"Longueur focale","metadata_location":"Localisation","metadata_location_longitude":"Longitude","metadata_location_latitude":"Latitude","metadata_location_orientation":"Direction de prise de vue","metadata_location_precision":"Pr\xe9cision du positionnement","metadata_quality":"Score de qualit\xe9","metadata_quality_help":"En savoir plus sur le score de qualit\xe9","metadata_quality_score":"Note globale","metadata_quality_gps_score":"Note du positionnement","metadata_quality_resolution_score":"Note de la r\xe9solution","metadata_quality_missing":"pas d\'info dans l\'image","metadata_exif":"EXIF / XMP","metadata_exif_name":"Balise","metadata_exif_value":"Valeur","report":"Signaler la photo","report_auth":"Ce signalement sera envoy\xe9 en utilisant votre compte \\"{a}\\"","report_nature_label":"Nature du probl\xe8me","report_nature":{"":"S\xe9lectionnez la nature du probl\xe8me\u2026","blur_missing":"Un visage ou une plaque d\'immatriculation est visible","blur_excess":"Un objet qui ne n\xe9cessite pas de floutage est flout\xe9","inappropriate":"L\'image est inappropri\xe9e (non pertinente, nudit\xe9\u2026)","privacy":"Un chemin priv\xe9 ou une propri\xe9t\xe9 priv\xe9e est visible","picture_low_quality":"L\'image est de mauvaise qualit\xe9","mislocated":"L\'image est mal g\xe9olocalis\xe9e","copyright":"L\'image enfreint les droits d\'auteur","other":"Tout autre type de probl\xe8me"},"report_whole_sequence":"Cela concerne toute la s\xe9quence","report_details":"D\xe9tails suppl\xe9mentaires","report_details_placeholder":"Optionnel, vous pouvez ajouter des d\xe9tails sur le probl\xe8me","report_email":"Votre email","report_email_placeholder":"Optionnel","report_submit":"Envoyer","report_wait":"Envoi du signalement en cours\u2026","report_success":"Le signalement a \xe9t\xe9 envoy\xe9 avec succ\xe8s. Il sera examin\xe9 d\xe8s que possible.","report_failure":"Une erreur est survenue lors de la cr\xe9ation du signalement : {e}. Veuillez r\xe9essayer plus tard."},"map":{"loading":"Chargement\u2026","thumbnail":"Miniature de la photo survol\xe9e","not_public":"Masqu\xe9 au public","slow_loading":"La carte est longue \xe0 charger et pourrait appara\xeetre cass\xe9e"}}')},6909:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"K\xe9t ujjal navig\xe1lhat","ctrlZoom":"K\xf6zel\xedt\xe9s vagy t\xe1vol\xedt\xe1s: Ctrl + g\xf6rget\xe9s","loadError":"A panor\xe1ma nem t\xf6lthet\u0151 be"},"gvs":{"zoom":"Nagy\xedt\xe1s","zoomOut":"T\xe1vol\xedt\xe1s","zoomIn":"K\xf6zel\xedt\xe9s","moveUp":"Mozg\xe1s fel","moveDown":"Mozg\xe1s le","moveLeft":"Mozg\xe1s balra","moveRight":"Mozg\xe1s jobbra","moveMiddle":"N\xe9zet k\xf6z\xe9pre hoz\xe1sa","expand":"B\u0151v\xedt\xe9s","expand_info":"Widget megjelen\xedt\xe9se teljes oldalon","show_psv":"K\xe9pn\xe9zeget\u0151 megjelen\xedt\xe9se","show_map":"T\xe9rk\xe9p megjelen\xedt\xe9se","minimize":"Widget elrejt\xe9se; a bal als\xf3 sarokban l\xe9v\u0151 gombbal \xfajra megjelen\xedtheti","options":"Be\xe1ll\xedt\xe1sok","filters":"Sz\u0171r\u0151k","layers":"R\xe9tegek","share":"Megoszt\xe1s","search":"Keres\xe9s","search_empty":"Nincs tal\xe1lat","share_links":"Linkek","share_page":"Link erre az oldalra","share_image":"Nagy felbont\xe1s\xfa (HD) k\xe9p","share_rss":"RSS h\xedrcsatorna","share_rss_title":"A t\xe9rk\xe9p l\xe1that\xf3 ter\xfclet\xe9n l\xe9v\u0151 \xfaj sorozatok RSS-h\xedrcsatorn\xe1ja","share_embed":"Be\xe1gyaz\xe1s a weboldaladon","share_print":"Nyomtat\xe1s","copy":"M\xe1sol\xe1s","copied":"M\xe1solva","error":"Ajjaj, baj van\u2026","error_subtitle":"Pr\xf3b\xe1lja \xfajra k\xe9s\u0151bb, vagy n\xe9zze meg a b\xf6ng\xe9sz\u0151konzolt a tov\xe1bbi r\xe9szletek\xe9rt.","sequence_next":"A sorozat k\xf6vetkez\u0151 k\xe9pe","sequence_play":"Sorozat lej\xe1tsz\xe1sa","sequence_pause":"Sorozatlej\xe1tsz\xe1s sz\xfcneteltet\xe9se","sequence_prev":"A sorozat el\u0151z\u0151 k\xe9pe","sequence_more":"Tov\xe1bbi lej\xe1tsz\xe1si lehet\u0151s\xe9gek","sequence_speed":"Lej\xe1tsz\xe1s sebess\xe9ge","legend_license":"Licenc: {l}","edit_osm":"OSM szerkeszt\xe9se","id":"iD","josm":"JOSM","josm_live":"JOSM automatikus szinkroniz\xe1l\xe1s\xe1nak enged\xe9lyez\xe9se k\xe9pbet\xf6lt\xe9skor","loading_labels_serious":["\ud83d\uddfa\ufe0f T\xe9rk\xe9padatok bet\xf6lt\xe9se","\ud83d\udda5\ufe0f API lek\xe9rdez\xe9se","\ud83d\uddbc\ufe0f B\xe9lyegk\xe9pek bet\xf6lt\xe9se","\ud83d\udd0d EXIF metaadatok elemz\xe9se","\ud83c\udfd8\ufe0f 3D megjelen\xedt\xe9s","\ud83d\udcf7 360\xb0-os k\xe9pek inicializ\xe1l\xe1sa","\ud83d\udfe0 Sz\xednek kiegyenl\xedt\xe9se","\ud83d\udcaf Min\u0151s\xe9gi pontsz\xe1m kisz\xe1m\xedt\xe1sa \xa9"],"loading_labels_fun":["\ud83e\udd8c Vadvesz\xe9lyt jelz\u0151 t\xe1bla \xe9szlel\xe9se","\ud83d\ude98 Panoramax aut\xf3 \xa9 keres\xe9se","\u2615 Koffeininjekci\xf3","\ud83d\ude00 Mosolyogj, fel lett\xe9l t\xe9rk\xe9pezve!","\ud83d\udc08 Kiscic\xe1s k\xe9pek megoszt\xe1sa","\ud83d\ude34 Halogat\xe1s cs\xf6kkent\xe9se","\ud83e\uded6 Tea megf\u0151z\xe9se","\ud83d\udc27 Forr\xe1sk\xf3d felnyit\xe1sa","\ud83d\ude87 Metr\xf3\xe1llom\xe1sok indexel\xe9se","\ud83e\uddf9 Metaadatok tisztogat\xe1sa","\ud83d\ude92 T\u0171zolt\xf3s\xe1gr\xf3l sz\xf3l\xf3 fot\xf3k bek\xfcld\xe9se","\ud83d\udeb2 Z\xf6ldutak friss\xedt\xe9se","\ud83d\ude89 Peronok bej\xe1r\xe1sa","\ud83d\udef0\ufe0f M\u0171holdak keres\xe9se","\ud83d\udc65 Person\xe1k meg\xedr\xe1sa","\ud83d\udc1f S\xfcltkrumplikap\xf3k lokaliz\xe1l\xe1sa","\ud83e\uddd1\u200d\ud83d\udcbb Hibakeres\u0151 fel\xfclet","\ud83d\udcc8 Statisztika n\xf6vel\xe9se"],"error_psv":"A Photo Sphere Viewer (g\xf6mbpanor\xe1ma-n\xe9zeget\u0151) nem t\xf6lt\u0151dik be megfelel\u0151en","error_pic":"A k\xe9rt k\xe9p nem tal\xe1lhat\xf3","error_nopic":"Az adott helyen nem \xe9rhet\u0151 el k\xe9p","error_api":"A k\xe9pkiszolg\xe1l\xf3 nem \xe9rhet\u0151 el","error_webgl":"A WebGL nem t\xe1mogatott ebben a b\xf6ng\xe9sz\u0151ben","error_josm":"A JOSM nem v\xe1laszol. Val\xf3ban fut \xe9s el\xe9rhet\u0151 t\xe1volr\xf3l?","error_api_compatibility":"A k\xe9pkiszolg\xe1l\xf3 nem kompatibilis a k\xe9pn\xe9zeget\u0151 ezen verzi\xf3j\xe1val","filter_date":"D\xe1tum szerint","filter_user":"Felhaszn\xe1l\xf3 szerint","filter_picture":"K\xe9pt\xedpus szerint","picture_flat":"Klasszikus","picture_360":"360\xb0","filter_camera_model":"Kameramodell szerint","map_background":"T\xe9rk\xe9ph\xe1tt\xe9r","map_background_aerial":"L\xe9gi felv\xe9tel","map_background_streets":"k\xe9pUtca","map_theme":"T\xe9rk\xe9p t\xe9m\xe1ja","map_theme_default":"Klasszikus","map_theme_age":"K\xe9pk\xe9sz\xedt\xe9s ideje","map_theme_age_1":"> 2 \xe9ve","map_theme_age_2":"< 2 \xe9ve","map_theme_age_3":"< 1 \xe9ve","map_theme_age_4":"< 1 h\xf3napja","map_theme_type":"Kamerat\xedpus","contrast":"Nagyobb k\xe9pkontraszt enged\xe9lyez\xe9se","metadata":"K\xe9p metaadatai","metadata_general_picid":"K\xe9p azonos\xedt\xf3js","metadata_general_seqid":"Sorozat azonos\xedt\xf3ja","metadata_general_picid_link":"Ugr\xe1s a k\xe9p JSON le\xedr\xe1s\xe1hoz","metadata_general_seqid_link":"Ugr\xe1s a sorozat JSON le\xedr\xe1s\xe1hoz","metadata_general_author":"Szerz\u0151","metadata_general_license":"Licenc (enged\xe9ly)","metadata_general_license_link":"Ugr\xe1s a licenc teljes le\xedr\xe1s\xe1hoz","metadata_general_date":"K\xe9sz\xedt\xe9s d\xe1tuma","metadata_camera":"Kamera","metadata_camera_make":"Gy\xe1rt\xf3","metadata_camera_model":"Modell","metadata_camera_type":"T\xedpus","metadata_camera_focal_length":"Gy\xfajt\xf3t\xe1vols\xe1g","metadata_location":"Helysz\xedn","metadata_location_longitude":"Hossz\xfas\xe1g","metadata_location_latitude":"Sz\xe9less\xe9g","metadata_location_orientation":"Felv\xe9tel ir\xe1nya","metadata_location_precision":"Helymeghat\xe1roz\xe1s pontoss\xe1ga","metadata_exif":"EXIF / XMP","metadata_exif_name":"C\xedmke","metadata_exif_value":"\xc9rt\xe9k","report":"K\xe9p bejelent\xe9se","report_auth":"A jelent\xe9s a fi\xf3kod ({a}) felhaszn\xe1l\xe1s\xe1val lesz elk\xfcldve","report_nature":{"":"Probl\xe9ma jelleg\xe9nek kiv\xe1laszt\xe1sa\u2026","blur_missing":"A k\xe9pen l\xe1tszik egy szem\xe9ly arca vagy egy rendsz\xe1mt\xe1bla","blur_excess":"A k\xe9pen el van hom\xe1lyos\xedtva egy olyan objektum, amelynek \xe9lesnek kellene lennie","inappropriate":"A k\xe9p nem megfelel\u0151 (irrelev\xe1ns, meztelens\xe9get jelen\xedt meg stb.)","privacy":"A k\xe9pen mag\xe1n\xfat vagy mag\xe1nter\xfclet l\xe1that\xf3","picture_low_quality":"A k\xe9p nagyon rossz min\u0151s\xe9g\u0171","mislocated":"A k\xe9p rosszul van elhelyezve a t\xe9rk\xe9pen","copyright":"A k\xe9p szerz\u0151i jogot s\xe9rt","other":"B\xe1rmilyen m\xe1s jelleg\u0171 probl\xe9ma"},"report_nature_label":"Probl\xe9ma jellege","report_details":"Tov\xe1bbi r\xe9szletek","filter_zoom_in":"Nagy\xedts a sz\u0171r\u0151k l\xe1that\xf3v\xe1 t\xe9tel\xe9hez","report_email":"E-mail-c\xedm","report_email_placeholder":"Nem k\xf6telez\u0151","report_submit":"Bek\xfcld\xe9s","report_success":"A jelent\xe9s sikeresen be lett k\xfcldve; a lehet\u0151 leghamarabb megvizsg\xe1ljuk.","report_failure":"Hiba t\xf6rt\xe9nt a jelent\xe9s l\xe9trehoz\xe1sakor: {e}. K\xe9rj\xfck, pr\xf3b\xe1ld meg k\xe9s\u0151bb \xfajra.","search_user":"Felhaszn\xe1l\xf3n\xe9v keres\xe9se\u2026","search_address":"C\xedm, v\xe1ros stb. keres\xe9se\u2026","share_embed_docs":"Tov\xe1bbi inform\xe1ci\xf3 a be\xe1gyaz\xe1s konfigur\xe1l\xe1s\xe1r\xf3l","error_click":"Kattints a folytat\xe1shoz","error_retry":"K\xe9rj\xfck, pr\xf3b\xe1ld meg k\xe9s\u0151bb","legend_title":"K\xe9p adatainak megjelen\xedt\xe9se","report_whole_sequence":"A teljes sorozatra vonatkozik","report_wait":"Jelent\xe9s bek\xfcld\xe9se folyamatban\u2026","report_details_placeholder":"Megadhatsz tov\xe1bbi r\xe9szleteket a probl\xe9m\xe1r\xf3l (nem k\xf6telez\u0151)","filter_qualityscore_help":"Kattints az enged\xe9lyez\xe9shez vagy a letilt\xe1shoz","filter_qualityscore":"Min\u0151s\xe9gi pontsz\xe1m","map_theme_score":"Min\u0151s\xe9gi pontsz\xe1m","metadata_camera_resolution":"Felbont\xe1s","metadata_quality":"Min\u0151s\xe9gi pontsz\xe1m","metadata_quality_help":"Tov\xe1bbi tudnival\xf3k a min\u0151s\xe9gi pontsz\xe1mr\xf3l","metadata_quality_score":"\xd6sszes\xedtett pontsz\xe1m","metadata_quality_gps_score":"Pozicion\xe1l\xe1si pontsz\xe1m","metadata_quality_resolution_score":"Felbont\xe1si pontsz\xe1m","metadata_quality_missing":"a k\xe9pben nincs megadva \xe9rt\xe9k"},"map":{"loading":"Bet\xf6lt\xe9s\u2026","thumbnail":"A kurzor alatti k\xe9p b\xe9lyegk\xe9pe","not_public":"Nem l\xe1that\xf3 nyilv\xe1nosan","slow_loading":"A t\xe9rk\xe9p lassan t\xf6lt\u0151dik be, \xe9s lehet, hogy lerobbant"},"maplibre":{"GeolocateControl.FindMyLocation":"Tart\xf3zkod\xe1si hely megtal\xe1l\xe1sa","GeolocateControl.LocationNotAvailable":"Tart\xf3zkod\xe1si hely nem \xe9rhet\u0151 el"}}')},4895:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"expand":"Espandi","zoomOut":"Rimpicciolisci","zoomIn":"Ingrandisci","zoom":"Zoom","moveUp":"Muovi in alto","moveDown":"Muovi in basso","moveLeft":"Muovi a sinistra","moveRight":"Muovi a destra","expand_info":"Fai apparire il widget a schermo pieno","options":"Opzioni","filters":"Filtri","layers":"Livelli","search":"Cerca","search_empty":"Nessun risultato trovato","search_address":"Cerca un indirizzo, citt\xe0\u2026","search_user":"Cerca un nome utente\u2026","share":"Condividi","share_links":"Collegamenti","share_page":"Collegamento a questa pagina","share_image":"Immagine HD","share_embed":"Incorpora nel tuo sito web","share_embed_docs":"Scopri di pi\xf9 sulla configurazione della incorporazione","share_print":"Stampa","copy":"Copia","copied":"Copiato","error":"Abbiamo un problema\u2026","error_click":"Clicca per continuare","error_retry":"Riprovare pi\xf9 tardi","sequence_play":"Riproduci questa sequenza","sequence_pause":"Pausa la sequenza","sequence_speed":"Velocit\xe0 di riproduzione","legend_license":"Licenza: {l}","legend_title":"Mostra dettagli della foto","edit_osm":"Modifica OSM","loading_labels_serious":["\ud83d\uddfa\ufe0f Caricamento dei dati della mappa","\ud83d\udda5\ufe0f Interrogazione delle API","\ud83d\uddbc\ufe0f Caricamento delle miniature","\ud83d\udd0d Analisi dei metadata EXIF","\ud83c\udfd8\ufe0f Creazione del rendering 3D","\ud83d\udcf7 Inizializzazione delle foto a 360\xb0","\ud83d\udfe0 Bilanciamento del colore","\ud83d\udcaf Calcolo del punteggio della qualit\xe0 \xa9"],"loading_labels_fun":["\ud83e\udd8c Rilevazione dei cartelli di attraversamento dei cervi","\ud83d\ude98 Ricerca dell\u2019auto Panoramax \xa9","\u2615 Iniezione di caffeina","\ud83d\ude00 Sorridete, siete stati mappati!","\ud83d\udc08 Condivisione delle foto di gatti","\ud83d\ude34 Riduzione della procrastinazione","\ud83e\uded6 Preparazione del t\xe8","\ud83d\udc27 Apertura del codice sorgente","\ud83d\ude87 Indicizzazione delle stazioni della metro","\ud83e\uddf9 Pulizia dei metadata","\ud83d\ude92 Invio delle foto delle stazioni dei pompieri","\ud83d\udeb2 Aggiornamento delle strade verdi","\ud83d\ude89 Passeggiata sulle banchine della stazione","\ud83d\udef0\ufe0f Ricerca dei satelliti","\ud83d\udc65 Scrittura delle persone","\ud83d\udc1f Ricerca dei negozi di patatine fritte","\ud83e\uddd1\u200d\ud83d\udcbb Debug dell\u2019interfaccia","\ud83d\udcc8 Incremento delle statistiche"],"error_psv":"Il visualizzatore delle foto sferiche non si sta caricando correttamente","error_pic":"La foto richiesta non \xe8 stata trovata","error_nopic":"Nessuna foto disponibile alla posizione richiesta","error_api":"Il server delle foto non \xe8 disponibile","error_webgl":"Il tuo browser non supporta WebGL","error_josm":"JOSM non risponde, \xe8 in esecuzione con il controllo remoto abilitato?","error_api_compatibility":"Il server delle foto non \xe8 compatibile con questa versione del visualizzatore","filter_date":"Data","filter_date_1month":"1 mese","filter_date_1year":"1 anno","filter_user_mypics":"Le mie foto","filter_picture":"Tipo di foto","filter_zoom_in":"Ingrandisci per vedere questo filtro","picture_flat":"Classica","picture_360":"360\xb0","filter_qualityscore_help":"Clicca per abilitare o disabilitare","map_background":"Sfondo della mappa","map_background_aerial":"Satellite","map_background_streets":"Strade","map_theme":"Tema della mappa","map_theme_default":"Classica","map_theme_age":"Data di acquisizione","map_theme_age_2":"< 2 anni","map_theme_age_3":"< 1 anno","map_theme_age_4":"< 1 mese","map_theme_score":"Punteggio della qualit\xe0","contrast":"Abilita un maggiore contrasto della foto","metadata":"Metadata della foto","metadata_general_picid":"Identificatore della foto","metadata_general_picid_link":"Vai alla descrizione JSON della foto","metadata_general_seqid_link":"Vai alla descrizione JSON della sequenza","metadata_general_author":"Autore","metadata_general_license":"Licenza","metadata_general_date":"Data di acquisizione","metadata_camera":"Fotocamera","metadata_camera_make":"Costruttore","metadata_camera_model":"Modello","metadata_camera_type":"Tipo","metadata_camera_resolution":"Risoluzione","metadata_location":"Posizione","metadata_location_longitude":"Longitudine","metadata_location_latitude":"Latitudine","metadata_location_precision":"Precisione della posizione","metadata_quality":"Punteggio della qualit\xe0","metadata_quality_score":"Punteggio globale","metadata_quality_gps_score":"Punteggio sulla posizione","metadata_quality_resolution_score":"Punteggio della risoluzione","metadata_exif":"EXIF / XMP","metadata_exif_name":"Attributo","report_auth":"Questa segnalazione verr\xe0 inviata usando la tua utenza \u201c{a}\u201d","report_nature_label":"Natura del problema","report_nature":{"blur_excess":"Un oggetto che non ha bisogno di essere offuscato lo \xe8","inappropriate":"La foto \xe8 inappropriata (non pertinente, nudo, \u2026)","mislocated":"La foto non \xe8 ben posizionata sulla mappa","copyright":"La foto viola il diritto d\u2019autore","other":"Qualsiasi altro tipo di problema","picture_low_quality":"La foto \xe8 di qualit\xe0 scarsa","":"Selezione la natura del problema\u2026","blur_missing":"Sono visibili la faccia di una persona o la targa di un\u2019auto","privacy":"Sono visibili un sentiero o una propriet\xe0 privati"},"report_whole_sequence":"Riguarda l\u2019intera sequenza","report_details":"Ulteriori dettagli","report_email":"La tua e-mail","report_email_placeholder":"Facoltativo","report_submit":"Invia","report_wait":"Invio della segnalazione\u2026","report_failure":"\xc8 avvenuto un errore durante la creazione della segnalazione: {e}. Riprovare pi\xf9 tardi.","moveMiddle":"Centra la visuale","show_map":"Mostra la mappa","sequence_next":"Prossima foto nella sequenza","map_theme_age_1":"> 2 anni","map_theme_type":"Tipo di fotocamera","minimize":"Nascondi il widget, puoi mostrarlo di nuovo usando il pulsante nell\u2019angolo in basso a sinistra","metadata_general_license_link":"Vedi la descrizione completa della licenza","share_rss":"Feed RSS","show_psv":"Mostra il visualizzatore delle foto","share_rss_title":"Feed RSS delle nuove sequenze nell\u2019attuale area visibile della mappa","sequence_prev":"Foto precedente della sequenza","sequence_more":"Altre opzioni di riproduzione","josm_live":"Abilita la sincronizzazione automatica di JOSM al caricamento delle foto","metadata_general_seqid":"Identificatore della sequenza","metadata_camera_focal_length":"Lunghezza focale","filter_user":"Utente","metadata_location_orientation":"Direzione dello scatto","filter_qualityscore":"Punteggio della qualit\xe0","metadata_quality_help":"Per saperne di pi\xf9 sul punteggio di qualit\xe0","metadata_quality_missing":"Nessun valore impostato nella foto","metadata_exif_value":"Valore","report":"Segnala foto","report_details_placeholder":"Facoltativo, puoi aggiungere dei dettagli sul problema e sul perch\xe9 lo ritieni rilevante","report_success":"La segnalazione \xe8 stata inviata correttamente. Non appena possibile verr\xe0 esaminata.","minimize_short":"Nascondi","qualityscore_title":"Informazioni sul punteggio di qualit\xe0","qualityscore_doc_1":"Panoramax propone un Punteggio della qualit\xe0 per ogni foto. Ci\xf2 permette di filtrare facilmente la mappa e mostrare le foto di alta qualit\xe0 disponibili.","qualityscore_doc_2":"Il voto \xe8 mostrato agli utenti con un valore tipo A/B/C/D/E (A \xe8 il voto migliore, E il peggiore) e graficamente viene mostrato con la seguente scala:","qualityscore_doc_link":"Nella nostra documentazione sono presenti maggiori dettagli sul calcolo del Punteggio della qualit\xe0.","qualityscore_doc_3":"Esso \xe8 calcolato basandosi sulla precisione del GPS e sulla risoluzione della foto. Un sistema professionale avr\xe0 un punteggio A, un action camera a 360\xb0 avr\xe0 un punteggio B e uno smartphone verr\xe0 classificato come C, D o E."},"psv":{"loadError":"Impossibile caricare l\u2019immagine panoramica","ctrlZoom":"Utilizza Ctrl + rotellina del mouse per ingrandire l\u2019immagine","twoFingers":"Usa due dita per spostarti"},"maplibre":{"GeolocateControl.FindMyLocation":"Trova la mia posizione","GeolocateControl.LocationNotAvailable":"Posizione non disponibile"},"map":{"loading":"Caricamento\u2026","thumbnail":"Miniatura della foto passata con il mouse","not_public":"Non pubblicamente visibile","slow_loading":"La mappa impiega troppo tempo a caricarsi e potrebbe apparire a pezzi"}}')},9026:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"moveRight":"Przesu\u0144 w prawo","sequence_speed":"Pr\u0119dko\u015b\u0107 odtwarzania","metadata_camera_model":"Model","search_address":"Szukaj adres, miasto\u2026","zoom":"Przybli\u017cenie","zoomIn":"Przybli\u017c","moveUp":"Przesu\u0144 w g\xf3r\u0119","moveDown":"Przesu\u0144 w d\xf3\u0142","moveLeft":"Przesu\u0144 w lewo","moveMiddle":"Wycentruj widok","expand":"Rozszerz","show_psv":"Poka\u017c przegl\u0105dark\u0119 zdj\u0119\u0107","show_map":"Poka\u017c map\u0119","options":"Opcje","filters":"Filtry","layers":"Warstwy","search":"Szukaj","search_empty":"Brak wynik\xf3w","search_user":"Szukaj nazwy u\u017cytkownika\u2026","share":"Udost\u0119pnij","share_links":"Linki","share_page":"Link do tej strony","share_rss":"Kana\u0142 RSS","share_print":"Drukuj","copy":"Kopiuj","copied":"Skopiowano","error":"Mamy problem\u2026","error_click":"Kliknij, aby kontynuowa\u0107","error_retry":"Prosz\u0119 spr\xf3buj p\xf3\u017aniej","sequence_next":"Nast\u0119pne zdj\u0119cie w sekwencji","sequence_pause":"Spauzuj sekwencj\u0119","sequence_prev":"Poprzednie zdj\u0119cie w sekwencji","sequence_more":"Wi\u0119cej opcji odtwarzania","legend_license":"Licencja: {l}","legend_title":"Poka\u017c szczeg\xf3\u0142y zdj\u0119cia","edit_osm":"Edytuj OSM","loading_labels_serious":["\ud83d\uddfa\ufe0f Wczytywanie danych mapy","\ud83d\udda5\ufe0f Odpytywanie API","\ud83d\uddbc\ufe0f Wczytywanie miniaturek","\ud83d\udd0d Analizowanie metadanych EXIF","\ud83c\udfd8\ufe0f Renderowanie 3D","\ud83d\udcf7 Inicjowanie zdj\u0119\u0107 360\xb0","\ud83d\udfe0 Balansowanie kolor\xf3w","\ud83d\udcaf Obliczanie oceny jako\u015bci \xa9"],"map_theme_age_2":"< 2 lata","map_theme_age_1":"> 2 lata","map_theme_age":"Data zrobienia","filter_picture":"Typ zdj\u0119cia","map_theme_age_3":"< rok","map_theme_age_4":"< miesi\u0105c","map_theme_type":"Typ aparatu","metadata":"Metadane zdj\u0119cia","metadata_general_picid":"Identyfikator zdj\u0119cia","metadata_general_seqid":"Identyfikator sekwencji","metadata_general_license":"Licencja","metadata_general_author":"Autor","metadata_camera":"Aparat","metadata_camera_type":"Typ","metadata_camera_resolution":"Rozdzielczo\u015b\u0107","metadata_location":"Lokalizacja","metadata_exif":"EXIF / XMP","metadata_quality_missing":"Brak warto\u015bci ustawionej w zdj\u0119ciu","metadata_exif_name":"Tag","metadata_exif_value":"Warto\u015b\u0107","report":"Zg\u0142o\u015b zdj\u0119cie","report_nature":{"privacy":"Prywatna droga lub w\u0142asno\u015b\u0107 widoczna","mislocated":"Zdj\u0119cie jest w z\u0142ym miejscu na mapie","copyright":"Zdj\u0119cie narusza prawa autorskie","picture_low_quality":"Zdj\u0119cie jest bardzo niskiej jako\u015bci","other":"Inny problem","":"Wybierz typ problemu\u2026","blur_missing":"Twarz osoby lub rejestracja samochodu jest widoczna","blur_excess":"Obiekt, kt\xf3ry nie wymaga zamazania jest zamazany","inappropriate":"Zdj\u0119cie jest niestosowne (niezwi\u0105zane, nago\u015b\u0107\u2026)"},"zoomOut":"Oddal","report_whole_sequence":"Dotyczy ca\u0142ej sekwencji","report_details":"Dodatkowe szczeg\xf3\u0142y","report_email":"Tw\xf3j adres email","report_email_placeholder":"Opcjonalne","report_submit":"Wy\u015blij","report_wait":"Wysy\u0142anie zg\u0142oszenia\u2026","report_success":"Zg\u0142oszenie zosta\u0142o wys\u0142ane. Zostanie przejrzane tak szybko jak to mo\u017cliwe.","share_rss_title":"Kana\u0142 RSS nowych sekwencji na widocznym obszarze mapy","loading_labels_fun":["\ud83e\udd8c Wykrywanie znak\xf3w przechodzenia jeleni",null,"\u2615 Wstrzykiwanie kofeiny","\ud83d\ude00 U\u015bmiechnij si\u0119, jeste\u015b mapowany!","\ud83d\udc08 Udost\u0119pnianie zdj\u0119\u0107 kot\xf3w","\ud83d\ude34 Zmniejszania prokrastynacji","\ud83e\uded6 Parzenie herbaty","\ud83d\udc27 Otwieranie kodu \u017ar\xf3d\u0142owego","\ud83d\ude87 Indeksowanie stacji metra","\ud83e\uddf9 Czyszczenie metadanych","\ud83d\ude92 Przesy\u0142anie zdj\u0119\u0107 remiz",null,"\ud83d\ude89 Przechodzenie peron\xf3w stacji","\ud83d\udef0\ufe0f Wyszukiwanie satelit",null,"\ud83d\udc1f Szukanie sklep\xf3w z frytkami i ryb\u0105","\ud83e\uddd1\u200d\ud83d\udcbb Interfejs debugowania","\ud83d\udcc8 Zwi\u0119kszanie statystyk"],"share_embed_docs":"Przeczytaj wi\u0119cej o konfiguracji osadzenia","sequence_play":"Odtw\xf3rz t\u0119 sekwencj\u0119","josm_live":"W\u0142\u0105cz automatyczn\u0105 synchronizacj\u0119 JOSM przy \u0142adowaniu zdj\u0119\u0107","error_api":"Serwer zdj\u0119\u0107 nie jest dost\u0119pny","error_webgl":"WebGL nie jest obs\u0142ugiwany przez t\u0119 przegl\u0105dark\u0119","error_api_compatibility":"Serwer zdj\u0119\u0107 nie jest kompatybilny z t\u0105 wersj\u0105 przegl\u0105darki","filter_date":"Data","filter_date_1month":"1 miesi\u0105c","filter_date_1year":"1 rok","filter_user":"U\u017cytkownik","filter_user_mypics":"Moje zdj\u0119cia","filter_zoom_in":"Przybli\u017c, aby filtry by\u0142y widoczne","picture_flat":"Klasyczne","picture_360":"360\xb0","filter_qualityscore":"Ocena jako\u015bci","map_background":"Podk\u0142ad mapowy","map_background_aerial":"Zdj\u0119cia lotnicze","map_background_streets":"Ulice","map_theme":"Motyw mapy","map_theme_default":"Klasyczny","map_theme_score":"Ocena jako\u015bci","contrast":"W\u0142\u0105cz wy\u017cszy kontrast zdj\u0119cia","metadata_general_picid_link":"Id\u017a do opisu zdj\u0119cia w JSON","metadata_general_seqid_link":"Id\u017a do opisu sekwencji w JSON","metadata_general_license_link":"Id\u017a do strony z pelnym opisem licencji","metadata_general_date":"Data zrobienia","metadata_camera_make":"Marka","metadata_camera_focal_length":"Ogniskowa","metadata_location_longitude":"D\u0142ugo\u015b\u0107 geograficzna","metadata_location_latitude":"Szeroko\u015b\u0107 geograficzna","metadata_location_orientation":"Kierunek robienia zdj\u0119cia","metadata_location_precision":"Precyzja lokalizacji","metadata_quality":"Ocena jako\u015bci","metadata_quality_help":"Dowiedz si\u0119 wi\u0119cej o ocenie jako\u015bci","metadata_quality_score":"Ocena globalna","metadata_quality_gps_score":"Ocena pozycji","metadata_quality_resolution_score":"Ocena rozdzielczo\u015bci","report_auth":"To zg\u0142oszenie b\u0119dzie wys\u0142anie przy pomocy Twojego konta \\"{a}\\"","report_nature_label":"Typ problemu","report_details_placeholder":"Opcjonalnie, mo\u017cesz doda\u0107 szczeg\xf3\u0142y o problemie","report_failure":"B\u0142\u0105d wyst\u0105pi\u0142 podczas tworzenia zg\u0142oszenia: {e}. Prosz\u0119 spr\xf3buj ponownie.","filter_qualityscore_help":"Kliknij, aby w\u0142\u0105czy\u0107 lub wy\u0142\u0105czy\u0107","error_josm":"JOSM nie odpowiada, czy jest uruchomiony i czy dost\u0119p zdalny jest w\u0142\u0105czony?"},"psv":{"twoFingers":"U\u017cyj dw\xf3ch palc\xf3w do nawigacji","ctrlZoom":"U\u017cyj ctrl + rolka myszy, aby powi\u0119kszy\u0107 zdj\u0119cie","loadError":"Panorama nie mo\u017ce by\u0107 za\u0142adowana"},"maplibre":{"GeolocateControl.FindMyLocation":"Znajd\u017a moj\u0105 lokalizacj\u0119","GeolocateControl.LocationNotAvailable":"Lokalizacja niedost\u0119pna"},"map":{"thumbnail":"Miniaturki najechanego zdj\u0119cia","not_public":"Niewidoczne publicznie","slow_loading":"Mapa \u0142aduje si\u0119 wolno i mo\u017ce si\u0119 wydawaj popsuta","loading":"\u0141adowanie\u2026"}}')},6984:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"contrast":"\u589e\u52a0\u76f8\u7247\u5c0d\u6bd4\u5ea6","copied":"\u5df2\u8907\u88fd","copy":"\u8907\u88fd","edit_osm":"\u7de8\u8f2f OSM","error":"Panoramax \u7576\u6a5f\u4e86\u2026","error_api":"\u76f8\u7247\u4f3a\u670d\u5668\u7121\u6cd5\u4f7f\u7528","error_api_compatibility":"\u76f8\u7247\u4f3a\u670d\u5668\u548c\u6b64\u6aa2\u8996\u5668\u7684\u7248\u672c\u4e0d\u76f8\u5bb9","error_josm":"JOSM \u6c92\u6709\u56de\u61c9\uff0c\u5b83\u5df2\u7d93\u555f\u52d5\u4e14\u555f\u7528\u9060\u7aef\u63a7\u5236\u4e86\u55ce?","error_nopic":"\u641c\u5c0b\u7684\u4f4d\u7f6e\u9644\u8fd1\u6c92\u6709\u76f8\u7247","error_pic":"\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u76f8\u7247","error_psv":"\u7121\u6cd5\u6b63\u78ba\u8f09\u5165 Photo Sphere Viewer","error_subtitle":"\u8acb\u7a0d\u5f8c\u91cd\u8a66\u6216\u6aa2\u67e5\u700f\u89bd\u5668\u7684\u4e3b\u63a7\u53f0\u4ee5\u4e86\u89e3\u8a73\u60c5\u3002","error_webgl":"\u60a8\u7684\u700f\u89bd\u5668\u4e0d\u652f\u63f4 WebGL","expand":"\u5c55\u958b","expand_info":"\u5728\u6574\u500b\u756b\u9762\u986f\u793a\u6b64\u5c0f\u5de5\u5177","filter_camera_model":"\u6309\u76f8\u6a5f\u578b\u865f","filter_date":"\u65e5\u671f","filter_picture":"\u76f8\u7247\u985e\u578b","filter_user":"\u4f7f\u7528\u8005","filter_zoom_in":"\u62c9\u8fd1\u5730\u5716\u4ee5\u986f\u793a\u7be9\u9078\u7d50\u679c","filters":"\u7be9\u9078\u5668","id":"iD","josm":"JOSM","josm_live":"\u555f\u7528\u8f09\u5165\u76f8\u7247\u6642\u81ea\u52d5\u540c\u6b65 JOSM","layers":"\u5716\u5c64","legend_license":"\u6388\u6b0a: {l}","loading_labels_fun":["\ud83e\udd8c \u5075\u6e2c\u5230\u7576\u5fc3\u6885\u82b1\u9e7f\u6a19\u8a8c","\ud83d\ude98 \u6b63\u5728\u641c\u5c0b Panoramax \u6c7d\u8eca \xa9","\u2615 \u6ce8\u5165\u5496\u5561\u56e0","\ud83d\ude00 \u8acb\u5fae\u7b11\uff0c\u60a8\u5df2\u88ab\u6a19\u8a18\u5728\u5730\u5716\u4e0a\u4e86\uff01","\ud83d\udc08 \u6b63\u5728\u5206\u4eab\u8c93\u54aa\u7684\u76f8\u7247","\ud83d\ude34 \u6b63\u5728\u6e1b\u5c11\u5ef6\u9072","\ud83e\uded6 \u6b63\u5728\u6c8f\u58fa\u597d\u8336","\ud83d\udc27 \u6b63\u5728\u958b\u555f\u539f\u59cb\u78bc","\ud83d\ude87 \u6b63\u5728\u7d22\u5f15\u5730\u9435\u8eca\u7ad9","\ud83e\uddf9 \u6e05\u7406\u8a6e\u91cb\u8cc7\u6599","\ud83d\ude92 \u6b63\u5728\u50b3\u9001\u6d88\u9632\u968a\u7684\u76f8\u7247","\ud83d\udeb2 \u66f4\u65b0\u7da0\u9053","\ud83d\ude89 \u6b63\u5728\u901a\u904e\u8eca\u7ad9\u6708\u53f0","\ud83d\udef0\ufe0f \u6b63\u5728\u641c\u5c0b\u885b\u661f","\ud83d\udc65 \u6b63\u5728\u64b0\u5beb\u4eba\u7269\u8a8c","\ud83c\udf57 \u6b63\u5728\u5b9a\u4f4d\u9e79\u9165\u96de\u5e97","\ud83e\uddd1\u200d\ud83d\udcbb \u6b63\u5728\u5075\u932f\u4ecb\u9762","\ud83d\udcc8 \u7d71\u8a08\u6578\u64da\u6b63\u5728\u589e\u52a0"],"loading_labels_serious":["\ud83d\uddfa\ufe0f \u6b63\u5728\u8f09\u5165\u5730\u5716\u8cc7\u6599","\ud83d\udda5\ufe0f \u6b63\u5728\u67e5\u8a62 API","\ud83d\uddbc\ufe0f \u6b63\u5728\u8f09\u5165\u7e2e\u5716","\ud83d\udd0d \u6b63\u5728\u5206\u6790 EXIF \u8a6e\u91cb\u8cc7\u6599","\ud83c\udfd8\ufe0f \u6b63\u5728\u7b97\u7e6a 3D","\ud83d\udcf7 \u6b63\u5728\u521d\u59cb\u5316 360\xb0 \u76f8\u7247","\ud83d\udfe0 \u6b63\u5728\u5e73\u8861\u8272\u5f69","\ud83d\udcaf \u6b63\u5728\u8a08\u7b97\u54c1\u8cea\u5206\u6578 \xa9"],"map_background":"\u5730\u5716\u80cc\u666f","map_background_aerial":"\u885b\u661f","map_background_streets":"\u9810\u8a2d","map_theme":"\u5730\u5716\u4e3b\u984c","map_theme_age":"\u62cd\u651d\u6642\u9593","map_theme_age_1":"> 2 \u5e74","map_theme_age_2":"< 2 \u5e74","map_theme_age_3":"< 1 \u5e74","map_theme_age_4":"< 1 \u500b\u6708","map_theme_default":"\u7d93\u5178","map_theme_type":"\u76f8\u6a5f\u985e\u578b","metadata":"\u76f8\u7247\u8a6e\u91cb\u8cc7\u6599","metadata_camera":"\u76f8\u6a5f","metadata_camera_focal_length":"\u7126\u8ddd","metadata_camera_make":"\u88fd\u9020\u5546","metadata_camera_model":"\u578b\u865f","metadata_camera_type":"\u985e\u578b","metadata_exif":"EXIF / XMP","metadata_exif_name":"\u6a19\u7c64","metadata_exif_value":"\u503c","metadata_general_author":"\u4f5c\u8005","metadata_general_date":"\u62cd\u651d\u6642\u9593","metadata_general_license":"\u6388\u6b0a","metadata_general_license_link":"\u67e5\u770b\u5b8c\u6574\u6388\u6b0a\u689d\u6b3e","metadata_general_picid":"\u76f8\u7247\u8b58\u5225\u78bc","metadata_general_picid_link":"\u524d\u5f80\u672c\u76f8\u7247\u7684 JSON \u8aaa\u660e","metadata_general_seqid":"\u5e8f\u5217\u8b58\u5225\u78bc","metadata_general_seqid_link":"\u524d\u5f80\u672c\u5e8f\u5217\u7684 JSON \u8aaa\u660e","metadata_location":"\u5730\u9ede","metadata_location_latitude":"\u7def\u5ea6","metadata_location_longitude":"\u7d93\u5ea6","metadata_location_orientation":"\u62cd\u651d\u65b9\u5411","metadata_location_precision":"\u5b9a\u4f4d\u7cbe\u5ea6","minimize":"\u96b1\u85cf\u9019\u500b\u5c0f\u5de5\u5177\uff0c\u60a8\u53ef\u4ee5\u6309\u5de6\u4e0b\u89d2\u7684\u6309\u9215\u518d\u6b21\u986f\u793a\u5b83","moveDown":"\u4e0b\u79fb","moveLeft":"\u5de6\u79fb","moveMiddle":"\u756b\u9762\u7f6e\u4e2d","moveRight":"\u53f3\u79fb","moveUp":"\u4e0a\u79fb","options":"\u9078\u9805","picture_360":"360\xb0","picture_flat":"\u7d93\u5178","search":"\u641c\u5c0b","search_address":"\u641c\u5c0b\u5730\u5740\u3001\u57ce\u5e02\u2026","search_empty":"\u627e\u4e0d\u5230\u7d50\u679c","search_user":"\u641c\u5c0b\u5e33\u865f\u2026","sequence_more":"\u66f4\u591a\u64ad\u653e\u9078\u9805","sequence_next":"\u5e8f\u5217\u4e2d\u7684\u4e0b\u4e00\u5f35\u76f8\u7247","sequence_pause":"\u66ab\u505c\u5e8f\u5217","sequence_play":"\u64ad\u653e\u5e8f\u5217","sequence_prev":"\u5e8f\u5217\u4e2d\u7684\u4e0a\u4e00\u5f35\u76f8\u7247","sequence_speed":"\u64ad\u653e\u901f\u5ea6","share":"\u5206\u4eab","share_embed":"\u5d4c\u5165\u5230\u60a8\u7684\u7db2\u7ad9","share_image":"\u9ad8\u756b\u8cea\u76f8\u7247","share_links":"\u8d85\u9023\u7d50","share_page":"\u672c\u9801\u7684\u8d85\u9023\u7d50","share_print":"\u5217\u5370","share_rss":"RSS \u6458\u8981","share_rss_title":"\u76ee\u524d\u5730\u5716\u53ef\u898b\u5340\u57df\u4e2d\u65b0\u76f8\u7247\u5e8f\u5217\u7684 RSS \u6458\u8981","show_map":"\u986f\u793a\u5730\u5716","show_psv":"\u986f\u793a\u76f8\u7247\u6aa2\u8996\u5668","zoom":"\u7e2e\u653e","zoomIn":"\u62c9\u8fd1","zoomOut":"\u62c9\u9060","report_submit":"\u9001\u51fa","report_email":"\u60a8\u7684 email","report_nature_label":"\u554f\u984c\u7684\u985e\u578b","report_nature":{"":"\u9078\u64c7\u554f\u984c\u7684\u985e\u578b\u2026","blur_missing":"\u53ef\u4ee5\u770b\u898b\u4eba\u81c9\u6216\u8eca\u724c","blur_excess":"\u4e0d\u9700\u8981\u6a21\u7cca\u7684\u7269\u4ef6\u88ab\u6a21\u7cca\u8655\u7406\u4e86","inappropriate":"\u4e0d\u7576\u7684\u76f8\u7247 (\u4e0d\u76f8\u95dc\u3001\u88f8\u9ad4\u2026)","privacy":"\u53ef\u4ee5\u770b\u898b\u79c1\u4eba\u7684\u9053\u8def\u6216\u8cc7\u7522","picture_low_quality":"\u76f8\u7247\u7684\u54c1\u8cea\u5f88\u5dee","mislocated":"\u76f8\u7247\u5728\u5730\u5716\u4e0a\u7684\u4f4d\u7f6e\u4e0d\u6b63\u78ba","copyright":"\u76f8\u7247\u4fb5\u72af\u4e86\u7248\u6b0a","other":"\u4efb\u4f55\u5176\u4ed6\u985e\u578b\u7684\u554f\u984c"},"share_embed_docs":"\u6df1\u5165\u4e86\u89e3\u5d4c\u5165\u8a2d\u5b9a\u503c","error_retry":"\u8acb\u7a0d\u5f8c\u518d\u8a66","error_click":"\u9ede\u64ca\u4ee5\u7e7c\u7e8c","legend_title":"\u986f\u793a\u76f8\u7247\u7684\u8a73\u7d30\u8cc7\u6599","report_email_placeholder":"\u9078\u586b","report_whole_sequence":"\u9019\u500b\u554f\u984c\u5f71\u97ff\u6574\u500b\u5e8f\u5217","report_details":"\u66f4\u591a\u8cc7\u8a0a","report_details_placeholder":"\u9078\u586b\uff0c\u60a8\u53ef\u4ee5\u8a73\u8ff0\u6b64\u554f\u984c\u548c\u5b83\u9020\u6210\u7684\u5f71\u97ff","report_wait":"\u6b63\u5728\u50b3\u9001\u5831\u544a\u2026","report_success":"\u5df2\u6210\u529f\u767c\u9001\u5831\u544a\uff0c\u6211\u5011\u5c07\u5118\u5feb\u5c0d\u5b83\u9032\u884c\u5be9\u6838\u3002","report_failure":"\u5efa\u7acb\u5831\u544a\u6642\u767c\u9001\u932f\u8aa4: {e}\uff0c\u8acb\u7a0d\u5f8c\u518d\u8a66\u3002","report_auth":"\u6b64\u5831\u544a\u5c07\u4f7f\u7528\u60a8\u7684\u5e33\u6236\u300c{a}\u300d\u767c\u9001","filter_qualityscore":"\u54c1\u8cea\u5206\u6578","filter_qualityscore_help":"\u9ede\u64ca\u4ee5\u555f\u7528\u6216\u505c\u7528","map_theme_score":"\u54c1\u8cea\u5206\u6578","metadata_camera_resolution":"\u89e3\u6790\u5ea6","metadata_quality":"\u54c1\u8cea\u5206\u6578","metadata_quality_help":"\u6df1\u5165\u4e86\u89e3\u54c1\u8cea\u5206\u6578","metadata_quality_gps_score":"\u5b9a\u4f4d\u5206\u6578","metadata_quality_resolution_score":"\u89e3\u6790\u5ea6\u5206\u6578","metadata_quality_missing":"\u76f8\u7247\u672a\u5305\u542b\u8cc7\u8a0a","report":"\u6aa2\u8209\u76f8\u7247","metadata_quality_score":"\u6574\u9ad4\u5206\u6578","filter_user_mypics":"\u6211\u7684\u76f8\u7247","filter_date_1month":"1 \u500b\u6708","filter_date_1year":"1 \u5e74","qualityscore_doc_2":"\u5206\u6578\u4ee5 A/B/C/D/E \u7b49\u7d1a\u7684\u5f62\u5f0f\u986f\u793a (A \u6700\u4f73\u3001E \u6700\u5dee) \uff0c\u4e26\u900f\u904e\u9019\u500b\u91cf\u5c3a\u8996\u89ba\u5316\u986f\u793a:","qualityscore_doc_link":"\u95dc\u65bc\u54c1\u8cea\u5206\u6578\u7684\u8a08\u7b97\u65b9\u5f0f\uff0c\u8acb\u53c3\u95b1\u6211\u5011\u7684\u6587\u4ef6\u3002","qualityscore_title":"\u95dc\u65bc\u54c1\u8cea\u5206\u6578","qualityscore_doc_1":"Panoramax \u70ba\u6bcf\u5f35\u76f8\u7247\u63d0\u4f9b\u54c1\u8cea\u5206\u6578\uff0c\u9019\u80fd\u5e6b\u52a9\u6211\u5011\u8f15\u9b06\u5730\u5728\u5730\u5716\u4e0a\u7be9\u9078\u548c\u986f\u793a\u9ad8\u54c1\u8cea\u76f8\u7247\u3002","qualityscore_doc_3":"\u5b83\u6839\u64da GPS \u7cbe\u78ba\u5ea6\u548c\u76f8\u7247\u89e3\u6790\u5ea6\u8a08\u7b97\u5f97\u51fa\uff0c\u5c08\u696d\u8a2d\u5099\u7684\u7b49\u7d1a\u70ba A\u3001360\xb0 \u904b\u52d5\u76f8\u6a5f\u7684\u7b49\u7d1a\u70ba B\u3001\u667a\u6167\u578b\u624b\u6a5f\u7684\u7b49\u7d1a\u70ba C/D/E\u3002"},"map":{"loading":"\u6b63\u5728\u8f09\u5165\u2026","not_public":"\u672a\u516c\u958b\u986f\u793a","thumbnail":"\u904a\u6a19\u61f8\u505c\u76f8\u7247\u7684\u7e2e\u5716","slow_loading":"\u5730\u5716\u8f09\u5165\u901f\u5ea6\u7de9\u6162\u800c\u4e14\u53ef\u80fd\u51fa\u73fe\u640d\u58de"},"psv":{"ctrlZoom":"\u4f7f\u7528 CTRL + \u6ed1\u9f20\u6efe\u8f2a\u7e2e\u653e\u5716\u7247","loadError":"\u7121\u6cd5\u8f09\u5165\u5168\u666f\u5716","twoFingers":"\u4f7f\u7528\u96d9\u6307\u79fb\u52d5"},"maplibre":{"GeolocateControl.FindMyLocation":"\u5c0b\u627e\u6211\u7684\u4f4d\u7f6e","GeolocateControl.LocationNotAvailable":"\u7121\u6cd5\u4f7f\u7528\u4f4d\u7f6e\u8cc7\u8a0a"}}')}},Da={};function __webpack_require__(ll){var cl=Da[ll];if(void 0!==cl)return cl.exports;var hl=Da[ll]={exports:{}};return F[ll].call(hl.exports,hl,hl.exports,__webpack_require__),hl.exports}__webpack_require__.n=F=>{var Da=F&&F.__esModule?()=>F.default:()=>F;return __webpack_require__.d(Da,{a:Da}),Da},__webpack_require__.d=(F,Da)=>{for(var ll in Da)__webpack_require__.o(Da,ll)&&!__webpack_require__.o(F,ll)&&Object.defineProperty(F,ll,{enumerable:!0,get:Da[ll]})},__webpack_require__.o=(F,Da)=>Object.prototype.hasOwnProperty.call(F,Da),__webpack_require__.r=F=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var ll={};return(()=>{"use strict";__webpack_require__.r(ll),__webpack_require__.d(ll,{Editor:()=>cl.A,StandaloneMap:()=>Da.A,Viewer:()=>F.Ay,default:()=>F.Ay});var F=__webpack_require__(2968),Da=__webpack_require__(7531),cl=__webpack_require__(9555)})(),ll})()));
|
|
34
|
+
const cl="168",hl=0,dl=1,pl=2,fl=100,Al=101,bl=102,kl=200,Dl=201,Wl=202,Ql=203,wc=204,Sc=205,eu=206,iu=207,su=208,cu=209,uu=210,hu=211,Lu=212,zu=213,Du=214,Nu=301,qu=302,ih=303,gh=304,ed=306,td=1e3,id=1001,nd=1002,rd=1003,ad=1004,sd=1005,od=1006,ld=1007,cd=1008,ud=1009,hd=1010,dd=1011,pd=1012,md=1013,fd=1014,gd=1015,Ad=1016,yd=1017,vd=1018,_d=1020,xd=35902,bd=1023,wd=1026,Ed=1027,Md=1028,Sd=1029,kd=1031,Td=1033,Id=33776,Cd=33777,Ld=33778,zd=33779,Pd=35840,Dd=35841,Rd=35842,Nd=35843,Ud=36196,Bd=37492,Od=37496,Fd=37808,jd=37809,Vd=37810,Gd=37811,Hd=37812,qd=37813,Zd=37814,Wd=37815,Kd=37816,Qd=37817,Xd=37818,Yd=37819,Jd=37820,$d=37821,lp=36492,mp=36494,gp=36495,Ap=36284,vp=36285,_p=36286,xp=2300,bp=2301,wp=2302,Ep=2400,Mp=2401,Sp=2402,kp="",Tp="srgb",Ip="srgb-linear",Cp="display-p3",Lp="display-p3-linear",zp="linear",Pp="srgb",Dp="rec709",Rp="p3",Np=7680,Up=512,Bp=513,Op=514,Fp=515,jp=516,Vp=517,Gp=518,Hp=519,qp=35044,Zp="300 es",Wp=2e3,Kp=2001;class EventDispatcher{addEventListener(F,Da){void 0===this._listeners&&(this._listeners={});const ll=this._listeners;void 0===ll[F]&&(ll[F]=[]),-1===ll[F].indexOf(Da)&&ll[F].push(Da)}hasEventListener(F,Da){if(void 0===this._listeners)return!1;const ll=this._listeners;return void 0!==ll[F]&&-1!==ll[F].indexOf(Da)}removeEventListener(F,Da){if(void 0===this._listeners)return;const ll=this._listeners[F];if(void 0!==ll){const F=ll.indexOf(Da);-1!==F&&ll.splice(F,1)}}dispatchEvent(F){if(void 0===this._listeners)return;const Da=this._listeners[F.type];if(void 0!==Da){F.target=this;const ll=Da.slice(0);for(let Da=0,cl=ll.length;Da<cl;Da++)ll[Da].call(this,F);F.target=null}}}const Qp=["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 Xp=1234567;const Yp=Math.PI/180,Jp=180/Math.PI;function generateUUID(){const F=4294967295*Math.random()|0,Da=4294967295*Math.random()|0,ll=4294967295*Math.random()|0,cl=4294967295*Math.random()|0;return(Qp[255&F]+Qp[F>>8&255]+Qp[F>>16&255]+Qp[F>>24&255]+"-"+Qp[255&Da]+Qp[Da>>8&255]+"-"+Qp[Da>>16&15|64]+Qp[Da>>24&255]+"-"+Qp[63&ll|128]+Qp[ll>>8&255]+"-"+Qp[ll>>16&255]+Qp[ll>>24&255]+Qp[255&cl]+Qp[cl>>8&255]+Qp[cl>>16&255]+Qp[cl>>24&255]).toLowerCase()}function clamp(F,Da,ll){return Math.max(Da,Math.min(ll,F))}function euclideanModulo(F,Da){return(F%Da+Da)%Da}function lerp(F,Da,ll){return(1-ll)*F+ll*Da}function denormalize(F,Da){switch(Da.constructor){case Float32Array:return F;case Uint32Array:return F/4294967295;case Uint16Array:return F/65535;case Uint8Array:return F/255;case Int32Array:return Math.max(F/2147483647,-1);case Int16Array:return Math.max(F/32767,-1);case Int8Array:return Math.max(F/127,-1);default:throw new Error("Invalid component type.")}}function normalize(F,Da){switch(Da.constructor){case Float32Array:return F;case Uint32Array:return Math.round(4294967295*F);case Uint16Array:return Math.round(65535*F);case Uint8Array:return Math.round(255*F);case Int32Array:return Math.round(2147483647*F);case Int16Array:return Math.round(32767*F);case Int8Array:return Math.round(127*F);default:throw new Error("Invalid component type.")}}const $p={DEG2RAD:Yp,RAD2DEG:Jp,generateUUID:generateUUID,clamp:clamp,euclideanModulo:euclideanModulo,mapLinear:function(F,Da,ll,cl,hl){return cl+(F-Da)*(hl-cl)/(ll-Da)},inverseLerp:function(F,Da,ll){return F!==Da?(ll-F)/(Da-F):0},lerp:lerp,damp:function(F,Da,ll,cl){return lerp(F,Da,1-Math.exp(-ll*cl))},pingpong:function(F,Da){return void 0===Da&&(Da=1),Da-Math.abs(euclideanModulo(F,2*Da)-Da)},smoothstep:function(F,Da,ll){return F<=Da?0:F>=ll?1:(F=(F-Da)/(ll-Da))*F*(3-2*F)},smootherstep:function(F,Da,ll){return F<=Da?0:F>=ll?1:(F=(F-Da)/(ll-Da))*F*F*(F*(6*F-15)+10)},randInt:function(F,Da){return F+Math.floor(Math.random()*(Da-F+1))},randFloat:function(F,Da){return F+Math.random()*(Da-F)},randFloatSpread:function(F){return F*(.5-Math.random())},seededRandom:function(F){void 0!==F&&(Xp=F);let Da=Xp+=1831565813;return Da=Math.imul(Da^Da>>>15,1|Da),Da^=Da+Math.imul(Da^Da>>>7,61|Da),((Da^Da>>>14)>>>0)/4294967296},degToRad:function(F){return F*Yp},radToDeg:function(F){return F*Jp},isPowerOfTwo:function(F){return 0===(F&F-1)&&0!==F},ceilPowerOfTwo:function(F){return Math.pow(2,Math.ceil(Math.log(F)/Math.LN2))},floorPowerOfTwo:function(F){return Math.pow(2,Math.floor(Math.log(F)/Math.LN2))},setQuaternionFromProperEuler:function(F,Da,ll,cl,hl){const dl=Math.cos,pl=Math.sin,fl=dl(ll/2),Al=pl(ll/2),bl=dl((Da+cl)/2),kl=pl((Da+cl)/2),Dl=dl((Da-cl)/2),Wl=pl((Da-cl)/2),Ql=dl((cl-Da)/2),wc=pl((cl-Da)/2);switch(hl){case"XYX":F.set(fl*kl,Al*Dl,Al*Wl,fl*bl);break;case"YZY":F.set(Al*Wl,fl*kl,Al*Dl,fl*bl);break;case"ZXZ":F.set(Al*Dl,Al*Wl,fl*kl,fl*bl);break;case"XZX":F.set(fl*kl,Al*wc,Al*Ql,fl*bl);break;case"YXY":F.set(Al*Ql,fl*kl,Al*wc,fl*bl);break;case"ZYZ":F.set(Al*wc,Al*Ql,fl*kl,fl*bl);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+hl)}},normalize:normalize,denormalize:denormalize};class Vector2{constructor(F,Da){void 0===F&&(F=0),void 0===Da&&(Da=0),Vector2.prototype.isVector2=!0,this.x=F,this.y=Da}get width(){return this.x}set width(F){this.x=F}get height(){return this.y}set height(F){this.y=F}set(F,Da){return this.x=F,this.y=Da,this}setScalar(F){return this.x=F,this.y=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+F)}}clone(){return new this.constructor(this.x,this.y)}copy(F){return this.x=F.x,this.y=F.y,this}add(F){return this.x+=F.x,this.y+=F.y,this}addScalar(F){return this.x+=F,this.y+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this}subScalar(F){return this.x-=F,this.y-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this}multiply(F){return this.x*=F.x,this.y*=F.y,this}multiplyScalar(F){return this.x*=F,this.y*=F,this}divide(F){return this.x/=F.x,this.y/=F.y,this}divideScalar(F){return this.multiplyScalar(1/F)}applyMatrix3(F){const Da=this.x,ll=this.y,cl=F.elements;return this.x=cl[0]*Da+cl[3]*ll+cl[6],this.y=cl[1]*Da+cl[4]*ll+cl[7],this}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y}cross(F){return this.x*F.y-this.y*F.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(F){const Da=Math.sqrt(this.lengthSq()*F.lengthSq());if(0===Da)return Math.PI/2;const ll=this.dot(F)/Da;return Math.acos(clamp(ll,-1,1))}distanceTo(F){return Math.sqrt(this.distanceToSquared(F))}distanceToSquared(F){const Da=this.x-F.x,ll=this.y-F.y;return Da*Da+ll*ll}manhattanDistanceTo(F){return Math.abs(this.x-F.x)+Math.abs(this.y-F.y)}setLength(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this}equals(F){return F.x===this.x&&F.y===this.y}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this}rotateAround(F,Da){const ll=Math.cos(Da),cl=Math.sin(Da),hl=this.x-F.x,dl=this.y-F.y;return this.x=hl*ll-dl*cl+F.x,this.y=hl*cl+dl*ll+F.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Matrix3{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al){Matrix3.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==F&&this.set(F,Da,ll,cl,hl,dl,pl,fl,Al)}set(F,Da,ll,cl,hl,dl,pl,fl,Al){const bl=this.elements;return bl[0]=F,bl[1]=cl,bl[2]=pl,bl[3]=Da,bl[4]=hl,bl[5]=fl,bl[6]=ll,bl[7]=dl,bl[8]=Al,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(F){const Da=this.elements,ll=F.elements;return Da[0]=ll[0],Da[1]=ll[1],Da[2]=ll[2],Da[3]=ll[3],Da[4]=ll[4],Da[5]=ll[5],Da[6]=ll[6],Da[7]=ll[7],Da[8]=ll[8],this}extractBasis(F,Da,ll){return F.setFromMatrix3Column(this,0),Da.setFromMatrix3Column(this,1),ll.setFromMatrix3Column(this,2),this}setFromMatrix4(F){const Da=F.elements;return this.set(Da[0],Da[4],Da[8],Da[1],Da[5],Da[9],Da[2],Da[6],Da[10]),this}multiply(F){return this.multiplyMatrices(this,F)}premultiply(F){return this.multiplyMatrices(F,this)}multiplyMatrices(F,Da){const ll=F.elements,cl=Da.elements,hl=this.elements,dl=ll[0],pl=ll[3],fl=ll[6],Al=ll[1],bl=ll[4],kl=ll[7],Dl=ll[2],Wl=ll[5],Ql=ll[8],wc=cl[0],Sc=cl[3],eu=cl[6],iu=cl[1],su=cl[4],cu=cl[7],uu=cl[2],hu=cl[5],Lu=cl[8];return hl[0]=dl*wc+pl*iu+fl*uu,hl[3]=dl*Sc+pl*su+fl*hu,hl[6]=dl*eu+pl*cu+fl*Lu,hl[1]=Al*wc+bl*iu+kl*uu,hl[4]=Al*Sc+bl*su+kl*hu,hl[7]=Al*eu+bl*cu+kl*Lu,hl[2]=Dl*wc+Wl*iu+Ql*uu,hl[5]=Dl*Sc+Wl*su+Ql*hu,hl[8]=Dl*eu+Wl*cu+Ql*Lu,this}multiplyScalar(F){const Da=this.elements;return Da[0]*=F,Da[3]*=F,Da[6]*=F,Da[1]*=F,Da[4]*=F,Da[7]*=F,Da[2]*=F,Da[5]*=F,Da[8]*=F,this}determinant(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8];return Da*dl*bl-Da*pl*Al-ll*hl*bl+ll*pl*fl+cl*hl*Al-cl*dl*fl}invert(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8],kl=bl*dl-pl*Al,Dl=pl*fl-bl*hl,Wl=Al*hl-dl*fl,Ql=Da*kl+ll*Dl+cl*Wl;if(0===Ql)return this.set(0,0,0,0,0,0,0,0,0);const wc=1/Ql;return F[0]=kl*wc,F[1]=(cl*Al-bl*ll)*wc,F[2]=(pl*ll-cl*dl)*wc,F[3]=Dl*wc,F[4]=(bl*Da-cl*fl)*wc,F[5]=(cl*hl-pl*Da)*wc,F[6]=Wl*wc,F[7]=(ll*fl-Al*Da)*wc,F[8]=(dl*Da-ll*hl)*wc,this}transpose(){let F;const Da=this.elements;return F=Da[1],Da[1]=Da[3],Da[3]=F,F=Da[2],Da[2]=Da[6],Da[6]=F,F=Da[5],Da[5]=Da[7],Da[7]=F,this}getNormalMatrix(F){return this.setFromMatrix4(F).invert().transpose()}transposeIntoArray(F){const Da=this.elements;return F[0]=Da[0],F[1]=Da[3],F[2]=Da[6],F[3]=Da[1],F[4]=Da[4],F[5]=Da[7],F[6]=Da[2],F[7]=Da[5],F[8]=Da[8],this}setUvTransform(F,Da,ll,cl,hl,dl,pl){const fl=Math.cos(hl),Al=Math.sin(hl);return this.set(ll*fl,ll*Al,-ll*(fl*dl+Al*pl)+dl+F,-cl*Al,cl*fl,-cl*(-Al*dl+fl*pl)+pl+Da,0,0,1),this}scale(F,Da){return this.premultiply(em.makeScale(F,Da)),this}rotate(F){return this.premultiply(em.makeRotation(-F)),this}translate(F,Da){return this.premultiply(em.makeTranslation(F,Da)),this}makeTranslation(F,Da){return F.isVector2?this.set(1,0,F.x,0,1,F.y,0,0,1):this.set(1,0,F,0,1,Da,0,0,1),this}makeRotation(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,-ll,0,ll,Da,0,0,0,1),this}makeScale(F,Da){return this.set(F,0,0,0,Da,0,0,0,1),this}equals(F){const Da=this.elements,ll=F.elements;for(let cl=0;cl<9;cl++)if(Da[cl]!==ll[cl])return!1;return!0}fromArray(F,Da){void 0===Da&&(Da=0);for(let ll=0;ll<9;ll++)this.elements[ll]=F[ll+Da];return this}toArray(F,Da){void 0===F&&(F=[]),void 0===Da&&(Da=0);const ll=this.elements;return F[Da]=ll[0],F[Da+1]=ll[1],F[Da+2]=ll[2],F[Da+3]=ll[3],F[Da+4]=ll[4],F[Da+5]=ll[5],F[Da+6]=ll[6],F[Da+7]=ll[7],F[Da+8]=ll[8],F}clone(){return(new this.constructor).fromArray(this.elements)}}const em=new Matrix3;function arrayNeedsUint32(F){for(let Da=F.length-1;Da>=0;--Da)if(F[Da]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function createElementNS(F){return document.createElementNS("http://www.w3.org/1999/xhtml",F)}function createCanvasElement(){const F=createElementNS("canvas");return F.style.display="block",F}const tm={};function warnOnce(F){F in tm||(tm[F]=!0,console.warn(F))}const im=(new Matrix3).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),nm=(new Matrix3).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),rm={[Ip]:{transfer:zp,primaries:Dp,luminanceCoefficients:[.2126,.7152,.0722],toReference:F=>F,fromReference:F=>F},[Tp]:{transfer:Pp,primaries:Dp,luminanceCoefficients:[.2126,.7152,.0722],toReference:F=>F.convertSRGBToLinear(),fromReference:F=>F.convertLinearToSRGB()},[Lp]:{transfer:zp,primaries:Rp,luminanceCoefficients:[.2289,.6917,.0793],toReference:F=>F.applyMatrix3(nm),fromReference:F=>F.applyMatrix3(im)},[Cp]:{transfer:Pp,primaries:Rp,luminanceCoefficients:[.2289,.6917,.0793],toReference:F=>F.convertSRGBToLinear().applyMatrix3(nm),fromReference:F=>F.applyMatrix3(im).convertLinearToSRGB()}},am=new Set([Ip,Lp]),sm={enabled:!0,_workingColorSpace:Ip,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(F){if(!am.has(F))throw new Error(`Unsupported working color space, "${F}".`);this._workingColorSpace=F},convert:function(F,Da,ll){if(!1===this.enabled||Da===ll||!Da||!ll)return F;const cl=rm[Da].toReference;return(0,rm[ll].fromReference)(cl(F))},fromWorkingColorSpace:function(F,Da){return this.convert(F,this._workingColorSpace,Da)},toWorkingColorSpace:function(F,Da){return this.convert(F,Da,this._workingColorSpace)},getPrimaries:function(F){return rm[F].primaries},getTransfer:function(F){return F===kp?zp:rm[F].transfer},getLuminanceCoefficients:function(F,Da){return void 0===Da&&(Da=this._workingColorSpace),F.fromArray(rm[Da].luminanceCoefficients)}};function SRGBToLinear(F){return F<.04045?.0773993808*F:Math.pow(.9478672986*F+.0521327014,2.4)}function LinearToSRGB(F){return F<.0031308?12.92*F:1.055*Math.pow(F,.41666)-.055}let om;class ImageUtils{static getDataURL(F){if(/^data:/i.test(F.src))return F.src;if("undefined"===typeof HTMLCanvasElement)return F.src;let Da;if(F instanceof HTMLCanvasElement)Da=F;else{void 0===om&&(om=createElementNS("canvas")),om.width=F.width,om.height=F.height;const ll=om.getContext("2d");F instanceof ImageData?ll.putImageData(F,0,0):ll.drawImage(F,0,0,F.width,F.height),Da=om}return Da.width>2048||Da.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",F),Da.toDataURL("image/jpeg",.6)):Da.toDataURL("image/png")}static sRGBToLinear(F){if("undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap){const Da=createElementNS("canvas");Da.width=F.width,Da.height=F.height;const ll=Da.getContext("2d");ll.drawImage(F,0,0,F.width,F.height);const cl=ll.getImageData(0,0,F.width,F.height),hl=cl.data;for(let F=0;F<hl.length;F++)hl[F]=255*SRGBToLinear(hl[F]/255);return ll.putImageData(cl,0,0),Da}if(F.data){const Da=F.data.slice(0);for(let F=0;F<Da.length;F++)Da instanceof Uint8Array||Da instanceof Uint8ClampedArray?Da[F]=Math.floor(255*SRGBToLinear(Da[F]/255)):Da[F]=SRGBToLinear(Da[F]);return{data:Da,width:F.width,height:F.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),F}}let lm=0;class Source{constructor(F){void 0===F&&(F=null),this.isSource=!0,Object.defineProperty(this,"id",{value:lm++}),this.uuid=generateUUID(),this.data=F,this.dataReady=!0,this.version=0}set needsUpdate(F){!0===F&&this.version++}toJSON(F){const Da=void 0===F||"string"===typeof F;if(!Da&&void 0!==F.images[this.uuid])return F.images[this.uuid];const ll={uuid:this.uuid,url:""},cl=this.data;if(null!==cl){let F;if(Array.isArray(cl)){F=[];for(let Da=0,ll=cl.length;Da<ll;Da++)cl[Da].isDataTexture?F.push(serializeImage(cl[Da].image)):F.push(serializeImage(cl[Da]))}else F=serializeImage(cl);ll.url=F}return Da||(F.images[this.uuid]=ll),ll}}function serializeImage(F){return"undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap?ImageUtils.getDataURL(F):F.data?{data:Array.from(F.data),width:F.width,height:F.height,type:F.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let cm=0;class Texture extends EventDispatcher{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){void 0===F&&(F=Texture.DEFAULT_IMAGE),void 0===Da&&(Da=Texture.DEFAULT_MAPPING),void 0===ll&&(ll=id),void 0===cl&&(cl=id),void 0===hl&&(hl=od),void 0===dl&&(dl=cd),void 0===pl&&(pl=bd),void 0===fl&&(fl=ud),void 0===Al&&(Al=Texture.DEFAULT_ANISOTROPY),void 0===bl&&(bl=kp),super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:cm++}),this.uuid=generateUUID(),this.name="",this.source=new Source(F),this.mipmaps=[],this.mapping=Da,this.channel=0,this.wrapS=ll,this.wrapT=cl,this.magFilter=hl,this.minFilter=dl,this.anisotropy=Al,this.format=pl,this.internalFormat=null,this.type=fl,this.offset=new Vector2(0,0),this.repeat=new Vector2(1,1),this.center=new Vector2(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Matrix3,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=bl,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(F){void 0===F&&(F=null),this.source.data=F}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(F){return this.name=F.name,this.source=F.source,this.mipmaps=F.mipmaps.slice(0),this.mapping=F.mapping,this.channel=F.channel,this.wrapS=F.wrapS,this.wrapT=F.wrapT,this.magFilter=F.magFilter,this.minFilter=F.minFilter,this.anisotropy=F.anisotropy,this.format=F.format,this.internalFormat=F.internalFormat,this.type=F.type,this.offset.copy(F.offset),this.repeat.copy(F.repeat),this.center.copy(F.center),this.rotation=F.rotation,this.matrixAutoUpdate=F.matrixAutoUpdate,this.matrix.copy(F.matrix),this.generateMipmaps=F.generateMipmaps,this.premultiplyAlpha=F.premultiplyAlpha,this.flipY=F.flipY,this.unpackAlignment=F.unpackAlignment,this.colorSpace=F.colorSpace,this.userData=JSON.parse(JSON.stringify(F.userData)),this.needsUpdate=!0,this}toJSON(F){const Da=void 0===F||"string"===typeof F;if(!Da&&void 0!==F.textures[this.uuid])return F.textures[this.uuid];const ll={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(F).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&&(ll.userData=this.userData),Da||(F.textures[this.uuid]=ll),ll}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(F){if(300!==this.mapping)return F;if(F.applyMatrix3(this.matrix),F.x<0||F.x>1)switch(this.wrapS){case td:F.x=F.x-Math.floor(F.x);break;case id:F.x=F.x<0?0:1;break;case nd:1===Math.abs(Math.floor(F.x)%2)?F.x=Math.ceil(F.x)-F.x:F.x=F.x-Math.floor(F.x)}if(F.y<0||F.y>1)switch(this.wrapT){case td:F.y=F.y-Math.floor(F.y);break;case id:F.y=F.y<0?0:1;break;case nd:1===Math.abs(Math.floor(F.y)%2)?F.y=Math.ceil(F.y)-F.y:F.y=F.y-Math.floor(F.y)}return this.flipY&&(F.y=1-F.y),F}set needsUpdate(F){!0===F&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(F){!0===F&&this.pmremVersion++}}Texture.DEFAULT_IMAGE=null,Texture.DEFAULT_MAPPING=300,Texture.DEFAULT_ANISOTROPY=1;class Vector4{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=1),Vector4.prototype.isVector4=!0,this.x=F,this.y=Da,this.z=ll,this.w=cl}get width(){return this.z}set width(F){this.z=F}get height(){return this.w}set height(F){this.w=F}set(F,Da,ll,cl){return this.x=F,this.y=Da,this.z=ll,this.w=cl,this}setScalar(F){return this.x=F,this.y=F,this.z=F,this.w=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setZ(F){return this.z=F,this}setW(F){return this.w=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;case 2:this.z=Da;break;case 3:this.w=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){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: "+F)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(F){return this.x=F.x,this.y=F.y,this.z=F.z,this.w=void 0!==F.w?F.w:1,this}add(F){return this.x+=F.x,this.y+=F.y,this.z+=F.z,this.w+=F.w,this}addScalar(F){return this.x+=F,this.y+=F,this.z+=F,this.w+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this.z=F.z+Da.z,this.w=F.w+Da.w,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this.z+=F.z*Da,this.w+=F.w*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this.z-=F.z,this.w-=F.w,this}subScalar(F){return this.x-=F,this.y-=F,this.z-=F,this.w-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this.z=F.z-Da.z,this.w=F.w-Da.w,this}multiply(F){return this.x*=F.x,this.y*=F.y,this.z*=F.z,this.w*=F.w,this}multiplyScalar(F){return this.x*=F,this.y*=F,this.z*=F,this.w*=F,this}applyMatrix4(F){const Da=this.x,ll=this.y,cl=this.z,hl=this.w,dl=F.elements;return this.x=dl[0]*Da+dl[4]*ll+dl[8]*cl+dl[12]*hl,this.y=dl[1]*Da+dl[5]*ll+dl[9]*cl+dl[13]*hl,this.z=dl[2]*Da+dl[6]*ll+dl[10]*cl+dl[14]*hl,this.w=dl[3]*Da+dl[7]*ll+dl[11]*cl+dl[15]*hl,this}divideScalar(F){return this.multiplyScalar(1/F)}setAxisAngleFromQuaternion(F){this.w=2*Math.acos(F.w);const Da=Math.sqrt(1-F.w*F.w);return Da<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=F.x/Da,this.y=F.y/Da,this.z=F.z/Da),this}setAxisAngleFromRotationMatrix(F){let Da,ll,cl,hl;const dl=.01,pl=.1,fl=F.elements,Al=fl[0],bl=fl[4],kl=fl[8],Dl=fl[1],Wl=fl[5],Ql=fl[9],wc=fl[2],Sc=fl[6],eu=fl[10];if(Math.abs(bl-Dl)<dl&&Math.abs(kl-wc)<dl&&Math.abs(Ql-Sc)<dl){if(Math.abs(bl+Dl)<pl&&Math.abs(kl+wc)<pl&&Math.abs(Ql+Sc)<pl&&Math.abs(Al+Wl+eu-3)<pl)return this.set(1,0,0,0),this;Da=Math.PI;const F=(Al+1)/2,fl=(Wl+1)/2,iu=(eu+1)/2,su=(bl+Dl)/4,cu=(kl+wc)/4,uu=(Ql+Sc)/4;return F>fl&&F>iu?F<dl?(ll=0,cl=.707106781,hl=.707106781):(ll=Math.sqrt(F),cl=su/ll,hl=cu/ll):fl>iu?fl<dl?(ll=.707106781,cl=0,hl=.707106781):(cl=Math.sqrt(fl),ll=su/cl,hl=uu/cl):iu<dl?(ll=.707106781,cl=.707106781,hl=0):(hl=Math.sqrt(iu),ll=cu/hl,cl=uu/hl),this.set(ll,cl,hl,Da),this}let iu=Math.sqrt((Sc-Ql)*(Sc-Ql)+(kl-wc)*(kl-wc)+(Dl-bl)*(Dl-bl));return Math.abs(iu)<.001&&(iu=1),this.x=(Sc-Ql)/iu,this.y=(kl-wc)/iu,this.z=(Dl-bl)/iu,this.w=Math.acos((Al+Wl+eu-1)/2),this}setFromMatrixPosition(F){const Da=F.elements;return this.x=Da[12],this.y=Da[13],this.z=Da[14],this.w=Da[15],this}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this.z=Math.min(this.z,F.z),this.w=Math.min(this.w,F.w),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this.z=Math.max(this.z,F.z),this.w=Math.max(this.w,F.w),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this.z=Math.max(F.z,Math.min(Da.z,this.z)),this.w=Math.max(F.w,Math.min(Da.w,this.w)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this.z=Math.max(F,Math.min(Da,this.z)),this.w=Math.max(F,Math.min(Da,this.w)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y+this.z*F.z+this.w*F.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(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this.z+=(F.z-this.z)*Da,this.w+=(F.w-this.w)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this.z=F.z+(Da.z-F.z)*ll,this.w=F.w+(Da.w-F.w)*ll,this}equals(F){return F.x===this.x&&F.y===this.y&&F.z===this.z&&F.w===this.w}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this.z=F[Da+2],this.w=F[Da+3],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F[Da+2]=this.z,F[Da+3]=this.w,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this.z=F.getZ(Da),this.w=F.getW(Da),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 RenderTarget extends EventDispatcher{constructor(F,Da,ll){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll={}),super(),this.isRenderTarget=!0,this.width=F,this.height=Da,this.depth=1,this.scissor=new Vector4(0,0,F,Da),this.scissorTest=!1,this.viewport=new Vector4(0,0,F,Da);const cl={width:F,height:Da,depth:1};ll=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:od,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},ll);const hl=new Texture(cl,ll.mapping,ll.wrapS,ll.wrapT,ll.magFilter,ll.minFilter,ll.format,ll.type,ll.anisotropy,ll.colorSpace);hl.flipY=!1,hl.generateMipmaps=ll.generateMipmaps,hl.internalFormat=ll.internalFormat,this.textures=[];const dl=ll.count;for(let pl=0;pl<dl;pl++)this.textures[pl]=hl.clone(),this.textures[pl].isRenderTargetTexture=!0;this.depthBuffer=ll.depthBuffer,this.stencilBuffer=ll.stencilBuffer,this.resolveDepthBuffer=ll.resolveDepthBuffer,this.resolveStencilBuffer=ll.resolveStencilBuffer,this.depthTexture=ll.depthTexture,this.samples=ll.samples}get texture(){return this.textures[0]}set texture(F){this.textures[0]=F}setSize(F,Da,ll){if(void 0===ll&&(ll=1),this.width!==F||this.height!==Da||this.depth!==ll){this.width=F,this.height=Da,this.depth=ll;for(let cl=0,hl=this.textures.length;cl<hl;cl++)this.textures[cl].image.width=F,this.textures[cl].image.height=Da,this.textures[cl].image.depth=ll;this.dispose()}this.viewport.set(0,0,F,Da),this.scissor.set(0,0,F,Da)}clone(){return(new this.constructor).copy(this)}copy(F){this.width=F.width,this.height=F.height,this.depth=F.depth,this.scissor.copy(F.scissor),this.scissorTest=F.scissorTest,this.viewport.copy(F.viewport),this.textures.length=0;for(let ll=0,cl=F.textures.length;ll<cl;ll++)this.textures[ll]=F.textures[ll].clone(),this.textures[ll].isRenderTargetTexture=!0;const Da=Object.assign({},F.texture.image);return this.texture.source=new Source(Da),this.depthBuffer=F.depthBuffer,this.stencilBuffer=F.stencilBuffer,this.resolveDepthBuffer=F.resolveDepthBuffer,this.resolveStencilBuffer=F.resolveStencilBuffer,null!==F.depthTexture&&(this.depthTexture=F.depthTexture.clone()),this.samples=F.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class WebGLRenderTarget extends RenderTarget{constructor(F,Da,ll){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll={}),super(F,Da,ll),this.isWebGLRenderTarget=!0}}class DataArrayTexture extends Texture{constructor(F,Da,ll,cl){void 0===F&&(F=null),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(null),this.isDataArrayTexture=!0,this.image={data:F,width:Da,height:ll,depth:cl},this.magFilter=rd,this.minFilter=rd,this.wrapR=id,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(F){this.layerUpdates.add(F)}clearLayerUpdates(){this.layerUpdates.clear()}}class Data3DTexture extends Texture{constructor(F,Da,ll,cl){void 0===F&&(F=null),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(null),this.isData3DTexture=!0,this.image={data:F,width:Da,height:ll,depth:cl},this.magFilter=rd,this.minFilter=rd,this.wrapR=id,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Quaternion{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=1),this.isQuaternion=!0,this._x=F,this._y=Da,this._z=ll,this._w=cl}static slerpFlat(F,Da,ll,cl,hl,dl,pl){let fl=ll[cl+0],Al=ll[cl+1],bl=ll[cl+2],kl=ll[cl+3];const Dl=hl[dl+0],Wl=hl[dl+1],Ql=hl[dl+2],wc=hl[dl+3];if(0===pl)return F[Da+0]=fl,F[Da+1]=Al,F[Da+2]=bl,void(F[Da+3]=kl);if(1===pl)return F[Da+0]=Dl,F[Da+1]=Wl,F[Da+2]=Ql,void(F[Da+3]=wc);if(kl!==wc||fl!==Dl||Al!==Wl||bl!==Ql){let F=1-pl;const Da=fl*Dl+Al*Wl+bl*Ql+kl*wc,ll=Da>=0?1:-1,cl=1-Da*Da;if(cl>Number.EPSILON){const hl=Math.sqrt(cl),dl=Math.atan2(hl,Da*ll);F=Math.sin(F*dl)/hl,pl=Math.sin(pl*dl)/hl}const hl=pl*ll;if(fl=fl*F+Dl*hl,Al=Al*F+Wl*hl,bl=bl*F+Ql*hl,kl=kl*F+wc*hl,F===1-pl){const F=1/Math.sqrt(fl*fl+Al*Al+bl*bl+kl*kl);fl*=F,Al*=F,bl*=F,kl*=F}}F[Da]=fl,F[Da+1]=Al,F[Da+2]=bl,F[Da+3]=kl}static multiplyQuaternionsFlat(F,Da,ll,cl,hl,dl){const pl=ll[cl],fl=ll[cl+1],Al=ll[cl+2],bl=ll[cl+3],kl=hl[dl],Dl=hl[dl+1],Wl=hl[dl+2],Ql=hl[dl+3];return F[Da]=pl*Ql+bl*kl+fl*Wl-Al*Dl,F[Da+1]=fl*Ql+bl*Dl+Al*kl-pl*Wl,F[Da+2]=Al*Ql+bl*Wl+pl*Dl-fl*kl,F[Da+3]=bl*Ql-pl*kl-fl*Dl-Al*Wl,F}get x(){return this._x}set x(F){this._x=F,this._onChangeCallback()}get y(){return this._y}set y(F){this._y=F,this._onChangeCallback()}get z(){return this._z}set z(F){this._z=F,this._onChangeCallback()}get w(){return this._w}set w(F){this._w=F,this._onChangeCallback()}set(F,Da,ll,cl){return this._x=F,this._y=Da,this._z=ll,this._w=cl,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(F){return this._x=F.x,this._y=F.y,this._z=F.z,this._w=F.w,this._onChangeCallback(),this}setFromEuler(F,Da){void 0===Da&&(Da=!0);const ll=F._x,cl=F._y,hl=F._z,dl=F._order,pl=Math.cos,fl=Math.sin,Al=pl(ll/2),bl=pl(cl/2),kl=pl(hl/2),Dl=fl(ll/2),Wl=fl(cl/2),Ql=fl(hl/2);switch(dl){case"XYZ":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"YXZ":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;case"ZXY":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"ZYX":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;case"YZX":this._x=Dl*bl*kl+Al*Wl*Ql,this._y=Al*Wl*kl+Dl*bl*Ql,this._z=Al*bl*Ql-Dl*Wl*kl,this._w=Al*bl*kl-Dl*Wl*Ql;break;case"XZY":this._x=Dl*bl*kl-Al*Wl*Ql,this._y=Al*Wl*kl-Dl*bl*Ql,this._z=Al*bl*Ql+Dl*Wl*kl,this._w=Al*bl*kl+Dl*Wl*Ql;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+dl)}return!0===Da&&this._onChangeCallback(),this}setFromAxisAngle(F,Da){const ll=Da/2,cl=Math.sin(ll);return this._x=F.x*cl,this._y=F.y*cl,this._z=F.z*cl,this._w=Math.cos(ll),this._onChangeCallback(),this}setFromRotationMatrix(F){const Da=F.elements,ll=Da[0],cl=Da[4],hl=Da[8],dl=Da[1],pl=Da[5],fl=Da[9],Al=Da[2],bl=Da[6],kl=Da[10],Dl=ll+pl+kl;if(Dl>0){const F=.5/Math.sqrt(Dl+1);this._w=.25/F,this._x=(bl-fl)*F,this._y=(hl-Al)*F,this._z=(dl-cl)*F}else if(ll>pl&&ll>kl){const F=2*Math.sqrt(1+ll-pl-kl);this._w=(bl-fl)/F,this._x=.25*F,this._y=(cl+dl)/F,this._z=(hl+Al)/F}else if(pl>kl){const F=2*Math.sqrt(1+pl-ll-kl);this._w=(hl-Al)/F,this._x=(cl+dl)/F,this._y=.25*F,this._z=(fl+bl)/F}else{const F=2*Math.sqrt(1+kl-ll-pl);this._w=(dl-cl)/F,this._x=(hl+Al)/F,this._y=(fl+bl)/F,this._z=.25*F}return this._onChangeCallback(),this}setFromUnitVectors(F,Da){let ll=F.dot(Da)+1;return ll<Number.EPSILON?(ll=0,Math.abs(F.x)>Math.abs(F.z)?(this._x=-F.y,this._y=F.x,this._z=0,this._w=ll):(this._x=0,this._y=-F.z,this._z=F.y,this._w=ll)):(this._x=F.y*Da.z-F.z*Da.y,this._y=F.z*Da.x-F.x*Da.z,this._z=F.x*Da.y-F.y*Da.x,this._w=ll),this.normalize()}angleTo(F){return 2*Math.acos(Math.abs(clamp(this.dot(F),-1,1)))}rotateTowards(F,Da){const ll=this.angleTo(F);if(0===ll)return this;const cl=Math.min(1,Da/ll);return this.slerp(F,cl),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(F){return this._x*F._x+this._y*F._y+this._z*F._z+this._w*F._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 F=this.length();return 0===F?(this._x=0,this._y=0,this._z=0,this._w=1):(F=1/F,this._x=this._x*F,this._y=this._y*F,this._z=this._z*F,this._w=this._w*F),this._onChangeCallback(),this}multiply(F){return this.multiplyQuaternions(this,F)}premultiply(F){return this.multiplyQuaternions(F,this)}multiplyQuaternions(F,Da){const ll=F._x,cl=F._y,hl=F._z,dl=F._w,pl=Da._x,fl=Da._y,Al=Da._z,bl=Da._w;return this._x=ll*bl+dl*pl+cl*Al-hl*fl,this._y=cl*bl+dl*fl+hl*pl-ll*Al,this._z=hl*bl+dl*Al+ll*fl-cl*pl,this._w=dl*bl-ll*pl-cl*fl-hl*Al,this._onChangeCallback(),this}slerp(F,Da){if(0===Da)return this;if(1===Da)return this.copy(F);const ll=this._x,cl=this._y,hl=this._z,dl=this._w;let pl=dl*F._w+ll*F._x+cl*F._y+hl*F._z;if(pl<0?(this._w=-F._w,this._x=-F._x,this._y=-F._y,this._z=-F._z,pl=-pl):this.copy(F),pl>=1)return this._w=dl,this._x=ll,this._y=cl,this._z=hl,this;const fl=1-pl*pl;if(fl<=Number.EPSILON){const F=1-Da;return this._w=F*dl+Da*this._w,this._x=F*ll+Da*this._x,this._y=F*cl+Da*this._y,this._z=F*hl+Da*this._z,this.normalize(),this}const Al=Math.sqrt(fl),bl=Math.atan2(Al,pl),kl=Math.sin((1-Da)*bl)/Al,Dl=Math.sin(Da*bl)/Al;return this._w=dl*kl+this._w*Dl,this._x=ll*kl+this._x*Dl,this._y=cl*kl+this._y*Dl,this._z=hl*kl+this._z*Dl,this._onChangeCallback(),this}slerpQuaternions(F,Da,ll){return this.copy(F).slerp(Da,ll)}random(){const F=2*Math.PI*Math.random(),Da=2*Math.PI*Math.random(),ll=Math.random(),cl=Math.sqrt(1-ll),hl=Math.sqrt(ll);return this.set(cl*Math.sin(F),cl*Math.cos(F),hl*Math.sin(Da),hl*Math.cos(Da))}equals(F){return F._x===this._x&&F._y===this._y&&F._z===this._z&&F._w===this._w}fromArray(F,Da){return void 0===Da&&(Da=0),this._x=F[Da],this._y=F[Da+1],this._z=F[Da+2],this._w=F[Da+3],this._onChangeCallback(),this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this._x,F[Da+1]=this._y,F[Da+2]=this._z,F[Da+3]=this._w,F}fromBufferAttribute(F,Da){return this._x=F.getX(Da),this._y=F.getY(Da),this._z=F.getZ(Da),this._w=F.getW(Da),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(F){return this._onChangeCallback=F,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vector3{constructor(F,Da,ll){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),Vector3.prototype.isVector3=!0,this.x=F,this.y=Da,this.z=ll}set(F,Da,ll){return void 0===ll&&(ll=this.z),this.x=F,this.y=Da,this.z=ll,this}setScalar(F){return this.x=F,this.y=F,this.z=F,this}setX(F){return this.x=F,this}setY(F){return this.y=F,this}setZ(F){return this.z=F,this}setComponent(F,Da){switch(F){case 0:this.x=Da;break;case 1:this.y=Da;break;case 2:this.z=Da;break;default:throw new Error("index is out of range: "+F)}return this}getComponent(F){switch(F){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+F)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(F){return this.x=F.x,this.y=F.y,this.z=F.z,this}add(F){return this.x+=F.x,this.y+=F.y,this.z+=F.z,this}addScalar(F){return this.x+=F,this.y+=F,this.z+=F,this}addVectors(F,Da){return this.x=F.x+Da.x,this.y=F.y+Da.y,this.z=F.z+Da.z,this}addScaledVector(F,Da){return this.x+=F.x*Da,this.y+=F.y*Da,this.z+=F.z*Da,this}sub(F){return this.x-=F.x,this.y-=F.y,this.z-=F.z,this}subScalar(F){return this.x-=F,this.y-=F,this.z-=F,this}subVectors(F,Da){return this.x=F.x-Da.x,this.y=F.y-Da.y,this.z=F.z-Da.z,this}multiply(F){return this.x*=F.x,this.y*=F.y,this.z*=F.z,this}multiplyScalar(F){return this.x*=F,this.y*=F,this.z*=F,this}multiplyVectors(F,Da){return this.x=F.x*Da.x,this.y=F.y*Da.y,this.z=F.z*Da.z,this}applyEuler(F){return this.applyQuaternion(hm.setFromEuler(F))}applyAxisAngle(F,Da){return this.applyQuaternion(hm.setFromAxisAngle(F,Da))}applyMatrix3(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements;return this.x=hl[0]*Da+hl[3]*ll+hl[6]*cl,this.y=hl[1]*Da+hl[4]*ll+hl[7]*cl,this.z=hl[2]*Da+hl[5]*ll+hl[8]*cl,this}applyNormalMatrix(F){return this.applyMatrix3(F).normalize()}applyMatrix4(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements,dl=1/(hl[3]*Da+hl[7]*ll+hl[11]*cl+hl[15]);return this.x=(hl[0]*Da+hl[4]*ll+hl[8]*cl+hl[12])*dl,this.y=(hl[1]*Da+hl[5]*ll+hl[9]*cl+hl[13])*dl,this.z=(hl[2]*Da+hl[6]*ll+hl[10]*cl+hl[14])*dl,this}applyQuaternion(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.x,dl=F.y,pl=F.z,fl=F.w,Al=2*(dl*cl-pl*ll),bl=2*(pl*Da-hl*cl),kl=2*(hl*ll-dl*Da);return this.x=Da+fl*Al+dl*kl-pl*bl,this.y=ll+fl*bl+pl*Al-hl*kl,this.z=cl+fl*kl+hl*bl-dl*Al,this}project(F){return this.applyMatrix4(F.matrixWorldInverse).applyMatrix4(F.projectionMatrix)}unproject(F){return this.applyMatrix4(F.projectionMatrixInverse).applyMatrix4(F.matrixWorld)}transformDirection(F){const Da=this.x,ll=this.y,cl=this.z,hl=F.elements;return this.x=hl[0]*Da+hl[4]*ll+hl[8]*cl,this.y=hl[1]*Da+hl[5]*ll+hl[9]*cl,this.z=hl[2]*Da+hl[6]*ll+hl[10]*cl,this.normalize()}divide(F){return this.x/=F.x,this.y/=F.y,this.z/=F.z,this}divideScalar(F){return this.multiplyScalar(1/F)}min(F){return this.x=Math.min(this.x,F.x),this.y=Math.min(this.y,F.y),this.z=Math.min(this.z,F.z),this}max(F){return this.x=Math.max(this.x,F.x),this.y=Math.max(this.y,F.y),this.z=Math.max(this.z,F.z),this}clamp(F,Da){return this.x=Math.max(F.x,Math.min(Da.x,this.x)),this.y=Math.max(F.y,Math.min(Da.y,this.y)),this.z=Math.max(F.z,Math.min(Da.z,this.z)),this}clampScalar(F,Da){return this.x=Math.max(F,Math.min(Da,this.x)),this.y=Math.max(F,Math.min(Da,this.y)),this.z=Math.max(F,Math.min(Da,this.z)),this}clampLength(F,Da){const ll=this.length();return this.divideScalar(ll||1).multiplyScalar(Math.max(F,Math.min(Da,ll)))}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(F){return this.x*F.x+this.y*F.y+this.z*F.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(F){return this.normalize().multiplyScalar(F)}lerp(F,Da){return this.x+=(F.x-this.x)*Da,this.y+=(F.y-this.y)*Da,this.z+=(F.z-this.z)*Da,this}lerpVectors(F,Da,ll){return this.x=F.x+(Da.x-F.x)*ll,this.y=F.y+(Da.y-F.y)*ll,this.z=F.z+(Da.z-F.z)*ll,this}cross(F){return this.crossVectors(this,F)}crossVectors(F,Da){const ll=F.x,cl=F.y,hl=F.z,dl=Da.x,pl=Da.y,fl=Da.z;return this.x=cl*fl-hl*pl,this.y=hl*dl-ll*fl,this.z=ll*pl-cl*dl,this}projectOnVector(F){const Da=F.lengthSq();if(0===Da)return this.set(0,0,0);const ll=F.dot(this)/Da;return this.copy(F).multiplyScalar(ll)}projectOnPlane(F){return um.copy(this).projectOnVector(F),this.sub(um)}reflect(F){return this.sub(um.copy(F).multiplyScalar(2*this.dot(F)))}angleTo(F){const Da=Math.sqrt(this.lengthSq()*F.lengthSq());if(0===Da)return Math.PI/2;const ll=this.dot(F)/Da;return Math.acos(clamp(ll,-1,1))}distanceTo(F){return Math.sqrt(this.distanceToSquared(F))}distanceToSquared(F){const Da=this.x-F.x,ll=this.y-F.y,cl=this.z-F.z;return Da*Da+ll*ll+cl*cl}manhattanDistanceTo(F){return Math.abs(this.x-F.x)+Math.abs(this.y-F.y)+Math.abs(this.z-F.z)}setFromSpherical(F){return this.setFromSphericalCoords(F.radius,F.phi,F.theta)}setFromSphericalCoords(F,Da,ll){const cl=Math.sin(Da)*F;return this.x=cl*Math.sin(ll),this.y=Math.cos(Da)*F,this.z=cl*Math.cos(ll),this}setFromCylindrical(F){return this.setFromCylindricalCoords(F.radius,F.theta,F.y)}setFromCylindricalCoords(F,Da,ll){return this.x=F*Math.sin(Da),this.y=ll,this.z=F*Math.cos(Da),this}setFromMatrixPosition(F){const Da=F.elements;return this.x=Da[12],this.y=Da[13],this.z=Da[14],this}setFromMatrixScale(F){const Da=this.setFromMatrixColumn(F,0).length(),ll=this.setFromMatrixColumn(F,1).length(),cl=this.setFromMatrixColumn(F,2).length();return this.x=Da,this.y=ll,this.z=cl,this}setFromMatrixColumn(F,Da){return this.fromArray(F.elements,4*Da)}setFromMatrix3Column(F,Da){return this.fromArray(F.elements,3*Da)}setFromEuler(F){return this.x=F._x,this.y=F._y,this.z=F._z,this}setFromColor(F){return this.x=F.r,this.y=F.g,this.z=F.b,this}equals(F){return F.x===this.x&&F.y===this.y&&F.z===this.z}fromArray(F,Da){return void 0===Da&&(Da=0),this.x=F[Da],this.y=F[Da+1],this.z=F[Da+2],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.x,F[Da+1]=this.y,F[Da+2]=this.z,F}fromBufferAttribute(F,Da){return this.x=F.getX(Da),this.y=F.getY(Da),this.z=F.getZ(Da),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const F=Math.random()*Math.PI*2,Da=2*Math.random()-1,ll=Math.sqrt(1-Da*Da);return this.x=ll*Math.cos(F),this.y=Da,this.z=ll*Math.sin(F),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const um=new Vector3,hm=new Quaternion;class Box3{constructor(F,Da){void 0===F&&(F=new Vector3(1/0,1/0,1/0)),void 0===Da&&(Da=new Vector3(-1/0,-1/0,-1/0)),this.isBox3=!0,this.min=F,this.max=Da}set(F,Da){return this.min.copy(F),this.max.copy(Da),this}setFromArray(F){this.makeEmpty();for(let Da=0,ll=F.length;Da<ll;Da+=3)this.expandByPoint(pm.fromArray(F,Da));return this}setFromBufferAttribute(F){this.makeEmpty();for(let Da=0,ll=F.count;Da<ll;Da++)this.expandByPoint(pm.fromBufferAttribute(F,Da));return this}setFromPoints(F){this.makeEmpty();for(let Da=0,ll=F.length;Da<ll;Da++)this.expandByPoint(F[Da]);return this}setFromCenterAndSize(F,Da){const ll=pm.copy(Da).multiplyScalar(.5);return this.min.copy(F).sub(ll),this.max.copy(F).add(ll),this}setFromObject(F,Da){return void 0===Da&&(Da=!1),this.makeEmpty(),this.expandByObject(F,Da)}clone(){return(new this.constructor).copy(this)}copy(F){return this.min.copy(F.min),this.max.copy(F.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(F){return this.isEmpty()?F.set(0,0,0):F.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(F){return this.isEmpty()?F.set(0,0,0):F.subVectors(this.max,this.min)}expandByPoint(F){return this.min.min(F),this.max.max(F),this}expandByVector(F){return this.min.sub(F),this.max.add(F),this}expandByScalar(F){return this.min.addScalar(-F),this.max.addScalar(F),this}expandByObject(F,Da){void 0===Da&&(Da=!1),F.updateWorldMatrix(!1,!1);const ll=F.geometry;if(void 0!==ll){const cl=ll.getAttribute("position");if(!0===Da&&void 0!==cl&&!0!==F.isInstancedMesh)for(let Da=0,ll=cl.count;Da<ll;Da++)!0===F.isMesh?F.getVertexPosition(Da,pm):pm.fromBufferAttribute(cl,Da),pm.applyMatrix4(F.matrixWorld),this.expandByPoint(pm);else void 0!==F.boundingBox?(null===F.boundingBox&&F.computeBoundingBox(),mm.copy(F.boundingBox)):(null===ll.boundingBox&&ll.computeBoundingBox(),mm.copy(ll.boundingBox)),mm.applyMatrix4(F.matrixWorld),this.union(mm)}const cl=F.children;for(let hl=0,dl=cl.length;hl<dl;hl++)this.expandByObject(cl[hl],Da);return this}containsPoint(F){return F.x>=this.min.x&&F.x<=this.max.x&&F.y>=this.min.y&&F.y<=this.max.y&&F.z>=this.min.z&&F.z<=this.max.z}containsBox(F){return this.min.x<=F.min.x&&F.max.x<=this.max.x&&this.min.y<=F.min.y&&F.max.y<=this.max.y&&this.min.z<=F.min.z&&F.max.z<=this.max.z}getParameter(F,Da){return Da.set((F.x-this.min.x)/(this.max.x-this.min.x),(F.y-this.min.y)/(this.max.y-this.min.y),(F.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(F){return F.max.x>=this.min.x&&F.min.x<=this.max.x&&F.max.y>=this.min.y&&F.min.y<=this.max.y&&F.max.z>=this.min.z&&F.min.z<=this.max.z}intersectsSphere(F){return this.clampPoint(F.center,pm),pm.distanceToSquared(F.center)<=F.radius*F.radius}intersectsPlane(F){let Da,ll;return F.normal.x>0?(Da=F.normal.x*this.min.x,ll=F.normal.x*this.max.x):(Da=F.normal.x*this.max.x,ll=F.normal.x*this.min.x),F.normal.y>0?(Da+=F.normal.y*this.min.y,ll+=F.normal.y*this.max.y):(Da+=F.normal.y*this.max.y,ll+=F.normal.y*this.min.y),F.normal.z>0?(Da+=F.normal.z*this.min.z,ll+=F.normal.z*this.max.z):(Da+=F.normal.z*this.max.z,ll+=F.normal.z*this.min.z),Da<=-F.constant&&ll>=-F.constant}intersectsTriangle(F){if(this.isEmpty())return!1;this.getCenter(xm),bm.subVectors(this.max,xm),fm.subVectors(F.a,xm),gm.subVectors(F.b,xm),Am.subVectors(F.c,xm),ym.subVectors(gm,fm),vm.subVectors(Am,gm),_m.subVectors(fm,Am);let Da=[0,-ym.z,ym.y,0,-vm.z,vm.y,0,-_m.z,_m.y,ym.z,0,-ym.x,vm.z,0,-vm.x,_m.z,0,-_m.x,-ym.y,ym.x,0,-vm.y,vm.x,0,-_m.y,_m.x,0];return!!satForAxes(Da,fm,gm,Am,bm)&&(Da=[1,0,0,0,1,0,0,0,1],!!satForAxes(Da,fm,gm,Am,bm)&&(wm.crossVectors(ym,vm),Da=[wm.x,wm.y,wm.z],satForAxes(Da,fm,gm,Am,bm)))}clampPoint(F,Da){return Da.copy(F).clamp(this.min,this.max)}distanceToPoint(F){return this.clampPoint(F,pm).distanceTo(F)}getBoundingSphere(F){return this.isEmpty()?F.makeEmpty():(this.getCenter(F.center),F.radius=.5*this.getSize(pm).length()),F}intersect(F){return this.min.max(F.min),this.max.min(F.max),this.isEmpty()&&this.makeEmpty(),this}union(F){return this.min.min(F.min),this.max.max(F.max),this}applyMatrix4(F){return this.isEmpty()||(dm[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(F),dm[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(F),dm[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(F),dm[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(F),dm[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(F),dm[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(F),dm[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(F),dm[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(F),this.setFromPoints(dm)),this}translate(F){return this.min.add(F),this.max.add(F),this}equals(F){return F.min.equals(this.min)&&F.max.equals(this.max)}}const dm=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3],pm=new Vector3,mm=new Box3,fm=new Vector3,gm=new Vector3,Am=new Vector3,ym=new Vector3,vm=new Vector3,_m=new Vector3,xm=new Vector3,bm=new Vector3,wm=new Vector3,Em=new Vector3;function satForAxes(F,Da,ll,cl,hl){for(let dl=0,pl=F.length-3;dl<=pl;dl+=3){Em.fromArray(F,dl);const pl=hl.x*Math.abs(Em.x)+hl.y*Math.abs(Em.y)+hl.z*Math.abs(Em.z),fl=Da.dot(Em),Al=ll.dot(Em),bl=cl.dot(Em);if(Math.max(-Math.max(fl,Al,bl),Math.min(fl,Al,bl))>pl)return!1}return!0}const Mm=new Box3,Sm=new Vector3,km=new Vector3;class Sphere{constructor(F,Da){void 0===F&&(F=new Vector3),void 0===Da&&(Da=-1),this.isSphere=!0,this.center=F,this.radius=Da}set(F,Da){return this.center.copy(F),this.radius=Da,this}setFromPoints(F,Da){const ll=this.center;void 0!==Da?ll.copy(Da):Mm.setFromPoints(F).getCenter(ll);let cl=0;for(let hl=0,dl=F.length;hl<dl;hl++)cl=Math.max(cl,ll.distanceToSquared(F[hl]));return this.radius=Math.sqrt(cl),this}copy(F){return this.center.copy(F.center),this.radius=F.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(F){return F.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(F){return F.distanceTo(this.center)-this.radius}intersectsSphere(F){const Da=this.radius+F.radius;return F.center.distanceToSquared(this.center)<=Da*Da}intersectsBox(F){return F.intersectsSphere(this)}intersectsPlane(F){return Math.abs(F.distanceToPoint(this.center))<=this.radius}clampPoint(F,Da){const ll=this.center.distanceToSquared(F);return Da.copy(F),ll>this.radius*this.radius&&(Da.sub(this.center).normalize(),Da.multiplyScalar(this.radius).add(this.center)),Da}getBoundingBox(F){return this.isEmpty()?(F.makeEmpty(),F):(F.set(this.center,this.center),F.expandByScalar(this.radius),F)}applyMatrix4(F){return this.center.applyMatrix4(F),this.radius=this.radius*F.getMaxScaleOnAxis(),this}translate(F){return this.center.add(F),this}expandByPoint(F){if(this.isEmpty())return this.center.copy(F),this.radius=0,this;Sm.subVectors(F,this.center);const Da=Sm.lengthSq();if(Da>this.radius*this.radius){const F=Math.sqrt(Da),ll=.5*(F-this.radius);this.center.addScaledVector(Sm,ll/F),this.radius+=ll}return this}union(F){return F.isEmpty()?this:this.isEmpty()?(this.copy(F),this):(!0===this.center.equals(F.center)?this.radius=Math.max(this.radius,F.radius):(km.subVectors(F.center,this.center).setLength(F.radius),this.expandByPoint(Sm.copy(F.center).add(km)),this.expandByPoint(Sm.copy(F.center).sub(km))),this)}equals(F){return F.center.equals(this.center)&&F.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Tm=new Vector3,Im=new Vector3,Cm=new Vector3,Lm=new Vector3,zm=new Vector3,Pm=new Vector3,Dm=new Vector3;class Ray{constructor(F,Da){void 0===F&&(F=new Vector3),void 0===Da&&(Da=new Vector3(0,0,-1)),this.origin=F,this.direction=Da}set(F,Da){return this.origin.copy(F),this.direction.copy(Da),this}copy(F){return this.origin.copy(F.origin),this.direction.copy(F.direction),this}at(F,Da){return Da.copy(this.origin).addScaledVector(this.direction,F)}lookAt(F){return this.direction.copy(F).sub(this.origin).normalize(),this}recast(F){return this.origin.copy(this.at(F,Tm)),this}closestPointToPoint(F,Da){Da.subVectors(F,this.origin);const ll=Da.dot(this.direction);return ll<0?Da.copy(this.origin):Da.copy(this.origin).addScaledVector(this.direction,ll)}distanceToPoint(F){return Math.sqrt(this.distanceSqToPoint(F))}distanceSqToPoint(F){const Da=Tm.subVectors(F,this.origin).dot(this.direction);return Da<0?this.origin.distanceToSquared(F):(Tm.copy(this.origin).addScaledVector(this.direction,Da),Tm.distanceToSquared(F))}distanceSqToSegment(F,Da,ll,cl){Im.copy(F).add(Da).multiplyScalar(.5),Cm.copy(Da).sub(F).normalize(),Lm.copy(this.origin).sub(Im);const hl=.5*F.distanceTo(Da),dl=-this.direction.dot(Cm),pl=Lm.dot(this.direction),fl=-Lm.dot(Cm),Al=Lm.lengthSq(),bl=Math.abs(1-dl*dl);let kl,Dl,Wl,Ql;if(bl>0)if(kl=dl*fl-pl,Dl=dl*pl-fl,Ql=hl*bl,kl>=0)if(Dl>=-Ql)if(Dl<=Ql){const F=1/bl;kl*=F,Dl*=F,Wl=kl*(kl+dl*Dl+2*pl)+Dl*(dl*kl+Dl+2*fl)+Al}else Dl=hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;else Dl=-hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;else Dl<=-Ql?(kl=Math.max(0,-(-dl*hl+pl)),Dl=kl>0?-hl:Math.min(Math.max(-hl,-fl),hl),Wl=-kl*kl+Dl*(Dl+2*fl)+Al):Dl<=Ql?(kl=0,Dl=Math.min(Math.max(-hl,-fl),hl),Wl=Dl*(Dl+2*fl)+Al):(kl=Math.max(0,-(dl*hl+pl)),Dl=kl>0?hl:Math.min(Math.max(-hl,-fl),hl),Wl=-kl*kl+Dl*(Dl+2*fl)+Al);else Dl=dl>0?-hl:hl,kl=Math.max(0,-(dl*Dl+pl)),Wl=-kl*kl+Dl*(Dl+2*fl)+Al;return ll&&ll.copy(this.origin).addScaledVector(this.direction,kl),cl&&cl.copy(Im).addScaledVector(Cm,Dl),Wl}intersectSphere(F,Da){Tm.subVectors(F.center,this.origin);const ll=Tm.dot(this.direction),cl=Tm.dot(Tm)-ll*ll,hl=F.radius*F.radius;if(cl>hl)return null;const dl=Math.sqrt(hl-cl),pl=ll-dl,fl=ll+dl;return fl<0?null:pl<0?this.at(fl,Da):this.at(pl,Da)}intersectsSphere(F){return this.distanceSqToPoint(F.center)<=F.radius*F.radius}distanceToPlane(F){const Da=F.normal.dot(this.direction);if(0===Da)return 0===F.distanceToPoint(this.origin)?0:null;const ll=-(this.origin.dot(F.normal)+F.constant)/Da;return ll>=0?ll:null}intersectPlane(F,Da){const ll=this.distanceToPlane(F);return null===ll?null:this.at(ll,Da)}intersectsPlane(F){const Da=F.distanceToPoint(this.origin);if(0===Da)return!0;return F.normal.dot(this.direction)*Da<0}intersectBox(F,Da){let ll,cl,hl,dl,pl,fl;const Al=1/this.direction.x,bl=1/this.direction.y,kl=1/this.direction.z,Dl=this.origin;return Al>=0?(ll=(F.min.x-Dl.x)*Al,cl=(F.max.x-Dl.x)*Al):(ll=(F.max.x-Dl.x)*Al,cl=(F.min.x-Dl.x)*Al),bl>=0?(hl=(F.min.y-Dl.y)*bl,dl=(F.max.y-Dl.y)*bl):(hl=(F.max.y-Dl.y)*bl,dl=(F.min.y-Dl.y)*bl),ll>dl||hl>cl?null:((hl>ll||isNaN(ll))&&(ll=hl),(dl<cl||isNaN(cl))&&(cl=dl),kl>=0?(pl=(F.min.z-Dl.z)*kl,fl=(F.max.z-Dl.z)*kl):(pl=(F.max.z-Dl.z)*kl,fl=(F.min.z-Dl.z)*kl),ll>fl||pl>cl?null:((pl>ll||ll!==ll)&&(ll=pl),(fl<cl||cl!==cl)&&(cl=fl),cl<0?null:this.at(ll>=0?ll:cl,Da)))}intersectsBox(F){return null!==this.intersectBox(F,Tm)}intersectTriangle(F,Da,ll,cl,hl){zm.subVectors(Da,F),Pm.subVectors(ll,F),Dm.crossVectors(zm,Pm);let dl,pl=this.direction.dot(Dm);if(pl>0){if(cl)return null;dl=1}else{if(!(pl<0))return null;dl=-1,pl=-pl}Lm.subVectors(this.origin,F);const fl=dl*this.direction.dot(Pm.crossVectors(Lm,Pm));if(fl<0)return null;const Al=dl*this.direction.dot(zm.cross(Lm));if(Al<0)return null;if(fl+Al>pl)return null;const bl=-dl*Lm.dot(Dm);return bl<0?null:this.at(bl/pl,hl)}applyMatrix4(F){return this.origin.applyMatrix4(F),this.direction.transformDirection(F),this}equals(F){return F.origin.equals(this.origin)&&F.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Matrix4{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc){Matrix4.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==F&&this.set(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc)}set(F,Da,ll,cl,hl,dl,pl,fl,Al,bl,kl,Dl,Wl,Ql,wc,Sc){const eu=this.elements;return eu[0]=F,eu[4]=Da,eu[8]=ll,eu[12]=cl,eu[1]=hl,eu[5]=dl,eu[9]=pl,eu[13]=fl,eu[2]=Al,eu[6]=bl,eu[10]=kl,eu[14]=Dl,eu[3]=Wl,eu[7]=Ql,eu[11]=wc,eu[15]=Sc,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 Matrix4).fromArray(this.elements)}copy(F){const Da=this.elements,ll=F.elements;return Da[0]=ll[0],Da[1]=ll[1],Da[2]=ll[2],Da[3]=ll[3],Da[4]=ll[4],Da[5]=ll[5],Da[6]=ll[6],Da[7]=ll[7],Da[8]=ll[8],Da[9]=ll[9],Da[10]=ll[10],Da[11]=ll[11],Da[12]=ll[12],Da[13]=ll[13],Da[14]=ll[14],Da[15]=ll[15],this}copyPosition(F){const Da=this.elements,ll=F.elements;return Da[12]=ll[12],Da[13]=ll[13],Da[14]=ll[14],this}setFromMatrix3(F){const Da=F.elements;return this.set(Da[0],Da[3],Da[6],0,Da[1],Da[4],Da[7],0,Da[2],Da[5],Da[8],0,0,0,0,1),this}extractBasis(F,Da,ll){return F.setFromMatrixColumn(this,0),Da.setFromMatrixColumn(this,1),ll.setFromMatrixColumn(this,2),this}makeBasis(F,Da,ll){return this.set(F.x,Da.x,ll.x,0,F.y,Da.y,ll.y,0,F.z,Da.z,ll.z,0,0,0,0,1),this}extractRotation(F){const Da=this.elements,ll=F.elements,cl=1/Rm.setFromMatrixColumn(F,0).length(),hl=1/Rm.setFromMatrixColumn(F,1).length(),dl=1/Rm.setFromMatrixColumn(F,2).length();return Da[0]=ll[0]*cl,Da[1]=ll[1]*cl,Da[2]=ll[2]*cl,Da[3]=0,Da[4]=ll[4]*hl,Da[5]=ll[5]*hl,Da[6]=ll[6]*hl,Da[7]=0,Da[8]=ll[8]*dl,Da[9]=ll[9]*dl,Da[10]=ll[10]*dl,Da[11]=0,Da[12]=0,Da[13]=0,Da[14]=0,Da[15]=1,this}makeRotationFromEuler(F){const Da=this.elements,ll=F.x,cl=F.y,hl=F.z,dl=Math.cos(ll),pl=Math.sin(ll),fl=Math.cos(cl),Al=Math.sin(cl),bl=Math.cos(hl),kl=Math.sin(hl);if("XYZ"===F.order){const F=dl*bl,ll=dl*kl,cl=pl*bl,hl=pl*kl;Da[0]=fl*bl,Da[4]=-fl*kl,Da[8]=Al,Da[1]=ll+cl*Al,Da[5]=F-hl*Al,Da[9]=-pl*fl,Da[2]=hl-F*Al,Da[6]=cl+ll*Al,Da[10]=dl*fl}else if("YXZ"===F.order){const F=fl*bl,ll=fl*kl,cl=Al*bl,hl=Al*kl;Da[0]=F+hl*pl,Da[4]=cl*pl-ll,Da[8]=dl*Al,Da[1]=dl*kl,Da[5]=dl*bl,Da[9]=-pl,Da[2]=ll*pl-cl,Da[6]=hl+F*pl,Da[10]=dl*fl}else if("ZXY"===F.order){const F=fl*bl,ll=fl*kl,cl=Al*bl,hl=Al*kl;Da[0]=F-hl*pl,Da[4]=-dl*kl,Da[8]=cl+ll*pl,Da[1]=ll+cl*pl,Da[5]=dl*bl,Da[9]=hl-F*pl,Da[2]=-dl*Al,Da[6]=pl,Da[10]=dl*fl}else if("ZYX"===F.order){const F=dl*bl,ll=dl*kl,cl=pl*bl,hl=pl*kl;Da[0]=fl*bl,Da[4]=cl*Al-ll,Da[8]=F*Al+hl,Da[1]=fl*kl,Da[5]=hl*Al+F,Da[9]=ll*Al-cl,Da[2]=-Al,Da[6]=pl*fl,Da[10]=dl*fl}else if("YZX"===F.order){const F=dl*fl,ll=dl*Al,cl=pl*fl,hl=pl*Al;Da[0]=fl*bl,Da[4]=hl-F*kl,Da[8]=cl*kl+ll,Da[1]=kl,Da[5]=dl*bl,Da[9]=-pl*bl,Da[2]=-Al*bl,Da[6]=ll*kl+cl,Da[10]=F-hl*kl}else if("XZY"===F.order){const F=dl*fl,ll=dl*Al,cl=pl*fl,hl=pl*Al;Da[0]=fl*bl,Da[4]=-kl,Da[8]=Al*bl,Da[1]=F*kl+hl,Da[5]=dl*bl,Da[9]=ll*kl-cl,Da[2]=cl*kl-ll,Da[6]=pl*bl,Da[10]=hl*kl+F}return Da[3]=0,Da[7]=0,Da[11]=0,Da[12]=0,Da[13]=0,Da[14]=0,Da[15]=1,this}makeRotationFromQuaternion(F){return this.compose(Um,F,Bm)}lookAt(F,Da,ll){const cl=this.elements;return jm.subVectors(F,Da),0===jm.lengthSq()&&(jm.z=1),jm.normalize(),Om.crossVectors(ll,jm),0===Om.lengthSq()&&(1===Math.abs(ll.z)?jm.x+=1e-4:jm.z+=1e-4,jm.normalize(),Om.crossVectors(ll,jm)),Om.normalize(),Fm.crossVectors(jm,Om),cl[0]=Om.x,cl[4]=Fm.x,cl[8]=jm.x,cl[1]=Om.y,cl[5]=Fm.y,cl[9]=jm.y,cl[2]=Om.z,cl[6]=Fm.z,cl[10]=jm.z,this}multiply(F){return this.multiplyMatrices(this,F)}premultiply(F){return this.multiplyMatrices(F,this)}multiplyMatrices(F,Da){const ll=F.elements,cl=Da.elements,hl=this.elements,dl=ll[0],pl=ll[4],fl=ll[8],Al=ll[12],bl=ll[1],kl=ll[5],Dl=ll[9],Wl=ll[13],Ql=ll[2],wc=ll[6],Sc=ll[10],eu=ll[14],iu=ll[3],su=ll[7],cu=ll[11],uu=ll[15],hu=cl[0],Lu=cl[4],zu=cl[8],Du=cl[12],Nu=cl[1],qu=cl[5],ih=cl[9],gh=cl[13],ed=cl[2],td=cl[6],id=cl[10],nd=cl[14],rd=cl[3],ad=cl[7],sd=cl[11],od=cl[15];return hl[0]=dl*hu+pl*Nu+fl*ed+Al*rd,hl[4]=dl*Lu+pl*qu+fl*td+Al*ad,hl[8]=dl*zu+pl*ih+fl*id+Al*sd,hl[12]=dl*Du+pl*gh+fl*nd+Al*od,hl[1]=bl*hu+kl*Nu+Dl*ed+Wl*rd,hl[5]=bl*Lu+kl*qu+Dl*td+Wl*ad,hl[9]=bl*zu+kl*ih+Dl*id+Wl*sd,hl[13]=bl*Du+kl*gh+Dl*nd+Wl*od,hl[2]=Ql*hu+wc*Nu+Sc*ed+eu*rd,hl[6]=Ql*Lu+wc*qu+Sc*td+eu*ad,hl[10]=Ql*zu+wc*ih+Sc*id+eu*sd,hl[14]=Ql*Du+wc*gh+Sc*nd+eu*od,hl[3]=iu*hu+su*Nu+cu*ed+uu*rd,hl[7]=iu*Lu+su*qu+cu*td+uu*ad,hl[11]=iu*zu+su*ih+cu*id+uu*sd,hl[15]=iu*Du+su*gh+cu*nd+uu*od,this}multiplyScalar(F){const Da=this.elements;return Da[0]*=F,Da[4]*=F,Da[8]*=F,Da[12]*=F,Da[1]*=F,Da[5]*=F,Da[9]*=F,Da[13]*=F,Da[2]*=F,Da[6]*=F,Da[10]*=F,Da[14]*=F,Da[3]*=F,Da[7]*=F,Da[11]*=F,Da[15]*=F,this}determinant(){const F=this.elements,Da=F[0],ll=F[4],cl=F[8],hl=F[12],dl=F[1],pl=F[5],fl=F[9],Al=F[13],bl=F[2],kl=F[6],Dl=F[10],Wl=F[14];return F[3]*(+hl*fl*kl-cl*Al*kl-hl*pl*Dl+ll*Al*Dl+cl*pl*Wl-ll*fl*Wl)+F[7]*(+Da*fl*Wl-Da*Al*Dl+hl*dl*Dl-cl*dl*Wl+cl*Al*bl-hl*fl*bl)+F[11]*(+Da*Al*kl-Da*pl*Wl-hl*dl*kl+ll*dl*Wl+hl*pl*bl-ll*Al*bl)+F[15]*(-cl*pl*bl-Da*fl*kl+Da*pl*Dl+cl*dl*kl-ll*dl*Dl+ll*fl*bl)}transpose(){const F=this.elements;let Da;return Da=F[1],F[1]=F[4],F[4]=Da,Da=F[2],F[2]=F[8],F[8]=Da,Da=F[6],F[6]=F[9],F[9]=Da,Da=F[3],F[3]=F[12],F[12]=Da,Da=F[7],F[7]=F[13],F[13]=Da,Da=F[11],F[11]=F[14],F[14]=Da,this}setPosition(F,Da,ll){const cl=this.elements;return F.isVector3?(cl[12]=F.x,cl[13]=F.y,cl[14]=F.z):(cl[12]=F,cl[13]=Da,cl[14]=ll),this}invert(){const F=this.elements,Da=F[0],ll=F[1],cl=F[2],hl=F[3],dl=F[4],pl=F[5],fl=F[6],Al=F[7],bl=F[8],kl=F[9],Dl=F[10],Wl=F[11],Ql=F[12],wc=F[13],Sc=F[14],eu=F[15],iu=kl*Sc*Al-wc*Dl*Al+wc*fl*Wl-pl*Sc*Wl-kl*fl*eu+pl*Dl*eu,su=Ql*Dl*Al-bl*Sc*Al-Ql*fl*Wl+dl*Sc*Wl+bl*fl*eu-dl*Dl*eu,cu=bl*wc*Al-Ql*kl*Al+Ql*pl*Wl-dl*wc*Wl-bl*pl*eu+dl*kl*eu,uu=Ql*kl*fl-bl*wc*fl-Ql*pl*Dl+dl*wc*Dl+bl*pl*Sc-dl*kl*Sc,hu=Da*iu+ll*su+cl*cu+hl*uu;if(0===hu)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const Lu=1/hu;return F[0]=iu*Lu,F[1]=(wc*Dl*hl-kl*Sc*hl-wc*cl*Wl+ll*Sc*Wl+kl*cl*eu-ll*Dl*eu)*Lu,F[2]=(pl*Sc*hl-wc*fl*hl+wc*cl*Al-ll*Sc*Al-pl*cl*eu+ll*fl*eu)*Lu,F[3]=(kl*fl*hl-pl*Dl*hl-kl*cl*Al+ll*Dl*Al+pl*cl*Wl-ll*fl*Wl)*Lu,F[4]=su*Lu,F[5]=(bl*Sc*hl-Ql*Dl*hl+Ql*cl*Wl-Da*Sc*Wl-bl*cl*eu+Da*Dl*eu)*Lu,F[6]=(Ql*fl*hl-dl*Sc*hl-Ql*cl*Al+Da*Sc*Al+dl*cl*eu-Da*fl*eu)*Lu,F[7]=(dl*Dl*hl-bl*fl*hl+bl*cl*Al-Da*Dl*Al-dl*cl*Wl+Da*fl*Wl)*Lu,F[8]=cu*Lu,F[9]=(Ql*kl*hl-bl*wc*hl-Ql*ll*Wl+Da*wc*Wl+bl*ll*eu-Da*kl*eu)*Lu,F[10]=(dl*wc*hl-Ql*pl*hl+Ql*ll*Al-Da*wc*Al-dl*ll*eu+Da*pl*eu)*Lu,F[11]=(bl*pl*hl-dl*kl*hl-bl*ll*Al+Da*kl*Al+dl*ll*Wl-Da*pl*Wl)*Lu,F[12]=uu*Lu,F[13]=(bl*wc*cl-Ql*kl*cl+Ql*ll*Dl-Da*wc*Dl-bl*ll*Sc+Da*kl*Sc)*Lu,F[14]=(Ql*pl*cl-dl*wc*cl-Ql*ll*fl+Da*wc*fl+dl*ll*Sc-Da*pl*Sc)*Lu,F[15]=(dl*kl*cl-bl*pl*cl+bl*ll*fl-Da*kl*fl-dl*ll*Dl+Da*pl*Dl)*Lu,this}scale(F){const Da=this.elements,ll=F.x,cl=F.y,hl=F.z;return Da[0]*=ll,Da[4]*=cl,Da[8]*=hl,Da[1]*=ll,Da[5]*=cl,Da[9]*=hl,Da[2]*=ll,Da[6]*=cl,Da[10]*=hl,Da[3]*=ll,Da[7]*=cl,Da[11]*=hl,this}getMaxScaleOnAxis(){const F=this.elements,Da=F[0]*F[0]+F[1]*F[1]+F[2]*F[2],ll=F[4]*F[4]+F[5]*F[5]+F[6]*F[6],cl=F[8]*F[8]+F[9]*F[9]+F[10]*F[10];return Math.sqrt(Math.max(Da,ll,cl))}makeTranslation(F,Da,ll){return F.isVector3?this.set(1,0,0,F.x,0,1,0,F.y,0,0,1,F.z,0,0,0,1):this.set(1,0,0,F,0,1,0,Da,0,0,1,ll,0,0,0,1),this}makeRotationX(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(1,0,0,0,0,Da,-ll,0,0,ll,Da,0,0,0,0,1),this}makeRotationY(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,0,ll,0,0,1,0,0,-ll,0,Da,0,0,0,0,1),this}makeRotationZ(F){const Da=Math.cos(F),ll=Math.sin(F);return this.set(Da,-ll,0,0,ll,Da,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(F,Da){const ll=Math.cos(Da),cl=Math.sin(Da),hl=1-ll,dl=F.x,pl=F.y,fl=F.z,Al=hl*dl,bl=hl*pl;return this.set(Al*dl+ll,Al*pl-cl*fl,Al*fl+cl*pl,0,Al*pl+cl*fl,bl*pl+ll,bl*fl-cl*dl,0,Al*fl-cl*pl,bl*fl+cl*dl,hl*fl*fl+ll,0,0,0,0,1),this}makeScale(F,Da,ll){return this.set(F,0,0,0,0,Da,0,0,0,0,ll,0,0,0,0,1),this}makeShear(F,Da,ll,cl,hl,dl){return this.set(1,ll,hl,0,F,1,dl,0,Da,cl,1,0,0,0,0,1),this}compose(F,Da,ll){const cl=this.elements,hl=Da._x,dl=Da._y,pl=Da._z,fl=Da._w,Al=hl+hl,bl=dl+dl,kl=pl+pl,Dl=hl*Al,Wl=hl*bl,Ql=hl*kl,wc=dl*bl,Sc=dl*kl,eu=pl*kl,iu=fl*Al,su=fl*bl,cu=fl*kl,uu=ll.x,hu=ll.y,Lu=ll.z;return cl[0]=(1-(wc+eu))*uu,cl[1]=(Wl+cu)*uu,cl[2]=(Ql-su)*uu,cl[3]=0,cl[4]=(Wl-cu)*hu,cl[5]=(1-(Dl+eu))*hu,cl[6]=(Sc+iu)*hu,cl[7]=0,cl[8]=(Ql+su)*Lu,cl[9]=(Sc-iu)*Lu,cl[10]=(1-(Dl+wc))*Lu,cl[11]=0,cl[12]=F.x,cl[13]=F.y,cl[14]=F.z,cl[15]=1,this}decompose(F,Da,ll){const cl=this.elements;let hl=Rm.set(cl[0],cl[1],cl[2]).length();const dl=Rm.set(cl[4],cl[5],cl[6]).length(),pl=Rm.set(cl[8],cl[9],cl[10]).length();this.determinant()<0&&(hl=-hl),F.x=cl[12],F.y=cl[13],F.z=cl[14],Nm.copy(this);const fl=1/hl,Al=1/dl,bl=1/pl;return Nm.elements[0]*=fl,Nm.elements[1]*=fl,Nm.elements[2]*=fl,Nm.elements[4]*=Al,Nm.elements[5]*=Al,Nm.elements[6]*=Al,Nm.elements[8]*=bl,Nm.elements[9]*=bl,Nm.elements[10]*=bl,Da.setFromRotationMatrix(Nm),ll.x=hl,ll.y=dl,ll.z=pl,this}makePerspective(F,Da,ll,cl,hl,dl,pl){void 0===pl&&(pl=Wp);const fl=this.elements,Al=2*hl/(Da-F),bl=2*hl/(ll-cl),kl=(Da+F)/(Da-F),Dl=(ll+cl)/(ll-cl);let Wl,Ql;if(pl===Wp)Wl=-(dl+hl)/(dl-hl),Ql=-2*dl*hl/(dl-hl);else{if(pl!==Kp)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+pl);Wl=-dl/(dl-hl),Ql=-dl*hl/(dl-hl)}return fl[0]=Al,fl[4]=0,fl[8]=kl,fl[12]=0,fl[1]=0,fl[5]=bl,fl[9]=Dl,fl[13]=0,fl[2]=0,fl[6]=0,fl[10]=Wl,fl[14]=Ql,fl[3]=0,fl[7]=0,fl[11]=-1,fl[15]=0,this}makeOrthographic(F,Da,ll,cl,hl,dl,pl){void 0===pl&&(pl=Wp);const fl=this.elements,Al=1/(Da-F),bl=1/(ll-cl),kl=1/(dl-hl),Dl=(Da+F)*Al,Wl=(ll+cl)*bl;let Ql,wc;if(pl===Wp)Ql=(dl+hl)*kl,wc=-2*kl;else{if(pl!==Kp)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+pl);Ql=hl*kl,wc=-1*kl}return fl[0]=2*Al,fl[4]=0,fl[8]=0,fl[12]=-Dl,fl[1]=0,fl[5]=2*bl,fl[9]=0,fl[13]=-Wl,fl[2]=0,fl[6]=0,fl[10]=wc,fl[14]=-Ql,fl[3]=0,fl[7]=0,fl[11]=0,fl[15]=1,this}equals(F){const Da=this.elements,ll=F.elements;for(let cl=0;cl<16;cl++)if(Da[cl]!==ll[cl])return!1;return!0}fromArray(F,Da){void 0===Da&&(Da=0);for(let ll=0;ll<16;ll++)this.elements[ll]=F[ll+Da];return this}toArray(F,Da){void 0===F&&(F=[]),void 0===Da&&(Da=0);const ll=this.elements;return F[Da]=ll[0],F[Da+1]=ll[1],F[Da+2]=ll[2],F[Da+3]=ll[3],F[Da+4]=ll[4],F[Da+5]=ll[5],F[Da+6]=ll[6],F[Da+7]=ll[7],F[Da+8]=ll[8],F[Da+9]=ll[9],F[Da+10]=ll[10],F[Da+11]=ll[11],F[Da+12]=ll[12],F[Da+13]=ll[13],F[Da+14]=ll[14],F[Da+15]=ll[15],F}}const Rm=new Vector3,Nm=new Matrix4,Um=new Vector3(0,0,0),Bm=new Vector3(1,1,1),Om=new Vector3,Fm=new Vector3,jm=new Vector3,Vm=new Matrix4,Gm=new Quaternion;class Euler{constructor(F,Da,ll,cl){void 0===F&&(F=0),void 0===Da&&(Da=0),void 0===ll&&(ll=0),void 0===cl&&(cl=Euler.DEFAULT_ORDER),this.isEuler=!0,this._x=F,this._y=Da,this._z=ll,this._order=cl}get x(){return this._x}set x(F){this._x=F,this._onChangeCallback()}get y(){return this._y}set y(F){this._y=F,this._onChangeCallback()}get z(){return this._z}set z(F){this._z=F,this._onChangeCallback()}get order(){return this._order}set order(F){this._order=F,this._onChangeCallback()}set(F,Da,ll,cl){return void 0===cl&&(cl=this._order),this._x=F,this._y=Da,this._z=ll,this._order=cl,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(F){return this._x=F._x,this._y=F._y,this._z=F._z,this._order=F._order,this._onChangeCallback(),this}setFromRotationMatrix(F,Da,ll){void 0===Da&&(Da=this._order),void 0===ll&&(ll=!0);const cl=F.elements,hl=cl[0],dl=cl[4],pl=cl[8],fl=cl[1],Al=cl[5],bl=cl[9],kl=cl[2],Dl=cl[6],Wl=cl[10];switch(Da){case"XYZ":this._y=Math.asin(clamp(pl,-1,1)),Math.abs(pl)<.9999999?(this._x=Math.atan2(-bl,Wl),this._z=Math.atan2(-dl,hl)):(this._x=Math.atan2(Dl,Al),this._z=0);break;case"YXZ":this._x=Math.asin(-clamp(bl,-1,1)),Math.abs(bl)<.9999999?(this._y=Math.atan2(pl,Wl),this._z=Math.atan2(fl,Al)):(this._y=Math.atan2(-kl,hl),this._z=0);break;case"ZXY":this._x=Math.asin(clamp(Dl,-1,1)),Math.abs(Dl)<.9999999?(this._y=Math.atan2(-kl,Wl),this._z=Math.atan2(-dl,Al)):(this._y=0,this._z=Math.atan2(fl,hl));break;case"ZYX":this._y=Math.asin(-clamp(kl,-1,1)),Math.abs(kl)<.9999999?(this._x=Math.atan2(Dl,Wl),this._z=Math.atan2(fl,hl)):(this._x=0,this._z=Math.atan2(-dl,Al));break;case"YZX":this._z=Math.asin(clamp(fl,-1,1)),Math.abs(fl)<.9999999?(this._x=Math.atan2(-bl,Al),this._y=Math.atan2(-kl,hl)):(this._x=0,this._y=Math.atan2(pl,Wl));break;case"XZY":this._z=Math.asin(-clamp(dl,-1,1)),Math.abs(dl)<.9999999?(this._x=Math.atan2(Dl,Al),this._y=Math.atan2(pl,hl)):(this._x=Math.atan2(-bl,Wl),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+Da)}return this._order=Da,!0===ll&&this._onChangeCallback(),this}setFromQuaternion(F,Da,ll){return Vm.makeRotationFromQuaternion(F),this.setFromRotationMatrix(Vm,Da,ll)}setFromVector3(F,Da){return void 0===Da&&(Da=this._order),this.set(F.x,F.y,F.z,Da)}reorder(F){return Gm.setFromEuler(this),this.setFromQuaternion(Gm,F)}equals(F){return F._x===this._x&&F._y===this._y&&F._z===this._z&&F._order===this._order}fromArray(F){return this._x=F[0],this._y=F[1],this._z=F[2],void 0!==F[3]&&(this._order=F[3]),this._onChangeCallback(),this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this._x,F[Da+1]=this._y,F[Da+2]=this._z,F[Da+3]=this._order,F}_onChange(F){return this._onChangeCallback=F,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Euler.DEFAULT_ORDER="XYZ";class Layers{constructor(){this.mask=1}set(F){this.mask=1<<F>>>0}enable(F){this.mask|=1<<F}enableAll(){this.mask=-1}toggle(F){this.mask^=1<<F}disable(F){this.mask&=~(1<<F)}disableAll(){this.mask=0}test(F){return 0!==(this.mask&F.mask)}isEnabled(F){return 0!==(this.mask&1<<F)}}let Hm=0;const qm=new Vector3,Zm=new Quaternion,Wm=new Matrix4,Km=new Vector3,Qm=new Vector3,Xm=new Vector3,Ym=new Quaternion,Jm=new Vector3(1,0,0),$m=new Vector3(0,1,0),ef=new Vector3(0,0,1),tf={type:"added"},nf={type:"removed"},rf={type:"childadded",child:null},af={type:"childremoved",child:null};class Object3D extends EventDispatcher{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Hm++}),this.uuid=generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Object3D.DEFAULT_UP.clone();const F=new Vector3,Da=new Euler,ll=new Quaternion,cl=new Vector3(1,1,1);Da._onChange((function(){ll.setFromEuler(Da,!1)})),ll._onChange((function(){Da.setFromQuaternion(ll,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:F},rotation:{configurable:!0,enumerable:!0,value:Da},quaternion:{configurable:!0,enumerable:!0,value:ll},scale:{configurable:!0,enumerable:!0,value:cl},modelViewMatrix:{value:new Matrix4},normalMatrix:{value:new Matrix3}}),this.matrix=new Matrix4,this.matrixWorld=new Matrix4,this.matrixAutoUpdate=Object3D.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(F){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(F),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(F){return this.quaternion.premultiply(F),this}setRotationFromAxisAngle(F,Da){this.quaternion.setFromAxisAngle(F,Da)}setRotationFromEuler(F){this.quaternion.setFromEuler(F,!0)}setRotationFromMatrix(F){this.quaternion.setFromRotationMatrix(F)}setRotationFromQuaternion(F){this.quaternion.copy(F)}rotateOnAxis(F,Da){return Zm.setFromAxisAngle(F,Da),this.quaternion.multiply(Zm),this}rotateOnWorldAxis(F,Da){return Zm.setFromAxisAngle(F,Da),this.quaternion.premultiply(Zm),this}rotateX(F){return this.rotateOnAxis(Jm,F)}rotateY(F){return this.rotateOnAxis($m,F)}rotateZ(F){return this.rotateOnAxis(ef,F)}translateOnAxis(F,Da){return qm.copy(F).applyQuaternion(this.quaternion),this.position.add(qm.multiplyScalar(Da)),this}translateX(F){return this.translateOnAxis(Jm,F)}translateY(F){return this.translateOnAxis($m,F)}translateZ(F){return this.translateOnAxis(ef,F)}localToWorld(F){return this.updateWorldMatrix(!0,!1),F.applyMatrix4(this.matrixWorld)}worldToLocal(F){return this.updateWorldMatrix(!0,!1),F.applyMatrix4(Wm.copy(this.matrixWorld).invert())}lookAt(F,Da,ll){F.isVector3?Km.copy(F):Km.set(F,Da,ll);const cl=this.parent;this.updateWorldMatrix(!0,!1),Qm.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Wm.lookAt(Qm,Km,this.up):Wm.lookAt(Km,Qm,this.up),this.quaternion.setFromRotationMatrix(Wm),cl&&(Wm.extractRotation(cl.matrixWorld),Zm.setFromRotationMatrix(Wm),this.quaternion.premultiply(Zm.invert()))}add(F){if(arguments.length>1){for(let F=0;F<arguments.length;F++)this.add(arguments[F]);return this}return F===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",F),this):(F&&F.isObject3D?(F.removeFromParent(),F.parent=this,this.children.push(F),F.dispatchEvent(tf),rf.child=F,this.dispatchEvent(rf),rf.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",F),this)}remove(F){if(arguments.length>1){for(let F=0;F<arguments.length;F++)this.remove(arguments[F]);return this}const Da=this.children.indexOf(F);return-1!==Da&&(F.parent=null,this.children.splice(Da,1),F.dispatchEvent(nf),af.child=F,this.dispatchEvent(af),af.child=null),this}removeFromParent(){const F=this.parent;return null!==F&&F.remove(this),this}clear(){return this.remove(...this.children)}attach(F){return this.updateWorldMatrix(!0,!1),Wm.copy(this.matrixWorld).invert(),null!==F.parent&&(F.parent.updateWorldMatrix(!0,!1),Wm.multiply(F.parent.matrixWorld)),F.applyMatrix4(Wm),F.removeFromParent(),F.parent=this,this.children.push(F),F.updateWorldMatrix(!1,!0),F.dispatchEvent(tf),rf.child=F,this.dispatchEvent(rf),rf.child=null,this}getObjectById(F){return this.getObjectByProperty("id",F)}getObjectByName(F){return this.getObjectByProperty("name",F)}getObjectByProperty(F,Da){if(this[F]===Da)return this;for(let ll=0,cl=this.children.length;ll<cl;ll++){const cl=this.children[ll].getObjectByProperty(F,Da);if(void 0!==cl)return cl}}getObjectsByProperty(F,Da,ll){void 0===ll&&(ll=[]),this[F]===Da&&ll.push(this);const cl=this.children;for(let hl=0,dl=cl.length;hl<dl;hl++)cl[hl].getObjectsByProperty(F,Da,ll);return ll}getWorldPosition(F){return this.updateWorldMatrix(!0,!1),F.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(F){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qm,F,Xm),F}getWorldScale(F){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Qm,Ym,F),F}getWorldDirection(F){this.updateWorldMatrix(!0,!1);const Da=this.matrixWorld.elements;return F.set(Da[8],Da[9],Da[10]).normalize()}raycast(){}traverse(F){F(this);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++)Da[ll].traverse(F)}traverseVisible(F){if(!1===this.visible)return;F(this);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++)Da[ll].traverseVisible(F)}traverseAncestors(F){const Da=this.parent;null!==Da&&(F(Da),Da.traverseAncestors(F))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(F){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||F)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,F=!0);const Da=this.children;for(let ll=0,cl=Da.length;ll<cl;ll++){Da[ll].updateMatrixWorld(F)}}updateWorldMatrix(F,Da){const ll=this.parent;if(!0===F&&null!==ll&&ll.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===Da){const F=this.children;for(let Da=0,ll=F.length;Da<ll;Da++){F[Da].updateWorldMatrix(!1,!0)}}}toJSON(F){const Da=void 0===F||"string"===typeof F,ll={};Da&&(F={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},ll.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const cl={};function serialize(Da,ll){return void 0===Da[ll.uuid]&&(Da[ll.uuid]=ll.toJSON(F)),ll.uuid}if(cl.uuid=this.uuid,cl.type=this.type,""!==this.name&&(cl.name=this.name),!0===this.castShadow&&(cl.castShadow=!0),!0===this.receiveShadow&&(cl.receiveShadow=!0),!1===this.visible&&(cl.visible=!1),!1===this.frustumCulled&&(cl.frustumCulled=!1),0!==this.renderOrder&&(cl.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(cl.userData=this.userData),cl.layers=this.layers.mask,cl.matrix=this.matrix.toArray(),cl.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(cl.matrixAutoUpdate=!1),this.isInstancedMesh&&(cl.type="InstancedMesh",cl.count=this.count,cl.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(cl.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(cl.type="BatchedMesh",cl.perObjectFrustumCulled=this.perObjectFrustumCulled,cl.sortObjects=this.sortObjects,cl.drawRanges=this._drawRanges,cl.reservedRanges=this._reservedRanges,cl.visibility=this._visibility,cl.active=this._active,cl.bounds=this._bounds.map((F=>({boxInitialized:F.boxInitialized,boxMin:F.box.min.toArray(),boxMax:F.box.max.toArray(),sphereInitialized:F.sphereInitialized,sphereRadius:F.sphere.radius,sphereCenter:F.sphere.center.toArray()}))),cl.maxInstanceCount=this._maxInstanceCount,cl.maxVertexCount=this._maxVertexCount,cl.maxIndexCount=this._maxIndexCount,cl.geometryInitialized=this._geometryInitialized,cl.geometryCount=this._geometryCount,cl.matricesTexture=this._matricesTexture.toJSON(F),null!==this._colorsTexture&&(cl.colorsTexture=this._colorsTexture.toJSON(F)),null!==this.boundingSphere&&(cl.boundingSphere={center:cl.boundingSphere.center.toArray(),radius:cl.boundingSphere.radius}),null!==this.boundingBox&&(cl.boundingBox={min:cl.boundingBox.min.toArray(),max:cl.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?cl.background=this.background.toJSON():this.background.isTexture&&(cl.background=this.background.toJSON(F).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(cl.environment=this.environment.toJSON(F).uuid);else if(this.isMesh||this.isLine||this.isPoints){cl.geometry=serialize(F.geometries,this.geometry);const Da=this.geometry.parameters;if(void 0!==Da&&void 0!==Da.shapes){const ll=Da.shapes;if(Array.isArray(ll))for(let Da=0,cl=ll.length;Da<cl;Da++){const cl=ll[Da];serialize(F.shapes,cl)}else serialize(F.shapes,ll)}}if(this.isSkinnedMesh&&(cl.bindMode=this.bindMode,cl.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(serialize(F.skeletons,this.skeleton),cl.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const Da=[];for(let ll=0,cl=this.material.length;ll<cl;ll++)Da.push(serialize(F.materials,this.material[ll]));cl.material=Da}else cl.material=serialize(F.materials,this.material);if(this.children.length>0){cl.children=[];for(let Da=0;Da<this.children.length;Da++)cl.children.push(this.children[Da].toJSON(F).object)}if(this.animations.length>0){cl.animations=[];for(let Da=0;Da<this.animations.length;Da++){const ll=this.animations[Da];cl.animations.push(serialize(F.animations,ll))}}if(Da){const Da=extractFromCache(F.geometries),cl=extractFromCache(F.materials),hl=extractFromCache(F.textures),dl=extractFromCache(F.images),pl=extractFromCache(F.shapes),fl=extractFromCache(F.skeletons),Al=extractFromCache(F.animations),bl=extractFromCache(F.nodes);Da.length>0&&(ll.geometries=Da),cl.length>0&&(ll.materials=cl),hl.length>0&&(ll.textures=hl),dl.length>0&&(ll.images=dl),pl.length>0&&(ll.shapes=pl),fl.length>0&&(ll.skeletons=fl),Al.length>0&&(ll.animations=Al),bl.length>0&&(ll.nodes=bl)}return ll.object=cl,ll;function extractFromCache(F){const Da=[];for(const ll in F){const cl=F[ll];delete cl.metadata,Da.push(cl)}return Da}}clone(F){return(new this.constructor).copy(this,F)}copy(F,Da){if(void 0===Da&&(Da=!0),this.name=F.name,this.up.copy(F.up),this.position.copy(F.position),this.rotation.order=F.rotation.order,this.quaternion.copy(F.quaternion),this.scale.copy(F.scale),this.matrix.copy(F.matrix),this.matrixWorld.copy(F.matrixWorld),this.matrixAutoUpdate=F.matrixAutoUpdate,this.matrixWorldAutoUpdate=F.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=F.matrixWorldNeedsUpdate,this.layers.mask=F.layers.mask,this.visible=F.visible,this.castShadow=F.castShadow,this.receiveShadow=F.receiveShadow,this.frustumCulled=F.frustumCulled,this.renderOrder=F.renderOrder,this.animations=F.animations.slice(),this.userData=JSON.parse(JSON.stringify(F.userData)),!0===Da)for(let ll=0;ll<F.children.length;ll++){const Da=F.children[ll];this.add(Da.clone())}return this}}Object3D.DEFAULT_UP=new Vector3(0,1,0),Object3D.DEFAULT_MATRIX_AUTO_UPDATE=!0,Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const sf=new Vector3,of=new Vector3,lf=new Vector3,cf=new Vector3,uf=new Vector3,hf=new Vector3,df=new Vector3,pf=new Vector3,mf=new Vector3,ff=new Vector3;class Triangle{constructor(F,Da,ll){void 0===F&&(F=new Vector3),void 0===Da&&(Da=new Vector3),void 0===ll&&(ll=new Vector3),this.a=F,this.b=Da,this.c=ll}static getNormal(F,Da,ll,cl){cl.subVectors(ll,Da),sf.subVectors(F,Da),cl.cross(sf);const hl=cl.lengthSq();return hl>0?cl.multiplyScalar(1/Math.sqrt(hl)):cl.set(0,0,0)}static getBarycoord(F,Da,ll,cl,hl){sf.subVectors(cl,Da),of.subVectors(ll,Da),lf.subVectors(F,Da);const dl=sf.dot(sf),pl=sf.dot(of),fl=sf.dot(lf),Al=of.dot(of),bl=of.dot(lf),kl=dl*Al-pl*pl;if(0===kl)return hl.set(0,0,0),null;const Dl=1/kl,Wl=(Al*fl-pl*bl)*Dl,Ql=(dl*bl-pl*fl)*Dl;return hl.set(1-Wl-Ql,Ql,Wl)}static containsPoint(F,Da,ll,cl){return null!==this.getBarycoord(F,Da,ll,cl,cf)&&(cf.x>=0&&cf.y>=0&&cf.x+cf.y<=1)}static getInterpolation(F,Da,ll,cl,hl,dl,pl,fl){return null===this.getBarycoord(F,Da,ll,cl,cf)?(fl.x=0,fl.y=0,"z"in fl&&(fl.z=0),"w"in fl&&(fl.w=0),null):(fl.setScalar(0),fl.addScaledVector(hl,cf.x),fl.addScaledVector(dl,cf.y),fl.addScaledVector(pl,cf.z),fl)}static isFrontFacing(F,Da,ll,cl){return sf.subVectors(ll,Da),of.subVectors(F,Da),sf.cross(of).dot(cl)<0}set(F,Da,ll){return this.a.copy(F),this.b.copy(Da),this.c.copy(ll),this}setFromPointsAndIndices(F,Da,ll,cl){return this.a.copy(F[Da]),this.b.copy(F[ll]),this.c.copy(F[cl]),this}setFromAttributeAndIndices(F,Da,ll,cl){return this.a.fromBufferAttribute(F,Da),this.b.fromBufferAttribute(F,ll),this.c.fromBufferAttribute(F,cl),this}clone(){return(new this.constructor).copy(this)}copy(F){return this.a.copy(F.a),this.b.copy(F.b),this.c.copy(F.c),this}getArea(){return sf.subVectors(this.c,this.b),of.subVectors(this.a,this.b),.5*sf.cross(of).length()}getMidpoint(F){return F.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(F){return Triangle.getNormal(this.a,this.b,this.c,F)}getPlane(F){return F.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(F,Da){return Triangle.getBarycoord(F,this.a,this.b,this.c,Da)}getInterpolation(F,Da,ll,cl,hl){return Triangle.getInterpolation(F,this.a,this.b,this.c,Da,ll,cl,hl)}containsPoint(F){return Triangle.containsPoint(F,this.a,this.b,this.c)}isFrontFacing(F){return Triangle.isFrontFacing(this.a,this.b,this.c,F)}intersectsBox(F){return F.intersectsTriangle(this)}closestPointToPoint(F,Da){const ll=this.a,cl=this.b,hl=this.c;let dl,pl;uf.subVectors(cl,ll),hf.subVectors(hl,ll),pf.subVectors(F,ll);const fl=uf.dot(pf),Al=hf.dot(pf);if(fl<=0&&Al<=0)return Da.copy(ll);mf.subVectors(F,cl);const bl=uf.dot(mf),kl=hf.dot(mf);if(bl>=0&&kl<=bl)return Da.copy(cl);const Dl=fl*kl-bl*Al;if(Dl<=0&&fl>=0&&bl<=0)return dl=fl/(fl-bl),Da.copy(ll).addScaledVector(uf,dl);ff.subVectors(F,hl);const Wl=uf.dot(ff),Ql=hf.dot(ff);if(Ql>=0&&Wl<=Ql)return Da.copy(hl);const wc=Wl*Al-fl*Ql;if(wc<=0&&Al>=0&&Ql<=0)return pl=Al/(Al-Ql),Da.copy(ll).addScaledVector(hf,pl);const Sc=bl*Ql-Wl*kl;if(Sc<=0&&kl-bl>=0&&Wl-Ql>=0)return df.subVectors(hl,cl),pl=(kl-bl)/(kl-bl+(Wl-Ql)),Da.copy(cl).addScaledVector(df,pl);const eu=1/(Sc+wc+Dl);return dl=wc*eu,pl=Dl*eu,Da.copy(ll).addScaledVector(uf,dl).addScaledVector(hf,pl)}equals(F){return F.a.equals(this.a)&&F.b.equals(this.b)&&F.c.equals(this.c)}}const gf={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},Af={h:0,s:0,l:0},yf={h:0,s:0,l:0};function hue2rgb(F,Da,ll){return ll<0&&(ll+=1),ll>1&&(ll-=1),ll<1/6?F+6*(Da-F)*ll:ll<.5?Da:ll<2/3?F+6*(Da-F)*(2/3-ll):F}class Color{constructor(F,Da,ll){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(F,Da,ll)}set(F,Da,ll){if(void 0===Da&&void 0===ll){const Da=F;Da&&Da.isColor?this.copy(Da):"number"===typeof Da?this.setHex(Da):"string"===typeof Da&&this.setStyle(Da)}else this.setRGB(F,Da,ll);return this}setScalar(F){return this.r=F,this.g=F,this.b=F,this}setHex(F,Da){return void 0===Da&&(Da=Tp),F=Math.floor(F),this.r=(F>>16&255)/255,this.g=(F>>8&255)/255,this.b=(255&F)/255,sm.toWorkingColorSpace(this,Da),this}setRGB(F,Da,ll,cl){return void 0===cl&&(cl=sm.workingColorSpace),this.r=F,this.g=Da,this.b=ll,sm.toWorkingColorSpace(this,cl),this}setHSL(F,Da,ll,cl){if(void 0===cl&&(cl=sm.workingColorSpace),F=euclideanModulo(F,1),Da=clamp(Da,0,1),ll=clamp(ll,0,1),0===Da)this.r=this.g=this.b=ll;else{const cl=ll<=.5?ll*(1+Da):ll+Da-ll*Da,hl=2*ll-cl;this.r=hue2rgb(hl,cl,F+1/3),this.g=hue2rgb(hl,cl,F),this.b=hue2rgb(hl,cl,F-1/3)}return sm.toWorkingColorSpace(this,cl),this}setStyle(F,Da){function handleAlpha(Da){void 0!==Da&&parseFloat(Da)<1&&console.warn("THREE.Color: Alpha component of "+F+" will be ignored.")}let ll;if(void 0===Da&&(Da=Tp),ll=/^(\w+)\(([^\)]*)\)/.exec(F)){let cl;const hl=ll[1],dl=ll[2];switch(hl){case"rgb":case"rgba":if(cl=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setRGB(Math.min(255,parseInt(cl[1],10))/255,Math.min(255,parseInt(cl[2],10))/255,Math.min(255,parseInt(cl[3],10))/255,Da);if(cl=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setRGB(Math.min(100,parseInt(cl[1],10))/100,Math.min(100,parseInt(cl[2],10))/100,Math.min(100,parseInt(cl[3],10))/100,Da);break;case"hsl":case"hsla":if(cl=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(dl))return handleAlpha(cl[4]),this.setHSL(parseFloat(cl[1])/360,parseFloat(cl[2])/100,parseFloat(cl[3])/100,Da);break;default:console.warn("THREE.Color: Unknown color model "+F)}}else if(ll=/^\#([A-Fa-f\d]+)$/.exec(F)){const cl=ll[1],hl=cl.length;if(3===hl)return this.setRGB(parseInt(cl.charAt(0),16)/15,parseInt(cl.charAt(1),16)/15,parseInt(cl.charAt(2),16)/15,Da);if(6===hl)return this.setHex(parseInt(cl,16),Da);console.warn("THREE.Color: Invalid hex color "+F)}else if(F&&F.length>0)return this.setColorName(F,Da);return this}setColorName(F,Da){void 0===Da&&(Da=Tp);const ll=gf[F.toLowerCase()];return void 0!==ll?this.setHex(ll,Da):console.warn("THREE.Color: Unknown color "+F),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(F){return this.r=F.r,this.g=F.g,this.b=F.b,this}copySRGBToLinear(F){return this.r=SRGBToLinear(F.r),this.g=SRGBToLinear(F.g),this.b=SRGBToLinear(F.b),this}copyLinearToSRGB(F){return this.r=LinearToSRGB(F.r),this.g=LinearToSRGB(F.g),this.b=LinearToSRGB(F.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(F){return void 0===F&&(F=Tp),sm.fromWorkingColorSpace(vf.copy(this),F),65536*Math.round(clamp(255*vf.r,0,255))+256*Math.round(clamp(255*vf.g,0,255))+Math.round(clamp(255*vf.b,0,255))}getHexString(F){return void 0===F&&(F=Tp),("000000"+this.getHex(F).toString(16)).slice(-6)}getHSL(F,Da){void 0===Da&&(Da=sm.workingColorSpace),sm.fromWorkingColorSpace(vf.copy(this),Da);const ll=vf.r,cl=vf.g,hl=vf.b,dl=Math.max(ll,cl,hl),pl=Math.min(ll,cl,hl);let fl,Al;const bl=(pl+dl)/2;if(pl===dl)fl=0,Al=0;else{const F=dl-pl;switch(Al=bl<=.5?F/(dl+pl):F/(2-dl-pl),dl){case ll:fl=(cl-hl)/F+(cl<hl?6:0);break;case cl:fl=(hl-ll)/F+2;break;case hl:fl=(ll-cl)/F+4}fl/=6}return F.h=fl,F.s=Al,F.l=bl,F}getRGB(F,Da){return void 0===Da&&(Da=sm.workingColorSpace),sm.fromWorkingColorSpace(vf.copy(this),Da),F.r=vf.r,F.g=vf.g,F.b=vf.b,F}getStyle(F){void 0===F&&(F=Tp),sm.fromWorkingColorSpace(vf.copy(this),F);const Da=vf.r,ll=vf.g,cl=vf.b;return F!==Tp?`color(${F} ${Da.toFixed(3)} ${ll.toFixed(3)} ${cl.toFixed(3)})`:`rgb(${Math.round(255*Da)},${Math.round(255*ll)},${Math.round(255*cl)})`}offsetHSL(F,Da,ll){return this.getHSL(Af),this.setHSL(Af.h+F,Af.s+Da,Af.l+ll)}add(F){return this.r+=F.r,this.g+=F.g,this.b+=F.b,this}addColors(F,Da){return this.r=F.r+Da.r,this.g=F.g+Da.g,this.b=F.b+Da.b,this}addScalar(F){return this.r+=F,this.g+=F,this.b+=F,this}sub(F){return this.r=Math.max(0,this.r-F.r),this.g=Math.max(0,this.g-F.g),this.b=Math.max(0,this.b-F.b),this}multiply(F){return this.r*=F.r,this.g*=F.g,this.b*=F.b,this}multiplyScalar(F){return this.r*=F,this.g*=F,this.b*=F,this}lerp(F,Da){return this.r+=(F.r-this.r)*Da,this.g+=(F.g-this.g)*Da,this.b+=(F.b-this.b)*Da,this}lerpColors(F,Da,ll){return this.r=F.r+(Da.r-F.r)*ll,this.g=F.g+(Da.g-F.g)*ll,this.b=F.b+(Da.b-F.b)*ll,this}lerpHSL(F,Da){this.getHSL(Af),F.getHSL(yf);const ll=lerp(Af.h,yf.h,Da),cl=lerp(Af.s,yf.s,Da),hl=lerp(Af.l,yf.l,Da);return this.setHSL(ll,cl,hl),this}setFromVector3(F){return this.r=F.x,this.g=F.y,this.b=F.z,this}applyMatrix3(F){const Da=this.r,ll=this.g,cl=this.b,hl=F.elements;return this.r=hl[0]*Da+hl[3]*ll+hl[6]*cl,this.g=hl[1]*Da+hl[4]*ll+hl[7]*cl,this.b=hl[2]*Da+hl[5]*ll+hl[8]*cl,this}equals(F){return F.r===this.r&&F.g===this.g&&F.b===this.b}fromArray(F,Da){return void 0===Da&&(Da=0),this.r=F[Da],this.g=F[Da+1],this.b=F[Da+2],this}toArray(F,Da){return void 0===F&&(F=[]),void 0===Da&&(Da=0),F[Da]=this.r,F[Da+1]=this.g,F[Da+2]=this.b,F}fromBufferAttribute(F,Da){return this.r=F.getX(Da),this.g=F.getY(Da),this.b=F.getZ(Da),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const vf=new Color;Color.NAMES=gf;let _f=0;class Material extends EventDispatcher{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:_f++}),this.uuid=generateUUID(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=fl,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Color(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Np,this.stencilZFail=Np,this.stencilZPass=Np,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(F){this._alphaTest>0!==F>0&&this.version++,this._alphaTest=F}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(F){if(void 0!==F)for(const Da in F){const ll=F[Da];if(void 0===ll){console.warn(`THREE.Material: parameter '${Da}' has value of undefined.`);continue}const cl=this[Da];void 0!==cl?cl&&cl.isColor?cl.set(ll):cl&&cl.isVector3&&ll&&ll.isVector3?cl.copy(ll):this[Da]=ll:console.warn(`THREE.Material: '${Da}' is not a property of THREE.${this.type}.`)}}toJSON(F){const Da=void 0===F||"string"===typeof F;Da&&(F={textures:{},images:{}});const ll={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function extractFromCache(F){const Da=[];for(const ll in F){const cl=F[ll];delete cl.metadata,Da.push(cl)}return Da}if(ll.uuid=this.uuid,ll.type=this.type,""!==this.name&&(ll.name=this.name),this.color&&this.color.isColor&&(ll.color=this.color.getHex()),void 0!==this.roughness&&(ll.roughness=this.roughness),void 0!==this.metalness&&(ll.metalness=this.metalness),void 0!==this.sheen&&(ll.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(ll.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(ll.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(ll.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(ll.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(ll.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(ll.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(ll.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(ll.shininess=this.shininess),void 0!==this.clearcoat&&(ll.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(ll.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(ll.clearcoatMap=this.clearcoatMap.toJSON(F).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(ll.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(F).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(ll.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(F).uuid,ll.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(ll.dispersion=this.dispersion),void 0!==this.iridescence&&(ll.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(ll.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(ll.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(ll.iridescenceMap=this.iridescenceMap.toJSON(F).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(ll.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(F).uuid),void 0!==this.anisotropy&&(ll.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(ll.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(ll.anisotropyMap=this.anisotropyMap.toJSON(F).uuid),this.map&&this.map.isTexture&&(ll.map=this.map.toJSON(F).uuid),this.matcap&&this.matcap.isTexture&&(ll.matcap=this.matcap.toJSON(F).uuid),this.alphaMap&&this.alphaMap.isTexture&&(ll.alphaMap=this.alphaMap.toJSON(F).uuid),this.lightMap&&this.lightMap.isTexture&&(ll.lightMap=this.lightMap.toJSON(F).uuid,ll.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(ll.aoMap=this.aoMap.toJSON(F).uuid,ll.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(ll.bumpMap=this.bumpMap.toJSON(F).uuid,ll.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(ll.normalMap=this.normalMap.toJSON(F).uuid,ll.normalMapType=this.normalMapType,ll.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(ll.displacementMap=this.displacementMap.toJSON(F).uuid,ll.displacementScale=this.displacementScale,ll.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(ll.roughnessMap=this.roughnessMap.toJSON(F).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(ll.metalnessMap=this.metalnessMap.toJSON(F).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(ll.emissiveMap=this.emissiveMap.toJSON(F).uuid),this.specularMap&&this.specularMap.isTexture&&(ll.specularMap=this.specularMap.toJSON(F).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(ll.specularIntensityMap=this.specularIntensityMap.toJSON(F).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(ll.specularColorMap=this.specularColorMap.toJSON(F).uuid),this.envMap&&this.envMap.isTexture&&(ll.envMap=this.envMap.toJSON(F).uuid,void 0!==this.combine&&(ll.combine=this.combine)),void 0!==this.envMapRotation&&(ll.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(ll.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(ll.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(ll.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(ll.gradientMap=this.gradientMap.toJSON(F).uuid),void 0!==this.transmission&&(ll.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(ll.transmissionMap=this.transmissionMap.toJSON(F).uuid),void 0!==this.thickness&&(ll.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(ll.thicknessMap=this.thicknessMap.toJSON(F).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(ll.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(ll.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(ll.size=this.size),null!==this.shadowSide&&(ll.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(ll.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(ll.blending=this.blending),0!==this.side&&(ll.side=this.side),!0===this.vertexColors&&(ll.vertexColors=!0),this.opacity<1&&(ll.opacity=this.opacity),!0===this.transparent&&(ll.transparent=!0),204!==this.blendSrc&&(ll.blendSrc=this.blendSrc),205!==this.blendDst&&(ll.blendDst=this.blendDst),this.blendEquation!==fl&&(ll.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(ll.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(ll.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(ll.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(ll.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(ll.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(ll.depthFunc=this.depthFunc),!1===this.depthTest&&(ll.depthTest=this.depthTest),!1===this.depthWrite&&(ll.depthWrite=this.depthWrite),!1===this.colorWrite&&(ll.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(ll.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(ll.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(ll.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(ll.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Np&&(ll.stencilFail=this.stencilFail),this.stencilZFail!==Np&&(ll.stencilZFail=this.stencilZFail),this.stencilZPass!==Np&&(ll.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(ll.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(ll.rotation=this.rotation),!0===this.polygonOffset&&(ll.polygonOffset=!0),0!==this.polygonOffsetFactor&&(ll.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(ll.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(ll.linewidth=this.linewidth),void 0!==this.dashSize&&(ll.dashSize=this.dashSize),void 0!==this.gapSize&&(ll.gapSize=this.gapSize),void 0!==this.scale&&(ll.scale=this.scale),!0===this.dithering&&(ll.dithering=!0),this.alphaTest>0&&(ll.alphaTest=this.alphaTest),!0===this.alphaHash&&(ll.alphaHash=!0),!0===this.alphaToCoverage&&(ll.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(ll.premultipliedAlpha=!0),!0===this.forceSinglePass&&(ll.forceSinglePass=!0),!0===this.wireframe&&(ll.wireframe=!0),this.wireframeLinewidth>1&&(ll.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(ll.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(ll.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(ll.flatShading=!0),!1===this.visible&&(ll.visible=!1),!1===this.toneMapped&&(ll.toneMapped=!1),!1===this.fog&&(ll.fog=!1),Object.keys(this.userData).length>0&&(ll.userData=this.userData),Da){const Da=extractFromCache(F.textures),cl=extractFromCache(F.images);Da.length>0&&(ll.textures=Da),cl.length>0&&(ll.images=cl)}return ll}clone(){return(new this.constructor).copy(this)}copy(F){this.name=F.name,this.blending=F.blending,this.side=F.side,this.vertexColors=F.vertexColors,this.opacity=F.opacity,this.transparent=F.transparent,this.blendSrc=F.blendSrc,this.blendDst=F.blendDst,this.blendEquation=F.blendEquation,this.blendSrcAlpha=F.blendSrcAlpha,this.blendDstAlpha=F.blendDstAlpha,this.blendEquationAlpha=F.blendEquationAlpha,this.blendColor.copy(F.blendColor),this.blendAlpha=F.blendAlpha,this.depthFunc=F.depthFunc,this.depthTest=F.depthTest,this.depthWrite=F.depthWrite,this.stencilWriteMask=F.stencilWriteMask,this.stencilFunc=F.stencilFunc,this.stencilRef=F.stencilRef,this.stencilFuncMask=F.stencilFuncMask,this.stencilFail=F.stencilFail,this.stencilZFail=F.stencilZFail,this.stencilZPass=F.stencilZPass,this.stencilWrite=F.stencilWrite;const Da=F.clippingPlanes;let ll=null;if(null!==Da){const F=Da.length;ll=new Array(F);for(let cl=0;cl!==F;++cl)ll[cl]=Da[cl].clone()}return this.clippingPlanes=ll,this.clipIntersection=F.clipIntersection,this.clipShadows=F.clipShadows,this.shadowSide=F.shadowSide,this.colorWrite=F.colorWrite,this.precision=F.precision,this.polygonOffset=F.polygonOffset,this.polygonOffsetFactor=F.polygonOffsetFactor,this.polygonOffsetUnits=F.polygonOffsetUnits,this.dithering=F.dithering,this.alphaTest=F.alphaTest,this.alphaHash=F.alphaHash,this.alphaToCoverage=F.alphaToCoverage,this.premultipliedAlpha=F.premultipliedAlpha,this.forceSinglePass=F.forceSinglePass,this.visible=F.visible,this.toneMapped=F.toneMapped,this.userData=JSON.parse(JSON.stringify(F.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(F){!0===F&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class MeshBasicMaterial extends Material{constructor(F){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Color(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 Euler,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(F)}copy(F){return super.copy(F),this.color.copy(F.color),this.map=F.map,this.lightMap=F.lightMap,this.lightMapIntensity=F.lightMapIntensity,this.aoMap=F.aoMap,this.aoMapIntensity=F.aoMapIntensity,this.specularMap=F.specularMap,this.alphaMap=F.alphaMap,this.envMap=F.envMap,this.envMapRotation.copy(F.envMapRotation),this.combine=F.combine,this.reflectivity=F.reflectivity,this.refractionRatio=F.refractionRatio,this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this.wireframeLinecap=F.wireframeLinecap,this.wireframeLinejoin=F.wireframeLinejoin,this.fog=F.fog,this}}const xf=new Vector3,bf=new Vector2;class BufferAttribute{constructor(F,Da,ll){if(void 0===ll&&(ll=!1),Array.isArray(F))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=F,this.itemSize=Da,this.count=void 0!==F?F.length/Da:0,this.normalized=ll,this.usage=qp,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=gd,this.version=0}onUploadCallback(){}set needsUpdate(F){!0===F&&this.version++}get updateRange(){return warnOnce("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(F){return this.usage=F,this}addUpdateRange(F,Da){this.updateRanges.push({start:F,count:Da})}clearUpdateRanges(){this.updateRanges.length=0}copy(F){return this.name=F.name,this.array=new F.array.constructor(F.array),this.itemSize=F.itemSize,this.count=F.count,this.normalized=F.normalized,this.usage=F.usage,this.gpuType=F.gpuType,this}copyAt(F,Da,ll){F*=this.itemSize,ll*=Da.itemSize;for(let cl=0,hl=this.itemSize;cl<hl;cl++)this.array[F+cl]=Da.array[ll+cl];return this}copyArray(F){return this.array.set(F),this}applyMatrix3(F){if(2===this.itemSize)for(let Da=0,ll=this.count;Da<ll;Da++)bf.fromBufferAttribute(this,Da),bf.applyMatrix3(F),this.setXY(Da,bf.x,bf.y);else if(3===this.itemSize)for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyMatrix3(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}applyMatrix4(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyMatrix4(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}applyNormalMatrix(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.applyNormalMatrix(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}transformDirection(F){for(let Da=0,ll=this.count;Da<ll;Da++)xf.fromBufferAttribute(this,Da),xf.transformDirection(F),this.setXYZ(Da,xf.x,xf.y,xf.z);return this}set(F,Da){return void 0===Da&&(Da=0),this.array.set(F,Da),this}getComponent(F,Da){let ll=this.array[F*this.itemSize+Da];return this.normalized&&(ll=denormalize(ll,this.array)),ll}setComponent(F,Da,ll){return this.normalized&&(ll=normalize(ll,this.array)),this.array[F*this.itemSize+Da]=ll,this}getX(F){let Da=this.array[F*this.itemSize];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setX(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize]=Da,this}getY(F){let Da=this.array[F*this.itemSize+1];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setY(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+1]=Da,this}getZ(F){let Da=this.array[F*this.itemSize+2];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setZ(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+2]=Da,this}getW(F){let Da=this.array[F*this.itemSize+3];return this.normalized&&(Da=denormalize(Da,this.array)),Da}setW(F,Da){return this.normalized&&(Da=normalize(Da,this.array)),this.array[F*this.itemSize+3]=Da,this}setXY(F,Da,ll){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this}setXYZ(F,Da,ll,cl){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array),cl=normalize(cl,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this.array[F+2]=cl,this}setXYZW(F,Da,ll,cl,hl){return F*=this.itemSize,this.normalized&&(Da=normalize(Da,this.array),ll=normalize(ll,this.array),cl=normalize(cl,this.array),hl=normalize(hl,this.array)),this.array[F+0]=Da,this.array[F+1]=ll,this.array[F+2]=cl,this.array[F+3]=hl,this}onUpload(F){return this.onUploadCallback=F,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const F={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(F.name=this.name),this.usage!==qp&&(F.usage=this.usage),F}}class Uint16BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Uint16Array(F),Da,ll)}}class Uint32BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Uint32Array(F),Da,ll)}}class Float32BufferAttribute extends BufferAttribute{constructor(F,Da,ll){super(new Float32Array(F),Da,ll)}}let wf=0;const Ef=new Matrix4,Mf=new Object3D,Sf=new Vector3,kf=new Box3,Tf=new Box3,If=new Vector3;class BufferGeometry extends EventDispatcher{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:wf++}),this.uuid=generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(F){return Array.isArray(F)?this.index=new(arrayNeedsUint32(F)?Uint32BufferAttribute:Uint16BufferAttribute)(F,1):this.index=F,this}getAttribute(F){return this.attributes[F]}setAttribute(F,Da){return this.attributes[F]=Da,this}deleteAttribute(F){return delete this.attributes[F],this}hasAttribute(F){return void 0!==this.attributes[F]}addGroup(F,Da,ll){void 0===ll&&(ll=0),this.groups.push({start:F,count:Da,materialIndex:ll})}clearGroups(){this.groups=[]}setDrawRange(F,Da){this.drawRange.start=F,this.drawRange.count=Da}applyMatrix4(F){const Da=this.attributes.position;void 0!==Da&&(Da.applyMatrix4(F),Da.needsUpdate=!0);const ll=this.attributes.normal;if(void 0!==ll){const Da=(new Matrix3).getNormalMatrix(F);ll.applyNormalMatrix(Da),ll.needsUpdate=!0}const cl=this.attributes.tangent;return void 0!==cl&&(cl.transformDirection(F),cl.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(F){return Ef.makeRotationFromQuaternion(F),this.applyMatrix4(Ef),this}rotateX(F){return Ef.makeRotationX(F),this.applyMatrix4(Ef),this}rotateY(F){return Ef.makeRotationY(F),this.applyMatrix4(Ef),this}rotateZ(F){return Ef.makeRotationZ(F),this.applyMatrix4(Ef),this}translate(F,Da,ll){return Ef.makeTranslation(F,Da,ll),this.applyMatrix4(Ef),this}scale(F,Da,ll){return Ef.makeScale(F,Da,ll),this.applyMatrix4(Ef),this}lookAt(F){return Mf.lookAt(F),Mf.updateMatrix(),this.applyMatrix4(Mf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Sf).negate(),this.translate(Sf.x,Sf.y,Sf.z),this}setFromPoints(F){const Da=[];for(let ll=0,cl=F.length;ll<cl;ll++){const cl=F[ll];Da.push(cl.x,cl.y,cl.z||0)}return this.setAttribute("position",new Float32BufferAttribute(Da,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Box3);const F=this.attributes.position,Da=this.morphAttributes.position;if(F&&F.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new Vector3(-1/0,-1/0,-1/0),new Vector3(1/0,1/0,1/0));if(void 0!==F){if(this.boundingBox.setFromBufferAttribute(F),Da)for(let ll=0,cl=Da.length;ll<cl;ll++){const F=Da[ll];kf.setFromBufferAttribute(F),this.morphTargetsRelative?(If.addVectors(this.boundingBox.min,kf.min),this.boundingBox.expandByPoint(If),If.addVectors(this.boundingBox.max,kf.max),this.boundingBox.expandByPoint(If)):(this.boundingBox.expandByPoint(kf.min),this.boundingBox.expandByPoint(kf.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(){null===this.boundingSphere&&(this.boundingSphere=new Sphere);const F=this.attributes.position,Da=this.morphAttributes.position;if(F&&F.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new Vector3,1/0);if(F){const ll=this.boundingSphere.center;if(kf.setFromBufferAttribute(F),Da)for(let F=0,hl=Da.length;F<hl;F++){const ll=Da[F];Tf.setFromBufferAttribute(ll),this.morphTargetsRelative?(If.addVectors(kf.min,Tf.min),kf.expandByPoint(If),If.addVectors(kf.max,Tf.max),kf.expandByPoint(If)):(kf.expandByPoint(Tf.min),kf.expandByPoint(Tf.max))}kf.getCenter(ll);let cl=0;for(let Da=0,hl=F.count;Da<hl;Da++)If.fromBufferAttribute(F,Da),cl=Math.max(cl,ll.distanceToSquared(If));if(Da)for(let hl=0,dl=Da.length;hl<dl;hl++){const dl=Da[hl],pl=this.morphTargetsRelative;for(let Da=0,hl=dl.count;Da<hl;Da++)If.fromBufferAttribute(dl,Da),pl&&(Sf.fromBufferAttribute(F,Da),If.add(Sf)),cl=Math.max(cl,ll.distanceToSquared(If))}this.boundingSphere.radius=Math.sqrt(cl),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 F=this.index,Da=this.attributes;if(null===F||void 0===Da.position||void 0===Da.normal||void 0===Da.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const ll=Da.position,cl=Da.normal,hl=Da.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new BufferAttribute(new Float32Array(4*ll.count),4));const dl=this.getAttribute("tangent"),pl=[],fl=[];for(let hu=0;hu<ll.count;hu++)pl[hu]=new Vector3,fl[hu]=new Vector3;const Al=new Vector3,bl=new Vector3,kl=new Vector3,Dl=new Vector2,Wl=new Vector2,Ql=new Vector2,wc=new Vector3,Sc=new Vector3;function handleTriangle(F,Da,cl){Al.fromBufferAttribute(ll,F),bl.fromBufferAttribute(ll,Da),kl.fromBufferAttribute(ll,cl),Dl.fromBufferAttribute(hl,F),Wl.fromBufferAttribute(hl,Da),Ql.fromBufferAttribute(hl,cl),bl.sub(Al),kl.sub(Al),Wl.sub(Dl),Ql.sub(Dl);const dl=1/(Wl.x*Ql.y-Ql.x*Wl.y);isFinite(dl)&&(wc.copy(bl).multiplyScalar(Ql.y).addScaledVector(kl,-Wl.y).multiplyScalar(dl),Sc.copy(kl).multiplyScalar(Wl.x).addScaledVector(bl,-Ql.x).multiplyScalar(dl),pl[F].add(wc),pl[Da].add(wc),pl[cl].add(wc),fl[F].add(Sc),fl[Da].add(Sc),fl[cl].add(Sc))}let eu=this.groups;0===eu.length&&(eu=[{start:0,count:F.count}]);for(let hu=0,Lu=eu.length;hu<Lu;++hu){const Da=eu[hu],ll=Da.start;for(let cl=ll,hl=ll+Da.count;cl<hl;cl+=3)handleTriangle(F.getX(cl+0),F.getX(cl+1),F.getX(cl+2))}const iu=new Vector3,su=new Vector3,cu=new Vector3,uu=new Vector3;function handleVertex(F){cu.fromBufferAttribute(cl,F),uu.copy(cu);const Da=pl[F];iu.copy(Da),iu.sub(cu.multiplyScalar(cu.dot(Da))).normalize(),su.crossVectors(uu,Da);const ll=su.dot(fl[F])<0?-1:1;dl.setXYZW(F,iu.x,iu.y,iu.z,ll)}for(let hu=0,Lu=eu.length;hu<Lu;++hu){const Da=eu[hu],ll=Da.start;for(let cl=ll,hl=ll+Da.count;cl<hl;cl+=3)handleVertex(F.getX(cl+0)),handleVertex(F.getX(cl+1)),handleVertex(F.getX(cl+2))}}computeVertexNormals(){const F=this.index,Da=this.getAttribute("position");if(void 0!==Da){let ll=this.getAttribute("normal");if(void 0===ll)ll=new BufferAttribute(new Float32Array(3*Da.count),3),this.setAttribute("normal",ll);else for(let F=0,Da=ll.count;F<Da;F++)ll.setXYZ(F,0,0,0);const cl=new Vector3,hl=new Vector3,dl=new Vector3,pl=new Vector3,fl=new Vector3,Al=new Vector3,bl=new Vector3,kl=new Vector3;if(F)for(let Dl=0,Wl=F.count;Dl<Wl;Dl+=3){const Wl=F.getX(Dl+0),Ql=F.getX(Dl+1),wc=F.getX(Dl+2);cl.fromBufferAttribute(Da,Wl),hl.fromBufferAttribute(Da,Ql),dl.fromBufferAttribute(Da,wc),bl.subVectors(dl,hl),kl.subVectors(cl,hl),bl.cross(kl),pl.fromBufferAttribute(ll,Wl),fl.fromBufferAttribute(ll,Ql),Al.fromBufferAttribute(ll,wc),pl.add(bl),fl.add(bl),Al.add(bl),ll.setXYZ(Wl,pl.x,pl.y,pl.z),ll.setXYZ(Ql,fl.x,fl.y,fl.z),ll.setXYZ(wc,Al.x,Al.y,Al.z)}else for(let F=0,Dl=Da.count;F<Dl;F+=3)cl.fromBufferAttribute(Da,F+0),hl.fromBufferAttribute(Da,F+1),dl.fromBufferAttribute(Da,F+2),bl.subVectors(dl,hl),kl.subVectors(cl,hl),bl.cross(kl),ll.setXYZ(F+0,bl.x,bl.y,bl.z),ll.setXYZ(F+1,bl.x,bl.y,bl.z),ll.setXYZ(F+2,bl.x,bl.y,bl.z);this.normalizeNormals(),ll.needsUpdate=!0}}normalizeNormals(){const F=this.attributes.normal;for(let Da=0,ll=F.count;Da<ll;Da++)If.fromBufferAttribute(F,Da),If.normalize(),F.setXYZ(Da,If.x,If.y,If.z)}toNonIndexed(){function convertBufferAttribute(F,Da){const ll=F.array,cl=F.itemSize,hl=F.normalized,dl=new ll.constructor(Da.length*cl);let pl=0,fl=0;for(let Al=0,bl=Da.length;Al<bl;Al++){pl=F.isInterleavedBufferAttribute?Da[Al]*F.data.stride+F.offset:Da[Al]*cl;for(let F=0;F<cl;F++)dl[fl++]=ll[pl++]}return new BufferAttribute(dl,cl,hl)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const F=new BufferGeometry,Da=this.index.array,ll=this.attributes;for(const dl in ll){const cl=convertBufferAttribute(ll[dl],Da);F.setAttribute(dl,cl)}const cl=this.morphAttributes;for(const dl in cl){const ll=[],hl=cl[dl];for(let F=0,cl=hl.length;F<cl;F++){const cl=convertBufferAttribute(hl[F],Da);ll.push(cl)}F.morphAttributes[dl]=ll}F.morphTargetsRelative=this.morphTargetsRelative;const hl=this.groups;for(let dl=0,pl=hl.length;dl<pl;dl++){const Da=hl[dl];F.addGroup(Da.start,Da.count,Da.materialIndex)}return F}toJSON(){const F={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(F.uuid=this.uuid,F.type=this.type,""!==this.name&&(F.name=this.name),Object.keys(this.userData).length>0&&(F.userData=this.userData),void 0!==this.parameters){const Da=this.parameters;for(const ll in Da)void 0!==Da[ll]&&(F[ll]=Da[ll]);return F}F.data={attributes:{}};const Da=this.index;null!==Da&&(F.data.index={type:Da.array.constructor.name,array:Array.prototype.slice.call(Da.array)});const ll=this.attributes;for(const fl in ll){const Da=ll[fl];F.data.attributes[fl]=Da.toJSON(F.data)}const cl={};let hl=!1;for(const fl in this.morphAttributes){const Da=this.morphAttributes[fl],ll=[];for(let cl=0,hl=Da.length;cl<hl;cl++){const hl=Da[cl];ll.push(hl.toJSON(F.data))}ll.length>0&&(cl[fl]=ll,hl=!0)}hl&&(F.data.morphAttributes=cl,F.data.morphTargetsRelative=this.morphTargetsRelative);const dl=this.groups;dl.length>0&&(F.data.groups=JSON.parse(JSON.stringify(dl)));const pl=this.boundingSphere;return null!==pl&&(F.data.boundingSphere={center:pl.center.toArray(),radius:pl.radius}),F}clone(){return(new this.constructor).copy(this)}copy(F){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const Da={};this.name=F.name;const ll=F.index;null!==ll&&this.setIndex(ll.clone(Da));const cl=F.attributes;for(const Al in cl){const F=cl[Al];this.setAttribute(Al,F.clone(Da))}const hl=F.morphAttributes;for(const Al in hl){const F=[],ll=hl[Al];for(let cl=0,hl=ll.length;cl<hl;cl++)F.push(ll[cl].clone(Da));this.morphAttributes[Al]=F}this.morphTargetsRelative=F.morphTargetsRelative;const dl=F.groups;for(let Al=0,bl=dl.length;Al<bl;Al++){const F=dl[Al];this.addGroup(F.start,F.count,F.materialIndex)}const pl=F.boundingBox;null!==pl&&(this.boundingBox=pl.clone());const fl=F.boundingSphere;return null!==fl&&(this.boundingSphere=fl.clone()),this.drawRange.start=F.drawRange.start,this.drawRange.count=F.drawRange.count,this.userData=F.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Cf=new Matrix4,Lf=new Ray,zf=new Sphere,Pf=new Vector3,Df=new Vector3,Rf=new Vector3,Nf=new Vector3,Uf=new Vector3,Bf=new Vector3,Of=new Vector2,Ff=new Vector2,jf=new Vector2,Vf=new Vector3,Gf=new Vector3,Hf=new Vector3,qf=new Vector3,Zf=new Vector3;class Mesh extends Object3D{constructor(F,Da){void 0===F&&(F=new BufferGeometry),void 0===Da&&(Da=new MeshBasicMaterial),super(),this.isMesh=!0,this.type="Mesh",this.geometry=F,this.material=Da,this.updateMorphTargets()}copy(F,Da){return super.copy(F,Da),void 0!==F.morphTargetInfluences&&(this.morphTargetInfluences=F.morphTargetInfluences.slice()),void 0!==F.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},F.morphTargetDictionary)),this.material=Array.isArray(F.material)?F.material.slice():F.material,this.geometry=F.geometry,this}updateMorphTargets(){const F=this.geometry.morphAttributes,Da=Object.keys(F);if(Da.length>0){const ll=F[Da[0]];if(void 0!==ll){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let F=0,Da=ll.length;F<Da;F++){const Da=ll[F].name||String(F);this.morphTargetInfluences.push(0),this.morphTargetDictionary[Da]=F}}}}getVertexPosition(F,Da){const ll=this.geometry,cl=ll.attributes.position,hl=ll.morphAttributes.position,dl=ll.morphTargetsRelative;Da.fromBufferAttribute(cl,F);const pl=this.morphTargetInfluences;if(hl&&pl){Bf.set(0,0,0);for(let ll=0,cl=hl.length;ll<cl;ll++){const cl=pl[ll],fl=hl[ll];0!==cl&&(Uf.fromBufferAttribute(fl,F),dl?Bf.addScaledVector(Uf,cl):Bf.addScaledVector(Uf.sub(Da),cl))}Da.add(Bf)}return Da}raycast(F,Da){const ll=this.geometry,cl=this.material,hl=this.matrixWorld;if(void 0!==cl){if(null===ll.boundingSphere&&ll.computeBoundingSphere(),zf.copy(ll.boundingSphere),zf.applyMatrix4(hl),Lf.copy(F.ray).recast(F.near),!1===zf.containsPoint(Lf.origin)){if(null===Lf.intersectSphere(zf,Pf))return;if(Lf.origin.distanceToSquared(Pf)>(F.far-F.near)**2)return}Cf.copy(hl).invert(),Lf.copy(F.ray).applyMatrix4(Cf),null!==ll.boundingBox&&!1===Lf.intersectsBox(ll.boundingBox)||this._computeIntersections(F,Da,Lf)}}_computeIntersections(F,Da,ll){let cl;const hl=this.geometry,dl=this.material,pl=hl.index,fl=hl.attributes.position,Al=hl.attributes.uv,bl=hl.attributes.uv1,kl=hl.attributes.normal,Dl=hl.groups,Wl=hl.drawRange;if(null!==pl)if(Array.isArray(dl))for(let Ql=0,wc=Dl.length;Ql<wc;Ql++){const hl=Dl[Ql],fl=dl[hl.materialIndex];for(let dl=Math.max(hl.start,Wl.start),Dl=Math.min(pl.count,Math.min(hl.start+hl.count,Wl.start+Wl.count));dl<Dl;dl+=3){cl=checkGeometryIntersection(this,fl,F,ll,Al,bl,kl,pl.getX(dl),pl.getX(dl+1),pl.getX(dl+2)),cl&&(cl.faceIndex=Math.floor(dl/3),cl.face.materialIndex=hl.materialIndex,Da.push(cl))}}else{for(let hl=Math.max(0,Wl.start),fl=Math.min(pl.count,Wl.start+Wl.count);hl<fl;hl+=3){cl=checkGeometryIntersection(this,dl,F,ll,Al,bl,kl,pl.getX(hl),pl.getX(hl+1),pl.getX(hl+2)),cl&&(cl.faceIndex=Math.floor(hl/3),Da.push(cl))}}else if(void 0!==fl)if(Array.isArray(dl))for(let Ql=0,wc=Dl.length;Ql<wc;Ql++){const hl=Dl[Ql],pl=dl[hl.materialIndex];for(let dl=Math.max(hl.start,Wl.start),Dl=Math.min(fl.count,Math.min(hl.start+hl.count,Wl.start+Wl.count));dl<Dl;dl+=3){cl=checkGeometryIntersection(this,pl,F,ll,Al,bl,kl,dl,dl+1,dl+2),cl&&(cl.faceIndex=Math.floor(dl/3),cl.face.materialIndex=hl.materialIndex,Da.push(cl))}}else{for(let hl=Math.max(0,Wl.start),pl=Math.min(fl.count,Wl.start+Wl.count);hl<pl;hl+=3){cl=checkGeometryIntersection(this,dl,F,ll,Al,bl,kl,hl,hl+1,hl+2),cl&&(cl.faceIndex=Math.floor(hl/3),Da.push(cl))}}}}function checkGeometryIntersection(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){F.getVertexPosition(fl,Df),F.getVertexPosition(Al,Rf),F.getVertexPosition(bl,Nf);const kl=function(F,Da,ll,cl,hl,dl,pl,fl){let Al;if(Al=1===Da.side?cl.intersectTriangle(pl,dl,hl,!0,fl):cl.intersectTriangle(hl,dl,pl,0===Da.side,fl),null===Al)return null;Zf.copy(fl),Zf.applyMatrix4(F.matrixWorld);const bl=ll.ray.origin.distanceTo(Zf);return bl<ll.near||bl>ll.far?null:{distance:bl,point:Zf.clone(),object:F}}(F,Da,ll,cl,Df,Rf,Nf,qf);if(kl){hl&&(Of.fromBufferAttribute(hl,fl),Ff.fromBufferAttribute(hl,Al),jf.fromBufferAttribute(hl,bl),kl.uv=Triangle.getInterpolation(qf,Df,Rf,Nf,Of,Ff,jf,new Vector2)),dl&&(Of.fromBufferAttribute(dl,fl),Ff.fromBufferAttribute(dl,Al),jf.fromBufferAttribute(dl,bl),kl.uv1=Triangle.getInterpolation(qf,Df,Rf,Nf,Of,Ff,jf,new Vector2)),pl&&(Vf.fromBufferAttribute(pl,fl),Gf.fromBufferAttribute(pl,Al),Hf.fromBufferAttribute(pl,bl),kl.normal=Triangle.getInterpolation(qf,Df,Rf,Nf,Vf,Gf,Hf,new Vector3),kl.normal.dot(cl.direction)>0&&kl.normal.multiplyScalar(-1));const F={a:fl,b:Al,c:bl,normal:new Vector3,materialIndex:0};Triangle.getNormal(Df,Rf,Nf,F.normal),kl.face=F}return kl}class BoxGeometry extends BufferGeometry{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),void 0===hl&&(hl=1),void 0===dl&&(dl=1),super(),this.type="BoxGeometry",this.parameters={width:F,height:Da,depth:ll,widthSegments:cl,heightSegments:hl,depthSegments:dl};const pl=this;cl=Math.floor(cl),hl=Math.floor(hl),dl=Math.floor(dl);const fl=[],Al=[],bl=[],kl=[];let Dl=0,Wl=0;function buildPlane(F,Da,ll,cl,hl,dl,Ql,wc,Sc,eu,iu){const su=dl/Sc,cu=Ql/eu,uu=dl/2,hu=Ql/2,Lu=wc/2,zu=Sc+1,Du=eu+1;let Nu=0,qu=0;const ih=new Vector3;for(let pl=0;pl<Du;pl++){const dl=pl*cu-hu;for(let fl=0;fl<zu;fl++){const Dl=fl*su-uu;ih[F]=Dl*cl,ih[Da]=dl*hl,ih[ll]=Lu,Al.push(ih.x,ih.y,ih.z),ih[F]=0,ih[Da]=0,ih[ll]=wc>0?1:-1,bl.push(ih.x,ih.y,ih.z),kl.push(fl/Sc),kl.push(1-pl/eu),Nu+=1}}for(let pl=0;pl<eu;pl++)for(let F=0;F<Sc;F++){const Da=Dl+F+zu*pl,ll=Dl+F+zu*(pl+1),cl=Dl+(F+1)+zu*(pl+1),hl=Dl+(F+1)+zu*pl;fl.push(Da,ll,hl),fl.push(ll,cl,hl),qu+=6}pl.addGroup(Wl,qu,iu),Wl+=qu,Dl+=Nu}buildPlane("z","y","x",-1,-1,ll,Da,F,dl,hl,0),buildPlane("z","y","x",1,-1,ll,Da,-F,dl,hl,1),buildPlane("x","z","y",1,1,F,ll,Da,cl,dl,2),buildPlane("x","z","y",1,-1,F,ll,-Da,cl,dl,3),buildPlane("x","y","z",1,-1,F,Da,ll,cl,hl,4),buildPlane("x","y","z",-1,-1,F,Da,-ll,cl,hl,5),this.setIndex(fl),this.setAttribute("position",new Float32BufferAttribute(Al,3)),this.setAttribute("normal",new Float32BufferAttribute(bl,3)),this.setAttribute("uv",new Float32BufferAttribute(kl,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new BoxGeometry(F.width,F.height,F.depth,F.widthSegments,F.heightSegments,F.depthSegments)}}function cloneUniforms(F){const Da={};for(const ll in F){Da[ll]={};for(const cl in F[ll]){const hl=F[ll][cl];hl&&(hl.isColor||hl.isMatrix3||hl.isMatrix4||hl.isVector2||hl.isVector3||hl.isVector4||hl.isTexture||hl.isQuaternion)?hl.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),Da[ll][cl]=null):Da[ll][cl]=hl.clone():Array.isArray(hl)?Da[ll][cl]=hl.slice():Da[ll][cl]=hl}}return Da}function mergeUniforms(F){const Da={};for(let ll=0;ll<F.length;ll++){const cl=cloneUniforms(F[ll]);for(const F in cl)Da[F]=cl[F]}return Da}function getUnlitUniformColorSpace(F){const Da=F.getRenderTarget();return null===Da?F.outputColorSpace:!0===Da.isXRRenderTarget?Da.texture.colorSpace:sm.workingColorSpace}const Wf={clone:cloneUniforms,merge:mergeUniforms};class ShaderMaterial extends Material{constructor(F){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",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,void 0!==F&&this.setValues(F)}copy(F){return super.copy(F),this.fragmentShader=F.fragmentShader,this.vertexShader=F.vertexShader,this.uniforms=cloneUniforms(F.uniforms),this.uniformsGroups=function(F){const Da=[];for(let ll=0;ll<F.length;ll++)Da.push(F[ll].clone());return Da}(F.uniformsGroups),this.defines=Object.assign({},F.defines),this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this.fog=F.fog,this.lights=F.lights,this.clipping=F.clipping,this.extensions=Object.assign({},F.extensions),this.glslVersion=F.glslVersion,this}toJSON(F){const Da=super.toJSON(F);Da.glslVersion=this.glslVersion,Da.uniforms={};for(const cl in this.uniforms){const ll=this.uniforms[cl].value;ll&&ll.isTexture?Da.uniforms[cl]={type:"t",value:ll.toJSON(F).uuid}:ll&&ll.isColor?Da.uniforms[cl]={type:"c",value:ll.getHex()}:ll&&ll.isVector2?Da.uniforms[cl]={type:"v2",value:ll.toArray()}:ll&&ll.isVector3?Da.uniforms[cl]={type:"v3",value:ll.toArray()}:ll&&ll.isVector4?Da.uniforms[cl]={type:"v4",value:ll.toArray()}:ll&&ll.isMatrix3?Da.uniforms[cl]={type:"m3",value:ll.toArray()}:ll&&ll.isMatrix4?Da.uniforms[cl]={type:"m4",value:ll.toArray()}:Da.uniforms[cl]={value:ll}}Object.keys(this.defines).length>0&&(Da.defines=this.defines),Da.vertexShader=this.vertexShader,Da.fragmentShader=this.fragmentShader,Da.lights=this.lights,Da.clipping=this.clipping;const ll={};for(const cl in this.extensions)!0===this.extensions[cl]&&(ll[cl]=!0);return Object.keys(ll).length>0&&(Da.extensions=ll),Da}}class Camera extends Object3D{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=Wp}copy(F,Da){return super.copy(F,Da),this.matrixWorldInverse.copy(F.matrixWorldInverse),this.projectionMatrix.copy(F.projectionMatrix),this.projectionMatrixInverse.copy(F.projectionMatrixInverse),this.coordinateSystem=F.coordinateSystem,this}getWorldDirection(F){return super.getWorldDirection(F).negate()}updateMatrixWorld(F){super.updateMatrixWorld(F),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(F,Da){super.updateWorldMatrix(F,Da),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const Kf=new Vector3,Qf=new Vector2,Xf=new Vector2;class PerspectiveCamera extends Camera{constructor(F,Da,ll,cl){void 0===F&&(F=50),void 0===Da&&(Da=1),void 0===ll&&(ll=.1),void 0===cl&&(cl=2e3),super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=F,this.zoom=1,this.near=ll,this.far=cl,this.focus=10,this.aspect=Da,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(F,Da){return super.copy(F,Da),this.fov=F.fov,this.zoom=F.zoom,this.near=F.near,this.far=F.far,this.focus=F.focus,this.aspect=F.aspect,this.view=null===F.view?null:Object.assign({},F.view),this.filmGauge=F.filmGauge,this.filmOffset=F.filmOffset,this}setFocalLength(F){const Da=.5*this.getFilmHeight()/F;this.fov=2*Jp*Math.atan(Da),this.updateProjectionMatrix()}getFocalLength(){const F=Math.tan(.5*Yp*this.fov);return.5*this.getFilmHeight()/F}getEffectiveFOV(){return 2*Jp*Math.atan(Math.tan(.5*Yp*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(F,Da,ll){Kf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),Da.set(Kf.x,Kf.y).multiplyScalar(-F/Kf.z),Kf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),ll.set(Kf.x,Kf.y).multiplyScalar(-F/Kf.z)}getViewSize(F,Da){return this.getViewBounds(F,Qf,Xf),Da.subVectors(Xf,Qf)}setViewOffset(F,Da,ll,cl,hl,dl){this.aspect=F/Da,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=F,this.view.fullHeight=Da,this.view.offsetX=ll,this.view.offsetY=cl,this.view.width=hl,this.view.height=dl,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const F=this.near;let Da=F*Math.tan(.5*Yp*this.fov)/this.zoom,ll=2*Da,cl=this.aspect*ll,hl=-.5*cl;const dl=this.view;if(null!==this.view&&this.view.enabled){const F=dl.fullWidth,pl=dl.fullHeight;hl+=dl.offsetX*cl/F,Da-=dl.offsetY*ll/pl,cl*=dl.width/F,ll*=dl.height/pl}const pl=this.filmOffset;0!==pl&&(hl+=F*pl/this.getFilmWidth()),this.projectionMatrix.makePerspective(hl,hl+cl,Da,Da-ll,F,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(F){const Da=super.toJSON(F);return Da.object.fov=this.fov,Da.object.zoom=this.zoom,Da.object.near=this.near,Da.object.far=this.far,Da.object.focus=this.focus,Da.object.aspect=this.aspect,null!==this.view&&(Da.object.view=Object.assign({},this.view)),Da.object.filmGauge=this.filmGauge,Da.object.filmOffset=this.filmOffset,Da}}const Yf=-90;class CubeCamera extends Object3D{constructor(F,Da,ll){super(),this.type="CubeCamera",this.renderTarget=ll,this.coordinateSystem=null,this.activeMipmapLevel=0;const cl=new PerspectiveCamera(Yf,1,F,Da);cl.layers=this.layers,this.add(cl);const hl=new PerspectiveCamera(Yf,1,F,Da);hl.layers=this.layers,this.add(hl);const dl=new PerspectiveCamera(Yf,1,F,Da);dl.layers=this.layers,this.add(dl);const pl=new PerspectiveCamera(Yf,1,F,Da);pl.layers=this.layers,this.add(pl);const fl=new PerspectiveCamera(Yf,1,F,Da);fl.layers=this.layers,this.add(fl);const Al=new PerspectiveCamera(Yf,1,F,Da);Al.layers=this.layers,this.add(Al)}updateCoordinateSystem(){const F=this.coordinateSystem,Da=this.children.concat(),[ll,cl,hl,dl,pl,fl]=Da;for(const Al of Da)this.remove(Al);if(F===Wp)ll.up.set(0,1,0),ll.lookAt(1,0,0),cl.up.set(0,1,0),cl.lookAt(-1,0,0),hl.up.set(0,0,-1),hl.lookAt(0,1,0),dl.up.set(0,0,1),dl.lookAt(0,-1,0),pl.up.set(0,1,0),pl.lookAt(0,0,1),fl.up.set(0,1,0),fl.lookAt(0,0,-1);else{if(F!==Kp)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+F);ll.up.set(0,-1,0),ll.lookAt(-1,0,0),cl.up.set(0,-1,0),cl.lookAt(1,0,0),hl.up.set(0,0,1),hl.lookAt(0,1,0),dl.up.set(0,0,-1),dl.lookAt(0,-1,0),pl.up.set(0,-1,0),pl.lookAt(0,0,1),fl.up.set(0,-1,0),fl.lookAt(0,0,-1)}for(const Al of Da)this.add(Al),Al.updateMatrixWorld()}update(F,Da){null===this.parent&&this.updateMatrixWorld();const{renderTarget:ll,activeMipmapLevel:cl}=this;this.coordinateSystem!==F.coordinateSystem&&(this.coordinateSystem=F.coordinateSystem,this.updateCoordinateSystem());const[hl,dl,pl,fl,Al,bl]=this.children,kl=F.getRenderTarget(),Dl=F.getActiveCubeFace(),Wl=F.getActiveMipmapLevel(),Ql=F.xr.enabled;F.xr.enabled=!1;const wc=ll.texture.generateMipmaps;ll.texture.generateMipmaps=!1,F.setRenderTarget(ll,0,cl),F.render(Da,hl),F.setRenderTarget(ll,1,cl),F.render(Da,dl),F.setRenderTarget(ll,2,cl),F.render(Da,pl),F.setRenderTarget(ll,3,cl),F.render(Da,fl),F.setRenderTarget(ll,4,cl),F.render(Da,Al),ll.texture.generateMipmaps=wc,F.setRenderTarget(ll,5,cl),F.render(Da,bl),F.setRenderTarget(kl,Dl,Wl),F.xr.enabled=Ql,ll.texture.needsPMREMUpdate=!0}}class CubeTexture extends Texture{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){super(F=void 0!==F?F:[],Da=void 0!==Da?Da:Nu,ll,cl,hl,dl,pl,fl,Al,bl),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(F){this.image=F}}class WebGLCubeRenderTarget extends WebGLRenderTarget{constructor(F,Da){void 0===F&&(F=1),void 0===Da&&(Da={}),super(F,F,Da),this.isWebGLCubeRenderTarget=!0;const ll={width:F,height:F,depth:1},cl=[ll,ll,ll,ll,ll,ll];this.texture=new CubeTexture(cl,Da.mapping,Da.wrapS,Da.wrapT,Da.magFilter,Da.minFilter,Da.format,Da.type,Da.anisotropy,Da.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==Da.generateMipmaps&&Da.generateMipmaps,this.texture.minFilter=void 0!==Da.minFilter?Da.minFilter:od}fromEquirectangularTexture(F,Da){this.texture.type=Da.type,this.texture.colorSpace=Da.colorSpace,this.texture.generateMipmaps=Da.generateMipmaps,this.texture.minFilter=Da.minFilter,this.texture.magFilter=Da.magFilter;const ll={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},cl=new BoxGeometry(5,5,5),hl=new ShaderMaterial({name:"CubemapFromEquirect",uniforms:cloneUniforms(ll.uniforms),vertexShader:ll.vertexShader,fragmentShader:ll.fragmentShader,side:1,blending:0});hl.uniforms.tEquirect.value=Da;const dl=new Mesh(cl,hl),pl=Da.minFilter;Da.minFilter===cd&&(Da.minFilter=od);return new CubeCamera(1,10,this).update(F,dl),Da.minFilter=pl,dl.geometry.dispose(),dl.material.dispose(),this}clear(F,Da,ll,cl){const hl=F.getRenderTarget();for(let dl=0;dl<6;dl++)F.setRenderTarget(this,dl),F.clear(Da,ll,cl);F.setRenderTarget(hl)}}const Jf=new Vector3,$f=new Vector3,eg=new Matrix3;class Plane{constructor(F,Da){void 0===F&&(F=new Vector3(1,0,0)),void 0===Da&&(Da=0),this.isPlane=!0,this.normal=F,this.constant=Da}set(F,Da){return this.normal.copy(F),this.constant=Da,this}setComponents(F,Da,ll,cl){return this.normal.set(F,Da,ll),this.constant=cl,this}setFromNormalAndCoplanarPoint(F,Da){return this.normal.copy(F),this.constant=-Da.dot(this.normal),this}setFromCoplanarPoints(F,Da,ll){const cl=Jf.subVectors(ll,Da).cross($f.subVectors(F,Da)).normalize();return this.setFromNormalAndCoplanarPoint(cl,F),this}copy(F){return this.normal.copy(F.normal),this.constant=F.constant,this}normalize(){const F=1/this.normal.length();return this.normal.multiplyScalar(F),this.constant*=F,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(F){return this.normal.dot(F)+this.constant}distanceToSphere(F){return this.distanceToPoint(F.center)-F.radius}projectPoint(F,Da){return Da.copy(F).addScaledVector(this.normal,-this.distanceToPoint(F))}intersectLine(F,Da){const ll=F.delta(Jf),cl=this.normal.dot(ll);if(0===cl)return 0===this.distanceToPoint(F.start)?Da.copy(F.start):null;const hl=-(F.start.dot(this.normal)+this.constant)/cl;return hl<0||hl>1?null:Da.copy(F.start).addScaledVector(ll,hl)}intersectsLine(F){const Da=this.distanceToPoint(F.start),ll=this.distanceToPoint(F.end);return Da<0&&ll>0||ll<0&&Da>0}intersectsBox(F){return F.intersectsPlane(this)}intersectsSphere(F){return F.intersectsPlane(this)}coplanarPoint(F){return F.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(F,Da){const ll=Da||eg.getNormalMatrix(F),cl=this.coplanarPoint(Jf).applyMatrix4(F),hl=this.normal.applyMatrix3(ll).normalize();return this.constant=-cl.dot(hl),this}translate(F){return this.constant-=F.dot(this.normal),this}equals(F){return F.normal.equals(this.normal)&&F.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const tg=new Sphere,ig=new Vector3;class Frustum{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=new Plane),void 0===Da&&(Da=new Plane),void 0===ll&&(ll=new Plane),void 0===cl&&(cl=new Plane),void 0===hl&&(hl=new Plane),void 0===dl&&(dl=new Plane),this.planes=[F,Da,ll,cl,hl,dl]}set(F,Da,ll,cl,hl,dl){const pl=this.planes;return pl[0].copy(F),pl[1].copy(Da),pl[2].copy(ll),pl[3].copy(cl),pl[4].copy(hl),pl[5].copy(dl),this}copy(F){const Da=this.planes;for(let ll=0;ll<6;ll++)Da[ll].copy(F.planes[ll]);return this}setFromProjectionMatrix(F,Da){void 0===Da&&(Da=Wp);const ll=this.planes,cl=F.elements,hl=cl[0],dl=cl[1],pl=cl[2],fl=cl[3],Al=cl[4],bl=cl[5],kl=cl[6],Dl=cl[7],Wl=cl[8],Ql=cl[9],wc=cl[10],Sc=cl[11],eu=cl[12],iu=cl[13],su=cl[14],cu=cl[15];if(ll[0].setComponents(fl-hl,Dl-Al,Sc-Wl,cu-eu).normalize(),ll[1].setComponents(fl+hl,Dl+Al,Sc+Wl,cu+eu).normalize(),ll[2].setComponents(fl+dl,Dl+bl,Sc+Ql,cu+iu).normalize(),ll[3].setComponents(fl-dl,Dl-bl,Sc-Ql,cu-iu).normalize(),ll[4].setComponents(fl-pl,Dl-kl,Sc-wc,cu-su).normalize(),Da===Wp)ll[5].setComponents(fl+pl,Dl+kl,Sc+wc,cu+su).normalize();else{if(Da!==Kp)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+Da);ll[5].setComponents(pl,kl,wc,su).normalize()}return this}intersectsObject(F){if(void 0!==F.boundingSphere)null===F.boundingSphere&&F.computeBoundingSphere(),tg.copy(F.boundingSphere).applyMatrix4(F.matrixWorld);else{const Da=F.geometry;null===Da.boundingSphere&&Da.computeBoundingSphere(),tg.copy(Da.boundingSphere).applyMatrix4(F.matrixWorld)}return this.intersectsSphere(tg)}intersectsSprite(F){return tg.center.set(0,0,0),tg.radius=.7071067811865476,tg.applyMatrix4(F.matrixWorld),this.intersectsSphere(tg)}intersectsSphere(F){const Da=this.planes,ll=F.center,cl=-F.radius;for(let hl=0;hl<6;hl++){if(Da[hl].distanceToPoint(ll)<cl)return!1}return!0}intersectsBox(F){const Da=this.planes;for(let ll=0;ll<6;ll++){const cl=Da[ll];if(ig.x=cl.normal.x>0?F.max.x:F.min.x,ig.y=cl.normal.y>0?F.max.y:F.min.y,ig.z=cl.normal.z>0?F.max.z:F.min.z,cl.distanceToPoint(ig)<0)return!1}return!0}containsPoint(F){const Da=this.planes;for(let ll=0;ll<6;ll++)if(Da[ll].distanceToPoint(F)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function WebGLAnimation(){let F=null,Da=!1,ll=null,cl=null;function onAnimationFrame(Da,hl){ll(Da,hl),cl=F.requestAnimationFrame(onAnimationFrame)}return{start:function(){!0!==Da&&null!==ll&&(cl=F.requestAnimationFrame(onAnimationFrame),Da=!0)},stop:function(){F.cancelAnimationFrame(cl),Da=!1},setAnimationLoop:function(F){ll=F},setContext:function(Da){F=Da}}}function WebGLAttributes(F){const Da=new WeakMap;return{get:function(F){return F.isInterleavedBufferAttribute&&(F=F.data),Da.get(F)},remove:function(ll){ll.isInterleavedBufferAttribute&&(ll=ll.data);const cl=Da.get(ll);cl&&(F.deleteBuffer(cl.buffer),Da.delete(ll))},update:function(ll,cl){if(ll.isInterleavedBufferAttribute&&(ll=ll.data),ll.isGLBufferAttribute){const F=Da.get(ll);return void((!F||F.version<ll.version)&&Da.set(ll,{buffer:ll.buffer,type:ll.type,bytesPerElement:ll.elementSize,version:ll.version}))}const hl=Da.get(ll);if(void 0===hl)Da.set(ll,function(Da,ll){const cl=Da.array,hl=Da.usage,dl=cl.byteLength,pl=F.createBuffer();let fl;if(F.bindBuffer(ll,pl),F.bufferData(ll,cl,hl),Da.onUploadCallback(),cl instanceof Float32Array)fl=F.FLOAT;else if(cl instanceof Uint16Array)fl=Da.isFloat16BufferAttribute?F.HALF_FLOAT:F.UNSIGNED_SHORT;else if(cl instanceof Int16Array)fl=F.SHORT;else if(cl instanceof Uint32Array)fl=F.UNSIGNED_INT;else if(cl instanceof Int32Array)fl=F.INT;else if(cl instanceof Int8Array)fl=F.BYTE;else if(cl instanceof Uint8Array)fl=F.UNSIGNED_BYTE;else{if(!(cl instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+cl);fl=F.UNSIGNED_BYTE}return{buffer:pl,type:fl,bytesPerElement:cl.BYTES_PER_ELEMENT,version:Da.version,size:dl}}(ll,cl));else if(hl.version<ll.version){if(hl.size!==ll.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.");!function(Da,ll,cl){const hl=ll.array,dl=ll._updateRange,pl=ll.updateRanges;if(F.bindBuffer(cl,Da),-1===dl.count&&0===pl.length&&F.bufferSubData(cl,0,hl),0!==pl.length){for(let Da=0,ll=pl.length;Da<ll;Da++){const ll=pl[Da];F.bufferSubData(cl,ll.start*hl.BYTES_PER_ELEMENT,hl,ll.start,ll.count)}ll.clearUpdateRanges()}-1!==dl.count&&(F.bufferSubData(cl,dl.offset*hl.BYTES_PER_ELEMENT,hl,dl.offset,dl.count),dl.count=-1),ll.onUploadCallback()}(hl.buffer,ll,cl),hl.version=ll.version}}}}class PlaneGeometry extends BufferGeometry{constructor(F,Da,ll,cl){void 0===F&&(F=1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=1),super(),this.type="PlaneGeometry",this.parameters={width:F,height:Da,widthSegments:ll,heightSegments:cl};const hl=F/2,dl=Da/2,pl=Math.floor(ll),fl=Math.floor(cl),Al=pl+1,bl=fl+1,kl=F/pl,Dl=Da/fl,Wl=[],Ql=[],wc=[],Sc=[];for(let eu=0;eu<bl;eu++){const F=eu*Dl-dl;for(let Da=0;Da<Al;Da++){const ll=Da*kl-hl;Ql.push(ll,-F,0),wc.push(0,0,1),Sc.push(Da/pl),Sc.push(1-eu/fl)}}for(let eu=0;eu<fl;eu++)for(let F=0;F<pl;F++){const Da=F+Al*eu,ll=F+Al*(eu+1),cl=F+1+Al*(eu+1),hl=F+1+Al*eu;Wl.push(Da,ll,hl),Wl.push(ll,cl,hl)}this.setIndex(Wl),this.setAttribute("position",new Float32BufferAttribute(Ql,3)),this.setAttribute("normal",new Float32BufferAttribute(wc,3)),this.setAttribute("uv",new Float32BufferAttribute(Sc,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new PlaneGeometry(F.width,F.height,F.widthSegments,F.heightSegments)}}const ng={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn 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 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( const in vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},rg={common:{diffuse:{value:new Color(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Matrix3}},envmap:{envMap:{value:null},envMapRotation:{value:new Matrix3},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Matrix3}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Matrix3}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Matrix3},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Matrix3},normalScale:{value:new Vector2(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Matrix3},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Matrix3}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Matrix3}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Matrix3}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Color(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 Color(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0},uvTransform:{value:new Matrix3}},sprite:{diffuse:{value:new Color(16777215)},opacity:{value:1},center:{value:new Vector2(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Matrix3},alphaMap:{value:null},alphaMapTransform:{value:new Matrix3},alphaTest:{value:0}}},ag={basic:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.fog]),vertexShader:ng.meshbasic_vert,fragmentShader:ng.meshbasic_frag},lambert:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,rg.lights,{emissive:{value:new Color(0)}}]),vertexShader:ng.meshlambert_vert,fragmentShader:ng.meshlambert_frag},phong:{uniforms:mergeUniforms([rg.common,rg.specularmap,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,rg.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:ng.meshphong_vert,fragmentShader:ng.meshphong_frag},standard:{uniforms:mergeUniforms([rg.common,rg.envmap,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.roughnessmap,rg.metalnessmap,rg.fog,rg.lights,{emissive:{value:new Color(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ng.meshphysical_vert,fragmentShader:ng.meshphysical_frag},toon:{uniforms:mergeUniforms([rg.common,rg.aomap,rg.lightmap,rg.emissivemap,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.gradientmap,rg.fog,rg.lights,{emissive:{value:new Color(0)}}]),vertexShader:ng.meshtoon_vert,fragmentShader:ng.meshtoon_frag},matcap:{uniforms:mergeUniforms([rg.common,rg.bumpmap,rg.normalmap,rg.displacementmap,rg.fog,{matcap:{value:null}}]),vertexShader:ng.meshmatcap_vert,fragmentShader:ng.meshmatcap_frag},points:{uniforms:mergeUniforms([rg.points,rg.fog]),vertexShader:ng.points_vert,fragmentShader:ng.points_frag},dashed:{uniforms:mergeUniforms([rg.common,rg.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ng.linedashed_vert,fragmentShader:ng.linedashed_frag},depth:{uniforms:mergeUniforms([rg.common,rg.displacementmap]),vertexShader:ng.depth_vert,fragmentShader:ng.depth_frag},normal:{uniforms:mergeUniforms([rg.common,rg.bumpmap,rg.normalmap,rg.displacementmap,{opacity:{value:1}}]),vertexShader:ng.meshnormal_vert,fragmentShader:ng.meshnormal_frag},sprite:{uniforms:mergeUniforms([rg.sprite,rg.fog]),vertexShader:ng.sprite_vert,fragmentShader:ng.sprite_frag},background:{uniforms:{uvTransform:{value:new Matrix3},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ng.background_vert,fragmentShader:ng.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Matrix3}},vertexShader:ng.backgroundCube_vert,fragmentShader:ng.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ng.cube_vert,fragmentShader:ng.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ng.equirect_vert,fragmentShader:ng.equirect_frag},distanceRGBA:{uniforms:mergeUniforms([rg.common,rg.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ng.distanceRGBA_vert,fragmentShader:ng.distanceRGBA_frag},shadow:{uniforms:mergeUniforms([rg.lights,rg.fog,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:ng.shadow_vert,fragmentShader:ng.shadow_frag}};ag.physical={uniforms:mergeUniforms([ag.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Matrix3},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Matrix3},clearcoatNormalScale:{value:new Vector2(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Matrix3},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Matrix3},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Matrix3},sheen:{value:0},sheenColor:{value:new Color(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Matrix3},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Matrix3},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Matrix3},transmissionSamplerSize:{value:new Vector2},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Matrix3},attenuationDistance:{value:0},attenuationColor:{value:new Color(0)},specularColor:{value:new Color(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Matrix3},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Matrix3},anisotropyVector:{value:new Vector2},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Matrix3}}]),vertexShader:ng.meshphysical_vert,fragmentShader:ng.meshphysical_frag};const sg={r:0,b:0,g:0},og=new Euler,lg=new Matrix4;function WebGLBackground(F,Da,ll,cl,hl,dl,pl){const fl=new Color(0);let Al,bl,kl=!0===dl?0:1,Dl=null,Wl=0,Ql=null;function getBackground(F){let cl=!0===F.isScene?F.background:null;if(cl&&cl.isTexture){cl=(F.backgroundBlurriness>0?ll:Da).get(cl)}return cl}function setClear(Da,ll){Da.getRGB(sg,getUnlitUniformColorSpace(F)),cl.buffers.color.setClear(sg.r,sg.g,sg.b,ll,pl)}return{getClearColor:function(){return fl},setClearColor:function(F,Da){void 0===Da&&(Da=1),fl.set(F),kl=Da,setClear(fl,kl)},getClearAlpha:function(){return kl},setClearAlpha:function(F){kl=F,setClear(fl,kl)},render:function(Da){let ll=!1;const hl=getBackground(Da);null===hl?setClear(fl,kl):hl&&hl.isColor&&(setClear(hl,1),ll=!0);const dl=F.xr.getEnvironmentBlendMode();"additive"===dl?cl.buffers.color.setClear(0,0,0,1,pl):"alpha-blend"===dl&&cl.buffers.color.setClear(0,0,0,0,pl),(F.autoClear||ll)&&(cl.buffers.depth.setTest(!0),cl.buffers.depth.setMask(!0),cl.buffers.color.setMask(!0),F.clear(F.autoClearColor,F.autoClearDepth,F.autoClearStencil))},addToRenderList:function(Da,ll){const cl=getBackground(ll);cl&&(cl.isCubeTexture||cl.mapping===ed)?(void 0===bl&&(bl=new Mesh(new BoxGeometry(1,1,1),new ShaderMaterial({name:"BackgroundCubeMaterial",uniforms:cloneUniforms(ag.backgroundCube.uniforms),vertexShader:ag.backgroundCube.vertexShader,fragmentShader:ag.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),bl.geometry.deleteAttribute("normal"),bl.geometry.deleteAttribute("uv"),bl.onBeforeRender=function(F,Da,ll){this.matrixWorld.copyPosition(ll.matrixWorld)},Object.defineProperty(bl.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),hl.update(bl)),og.copy(ll.backgroundRotation),og.x*=-1,og.y*=-1,og.z*=-1,cl.isCubeTexture&&!1===cl.isRenderTargetTexture&&(og.y*=-1,og.z*=-1),bl.material.uniforms.envMap.value=cl,bl.material.uniforms.flipEnvMap.value=cl.isCubeTexture&&!1===cl.isRenderTargetTexture?-1:1,bl.material.uniforms.backgroundBlurriness.value=ll.backgroundBlurriness,bl.material.uniforms.backgroundIntensity.value=ll.backgroundIntensity,bl.material.uniforms.backgroundRotation.value.setFromMatrix4(lg.makeRotationFromEuler(og)),bl.material.toneMapped=sm.getTransfer(cl.colorSpace)!==Pp,Dl===cl&&Wl===cl.version&&Ql===F.toneMapping||(bl.material.needsUpdate=!0,Dl=cl,Wl=cl.version,Ql=F.toneMapping),bl.layers.enableAll(),Da.unshift(bl,bl.geometry,bl.material,0,0,null)):cl&&cl.isTexture&&(void 0===Al&&(Al=new Mesh(new PlaneGeometry(2,2),new ShaderMaterial({name:"BackgroundMaterial",uniforms:cloneUniforms(ag.background.uniforms),vertexShader:ag.background.vertexShader,fragmentShader:ag.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),Al.geometry.deleteAttribute("normal"),Object.defineProperty(Al.material,"map",{get:function(){return this.uniforms.t2D.value}}),hl.update(Al)),Al.material.uniforms.t2D.value=cl,Al.material.uniforms.backgroundIntensity.value=ll.backgroundIntensity,Al.material.toneMapped=sm.getTransfer(cl.colorSpace)!==Pp,!0===cl.matrixAutoUpdate&&cl.updateMatrix(),Al.material.uniforms.uvTransform.value.copy(cl.matrix),Dl===cl&&Wl===cl.version&&Ql===F.toneMapping||(Al.material.needsUpdate=!0,Dl=cl,Wl=cl.version,Ql=F.toneMapping),Al.layers.enableAll(),Da.unshift(Al,Al.geometry,Al.material,0,0,null))}}}function WebGLBindingStates(F,Da){const ll=F.getParameter(F.MAX_VERTEX_ATTRIBS),cl={},hl=createBindingState(null);let dl=hl,pl=!1;function bindVertexArrayObject(Da){return F.bindVertexArray(Da)}function deleteVertexArrayObject(Da){return F.deleteVertexArray(Da)}function createBindingState(F){const Da=[],cl=[],hl=[];for(let dl=0;dl<ll;dl++)Da[dl]=0,cl[dl]=0,hl[dl]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:Da,enabledAttributes:cl,attributeDivisors:hl,object:F,attributes:{},index:null}}function initAttributes(){const F=dl.newAttributes;for(let Da=0,ll=F.length;Da<ll;Da++)F[Da]=0}function enableAttribute(F){enableAttributeAndDivisor(F,0)}function enableAttributeAndDivisor(Da,ll){const cl=dl.newAttributes,hl=dl.enabledAttributes,pl=dl.attributeDivisors;cl[Da]=1,0===hl[Da]&&(F.enableVertexAttribArray(Da),hl[Da]=1),pl[Da]!==ll&&(F.vertexAttribDivisor(Da,ll),pl[Da]=ll)}function disableUnusedAttributes(){const Da=dl.newAttributes,ll=dl.enabledAttributes;for(let cl=0,hl=ll.length;cl<hl;cl++)ll[cl]!==Da[cl]&&(F.disableVertexAttribArray(cl),ll[cl]=0)}function vertexAttribPointer(Da,ll,cl,hl,dl,pl,fl){!0===fl?F.vertexAttribIPointer(Da,ll,cl,dl,pl):F.vertexAttribPointer(Da,ll,cl,hl,dl,pl)}function reset(){resetDefaultState(),pl=!0,dl!==hl&&(dl=hl,bindVertexArrayObject(dl.object))}function resetDefaultState(){hl.geometry=null,hl.program=null,hl.wireframe=!1}return{setup:function(ll,hl,fl,Al,bl){let kl=!1;const Dl=function(Da,ll,hl){const dl=!0===hl.wireframe;let pl=cl[Da.id];void 0===pl&&(pl={},cl[Da.id]=pl);let fl=pl[ll.id];void 0===fl&&(fl={},pl[ll.id]=fl);let Al=fl[dl];void 0===Al&&(Al=createBindingState(F.createVertexArray()),fl[dl]=Al);return Al}(Al,fl,hl);dl!==Dl&&(dl=Dl,bindVertexArrayObject(dl.object)),kl=function(F,Da,ll,cl){const hl=dl.attributes,pl=Da.attributes;let fl=0;const Al=ll.getAttributes();for(const dl in Al){if(Al[dl].location>=0){const Da=hl[dl];let ll=pl[dl];if(void 0===ll&&("instanceMatrix"===dl&&F.instanceMatrix&&(ll=F.instanceMatrix),"instanceColor"===dl&&F.instanceColor&&(ll=F.instanceColor)),void 0===Da)return!0;if(Da.attribute!==ll)return!0;if(ll&&Da.data!==ll.data)return!0;fl++}}return dl.attributesNum!==fl||dl.index!==cl}(ll,Al,fl,bl),kl&&function(F,Da,ll,cl){const hl={},pl=Da.attributes;let fl=0;const Al=ll.getAttributes();for(const dl in Al){if(Al[dl].location>=0){let Da=pl[dl];void 0===Da&&("instanceMatrix"===dl&&F.instanceMatrix&&(Da=F.instanceMatrix),"instanceColor"===dl&&F.instanceColor&&(Da=F.instanceColor));const ll={};ll.attribute=Da,Da&&Da.data&&(ll.data=Da.data),hl[dl]=ll,fl++}}dl.attributes=hl,dl.attributesNum=fl,dl.index=cl}(ll,Al,fl,bl),null!==bl&&Da.update(bl,F.ELEMENT_ARRAY_BUFFER),(kl||pl)&&(pl=!1,function(ll,cl,hl,dl){initAttributes();const pl=dl.attributes,fl=hl.getAttributes(),Al=cl.defaultAttributeValues;for(const bl in fl){const cl=fl[bl];if(cl.location>=0){let hl=pl[bl];if(void 0===hl&&("instanceMatrix"===bl&&ll.instanceMatrix&&(hl=ll.instanceMatrix),"instanceColor"===bl&&ll.instanceColor&&(hl=ll.instanceColor)),void 0!==hl){const pl=hl.normalized,fl=hl.itemSize,Al=Da.get(hl);if(void 0===Al)continue;const bl=Al.buffer,kl=Al.type,Dl=Al.bytesPerElement,Wl=kl===F.INT||kl===F.UNSIGNED_INT||hl.gpuType===md;if(hl.isInterleavedBufferAttribute){const Da=hl.data,Al=Da.stride,Ql=hl.offset;if(Da.isInstancedInterleavedBuffer){for(let F=0;F<cl.locationSize;F++)enableAttributeAndDivisor(cl.location+F,Da.meshPerAttribute);!0!==ll.isInstancedMesh&&void 0===dl._maxInstanceCount&&(dl._maxInstanceCount=Da.meshPerAttribute*Da.count)}else for(let F=0;F<cl.locationSize;F++)enableAttribute(cl.location+F);F.bindBuffer(F.ARRAY_BUFFER,bl);for(let F=0;F<cl.locationSize;F++)vertexAttribPointer(cl.location+F,fl/cl.locationSize,kl,pl,Al*Dl,(Ql+fl/cl.locationSize*F)*Dl,Wl)}else{if(hl.isInstancedBufferAttribute){for(let F=0;F<cl.locationSize;F++)enableAttributeAndDivisor(cl.location+F,hl.meshPerAttribute);!0!==ll.isInstancedMesh&&void 0===dl._maxInstanceCount&&(dl._maxInstanceCount=hl.meshPerAttribute*hl.count)}else for(let F=0;F<cl.locationSize;F++)enableAttribute(cl.location+F);F.bindBuffer(F.ARRAY_BUFFER,bl);for(let F=0;F<cl.locationSize;F++)vertexAttribPointer(cl.location+F,fl/cl.locationSize,kl,pl,fl*Dl,fl/cl.locationSize*F*Dl,Wl)}}else if(void 0!==Al){const Da=Al[bl];if(void 0!==Da)switch(Da.length){case 2:F.vertexAttrib2fv(cl.location,Da);break;case 3:F.vertexAttrib3fv(cl.location,Da);break;case 4:F.vertexAttrib4fv(cl.location,Da);break;default:F.vertexAttrib1fv(cl.location,Da)}}}}disableUnusedAttributes()}(ll,hl,fl,Al),null!==bl&&F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,Da.get(bl).buffer))},reset:reset,resetDefaultState:resetDefaultState,dispose:function(){reset();for(const F in cl){const Da=cl[F];for(const F in Da){const ll=Da[F];for(const F in ll)deleteVertexArrayObject(ll[F].object),delete ll[F];delete Da[F]}delete cl[F]}},releaseStatesOfGeometry:function(F){if(void 0===cl[F.id])return;const Da=cl[F.id];for(const ll in Da){const F=Da[ll];for(const Da in F)deleteVertexArrayObject(F[Da].object),delete F[Da];delete Da[ll]}delete cl[F.id]},releaseStatesOfProgram:function(F){for(const Da in cl){const ll=cl[Da];if(void 0===ll[F.id])continue;const hl=ll[F.id];for(const F in hl)deleteVertexArrayObject(hl[F].object),delete hl[F];delete ll[F.id]}},initAttributes:initAttributes,enableAttribute:enableAttribute,disableUnusedAttributes:disableUnusedAttributes}}function WebGLBufferRenderer(F,Da,ll){let cl;function renderInstances(Da,hl,dl){0!==dl&&(F.drawArraysInstanced(cl,Da,hl,dl),ll.update(hl,cl,dl))}this.setMode=function(F){cl=F},this.render=function(Da,hl){F.drawArrays(cl,Da,hl),ll.update(hl,cl,1)},this.renderInstances=renderInstances,this.renderMultiDraw=function(F,hl,dl){if(0===dl)return;Da.get("WEBGL_multi_draw").multiDrawArraysWEBGL(cl,F,0,hl,0,dl);let pl=0;for(let Da=0;Da<dl;Da++)pl+=hl[Da];ll.update(pl,cl,1)},this.renderMultiDrawInstances=function(F,hl,dl,pl){if(0===dl)return;const fl=Da.get("WEBGL_multi_draw");if(null===fl)for(let Da=0;Da<F.length;Da++)renderInstances(F[Da],hl[Da],pl[Da]);else{fl.multiDrawArraysInstancedWEBGL(cl,F,0,hl,0,pl,0,dl);let Da=0;for(let F=0;F<dl;F++)Da+=hl[F];for(let F=0;F<pl.length;F++)ll.update(Da,cl,pl[F])}}}function WebGLCapabilities(F,Da,ll,cl){let hl;function getMaxPrecision(Da){if("highp"===Da){if(F.getShaderPrecisionFormat(F.VERTEX_SHADER,F.HIGH_FLOAT).precision>0&&F.getShaderPrecisionFormat(F.FRAGMENT_SHADER,F.HIGH_FLOAT).precision>0)return"highp";Da="mediump"}return"mediump"===Da&&F.getShaderPrecisionFormat(F.VERTEX_SHADER,F.MEDIUM_FLOAT).precision>0&&F.getShaderPrecisionFormat(F.FRAGMENT_SHADER,F.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let dl=void 0!==ll.precision?ll.precision:"highp";const pl=getMaxPrecision(dl);pl!==dl&&(console.warn("THREE.WebGLRenderer:",dl,"not supported, using",pl,"instead."),dl=pl);const fl=!0===ll.logarithmicDepthBuffer,Al=F.getParameter(F.MAX_TEXTURE_IMAGE_UNITS),bl=F.getParameter(F.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==hl)return hl;if(!0===Da.has("EXT_texture_filter_anisotropic")){const ll=Da.get("EXT_texture_filter_anisotropic");hl=F.getParameter(ll.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else hl=0;return hl},getMaxPrecision:getMaxPrecision,textureFormatReadable:function(Da){return Da===bd||cl.convert(Da)===F.getParameter(F.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(ll){const hl=ll===Ad&&(Da.has("EXT_color_buffer_half_float")||Da.has("EXT_color_buffer_float"));return!(ll!==ud&&cl.convert(ll)!==F.getParameter(F.IMPLEMENTATION_COLOR_READ_TYPE)&&ll!==gd&&!hl)},precision:dl,logarithmicDepthBuffer:fl,maxTextures:Al,maxVertexTextures:bl,maxTextureSize:F.getParameter(F.MAX_TEXTURE_SIZE),maxCubemapSize:F.getParameter(F.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:F.getParameter(F.MAX_VERTEX_ATTRIBS),maxVertexUniforms:F.getParameter(F.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:F.getParameter(F.MAX_VARYING_VECTORS),maxFragmentUniforms:F.getParameter(F.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:bl>0,maxSamples:F.getParameter(F.MAX_SAMPLES)}}function WebGLClipping(F){const Da=this;let ll=null,cl=0,hl=!1,dl=!1;const pl=new Plane,fl=new Matrix3,Al={value:null,needsUpdate:!1};function projectPlanes(F,ll,cl,hl){const dl=null!==F?F.length:0;let bl=null;if(0!==dl){if(bl=Al.value,!0!==hl||null===bl){const Da=cl+4*dl,hl=ll.matrixWorldInverse;fl.getNormalMatrix(hl),(null===bl||bl.length<Da)&&(bl=new Float32Array(Da));for(let ll=0,Al=cl;ll!==dl;++ll,Al+=4)pl.copy(F[ll]).applyMatrix4(hl,fl),pl.normal.toArray(bl,Al),bl[Al+3]=pl.constant}Al.value=bl,Al.needsUpdate=!0}return Da.numPlanes=dl,Da.numIntersection=0,bl}this.uniform=Al,this.numPlanes=0,this.numIntersection=0,this.init=function(F,Da){const ll=0!==F.length||Da||0!==cl||hl;return hl=Da,cl=F.length,ll},this.beginShadows=function(){dl=!0,projectPlanes(null)},this.endShadows=function(){dl=!1},this.setGlobalState=function(F,Da){ll=projectPlanes(F,Da,0)},this.setState=function(pl,fl,bl){const kl=pl.clippingPlanes,Dl=pl.clipIntersection,Wl=pl.clipShadows,Ql=F.get(pl);if(!hl||null===kl||0===kl.length||dl&&!Wl)dl?projectPlanes(null):function(){Al.value!==ll&&(Al.value=ll,Al.needsUpdate=cl>0);Da.numPlanes=cl,Da.numIntersection=0}();else{const F=dl?0:cl,Da=4*F;let hl=Ql.clippingState||null;Al.value=hl,hl=projectPlanes(kl,fl,Da,bl);for(let cl=0;cl!==Da;++cl)hl[cl]=ll[cl];Ql.clippingState=hl,this.numIntersection=Dl?this.numPlanes:0,this.numPlanes+=F}}}function WebGLCubeMaps(F){let Da=new WeakMap;function mapTextureMapping(F,Da){return Da===ih?F.mapping=Nu:Da===gh&&(F.mapping=qu),F}function onTextureDispose(F){const ll=F.target;ll.removeEventListener("dispose",onTextureDispose);const cl=Da.get(ll);void 0!==cl&&(Da.delete(ll),cl.dispose())}return{get:function(ll){if(ll&&ll.isTexture){const cl=ll.mapping;if(cl===ih||cl===gh){if(Da.has(ll)){return mapTextureMapping(Da.get(ll).texture,ll.mapping)}{const cl=ll.image;if(cl&&cl.height>0){const hl=new WebGLCubeRenderTarget(cl.height);return hl.fromEquirectangularTexture(F,ll),Da.set(ll,hl),ll.addEventListener("dispose",onTextureDispose),mapTextureMapping(hl.texture,ll.mapping)}return null}}}return ll},dispose:function(){Da=new WeakMap}}}class OrthographicCamera extends Camera{constructor(F,Da,ll,cl,hl,dl){void 0===F&&(F=-1),void 0===Da&&(Da=1),void 0===ll&&(ll=1),void 0===cl&&(cl=-1),void 0===hl&&(hl=.1),void 0===dl&&(dl=2e3),super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=F,this.right=Da,this.top=ll,this.bottom=cl,this.near=hl,this.far=dl,this.updateProjectionMatrix()}copy(F,Da){return super.copy(F,Da),this.left=F.left,this.right=F.right,this.top=F.top,this.bottom=F.bottom,this.near=F.near,this.far=F.far,this.zoom=F.zoom,this.view=null===F.view?null:Object.assign({},F.view),this}setViewOffset(F,Da,ll,cl,hl,dl){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=F,this.view.fullHeight=Da,this.view.offsetX=ll,this.view.offsetY=cl,this.view.width=hl,this.view.height=dl,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const F=(this.right-this.left)/(2*this.zoom),Da=(this.top-this.bottom)/(2*this.zoom),ll=(this.right+this.left)/2,cl=(this.top+this.bottom)/2;let hl=ll-F,dl=ll+F,pl=cl+Da,fl=cl-Da;if(null!==this.view&&this.view.enabled){const F=(this.right-this.left)/this.view.fullWidth/this.zoom,Da=(this.top-this.bottom)/this.view.fullHeight/this.zoom;hl+=F*this.view.offsetX,dl=hl+F*this.view.width,pl-=Da*this.view.offsetY,fl=pl-Da*this.view.height}this.projectionMatrix.makeOrthographic(hl,dl,pl,fl,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(F){const Da=super.toJSON(F);return Da.object.zoom=this.zoom,Da.object.left=this.left,Da.object.right=this.right,Da.object.top=this.top,Da.object.bottom=this.bottom,Da.object.near=this.near,Da.object.far=this.far,null!==this.view&&(Da.object.view=Object.assign({},this.view)),Da}}const cg=[.125,.215,.35,.446,.526,.582],ug=20,hg=new OrthographicCamera,dg=new Color;let pg=null,mg=0,fg=0,gg=!1;const Ag=(1+Math.sqrt(5))/2,yg=1/Ag,vg=[new Vector3(-Ag,yg,0),new Vector3(Ag,yg,0),new Vector3(-yg,0,Ag),new Vector3(yg,0,Ag),new Vector3(0,Ag,-yg),new Vector3(0,Ag,yg),new Vector3(-1,1,-1),new Vector3(1,1,-1),new Vector3(-1,1,1),new Vector3(1,1,1)];class PMREMGenerator{constructor(F){this._renderer=F,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(F,Da,ll,cl){void 0===Da&&(Da=0),void 0===ll&&(ll=.1),void 0===cl&&(cl=100),pg=this._renderer.getRenderTarget(),mg=this._renderer.getActiveCubeFace(),fg=this._renderer.getActiveMipmapLevel(),gg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const hl=this._allocateTargets();return hl.depthBuffer=!0,this._sceneToCubeUV(F,ll,cl,hl),Da>0&&this._blur(hl,0,0,Da),this._applyPMREM(hl),this._cleanup(hl),hl}fromEquirectangular(F,Da){return void 0===Da&&(Da=null),this._fromTexture(F,Da)}fromCubemap(F,Da){return void 0===Da&&(Da=null),this._fromTexture(F,Da)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(F){this._lodMax=Math.floor(Math.log2(F)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let F=0;F<this._lodPlanes.length;F++)this._lodPlanes[F].dispose()}_cleanup(F){this._renderer.setRenderTarget(pg,mg,fg),this._renderer.xr.enabled=gg,F.scissorTest=!1,_setViewport(F,0,0,F.width,F.height)}_fromTexture(F,Da){F.mapping===Nu||F.mapping===qu?this._setSize(0===F.image.length?16:F.image[0].width||F.image[0].image.width):this._setSize(F.image.width/4),pg=this._renderer.getRenderTarget(),mg=this._renderer.getActiveCubeFace(),fg=this._renderer.getActiveMipmapLevel(),gg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const ll=Da||this._allocateTargets();return this._textureToCubeUV(F,ll),this._applyPMREM(ll),this._cleanup(ll),ll}_allocateTargets(){const F=3*Math.max(this._cubeSize,112),Da=4*this._cubeSize,ll={magFilter:od,minFilter:od,generateMipmaps:!1,type:Ad,format:bd,colorSpace:Ip,depthBuffer:!1},cl=_createRenderTarget(F,Da,ll);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==F||this._pingPongRenderTarget.height!==Da){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=_createRenderTarget(F,Da,ll);const{_lodMax:cl}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(F){const Da=[],ll=[],cl=[];let hl=F;const dl=F-4+1+cg.length;for(let pl=0;pl<dl;pl++){const dl=Math.pow(2,hl);ll.push(dl);let fl=1/dl;pl>F-4?fl=cg[pl-F+4-1]:0===pl&&(fl=0),cl.push(fl);const Al=1/(dl-2),bl=-Al,kl=1+Al,Dl=[bl,bl,kl,bl,kl,kl,bl,bl,kl,kl,bl,kl],Wl=6,Ql=6,wc=3,Sc=2,eu=1,iu=new Float32Array(wc*Ql*Wl),su=new Float32Array(Sc*Ql*Wl),cu=new Float32Array(eu*Ql*Wl);for(let F=0;F<Wl;F++){const Da=F%3*2/3-1,ll=F>2?0:-1,cl=[Da,ll,0,Da+2/3,ll,0,Da+2/3,ll+1,0,Da,ll,0,Da+2/3,ll+1,0,Da,ll+1,0];iu.set(cl,wc*Ql*F),su.set(Dl,Sc*Ql*F);const hl=[F,F,F,F,F,F];cu.set(hl,eu*Ql*F)}const uu=new BufferGeometry;uu.setAttribute("position",new BufferAttribute(iu,wc)),uu.setAttribute("uv",new BufferAttribute(su,Sc)),uu.setAttribute("faceIndex",new BufferAttribute(cu,eu)),Da.push(uu),hl>4&&hl--}return{lodPlanes:Da,sizeLods:ll,sigmas:cl}}(cl)),this._blurMaterial=function(F,Da,ll){const cl=new Float32Array(ug),hl=new Vector3(0,1,0),dl=new ShaderMaterial({name:"SphericalGaussianBlur",defines:{n:ug,CUBEUV_TEXEL_WIDTH:1/Da,CUBEUV_TEXEL_HEIGHT:1/ll,CUBEUV_MAX_MIP:`${F}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:cl},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:hl}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return dl}(cl,F,Da)}return cl}_compileMaterial(F){const Da=new Mesh(this._lodPlanes[0],F);this._renderer.compile(Da,hg)}_sceneToCubeUV(F,Da,ll,cl){const hl=new PerspectiveCamera(90,1,Da,ll),dl=[1,-1,1,1,1,1],pl=[1,1,1,-1,-1,-1],fl=this._renderer,Al=fl.autoClear,bl=fl.toneMapping;fl.getClearColor(dg),fl.toneMapping=0,fl.autoClear=!1;const kl=new MeshBasicMaterial({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),Dl=new Mesh(new BoxGeometry,kl);let Wl=!1;const Ql=F.background;Ql?Ql.isColor&&(kl.color.copy(Ql),F.background=null,Wl=!0):(kl.color.copy(dg),Wl=!0);for(let wc=0;wc<6;wc++){const Da=wc%3;0===Da?(hl.up.set(0,dl[wc],0),hl.lookAt(pl[wc],0,0)):1===Da?(hl.up.set(0,0,dl[wc]),hl.lookAt(0,pl[wc],0)):(hl.up.set(0,dl[wc],0),hl.lookAt(0,0,pl[wc]));const ll=this._cubeSize;_setViewport(cl,Da*ll,wc>2?ll:0,ll,ll),fl.setRenderTarget(cl),Wl&&fl.render(Dl,hl),fl.render(F,hl)}Dl.geometry.dispose(),Dl.material.dispose(),fl.toneMapping=bl,fl.autoClear=Al,F.background=Ql}_textureToCubeUV(F,Da){const ll=this._renderer,cl=F.mapping===Nu||F.mapping===qu;cl?(null===this._cubemapMaterial&&(this._cubemapMaterial=_getCubemapMaterial()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===F.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=_getEquirectMaterial());const hl=cl?this._cubemapMaterial:this._equirectMaterial,dl=new Mesh(this._lodPlanes[0],hl);hl.uniforms.envMap.value=F;const pl=this._cubeSize;_setViewport(Da,0,0,3*pl,2*pl),ll.setRenderTarget(Da),ll.render(dl,hg)}_applyPMREM(F){const Da=this._renderer,ll=Da.autoClear;Da.autoClear=!1;const cl=this._lodPlanes.length;for(let hl=1;hl<cl;hl++){const Da=Math.sqrt(this._sigmas[hl]*this._sigmas[hl]-this._sigmas[hl-1]*this._sigmas[hl-1]),ll=vg[(cl-hl-1)%vg.length];this._blur(F,hl-1,hl,Da,ll)}Da.autoClear=ll}_blur(F,Da,ll,cl,hl){const dl=this._pingPongRenderTarget;this._halfBlur(F,dl,Da,ll,cl,"latitudinal",hl),this._halfBlur(dl,F,ll,ll,cl,"longitudinal",hl)}_halfBlur(F,Da,ll,cl,hl,dl,pl){const fl=this._renderer,Al=this._blurMaterial;"latitudinal"!==dl&&"longitudinal"!==dl&&console.error("blur direction must be either latitudinal or longitudinal!");const bl=new Mesh(this._lodPlanes[cl],Al),kl=Al.uniforms,Dl=this._sizeLods[ll]-1,Wl=isFinite(hl)?Math.PI/(2*Dl):2*Math.PI/39,Ql=hl/Wl,wc=isFinite(hl)?1+Math.floor(3*Ql):ug;wc>ug&&console.warn(`sigmaRadians, ${hl}, is too large and will clip, as it requested ${wc} samples when the maximum is set to 20`);const Sc=[];let eu=0;for(let cu=0;cu<ug;++cu){const F=cu/Ql,Da=Math.exp(-F*F/2);Sc.push(Da),0===cu?eu+=Da:cu<wc&&(eu+=2*Da)}for(let cu=0;cu<Sc.length;cu++)Sc[cu]=Sc[cu]/eu;kl.envMap.value=F.texture,kl.samples.value=wc,kl.weights.value=Sc,kl.latitudinal.value="latitudinal"===dl,pl&&(kl.poleAxis.value=pl);const{_lodMax:iu}=this;kl.dTheta.value=Wl,kl.mipInt.value=iu-ll;const su=this._sizeLods[cl];_setViewport(Da,3*su*(cl>iu-4?cl-iu+4:0),4*(this._cubeSize-su),3*su,2*su),fl.setRenderTarget(Da),fl.render(bl,hg)}}function _createRenderTarget(F,Da,ll){const cl=new WebGLRenderTarget(F,Da,ll);return cl.texture.mapping=ed,cl.texture.name="PMREM.cubeUv",cl.scissorTest=!0,cl}function _setViewport(F,Da,ll,cl,hl){F.viewport.set(Da,ll,cl,hl),F.scissor.set(Da,ll,cl,hl)}function _getEquirectMaterial(){return new ShaderMaterial({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCubemapMaterial(){return new ShaderMaterial({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:_getCommonVertexShader(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function _getCommonVertexShader(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function WebGLCubeUVMaps(F){let Da=new WeakMap,ll=null;function onTextureDispose(F){const ll=F.target;ll.removeEventListener("dispose",onTextureDispose);const cl=Da.get(ll);void 0!==cl&&(Da.delete(ll),cl.dispose())}return{get:function(cl){if(cl&&cl.isTexture){const hl=cl.mapping,dl=hl===ih||hl===gh,pl=hl===Nu||hl===qu;if(dl||pl){let hl=Da.get(cl);const fl=void 0!==hl?hl.texture.pmremVersion:0;if(cl.isRenderTargetTexture&&cl.pmremVersion!==fl)return null===ll&&(ll=new PMREMGenerator(F)),hl=dl?ll.fromEquirectangular(cl,hl):ll.fromCubemap(cl,hl),hl.texture.pmremVersion=cl.pmremVersion,Da.set(cl,hl),hl.texture;if(void 0!==hl)return hl.texture;{const fl=cl.image;return dl&&fl&&fl.height>0||pl&&fl&&function(F){let Da=0;const ll=6;for(let cl=0;cl<ll;cl++)void 0!==F[cl]&&Da++;return Da===ll}(fl)?(null===ll&&(ll=new PMREMGenerator(F)),hl=dl?ll.fromEquirectangular(cl):ll.fromCubemap(cl),hl.texture.pmremVersion=cl.pmremVersion,Da.set(cl,hl),cl.addEventListener("dispose",onTextureDispose),hl.texture):null}}}return cl},dispose:function(){Da=new WeakMap,null!==ll&&(ll.dispose(),ll=null)}}}function WebGLExtensions(F){const Da={};function getExtension(ll){if(void 0!==Da[ll])return Da[ll];let cl;switch(ll){case"WEBGL_depth_texture":cl=F.getExtension("WEBGL_depth_texture")||F.getExtension("MOZ_WEBGL_depth_texture")||F.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":cl=F.getExtension("EXT_texture_filter_anisotropic")||F.getExtension("MOZ_EXT_texture_filter_anisotropic")||F.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":cl=F.getExtension("WEBGL_compressed_texture_s3tc")||F.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||F.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":cl=F.getExtension("WEBGL_compressed_texture_pvrtc")||F.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:cl=F.getExtension(ll)}return Da[ll]=cl,cl}return{has:function(F){return null!==getExtension(F)},init:function(){getExtension("EXT_color_buffer_float"),getExtension("WEBGL_clip_cull_distance"),getExtension("OES_texture_float_linear"),getExtension("EXT_color_buffer_half_float"),getExtension("WEBGL_multisampled_render_to_texture"),getExtension("WEBGL_render_shared_exponent")},get:function(F){const Da=getExtension(F);return null===Da&&warnOnce("THREE.WebGLRenderer: "+F+" extension not supported."),Da}}}function WebGLGeometries(F,Da,ll,cl){const hl={},dl=new WeakMap;function onGeometryDispose(F){const pl=F.target;null!==pl.index&&Da.remove(pl.index);for(const ll in pl.attributes)Da.remove(pl.attributes[ll]);for(const ll in pl.morphAttributes){const F=pl.morphAttributes[ll];for(let ll=0,cl=F.length;ll<cl;ll++)Da.remove(F[ll])}pl.removeEventListener("dispose",onGeometryDispose),delete hl[pl.id];const fl=dl.get(pl);fl&&(Da.remove(fl),dl.delete(pl)),cl.releaseStatesOfGeometry(pl),!0===pl.isInstancedBufferGeometry&&delete pl._maxInstanceCount,ll.memory.geometries--}function updateWireframeAttribute(F){const ll=[],cl=F.index,hl=F.attributes.position;let pl=0;if(null!==cl){const F=cl.array;pl=cl.version;for(let Da=0,cl=F.length;Da<cl;Da+=3){const cl=F[Da+0],hl=F[Da+1],dl=F[Da+2];ll.push(cl,hl,hl,dl,dl,cl)}}else{if(void 0===hl)return;{const F=hl.array;pl=hl.version;for(let Da=0,cl=F.length/3-1;Da<cl;Da+=3){const F=Da+0,cl=Da+1,hl=Da+2;ll.push(F,cl,cl,hl,hl,F)}}}const fl=new(arrayNeedsUint32(ll)?Uint32BufferAttribute:Uint16BufferAttribute)(ll,1);fl.version=pl;const Al=dl.get(F);Al&&Da.remove(Al),dl.set(F,fl)}return{get:function(F,Da){return!0===hl[Da.id]||(Da.addEventListener("dispose",onGeometryDispose),hl[Da.id]=!0,ll.memory.geometries++),Da},update:function(ll){const cl=ll.attributes;for(const dl in cl)Da.update(cl[dl],F.ARRAY_BUFFER);const hl=ll.morphAttributes;for(const dl in hl){const ll=hl[dl];for(let cl=0,hl=ll.length;cl<hl;cl++)Da.update(ll[cl],F.ARRAY_BUFFER)}},getWireframeAttribute:function(F){const Da=dl.get(F);if(Da){const ll=F.index;null!==ll&&Da.version<ll.version&&updateWireframeAttribute(F)}else updateWireframeAttribute(F);return dl.get(F)}}}function WebGLIndexedBufferRenderer(F,Da,ll){let cl,hl,dl;function renderInstances(Da,pl,fl){0!==fl&&(F.drawElementsInstanced(cl,pl,hl,Da*dl,fl),ll.update(pl,cl,fl))}this.setMode=function(F){cl=F},this.setIndex=function(F){hl=F.type,dl=F.bytesPerElement},this.render=function(Da,pl){F.drawElements(cl,pl,hl,Da*dl),ll.update(pl,cl,1)},this.renderInstances=renderInstances,this.renderMultiDraw=function(F,dl,pl){if(0===pl)return;Da.get("WEBGL_multi_draw").multiDrawElementsWEBGL(cl,dl,0,hl,F,0,pl);let fl=0;for(let Da=0;Da<pl;Da++)fl+=dl[Da];ll.update(fl,cl,1)},this.renderMultiDrawInstances=function(F,pl,fl,Al){if(0===fl)return;const bl=Da.get("WEBGL_multi_draw");if(null===bl)for(let Da=0;Da<F.length;Da++)renderInstances(F[Da]/dl,pl[Da],Al[Da]);else{bl.multiDrawElementsInstancedWEBGL(cl,pl,0,hl,F,0,Al,0,fl);let Da=0;for(let F=0;F<fl;F++)Da+=pl[F];for(let F=0;F<Al.length;F++)ll.update(Da,cl,Al[F])}}}function WebGLInfo(F){const Da={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:Da,programs:null,autoReset:!0,reset:function(){Da.calls=0,Da.triangles=0,Da.points=0,Da.lines=0},update:function(ll,cl,hl){switch(Da.calls++,cl){case F.TRIANGLES:Da.triangles+=hl*(ll/3);break;case F.LINES:Da.lines+=hl*(ll/2);break;case F.LINE_STRIP:Da.lines+=hl*(ll-1);break;case F.LINE_LOOP:Da.lines+=hl*ll;break;case F.POINTS:Da.points+=hl*ll;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",cl)}}}}function WebGLMorphtargets(F,Da,ll){const cl=new WeakMap,hl=new Vector4;return{update:function(dl,pl,fl){const Al=dl.morphTargetInfluences,bl=pl.morphAttributes.position||pl.morphAttributes.normal||pl.morphAttributes.color,kl=void 0!==bl?bl.length:0;let Dl=cl.get(pl);if(void 0===Dl||Dl.count!==kl){void 0!==Dl&&Dl.texture.dispose();const Wl=void 0!==pl.morphAttributes.position,Ql=void 0!==pl.morphAttributes.normal,wc=void 0!==pl.morphAttributes.color,Sc=pl.morphAttributes.position||[],eu=pl.morphAttributes.normal||[],iu=pl.morphAttributes.color||[];let su=0;!0===Wl&&(su=1),!0===Ql&&(su=2),!0===wc&&(su=3);let cu=pl.attributes.position.count*su,uu=1;cu>Da.maxTextureSize&&(uu=Math.ceil(cu/Da.maxTextureSize),cu=Da.maxTextureSize);const hu=new Float32Array(cu*uu*4*kl),Lu=new DataArrayTexture(hu,cu,uu,kl);Lu.type=gd,Lu.needsUpdate=!0;const zu=4*su;for(let Du=0;Du<kl;Du++){const Nu=Sc[Du],qu=eu[Du],ih=iu[Du],gh=cu*uu*4*Du;for(let ed=0;ed<Nu.count;ed++){const td=ed*zu;!0===Wl&&(hl.fromBufferAttribute(Nu,ed),hu[gh+td+0]=hl.x,hu[gh+td+1]=hl.y,hu[gh+td+2]=hl.z,hu[gh+td+3]=0),!0===Ql&&(hl.fromBufferAttribute(qu,ed),hu[gh+td+4]=hl.x,hu[gh+td+5]=hl.y,hu[gh+td+6]=hl.z,hu[gh+td+7]=0),!0===wc&&(hl.fromBufferAttribute(ih,ed),hu[gh+td+8]=hl.x,hu[gh+td+9]=hl.y,hu[gh+td+10]=hl.z,hu[gh+td+11]=4===ih.itemSize?hl.w:1)}}function disposeTexture(){Lu.dispose(),cl.delete(pl),pl.removeEventListener("dispose",disposeTexture)}Dl={count:kl,texture:Lu,size:new Vector2(cu,uu)},cl.set(pl,Dl),pl.addEventListener("dispose",disposeTexture)}if(!0===dl.isInstancedMesh&&null!==dl.morphTexture)fl.getUniforms().setValue(F,"morphTexture",dl.morphTexture,ll);else{let id=0;for(let rd=0;rd<Al.length;rd++)id+=Al[rd];const nd=pl.morphTargetsRelative?1:1-id;fl.getUniforms().setValue(F,"morphTargetBaseInfluence",nd),fl.getUniforms().setValue(F,"morphTargetInfluences",Al)}fl.getUniforms().setValue(F,"morphTargetsTexture",Dl.texture,ll),fl.getUniforms().setValue(F,"morphTargetsTextureSize",Dl.size)}}}function WebGLObjects(F,Da,ll,cl){let hl=new WeakMap;function onInstancedMeshDispose(F){const Da=F.target;Da.removeEventListener("dispose",onInstancedMeshDispose),ll.remove(Da.instanceMatrix),null!==Da.instanceColor&&ll.remove(Da.instanceColor)}return{update:function(dl){const pl=cl.render.frame,fl=dl.geometry,Al=Da.get(dl,fl);if(hl.get(Al)!==pl&&(Da.update(Al),hl.set(Al,pl)),dl.isInstancedMesh&&(!1===dl.hasEventListener("dispose",onInstancedMeshDispose)&&dl.addEventListener("dispose",onInstancedMeshDispose),hl.get(dl)!==pl&&(ll.update(dl.instanceMatrix,F.ARRAY_BUFFER),null!==dl.instanceColor&&ll.update(dl.instanceColor,F.ARRAY_BUFFER),hl.set(dl,pl))),dl.isSkinnedMesh){const F=dl.skeleton;hl.get(F)!==pl&&(F.update(),hl.set(F,pl))}return Al},dispose:function(){hl=new WeakMap}}}class DepthTexture extends Texture{constructor(F,Da,ll,cl,hl,dl,pl,fl,Al,bl){if(void 0===bl&&(bl=wd),bl!==wd&&bl!==Ed)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===ll&&bl===wd&&(ll=fd),void 0===ll&&bl===Ed&&(ll=_d),super(null,cl,hl,dl,pl,fl,bl,ll,Al),this.isDepthTexture=!0,this.image={width:F,height:Da},this.magFilter=void 0!==pl?pl:rd,this.minFilter=void 0!==fl?fl:rd,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(F){return super.copy(F),this.compareFunction=F.compareFunction,this}toJSON(F){const Da=super.toJSON(F);return null!==this.compareFunction&&(Da.compareFunction=this.compareFunction),Da}}const _g=new Texture,xg=new DepthTexture(1,1),bg=new DataArrayTexture,wg=new Data3DTexture,Eg=new CubeTexture,Mg=[],Sg=[],kg=new Float32Array(16),Tg=new Float32Array(9),Ig=new Float32Array(4);function flatten(F,Da,ll){const cl=F[0];if(cl<=0||cl>0)return F;const hl=Da*ll;let dl=Mg[hl];if(void 0===dl&&(dl=new Float32Array(hl),Mg[hl]=dl),0!==Da){cl.toArray(dl,0);for(let cl=1,hl=0;cl!==Da;++cl)hl+=ll,F[cl].toArray(dl,hl)}return dl}function arraysEqual(F,Da){if(F.length!==Da.length)return!1;for(let ll=0,cl=F.length;ll<cl;ll++)if(F[ll]!==Da[ll])return!1;return!0}function copyArray(F,Da){for(let ll=0,cl=Da.length;ll<cl;ll++)F[ll]=Da[ll]}function allocTexUnits(F,Da){let ll=Sg[Da];void 0===ll&&(ll=new Int32Array(Da),Sg[Da]=ll);for(let cl=0;cl!==Da;++cl)ll[cl]=F.allocateTextureUnit();return ll}function setValueV1f(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1f(this.addr,Da),ll[0]=Da)}function setValueV2f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2f(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2fv(this.addr,Da),copyArray(ll,Da)}}function setValueV3f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3f(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else if(void 0!==Da.r)ll[0]===Da.r&&ll[1]===Da.g&&ll[2]===Da.b||(F.uniform3f(this.addr,Da.r,Da.g,Da.b),ll[0]=Da.r,ll[1]=Da.g,ll[2]=Da.b);else{if(arraysEqual(ll,Da))return;F.uniform3fv(this.addr,Da),copyArray(ll,Da)}}function setValueV4f(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4f(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4fv(this.addr,Da),copyArray(ll,Da)}}function setValueM2(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix2fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;Ig.set(cl),F.uniformMatrix2fv(this.addr,!1,Ig),copyArray(ll,cl)}}function setValueM3(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix3fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;Tg.set(cl),F.uniformMatrix3fv(this.addr,!1,Tg),copyArray(ll,cl)}}function setValueM4(F,Da){const ll=this.cache,cl=Da.elements;if(void 0===cl){if(arraysEqual(ll,Da))return;F.uniformMatrix4fv(this.addr,!1,Da),copyArray(ll,Da)}else{if(arraysEqual(ll,cl))return;kg.set(cl),F.uniformMatrix4fv(this.addr,!1,kg),copyArray(ll,cl)}}function setValueV1i(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1i(this.addr,Da),ll[0]=Da)}function setValueV2i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2i(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2iv(this.addr,Da),copyArray(ll,Da)}}function setValueV3i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3i(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else{if(arraysEqual(ll,Da))return;F.uniform3iv(this.addr,Da),copyArray(ll,Da)}}function setValueV4i(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4i(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4iv(this.addr,Da),copyArray(ll,Da)}}function setValueV1ui(F,Da){const ll=this.cache;ll[0]!==Da&&(F.uniform1ui(this.addr,Da),ll[0]=Da)}function setValueV2ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y||(F.uniform2ui(this.addr,Da.x,Da.y),ll[0]=Da.x,ll[1]=Da.y);else{if(arraysEqual(ll,Da))return;F.uniform2uiv(this.addr,Da),copyArray(ll,Da)}}function setValueV3ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z||(F.uniform3ui(this.addr,Da.x,Da.y,Da.z),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z);else{if(arraysEqual(ll,Da))return;F.uniform3uiv(this.addr,Da),copyArray(ll,Da)}}function setValueV4ui(F,Da){const ll=this.cache;if(void 0!==Da.x)ll[0]===Da.x&&ll[1]===Da.y&&ll[2]===Da.z&&ll[3]===Da.w||(F.uniform4ui(this.addr,Da.x,Da.y,Da.z,Da.w),ll[0]=Da.x,ll[1]=Da.y,ll[2]=Da.z,ll[3]=Da.w);else{if(arraysEqual(ll,Da))return;F.uniform4uiv(this.addr,Da),copyArray(ll,Da)}}function setValueT1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();let dl;cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),this.type===F.SAMPLER_2D_SHADOW?(xg.compareFunction=515,dl=xg):dl=_g,ll.setTexture2D(Da||dl,hl)}function setValueT3D1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTexture3D(Da||wg,hl)}function setValueT6(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTextureCube(Da||Eg,hl)}function setValueT2DArray1(F,Da,ll){const cl=this.cache,hl=ll.allocateTextureUnit();cl[0]!==hl&&(F.uniform1i(this.addr,hl),cl[0]=hl),ll.setTexture2DArray(Da||bg,hl)}function setValueV1fArray(F,Da){F.uniform1fv(this.addr,Da)}function setValueV2fArray(F,Da){const ll=flatten(Da,this.size,2);F.uniform2fv(this.addr,ll)}function setValueV3fArray(F,Da){const ll=flatten(Da,this.size,3);F.uniform3fv(this.addr,ll)}function setValueV4fArray(F,Da){const ll=flatten(Da,this.size,4);F.uniform4fv(this.addr,ll)}function setValueM2Array(F,Da){const ll=flatten(Da,this.size,4);F.uniformMatrix2fv(this.addr,!1,ll)}function setValueM3Array(F,Da){const ll=flatten(Da,this.size,9);F.uniformMatrix3fv(this.addr,!1,ll)}function setValueM4Array(F,Da){const ll=flatten(Da,this.size,16);F.uniformMatrix4fv(this.addr,!1,ll)}function setValueV1iArray(F,Da){F.uniform1iv(this.addr,Da)}function setValueV2iArray(F,Da){F.uniform2iv(this.addr,Da)}function setValueV3iArray(F,Da){F.uniform3iv(this.addr,Da)}function setValueV4iArray(F,Da){F.uniform4iv(this.addr,Da)}function setValueV1uiArray(F,Da){F.uniform1uiv(this.addr,Da)}function setValueV2uiArray(F,Da){F.uniform2uiv(this.addr,Da)}function setValueV3uiArray(F,Da){F.uniform3uiv(this.addr,Da)}function setValueV4uiArray(F,Da){F.uniform4uiv(this.addr,Da)}function setValueT1Array(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture2D(Da[pl]||_g,dl[pl])}function setValueT3DArray(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture3D(Da[pl]||wg,dl[pl])}function setValueT6Array(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTextureCube(Da[pl]||Eg,dl[pl])}function setValueT2DArrayArray(F,Da,ll){const cl=this.cache,hl=Da.length,dl=allocTexUnits(ll,hl);arraysEqual(cl,dl)||(F.uniform1iv(this.addr,dl),copyArray(cl,dl));for(let pl=0;pl!==hl;++pl)ll.setTexture2DArray(Da[pl]||bg,dl[pl])}class SingleUniform{constructor(F,Da,ll){this.id=F,this.addr=ll,this.cache=[],this.type=Da.type,this.setValue=function(F){switch(F){case 5126:return setValueV1f;case 35664:return setValueV2f;case 35665:return setValueV3f;case 35666:return setValueV4f;case 35674:return setValueM2;case 35675:return setValueM3;case 35676:return setValueM4;case 5124:case 35670:return setValueV1i;case 35667:case 35671:return setValueV2i;case 35668:case 35672:return setValueV3i;case 35669:case 35673:return setValueV4i;case 5125:return setValueV1ui;case 36294:return setValueV2ui;case 36295:return setValueV3ui;case 36296:return setValueV4ui;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1;case 35679:case 36299:case 36307:return setValueT3D1;case 35680:case 36300:case 36308:case 36293:return setValueT6;case 36289:case 36303:case 36311:case 36292:return setValueT2DArray1}}(Da.type)}}class PureArrayUniform{constructor(F,Da,ll){this.id=F,this.addr=ll,this.cache=[],this.type=Da.type,this.size=Da.size,this.setValue=function(F){switch(F){case 5126:return setValueV1fArray;case 35664:return setValueV2fArray;case 35665:return setValueV3fArray;case 35666:return setValueV4fArray;case 35674:return setValueM2Array;case 35675:return setValueM3Array;case 35676:return setValueM4Array;case 5124:case 35670:return setValueV1iArray;case 35667:case 35671:return setValueV2iArray;case 35668:case 35672:return setValueV3iArray;case 35669:case 35673:return setValueV4iArray;case 5125:return setValueV1uiArray;case 36294:return setValueV2uiArray;case 36295:return setValueV3uiArray;case 36296:return setValueV4uiArray;case 35678:case 36198:case 36298:case 36306:case 35682:return setValueT1Array;case 35679:case 36299:case 36307:return setValueT3DArray;case 35680:case 36300:case 36308:case 36293:return setValueT6Array;case 36289:case 36303:case 36311:case 36292:return setValueT2DArrayArray}}(Da.type)}}class StructuredUniform{constructor(F){this.id=F,this.seq=[],this.map={}}setValue(F,Da,ll){const cl=this.seq;for(let hl=0,dl=cl.length;hl!==dl;++hl){const dl=cl[hl];dl.setValue(F,Da[dl.id],ll)}}}const Cg=/(\w+)(\])?(\[|\.)?/g;function addUniform(F,Da){F.seq.push(Da),F.map[Da.id]=Da}function parseUniform(F,Da,ll){const cl=F.name,hl=cl.length;for(Cg.lastIndex=0;;){const dl=Cg.exec(cl),pl=Cg.lastIndex;let fl=dl[1];const Al="]"===dl[2],bl=dl[3];if(Al&&(fl|=0),void 0===bl||"["===bl&&pl+2===hl){addUniform(ll,void 0===bl?new SingleUniform(fl,F,Da):new PureArrayUniform(fl,F,Da));break}{let F=ll.map[fl];void 0===F&&(F=new StructuredUniform(fl),addUniform(ll,F)),ll=F}}}class WebGLUniforms{constructor(F,Da){this.seq=[],this.map={};const ll=F.getProgramParameter(Da,F.ACTIVE_UNIFORMS);for(let cl=0;cl<ll;++cl){const ll=F.getActiveUniform(Da,cl);parseUniform(ll,F.getUniformLocation(Da,ll.name),this)}}setValue(F,Da,ll,cl){const hl=this.map[Da];void 0!==hl&&hl.setValue(F,ll,cl)}setOptional(F,Da,ll){const cl=Da[ll];void 0!==cl&&this.setValue(F,ll,cl)}static upload(F,Da,ll,cl){for(let hl=0,dl=Da.length;hl!==dl;++hl){const dl=Da[hl],pl=ll[dl.id];!1!==pl.needsUpdate&&dl.setValue(F,pl.value,cl)}}static seqWithValue(F,Da){const ll=[];for(let cl=0,hl=F.length;cl!==hl;++cl){const hl=F[cl];hl.id in Da&&ll.push(hl)}return ll}}function WebGLShader(F,Da,ll){const cl=F.createShader(Da);return F.shaderSource(cl,ll),F.compileShader(cl),cl}let Lg=0;function getShaderErrors(F,Da,ll){const cl=F.getShaderParameter(Da,F.COMPILE_STATUS),hl=F.getShaderInfoLog(Da).trim();if(cl&&""===hl)return"";const dl=/ERROR: 0:(\d+)/.exec(hl);if(dl){const cl=parseInt(dl[1]);return ll.toUpperCase()+"\n\n"+hl+"\n\n"+function(F,Da){const ll=F.split("\n"),cl=[],hl=Math.max(Da-6,0),dl=Math.min(Da+6,ll.length);for(let pl=hl;pl<dl;pl++){const F=pl+1;cl.push(`${F===Da?">":" "} ${F}: ${ll[pl]}`)}return cl.join("\n")}(F.getShaderSource(Da),cl)}return hl}function getTexelEncodingFunction(F,Da){const ll=function(F){const Da=sm.getPrimaries(sm.workingColorSpace),ll=sm.getPrimaries(F);let cl;switch(Da===ll?cl="":Da===Rp&&ll===Dp?cl="LinearDisplayP3ToLinearSRGB":Da===Dp&&ll===Rp&&(cl="LinearSRGBToLinearDisplayP3"),F){case Ip:case Lp:return[cl,"LinearTransferOETF"];case Tp:case Cp:return[cl,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",F),[cl,"LinearTransferOETF"]}}(Da);return`vec4 ${F}( vec4 value ) { return ${ll[0]}( ${ll[1]}( value ) ); }`}function getToneMappingFunction(F,Da){let ll;switch(Da){case 1:ll="Linear";break;case 2:ll="Reinhard";break;case 3:ll="Cineon";break;case 4:ll="ACESFilmic";break;case 6:ll="AgX";break;case 7:ll="Neutral";break;case 5:ll="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",Da),ll="Linear"}return"vec3 "+F+"( vec3 color ) { return "+ll+"ToneMapping( color ); }"}const zg=new Vector3;function getLuminanceFunction(){sm.getLuminanceCoefficients(zg);return["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${zg.x.toFixed(4)}, ${zg.y.toFixed(4)}, ${zg.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")}function filterEmptyLine(F){return""!==F}function replaceLightNums(F,Da){const ll=Da.numSpotLightShadows+Da.numSpotLightMaps-Da.numSpotLightShadowsWithMaps;return F.replace(/NUM_DIR_LIGHTS/g,Da.numDirLights).replace(/NUM_SPOT_LIGHTS/g,Da.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,Da.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,ll).replace(/NUM_RECT_AREA_LIGHTS/g,Da.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,Da.numPointLights).replace(/NUM_HEMI_LIGHTS/g,Da.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,Da.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,Da.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,Da.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,Da.numPointLightShadows)}function replaceClippingPlaneNums(F,Da){return F.replace(/NUM_CLIPPING_PLANES/g,Da.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,Da.numClippingPlanes-Da.numClipIntersection)}const Pg=/^[ \t]*#include +<([\w\d./]+)>/gm;function resolveIncludes(F){return F.replace(Pg,includeReplacer)}const Dg=new Map;function includeReplacer(F,Da){let ll=ng[Da];if(void 0===ll){const F=Dg.get(Da);if(void 0===F)throw new Error("Can not resolve #include <"+Da+">");ll=ng[F],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',Da,F)}return resolveIncludes(ll)}const Rg=/#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 unrollLoops(F){return F.replace(Rg,loopReplacer)}function loopReplacer(F,Da,ll,cl){let hl="";for(let dl=parseInt(Da);dl<parseInt(ll);dl++)hl+=cl.replace(/\[\s*i\s*\]/g,"[ "+dl+" ]").replace(/UNROLLED_LOOP_INDEX/g,dl);return hl}function generatePrecision(F){let Da=`precision ${F.precision} float;\n\tprecision ${F.precision} int;\n\tprecision ${F.precision} sampler2D;\n\tprecision ${F.precision} samplerCube;\n\tprecision ${F.precision} sampler3D;\n\tprecision ${F.precision} sampler2DArray;\n\tprecision ${F.precision} sampler2DShadow;\n\tprecision ${F.precision} samplerCubeShadow;\n\tprecision ${F.precision} sampler2DArrayShadow;\n\tprecision ${F.precision} isampler2D;\n\tprecision ${F.precision} isampler3D;\n\tprecision ${F.precision} isamplerCube;\n\tprecision ${F.precision} isampler2DArray;\n\tprecision ${F.precision} usampler2D;\n\tprecision ${F.precision} usampler3D;\n\tprecision ${F.precision} usamplerCube;\n\tprecision ${F.precision} usampler2DArray;\n\t`;return"highp"===F.precision?Da+="\n#define HIGH_PRECISION":"mediump"===F.precision?Da+="\n#define MEDIUM_PRECISION":"lowp"===F.precision&&(Da+="\n#define LOW_PRECISION"),Da}function WebGLProgram(F,Da,ll,cl){const hl=F.getContext(),dl=ll.defines;let pl=ll.vertexShader,fl=ll.fragmentShader;const Al=function(F){let Da="SHADOWMAP_TYPE_BASIC";return 1===F.shadowMapType?Da="SHADOWMAP_TYPE_PCF":2===F.shadowMapType?Da="SHADOWMAP_TYPE_PCF_SOFT":3===F.shadowMapType&&(Da="SHADOWMAP_TYPE_VSM"),Da}(ll),bl=function(F){let Da="ENVMAP_TYPE_CUBE";if(F.envMap)switch(F.envMapMode){case Nu:case qu:Da="ENVMAP_TYPE_CUBE";break;case ed:Da="ENVMAP_TYPE_CUBE_UV"}return Da}(ll),kl=function(F){let Da="ENVMAP_MODE_REFLECTION";F.envMap&&F.envMapMode===qu&&(Da="ENVMAP_MODE_REFRACTION");return Da}(ll),Dl=function(F){let Da="ENVMAP_BLENDING_NONE";if(F.envMap)switch(F.combine){case 0:Da="ENVMAP_BLENDING_MULTIPLY";break;case 1:Da="ENVMAP_BLENDING_MIX";break;case 2:Da="ENVMAP_BLENDING_ADD"}return Da}(ll),Wl=function(F){const Da=F.envMapCubeUVHeight;if(null===Da)return null;const ll=Math.log2(Da)-2,cl=1/Da;return{texelWidth:1/(3*Math.max(Math.pow(2,ll),112)),texelHeight:cl,maxMip:ll}}(ll),Ql=function(F){return[F.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",F.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(filterEmptyLine).join("\n")}(ll),wc=function(F){const Da=[];for(const ll in F){const cl=F[ll];!1!==cl&&Da.push("#define "+ll+" "+cl)}return Da.join("\n")}(dl),Sc=hl.createProgram();let eu,iu,su=ll.glslVersion?"#version "+ll.glslVersion+"\n":"";ll.isRawShaderMaterial?(eu=["#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc].filter(filterEmptyLine).join("\n"),eu.length>0&&(eu+="\n"),iu=["#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc].filter(filterEmptyLine).join("\n"),iu.length>0&&(iu+="\n")):(eu=[generatePrecision(ll),"#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc,ll.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",ll.batching?"#define USE_BATCHING":"",ll.batchingColor?"#define USE_BATCHING_COLOR":"",ll.instancing?"#define USE_INSTANCING":"",ll.instancingColor?"#define USE_INSTANCING_COLOR":"",ll.instancingMorph?"#define USE_INSTANCING_MORPH":"",ll.useFog&&ll.fog?"#define USE_FOG":"",ll.useFog&&ll.fogExp2?"#define FOG_EXP2":"",ll.map?"#define USE_MAP":"",ll.envMap?"#define USE_ENVMAP":"",ll.envMap?"#define "+kl:"",ll.lightMap?"#define USE_LIGHTMAP":"",ll.aoMap?"#define USE_AOMAP":"",ll.bumpMap?"#define USE_BUMPMAP":"",ll.normalMap?"#define USE_NORMALMAP":"",ll.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",ll.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",ll.displacementMap?"#define USE_DISPLACEMENTMAP":"",ll.emissiveMap?"#define USE_EMISSIVEMAP":"",ll.anisotropy?"#define USE_ANISOTROPY":"",ll.anisotropyMap?"#define USE_ANISOTROPYMAP":"",ll.clearcoatMap?"#define USE_CLEARCOATMAP":"",ll.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",ll.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",ll.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",ll.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",ll.specularMap?"#define USE_SPECULARMAP":"",ll.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",ll.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",ll.roughnessMap?"#define USE_ROUGHNESSMAP":"",ll.metalnessMap?"#define USE_METALNESSMAP":"",ll.alphaMap?"#define USE_ALPHAMAP":"",ll.alphaHash?"#define USE_ALPHAHASH":"",ll.transmission?"#define USE_TRANSMISSION":"",ll.transmissionMap?"#define USE_TRANSMISSIONMAP":"",ll.thicknessMap?"#define USE_THICKNESSMAP":"",ll.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",ll.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",ll.mapUv?"#define MAP_UV "+ll.mapUv:"",ll.alphaMapUv?"#define ALPHAMAP_UV "+ll.alphaMapUv:"",ll.lightMapUv?"#define LIGHTMAP_UV "+ll.lightMapUv:"",ll.aoMapUv?"#define AOMAP_UV "+ll.aoMapUv:"",ll.emissiveMapUv?"#define EMISSIVEMAP_UV "+ll.emissiveMapUv:"",ll.bumpMapUv?"#define BUMPMAP_UV "+ll.bumpMapUv:"",ll.normalMapUv?"#define NORMALMAP_UV "+ll.normalMapUv:"",ll.displacementMapUv?"#define DISPLACEMENTMAP_UV "+ll.displacementMapUv:"",ll.metalnessMapUv?"#define METALNESSMAP_UV "+ll.metalnessMapUv:"",ll.roughnessMapUv?"#define ROUGHNESSMAP_UV "+ll.roughnessMapUv:"",ll.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+ll.anisotropyMapUv:"",ll.clearcoatMapUv?"#define CLEARCOATMAP_UV "+ll.clearcoatMapUv:"",ll.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+ll.clearcoatNormalMapUv:"",ll.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+ll.clearcoatRoughnessMapUv:"",ll.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+ll.iridescenceMapUv:"",ll.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+ll.iridescenceThicknessMapUv:"",ll.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+ll.sheenColorMapUv:"",ll.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+ll.sheenRoughnessMapUv:"",ll.specularMapUv?"#define SPECULARMAP_UV "+ll.specularMapUv:"",ll.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+ll.specularColorMapUv:"",ll.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+ll.specularIntensityMapUv:"",ll.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+ll.transmissionMapUv:"",ll.thicknessMapUv?"#define THICKNESSMAP_UV "+ll.thicknessMapUv:"",ll.vertexTangents&&!1===ll.flatShading?"#define USE_TANGENT":"",ll.vertexColors?"#define USE_COLOR":"",ll.vertexAlphas?"#define USE_COLOR_ALPHA":"",ll.vertexUv1s?"#define USE_UV1":"",ll.vertexUv2s?"#define USE_UV2":"",ll.vertexUv3s?"#define USE_UV3":"",ll.pointsUvs?"#define USE_POINTS_UV":"",ll.flatShading?"#define FLAT_SHADED":"",ll.skinning?"#define USE_SKINNING":"",ll.morphTargets?"#define USE_MORPHTARGETS":"",ll.morphNormals&&!1===ll.flatShading?"#define USE_MORPHNORMALS":"",ll.morphColors?"#define USE_MORPHCOLORS":"",ll.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+ll.morphTextureStride:"",ll.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+ll.morphTargetsCount:"",ll.doubleSided?"#define DOUBLE_SIDED":"",ll.flipSided?"#define FLIP_SIDED":"",ll.shadowMapEnabled?"#define USE_SHADOWMAP":"",ll.shadowMapEnabled?"#define "+Al:"",ll.sizeAttenuation?"#define USE_SIZEATTENUATION":"",ll.numLightProbes>0?"#define USE_LIGHT_PROBES":"",ll.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(filterEmptyLine).join("\n"),iu=[generatePrecision(ll),"#define SHADER_TYPE "+ll.shaderType,"#define SHADER_NAME "+ll.shaderName,wc,ll.useFog&&ll.fog?"#define USE_FOG":"",ll.useFog&&ll.fogExp2?"#define FOG_EXP2":"",ll.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",ll.map?"#define USE_MAP":"",ll.matcap?"#define USE_MATCAP":"",ll.envMap?"#define USE_ENVMAP":"",ll.envMap?"#define "+bl:"",ll.envMap?"#define "+kl:"",ll.envMap?"#define "+Dl:"",Wl?"#define CUBEUV_TEXEL_WIDTH "+Wl.texelWidth:"",Wl?"#define CUBEUV_TEXEL_HEIGHT "+Wl.texelHeight:"",Wl?"#define CUBEUV_MAX_MIP "+Wl.maxMip+".0":"",ll.lightMap?"#define USE_LIGHTMAP":"",ll.aoMap?"#define USE_AOMAP":"",ll.bumpMap?"#define USE_BUMPMAP":"",ll.normalMap?"#define USE_NORMALMAP":"",ll.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",ll.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",ll.emissiveMap?"#define USE_EMISSIVEMAP":"",ll.anisotropy?"#define USE_ANISOTROPY":"",ll.anisotropyMap?"#define USE_ANISOTROPYMAP":"",ll.clearcoat?"#define USE_CLEARCOAT":"",ll.clearcoatMap?"#define USE_CLEARCOATMAP":"",ll.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",ll.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",ll.dispersion?"#define USE_DISPERSION":"",ll.iridescence?"#define USE_IRIDESCENCE":"",ll.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",ll.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",ll.specularMap?"#define USE_SPECULARMAP":"",ll.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",ll.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",ll.roughnessMap?"#define USE_ROUGHNESSMAP":"",ll.metalnessMap?"#define USE_METALNESSMAP":"",ll.alphaMap?"#define USE_ALPHAMAP":"",ll.alphaTest?"#define USE_ALPHATEST":"",ll.alphaHash?"#define USE_ALPHAHASH":"",ll.sheen?"#define USE_SHEEN":"",ll.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",ll.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",ll.transmission?"#define USE_TRANSMISSION":"",ll.transmissionMap?"#define USE_TRANSMISSIONMAP":"",ll.thicknessMap?"#define USE_THICKNESSMAP":"",ll.vertexTangents&&!1===ll.flatShading?"#define USE_TANGENT":"",ll.vertexColors||ll.instancingColor||ll.batchingColor?"#define USE_COLOR":"",ll.vertexAlphas?"#define USE_COLOR_ALPHA":"",ll.vertexUv1s?"#define USE_UV1":"",ll.vertexUv2s?"#define USE_UV2":"",ll.vertexUv3s?"#define USE_UV3":"",ll.pointsUvs?"#define USE_POINTS_UV":"",ll.gradientMap?"#define USE_GRADIENTMAP":"",ll.flatShading?"#define FLAT_SHADED":"",ll.doubleSided?"#define DOUBLE_SIDED":"",ll.flipSided?"#define FLIP_SIDED":"",ll.shadowMapEnabled?"#define USE_SHADOWMAP":"",ll.shadowMapEnabled?"#define "+Al:"",ll.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",ll.numLightProbes>0?"#define USE_LIGHT_PROBES":"",ll.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",ll.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==ll.toneMapping?"#define TONE_MAPPING":"",0!==ll.toneMapping?ng.tonemapping_pars_fragment:"",0!==ll.toneMapping?getToneMappingFunction("toneMapping",ll.toneMapping):"",ll.dithering?"#define DITHERING":"",ll.opaque?"#define OPAQUE":"",ng.colorspace_pars_fragment,getTexelEncodingFunction("linearToOutputTexel",ll.outputColorSpace),getLuminanceFunction(),ll.useDepthPacking?"#define DEPTH_PACKING "+ll.depthPacking:"","\n"].filter(filterEmptyLine).join("\n")),pl=resolveIncludes(pl),pl=replaceLightNums(pl,ll),pl=replaceClippingPlaneNums(pl,ll),fl=resolveIncludes(fl),fl=replaceLightNums(fl,ll),fl=replaceClippingPlaneNums(fl,ll),pl=unrollLoops(pl),fl=unrollLoops(fl),!0!==ll.isRawShaderMaterial&&(su="#version 300 es\n",eu=[Ql,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+eu,iu=["#define varying in",ll.glslVersion===Zp?"":"layout(location = 0) out highp vec4 pc_fragColor;",ll.glslVersion===Zp?"":"#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("\n")+"\n"+iu);const cu=su+eu+pl,uu=su+iu+fl,hu=WebGLShader(hl,hl.VERTEX_SHADER,cu),Lu=WebGLShader(hl,hl.FRAGMENT_SHADER,uu);function onFirstUse(Da){if(F.debug.checkShaderErrors){const ll=hl.getProgramInfoLog(Sc).trim(),cl=hl.getShaderInfoLog(hu).trim(),dl=hl.getShaderInfoLog(Lu).trim();let pl=!0,fl=!0;if(!1===hl.getProgramParameter(Sc,hl.LINK_STATUS))if(pl=!1,"function"===typeof F.debug.onShaderError)F.debug.onShaderError(hl,Sc,hu,Lu);else{const F=getShaderErrors(hl,hu,"vertex"),cl=getShaderErrors(hl,Lu,"fragment");console.error("THREE.WebGLProgram: Shader Error "+hl.getError()+" - VALIDATE_STATUS "+hl.getProgramParameter(Sc,hl.VALIDATE_STATUS)+"\n\nMaterial Name: "+Da.name+"\nMaterial Type: "+Da.type+"\n\nProgram Info Log: "+ll+"\n"+F+"\n"+cl)}else""!==ll?console.warn("THREE.WebGLProgram: Program Info Log:",ll):""!==cl&&""!==dl||(fl=!1);fl&&(Da.diagnostics={runnable:pl,programLog:ll,vertexShader:{log:cl,prefix:eu},fragmentShader:{log:dl,prefix:iu}})}hl.deleteShader(hu),hl.deleteShader(Lu),zu=new WebGLUniforms(hl,Sc),Du=function(F,Da){const ll={},cl=F.getProgramParameter(Da,F.ACTIVE_ATTRIBUTES);for(let hl=0;hl<cl;hl++){const cl=F.getActiveAttrib(Da,hl),dl=cl.name;let pl=1;cl.type===F.FLOAT_MAT2&&(pl=2),cl.type===F.FLOAT_MAT3&&(pl=3),cl.type===F.FLOAT_MAT4&&(pl=4),ll[dl]={type:cl.type,location:F.getAttribLocation(Da,dl),locationSize:pl}}return ll}(hl,Sc)}let zu,Du;hl.attachShader(Sc,hu),hl.attachShader(Sc,Lu),void 0!==ll.index0AttributeName?hl.bindAttribLocation(Sc,0,ll.index0AttributeName):!0===ll.morphTargets&&hl.bindAttribLocation(Sc,0,"position"),hl.linkProgram(Sc),this.getUniforms=function(){return void 0===zu&&onFirstUse(this),zu},this.getAttributes=function(){return void 0===Du&&onFirstUse(this),Du};let ih=!1===ll.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===ih&&(ih=hl.getProgramParameter(Sc,37297)),ih},this.destroy=function(){cl.releaseStatesOfProgram(this),hl.deleteProgram(Sc),this.program=void 0},this.type=ll.shaderType,this.name=ll.shaderName,this.id=Lg++,this.cacheKey=Da,this.usedTimes=1,this.program=Sc,this.vertexShader=hu,this.fragmentShader=Lu,this}let Ng=0;class WebGLShaderCache{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(F){const Da=F.vertexShader,ll=F.fragmentShader,cl=this._getShaderStage(Da),hl=this._getShaderStage(ll),dl=this._getShaderCacheForMaterial(F);return!1===dl.has(cl)&&(dl.add(cl),cl.usedTimes++),!1===dl.has(hl)&&(dl.add(hl),hl.usedTimes++),this}remove(F){const Da=this.materialCache.get(F);for(const ll of Da)ll.usedTimes--,0===ll.usedTimes&&this.shaderCache.delete(ll.code);return this.materialCache.delete(F),this}getVertexShaderID(F){return this._getShaderStage(F.vertexShader).id}getFragmentShaderID(F){return this._getShaderStage(F.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(F){const Da=this.materialCache;let ll=Da.get(F);return void 0===ll&&(ll=new Set,Da.set(F,ll)),ll}_getShaderStage(F){const Da=this.shaderCache;let ll=Da.get(F);return void 0===ll&&(ll=new WebGLShaderStage(F),Da.set(F,ll)),ll}}class WebGLShaderStage{constructor(F){this.id=Ng++,this.code=F,this.usedTimes=0}}function WebGLPrograms(F,Da,ll,cl,hl,dl,pl){const fl=new Layers,Al=new WebGLShaderCache,bl=new Set,kl=[],Dl=hl.logarithmicDepthBuffer,Wl=hl.vertexTextures;let Ql=hl.precision;const wc={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 getChannel(F){return bl.add(F),0===F?"uv":`uv${F}`}return{getParameters:function(dl,fl,kl,Sc,eu){const iu=Sc.fog,su=eu.geometry,cu=dl.isMeshStandardMaterial?Sc.environment:null,uu=(dl.isMeshStandardMaterial?ll:Da).get(dl.envMap||cu),hu=uu&&uu.mapping===ed?uu.image.height:null,Lu=wc[dl.type];null!==dl.precision&&(Ql=hl.getMaxPrecision(dl.precision),Ql!==dl.precision&&console.warn("THREE.WebGLProgram.getParameters:",dl.precision,"not supported, using",Ql,"instead."));const zu=su.morphAttributes.position||su.morphAttributes.normal||su.morphAttributes.color,Du=void 0!==zu?zu.length:0;let Nu,qu,ih,gh,td=0;if(void 0!==su.morphAttributes.position&&(td=1),void 0!==su.morphAttributes.normal&&(td=2),void 0!==su.morphAttributes.color&&(td=3),Lu){const F=ag[Lu];Nu=F.vertexShader,qu=F.fragmentShader}else Nu=dl.vertexShader,qu=dl.fragmentShader,Al.update(dl),ih=Al.getVertexShaderID(dl),gh=Al.getFragmentShaderID(dl);const id=F.getRenderTarget(),nd=!0===eu.isInstancedMesh,rd=!0===eu.isBatchedMesh,ad=!!dl.map,sd=!!dl.matcap,od=!!uu,ld=!!dl.aoMap,cd=!!dl.lightMap,ud=!!dl.bumpMap,hd=!!dl.normalMap,dd=!!dl.displacementMap,pd=!!dl.emissiveMap,md=!!dl.metalnessMap,fd=!!dl.roughnessMap,gd=dl.anisotropy>0,Ad=dl.clearcoat>0,yd=dl.dispersion>0,vd=dl.iridescence>0,_d=dl.sheen>0,xd=dl.transmission>0,bd=gd&&!!dl.anisotropyMap,wd=Ad&&!!dl.clearcoatMap,Ed=Ad&&!!dl.clearcoatNormalMap,Md=Ad&&!!dl.clearcoatRoughnessMap,Sd=vd&&!!dl.iridescenceMap,kd=vd&&!!dl.iridescenceThicknessMap,Td=_d&&!!dl.sheenColorMap,Id=_d&&!!dl.sheenRoughnessMap,Cd=!!dl.specularMap,Ld=!!dl.specularColorMap,zd=!!dl.specularIntensityMap,Pd=xd&&!!dl.transmissionMap,Dd=xd&&!!dl.thicknessMap,Rd=!!dl.gradientMap,Nd=!!dl.alphaMap,Ud=dl.alphaTest>0,Bd=!!dl.alphaHash,Od=!!dl.extensions;let Fd=0;dl.toneMapped&&(null!==id&&!0!==id.isXRRenderTarget||(Fd=F.toneMapping));const jd={shaderID:Lu,shaderType:dl.type,shaderName:dl.name,vertexShader:Nu,fragmentShader:qu,defines:dl.defines,customVertexShaderID:ih,customFragmentShaderID:gh,isRawShaderMaterial:!0===dl.isRawShaderMaterial,glslVersion:dl.glslVersion,precision:Ql,batching:rd,batchingColor:rd&&null!==eu._colorsTexture,instancing:nd,instancingColor:nd&&null!==eu.instanceColor,instancingMorph:nd&&null!==eu.morphTexture,supportsVertexTextures:Wl,outputColorSpace:null===id?F.outputColorSpace:!0===id.isXRRenderTarget?id.texture.colorSpace:Ip,alphaToCoverage:!!dl.alphaToCoverage,map:ad,matcap:sd,envMap:od,envMapMode:od&&uu.mapping,envMapCubeUVHeight:hu,aoMap:ld,lightMap:cd,bumpMap:ud,normalMap:hd,displacementMap:Wl&&dd,emissiveMap:pd,normalMapObjectSpace:hd&&1===dl.normalMapType,normalMapTangentSpace:hd&&0===dl.normalMapType,metalnessMap:md,roughnessMap:fd,anisotropy:gd,anisotropyMap:bd,clearcoat:Ad,clearcoatMap:wd,clearcoatNormalMap:Ed,clearcoatRoughnessMap:Md,dispersion:yd,iridescence:vd,iridescenceMap:Sd,iridescenceThicknessMap:kd,sheen:_d,sheenColorMap:Td,sheenRoughnessMap:Id,specularMap:Cd,specularColorMap:Ld,specularIntensityMap:zd,transmission:xd,transmissionMap:Pd,thicknessMap:Dd,gradientMap:Rd,opaque:!1===dl.transparent&&1===dl.blending&&!1===dl.alphaToCoverage,alphaMap:Nd,alphaTest:Ud,alphaHash:Bd,combine:dl.combine,mapUv:ad&&getChannel(dl.map.channel),aoMapUv:ld&&getChannel(dl.aoMap.channel),lightMapUv:cd&&getChannel(dl.lightMap.channel),bumpMapUv:ud&&getChannel(dl.bumpMap.channel),normalMapUv:hd&&getChannel(dl.normalMap.channel),displacementMapUv:dd&&getChannel(dl.displacementMap.channel),emissiveMapUv:pd&&getChannel(dl.emissiveMap.channel),metalnessMapUv:md&&getChannel(dl.metalnessMap.channel),roughnessMapUv:fd&&getChannel(dl.roughnessMap.channel),anisotropyMapUv:bd&&getChannel(dl.anisotropyMap.channel),clearcoatMapUv:wd&&getChannel(dl.clearcoatMap.channel),clearcoatNormalMapUv:Ed&&getChannel(dl.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Md&&getChannel(dl.clearcoatRoughnessMap.channel),iridescenceMapUv:Sd&&getChannel(dl.iridescenceMap.channel),iridescenceThicknessMapUv:kd&&getChannel(dl.iridescenceThicknessMap.channel),sheenColorMapUv:Td&&getChannel(dl.sheenColorMap.channel),sheenRoughnessMapUv:Id&&getChannel(dl.sheenRoughnessMap.channel),specularMapUv:Cd&&getChannel(dl.specularMap.channel),specularColorMapUv:Ld&&getChannel(dl.specularColorMap.channel),specularIntensityMapUv:zd&&getChannel(dl.specularIntensityMap.channel),transmissionMapUv:Pd&&getChannel(dl.transmissionMap.channel),thicknessMapUv:Dd&&getChannel(dl.thicknessMap.channel),alphaMapUv:Nd&&getChannel(dl.alphaMap.channel),vertexTangents:!!su.attributes.tangent&&(hd||gd),vertexColors:dl.vertexColors,vertexAlphas:!0===dl.vertexColors&&!!su.attributes.color&&4===su.attributes.color.itemSize,pointsUvs:!0===eu.isPoints&&!!su.attributes.uv&&(ad||Nd),fog:!!iu,useFog:!0===dl.fog,fogExp2:!!iu&&iu.isFogExp2,flatShading:!0===dl.flatShading,sizeAttenuation:!0===dl.sizeAttenuation,logarithmicDepthBuffer:Dl,skinning:!0===eu.isSkinnedMesh,morphTargets:void 0!==su.morphAttributes.position,morphNormals:void 0!==su.morphAttributes.normal,morphColors:void 0!==su.morphAttributes.color,morphTargetsCount:Du,morphTextureStride:td,numDirLights:fl.directional.length,numPointLights:fl.point.length,numSpotLights:fl.spot.length,numSpotLightMaps:fl.spotLightMap.length,numRectAreaLights:fl.rectArea.length,numHemiLights:fl.hemi.length,numDirLightShadows:fl.directionalShadowMap.length,numPointLightShadows:fl.pointShadowMap.length,numSpotLightShadows:fl.spotShadowMap.length,numSpotLightShadowsWithMaps:fl.numSpotLightShadowsWithMaps,numLightProbes:fl.numLightProbes,numClippingPlanes:pl.numPlanes,numClipIntersection:pl.numIntersection,dithering:dl.dithering,shadowMapEnabled:F.shadowMap.enabled&&kl.length>0,shadowMapType:F.shadowMap.type,toneMapping:Fd,decodeVideoTexture:ad&&!0===dl.map.isVideoTexture&&sm.getTransfer(dl.map.colorSpace)===Pp,premultipliedAlpha:dl.premultipliedAlpha,doubleSided:2===dl.side,flipSided:1===dl.side,useDepthPacking:dl.depthPacking>=0,depthPacking:dl.depthPacking||0,index0AttributeName:dl.index0AttributeName,extensionClipCullDistance:Od&&!0===dl.extensions.clipCullDistance&&cl.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Od&&!0===dl.extensions.multiDraw||rd)&&cl.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:cl.has("KHR_parallel_shader_compile"),customProgramCacheKey:dl.customProgramCacheKey()};return jd.vertexUv1s=bl.has(1),jd.vertexUv2s=bl.has(2),jd.vertexUv3s=bl.has(3),bl.clear(),jd},getProgramCacheKey:function(Da){const ll=[];if(Da.shaderID?ll.push(Da.shaderID):(ll.push(Da.customVertexShaderID),ll.push(Da.customFragmentShaderID)),void 0!==Da.defines)for(const F in Da.defines)ll.push(F),ll.push(Da.defines[F]);return!1===Da.isRawShaderMaterial&&(!function(F,Da){F.push(Da.precision),F.push(Da.outputColorSpace),F.push(Da.envMapMode),F.push(Da.envMapCubeUVHeight),F.push(Da.mapUv),F.push(Da.alphaMapUv),F.push(Da.lightMapUv),F.push(Da.aoMapUv),F.push(Da.bumpMapUv),F.push(Da.normalMapUv),F.push(Da.displacementMapUv),F.push(Da.emissiveMapUv),F.push(Da.metalnessMapUv),F.push(Da.roughnessMapUv),F.push(Da.anisotropyMapUv),F.push(Da.clearcoatMapUv),F.push(Da.clearcoatNormalMapUv),F.push(Da.clearcoatRoughnessMapUv),F.push(Da.iridescenceMapUv),F.push(Da.iridescenceThicknessMapUv),F.push(Da.sheenColorMapUv),F.push(Da.sheenRoughnessMapUv),F.push(Da.specularMapUv),F.push(Da.specularColorMapUv),F.push(Da.specularIntensityMapUv),F.push(Da.transmissionMapUv),F.push(Da.thicknessMapUv),F.push(Da.combine),F.push(Da.fogExp2),F.push(Da.sizeAttenuation),F.push(Da.morphTargetsCount),F.push(Da.morphAttributeCount),F.push(Da.numDirLights),F.push(Da.numPointLights),F.push(Da.numSpotLights),F.push(Da.numSpotLightMaps),F.push(Da.numHemiLights),F.push(Da.numRectAreaLights),F.push(Da.numDirLightShadows),F.push(Da.numPointLightShadows),F.push(Da.numSpotLightShadows),F.push(Da.numSpotLightShadowsWithMaps),F.push(Da.numLightProbes),F.push(Da.shadowMapType),F.push(Da.toneMapping),F.push(Da.numClippingPlanes),F.push(Da.numClipIntersection),F.push(Da.depthPacking)}(ll,Da),function(F,Da){fl.disableAll(),Da.supportsVertexTextures&&fl.enable(0);Da.instancing&&fl.enable(1);Da.instancingColor&&fl.enable(2);Da.instancingMorph&&fl.enable(3);Da.matcap&&fl.enable(4);Da.envMap&&fl.enable(5);Da.normalMapObjectSpace&&fl.enable(6);Da.normalMapTangentSpace&&fl.enable(7);Da.clearcoat&&fl.enable(8);Da.iridescence&&fl.enable(9);Da.alphaTest&&fl.enable(10);Da.vertexColors&&fl.enable(11);Da.vertexAlphas&&fl.enable(12);Da.vertexUv1s&&fl.enable(13);Da.vertexUv2s&&fl.enable(14);Da.vertexUv3s&&fl.enable(15);Da.vertexTangents&&fl.enable(16);Da.anisotropy&&fl.enable(17);Da.alphaHash&&fl.enable(18);Da.batching&&fl.enable(19);Da.dispersion&&fl.enable(20);Da.batchingColor&&fl.enable(21);F.push(fl.mask),fl.disableAll(),Da.fog&&fl.enable(0);Da.useFog&&fl.enable(1);Da.flatShading&&fl.enable(2);Da.logarithmicDepthBuffer&&fl.enable(3);Da.skinning&&fl.enable(4);Da.morphTargets&&fl.enable(5);Da.morphNormals&&fl.enable(6);Da.morphColors&&fl.enable(7);Da.premultipliedAlpha&&fl.enable(8);Da.shadowMapEnabled&&fl.enable(9);Da.doubleSided&&fl.enable(10);Da.flipSided&&fl.enable(11);Da.useDepthPacking&&fl.enable(12);Da.dithering&&fl.enable(13);Da.transmission&&fl.enable(14);Da.sheen&&fl.enable(15);Da.opaque&&fl.enable(16);Da.pointsUvs&&fl.enable(17);Da.decodeVideoTexture&&fl.enable(18);Da.alphaToCoverage&&fl.enable(19);F.push(fl.mask)}(ll,Da),ll.push(F.outputColorSpace)),ll.push(Da.customProgramCacheKey),ll.join()},getUniforms:function(F){const Da=wc[F.type];let ll;if(Da){const F=ag[Da];ll=Wf.clone(F.uniforms)}else ll=F.uniforms;return ll},acquireProgram:function(Da,ll){let cl;for(let F=0,hl=kl.length;F<hl;F++){const Da=kl[F];if(Da.cacheKey===ll){cl=Da,++cl.usedTimes;break}}return void 0===cl&&(cl=new WebGLProgram(F,ll,Da,dl),kl.push(cl)),cl},releaseProgram:function(F){if(0===--F.usedTimes){const Da=kl.indexOf(F);kl[Da]=kl[kl.length-1],kl.pop(),F.destroy()}},releaseShaderCache:function(F){Al.remove(F)},programs:kl,dispose:function(){Al.dispose()}}}function WebGLProperties(){let F=new WeakMap;return{has:function(Da){return F.has(Da)},get:function(Da){let ll=F.get(Da);return void 0===ll&&(ll={},F.set(Da,ll)),ll},remove:function(Da){F.delete(Da)},update:function(Da,ll,cl){F.get(Da)[ll]=cl},dispose:function(){F=new WeakMap}}}function painterSortStable(F,Da){return F.groupOrder!==Da.groupOrder?F.groupOrder-Da.groupOrder:F.renderOrder!==Da.renderOrder?F.renderOrder-Da.renderOrder:F.material.id!==Da.material.id?F.material.id-Da.material.id:F.z!==Da.z?F.z-Da.z:F.id-Da.id}function reversePainterSortStable(F,Da){return F.groupOrder!==Da.groupOrder?F.groupOrder-Da.groupOrder:F.renderOrder!==Da.renderOrder?F.renderOrder-Da.renderOrder:F.z!==Da.z?Da.z-F.z:F.id-Da.id}function WebGLRenderList(){const F=[];let Da=0;const ll=[],cl=[],hl=[];function getNextRenderItem(ll,cl,hl,dl,pl,fl){let Al=F[Da];return void 0===Al?(Al={id:ll.id,object:ll,geometry:cl,material:hl,groupOrder:dl,renderOrder:ll.renderOrder,z:pl,group:fl},F[Da]=Al):(Al.id=ll.id,Al.object=ll,Al.geometry=cl,Al.material=hl,Al.groupOrder=dl,Al.renderOrder=ll.renderOrder,Al.z=pl,Al.group=fl),Da++,Al}return{opaque:ll,transmissive:cl,transparent:hl,init:function(){Da=0,ll.length=0,cl.length=0,hl.length=0},push:function(F,Da,dl,pl,fl,Al){const bl=getNextRenderItem(F,Da,dl,pl,fl,Al);dl.transmission>0?cl.push(bl):!0===dl.transparent?hl.push(bl):ll.push(bl)},unshift:function(F,Da,dl,pl,fl,Al){const bl=getNextRenderItem(F,Da,dl,pl,fl,Al);dl.transmission>0?cl.unshift(bl):!0===dl.transparent?hl.unshift(bl):ll.unshift(bl)},finish:function(){for(let ll=Da,cl=F.length;ll<cl;ll++){const Da=F[ll];if(null===Da.id)break;Da.id=null,Da.object=null,Da.geometry=null,Da.material=null,Da.group=null}},sort:function(F,Da){ll.length>1&&ll.sort(F||painterSortStable),cl.length>1&&cl.sort(Da||reversePainterSortStable),hl.length>1&&hl.sort(Da||reversePainterSortStable)}}}function WebGLRenderLists(){let F=new WeakMap;return{get:function(Da,ll){const cl=F.get(Da);let hl;return void 0===cl?(hl=new WebGLRenderList,F.set(Da,[hl])):ll>=cl.length?(hl=new WebGLRenderList,cl.push(hl)):hl=cl[ll],hl},dispose:function(){F=new WeakMap}}}function UniformsCache(){const F={};return{get:function(Da){if(void 0!==F[Da.id])return F[Da.id];let ll;switch(Da.type){case"DirectionalLight":ll={direction:new Vector3,color:new Color};break;case"SpotLight":ll={position:new Vector3,direction:new Vector3,color:new Color,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":ll={position:new Vector3,color:new Color,distance:0,decay:0};break;case"HemisphereLight":ll={direction:new Vector3,skyColor:new Color,groundColor:new Color};break;case"RectAreaLight":ll={color:new Color,position:new Vector3,halfWidth:new Vector3,halfHeight:new Vector3}}return F[Da.id]=ll,ll}}}let Ug=0;function shadowCastingAndTexturingLightsFirst(F,Da){return(Da.castShadow?2:0)-(F.castShadow?2:0)+(Da.map?1:0)-(F.map?1:0)}function WebGLLights(F){const Da=new UniformsCache,ll=function(){const F={};return{get:function(Da){if(void 0!==F[Da.id])return F[Da.id];let ll;switch(Da.type){case"DirectionalLight":case"SpotLight":ll={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2};break;case"PointLight":ll={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Vector2,shadowCameraNear:1,shadowCameraFar:1e3}}return F[Da.id]=ll,ll}}}(),cl={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 fl=0;fl<9;fl++)cl.probe.push(new Vector3);const hl=new Vector3,dl=new Matrix4,pl=new Matrix4;return{setup:function(hl){let dl=0,pl=0,fl=0;for(let F=0;F<9;F++)cl.probe[F].set(0,0,0);let Al=0,bl=0,kl=0,Dl=0,Wl=0,Ql=0,wc=0,Sc=0,eu=0,iu=0,su=0;hl.sort(shadowCastingAndTexturingLightsFirst);for(let F=0,uu=hl.length;F<uu;F++){const cu=hl[F],uu=cu.color,hu=cu.intensity,Lu=cu.distance,zu=cu.shadow&&cu.shadow.map?cu.shadow.map.texture:null;if(cu.isAmbientLight)dl+=uu.r*hu,pl+=uu.g*hu,fl+=uu.b*hu;else if(cu.isLightProbe){for(let F=0;F<9;F++)cl.probe[F].addScaledVector(cu.sh.coefficients[F],hu);su++}else if(cu.isDirectionalLight){const F=Da.get(cu);if(F.color.copy(cu.color).multiplyScalar(cu.intensity),cu.castShadow){const F=cu.shadow,Da=ll.get(cu);Da.shadowIntensity=F.intensity,Da.shadowBias=F.bias,Da.shadowNormalBias=F.normalBias,Da.shadowRadius=F.radius,Da.shadowMapSize=F.mapSize,cl.directionalShadow[Al]=Da,cl.directionalShadowMap[Al]=zu,cl.directionalShadowMatrix[Al]=cu.shadow.matrix,Ql++}cl.directional[Al]=F,Al++}else if(cu.isSpotLight){const F=Da.get(cu);F.position.setFromMatrixPosition(cu.matrixWorld),F.color.copy(uu).multiplyScalar(hu),F.distance=Lu,F.coneCos=Math.cos(cu.angle),F.penumbraCos=Math.cos(cu.angle*(1-cu.penumbra)),F.decay=cu.decay,cl.spot[kl]=F;const hl=cu.shadow;if(cu.map&&(cl.spotLightMap[eu]=cu.map,eu++,hl.updateMatrices(cu),cu.castShadow&&iu++),cl.spotLightMatrix[kl]=hl.matrix,cu.castShadow){const F=ll.get(cu);F.shadowIntensity=hl.intensity,F.shadowBias=hl.bias,F.shadowNormalBias=hl.normalBias,F.shadowRadius=hl.radius,F.shadowMapSize=hl.mapSize,cl.spotShadow[kl]=F,cl.spotShadowMap[kl]=zu,Sc++}kl++}else if(cu.isRectAreaLight){const F=Da.get(cu);F.color.copy(uu).multiplyScalar(hu),F.halfWidth.set(.5*cu.width,0,0),F.halfHeight.set(0,.5*cu.height,0),cl.rectArea[Dl]=F,Dl++}else if(cu.isPointLight){const F=Da.get(cu);if(F.color.copy(cu.color).multiplyScalar(cu.intensity),F.distance=cu.distance,F.decay=cu.decay,cu.castShadow){const F=cu.shadow,Da=ll.get(cu);Da.shadowIntensity=F.intensity,Da.shadowBias=F.bias,Da.shadowNormalBias=F.normalBias,Da.shadowRadius=F.radius,Da.shadowMapSize=F.mapSize,Da.shadowCameraNear=F.camera.near,Da.shadowCameraFar=F.camera.far,cl.pointShadow[bl]=Da,cl.pointShadowMap[bl]=zu,cl.pointShadowMatrix[bl]=cu.shadow.matrix,wc++}cl.point[bl]=F,bl++}else if(cu.isHemisphereLight){const F=Da.get(cu);F.skyColor.copy(cu.color).multiplyScalar(hu),F.groundColor.copy(cu.groundColor).multiplyScalar(hu),cl.hemi[Wl]=F,Wl++}}Dl>0&&(!0===F.has("OES_texture_float_linear")?(cl.rectAreaLTC1=rg.LTC_FLOAT_1,cl.rectAreaLTC2=rg.LTC_FLOAT_2):(cl.rectAreaLTC1=rg.LTC_HALF_1,cl.rectAreaLTC2=rg.LTC_HALF_2)),cl.ambient[0]=dl,cl.ambient[1]=pl,cl.ambient[2]=fl;const cu=cl.hash;cu.directionalLength===Al&&cu.pointLength===bl&&cu.spotLength===kl&&cu.rectAreaLength===Dl&&cu.hemiLength===Wl&&cu.numDirectionalShadows===Ql&&cu.numPointShadows===wc&&cu.numSpotShadows===Sc&&cu.numSpotMaps===eu&&cu.numLightProbes===su||(cl.directional.length=Al,cl.spot.length=kl,cl.rectArea.length=Dl,cl.point.length=bl,cl.hemi.length=Wl,cl.directionalShadow.length=Ql,cl.directionalShadowMap.length=Ql,cl.pointShadow.length=wc,cl.pointShadowMap.length=wc,cl.spotShadow.length=Sc,cl.spotShadowMap.length=Sc,cl.directionalShadowMatrix.length=Ql,cl.pointShadowMatrix.length=wc,cl.spotLightMatrix.length=Sc+eu-iu,cl.spotLightMap.length=eu,cl.numSpotLightShadowsWithMaps=iu,cl.numLightProbes=su,cu.directionalLength=Al,cu.pointLength=bl,cu.spotLength=kl,cu.rectAreaLength=Dl,cu.hemiLength=Wl,cu.numDirectionalShadows=Ql,cu.numPointShadows=wc,cu.numSpotShadows=Sc,cu.numSpotMaps=eu,cu.numLightProbes=su,cl.version=Ug++)},setupView:function(F,Da){let ll=0,fl=0,Al=0,bl=0,kl=0;const Dl=Da.matrixWorldInverse;for(let Wl=0,Ql=F.length;Wl<Ql;Wl++){const Da=F[Wl];if(Da.isDirectionalLight){const F=cl.directional[ll];F.direction.setFromMatrixPosition(Da.matrixWorld),hl.setFromMatrixPosition(Da.target.matrixWorld),F.direction.sub(hl),F.direction.transformDirection(Dl),ll++}else if(Da.isSpotLight){const F=cl.spot[Al];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),F.direction.setFromMatrixPosition(Da.matrixWorld),hl.setFromMatrixPosition(Da.target.matrixWorld),F.direction.sub(hl),F.direction.transformDirection(Dl),Al++}else if(Da.isRectAreaLight){const F=cl.rectArea[bl];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),pl.identity(),dl.copy(Da.matrixWorld),dl.premultiply(Dl),pl.extractRotation(dl),F.halfWidth.set(.5*Da.width,0,0),F.halfHeight.set(0,.5*Da.height,0),F.halfWidth.applyMatrix4(pl),F.halfHeight.applyMatrix4(pl),bl++}else if(Da.isPointLight){const F=cl.point[fl];F.position.setFromMatrixPosition(Da.matrixWorld),F.position.applyMatrix4(Dl),fl++}else if(Da.isHemisphereLight){const F=cl.hemi[kl];F.direction.setFromMatrixPosition(Da.matrixWorld),F.direction.transformDirection(Dl),kl++}}},state:cl}}function WebGLRenderState(F){const Da=new WebGLLights(F),ll=[],cl=[];const hl={lightsArray:ll,shadowsArray:cl,camera:null,lights:Da,transmissionRenderTarget:{}};return{init:function(F){hl.camera=F,ll.length=0,cl.length=0},state:hl,setupLights:function(){Da.setup(ll)},setupLightsView:function(F){Da.setupView(ll,F)},pushLight:function(F){ll.push(F)},pushShadow:function(F){cl.push(F)}}}function WebGLRenderStates(F){let Da=new WeakMap;return{get:function(ll,cl){void 0===cl&&(cl=0);const hl=Da.get(ll);let dl;return void 0===hl?(dl=new WebGLRenderState(F),Da.set(ll,[dl])):cl>=hl.length?(dl=new WebGLRenderState(F),hl.push(dl)):dl=hl[cl],dl},dispose:function(){Da=new WeakMap}}}class MeshDepthMaterial extends Material{constructor(F){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(F)}copy(F){return super.copy(F),this.depthPacking=F.depthPacking,this.map=F.map,this.alphaMap=F.alphaMap,this.displacementMap=F.displacementMap,this.displacementScale=F.displacementScale,this.displacementBias=F.displacementBias,this.wireframe=F.wireframe,this.wireframeLinewidth=F.wireframeLinewidth,this}}class MeshDistanceMaterial extends Material{constructor(F){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(F)}copy(F){return super.copy(F),this.map=F.map,this.alphaMap=F.alphaMap,this.displacementMap=F.displacementMap,this.displacementScale=F.displacementScale,this.displacementBias=F.displacementBias,this}}function WebGLShadowMap(F,Da,ll){let cl=new Frustum;const fl=new Vector2,Al=new Vector2,bl=new Vector4,kl=new MeshDepthMaterial({depthPacking:3201}),Dl=new MeshDistanceMaterial,Wl={},Ql=ll.maxTextureSize,wc={[hl]:1,[dl]:0,[pl]:2},Sc=new ShaderMaterial({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Vector2},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),eu=Sc.clone();eu.defines.HORIZONTAL_PASS=1;const iu=new BufferGeometry;iu.setAttribute("position",new BufferAttribute(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const su=new Mesh(iu,Sc),cu=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let uu=this.type;function VSMPass(ll,cl){const hl=Da.update(su);Sc.defines.VSM_SAMPLES!==ll.blurSamples&&(Sc.defines.VSM_SAMPLES=ll.blurSamples,eu.defines.VSM_SAMPLES=ll.blurSamples,Sc.needsUpdate=!0,eu.needsUpdate=!0),null===ll.mapPass&&(ll.mapPass=new WebGLRenderTarget(fl.x,fl.y)),Sc.uniforms.shadow_pass.value=ll.map.texture,Sc.uniforms.resolution.value=ll.mapSize,Sc.uniforms.radius.value=ll.radius,F.setRenderTarget(ll.mapPass),F.clear(),F.renderBufferDirect(cl,null,hl,Sc,su,null),eu.uniforms.shadow_pass.value=ll.mapPass.texture,eu.uniforms.resolution.value=ll.mapSize,eu.uniforms.radius.value=ll.radius,F.setRenderTarget(ll.map),F.clear(),F.renderBufferDirect(cl,null,hl,eu,su,null)}function getDepthMaterial(Da,ll,cl,hl){let dl=null;const pl=!0===cl.isPointLight?Da.customDistanceMaterial:Da.customDepthMaterial;if(void 0!==pl)dl=pl;else if(dl=!0===cl.isPointLight?Dl:kl,F.localClippingEnabled&&!0===ll.clipShadows&&Array.isArray(ll.clippingPlanes)&&0!==ll.clippingPlanes.length||ll.displacementMap&&0!==ll.displacementScale||ll.alphaMap&&ll.alphaTest>0||ll.map&&ll.alphaTest>0){const F=dl.uuid,Da=ll.uuid;let cl=Wl[F];void 0===cl&&(cl={},Wl[F]=cl);let hl=cl[Da];void 0===hl&&(hl=dl.clone(),cl[Da]=hl,ll.addEventListener("dispose",onMaterialDispose)),dl=hl}if(dl.visible=ll.visible,dl.wireframe=ll.wireframe,dl.side=3===hl?null!==ll.shadowSide?ll.shadowSide:ll.side:null!==ll.shadowSide?ll.shadowSide:wc[ll.side],dl.alphaMap=ll.alphaMap,dl.alphaTest=ll.alphaTest,dl.map=ll.map,dl.clipShadows=ll.clipShadows,dl.clippingPlanes=ll.clippingPlanes,dl.clipIntersection=ll.clipIntersection,dl.displacementMap=ll.displacementMap,dl.displacementScale=ll.displacementScale,dl.displacementBias=ll.displacementBias,dl.wireframeLinewidth=ll.wireframeLinewidth,dl.linewidth=ll.linewidth,!0===cl.isPointLight&&!0===dl.isMeshDistanceMaterial){F.properties.get(dl).light=cl}return dl}function renderObject(ll,hl,dl,pl,fl){if(!1===ll.visible)return;if(ll.layers.test(hl.layers)&&(ll.isMesh||ll.isLine||ll.isPoints)&&(ll.castShadow||ll.receiveShadow&&3===fl)&&(!ll.frustumCulled||cl.intersectsObject(ll))){ll.modelViewMatrix.multiplyMatrices(dl.matrixWorldInverse,ll.matrixWorld);const cl=Da.update(ll),Al=ll.material;if(Array.isArray(Al)){const Da=cl.groups;for(let bl=0,kl=Da.length;bl<kl;bl++){const kl=Da[bl],Dl=Al[kl.materialIndex];if(Dl&&Dl.visible){const Da=getDepthMaterial(ll,Dl,pl,fl);ll.onBeforeShadow(F,ll,hl,dl,cl,Da,kl),F.renderBufferDirect(dl,null,cl,Da,ll,kl),ll.onAfterShadow(F,ll,hl,dl,cl,Da,kl)}}}else if(Al.visible){const Da=getDepthMaterial(ll,Al,pl,fl);ll.onBeforeShadow(F,ll,hl,dl,cl,Da,null),F.renderBufferDirect(dl,null,cl,Da,ll,null),ll.onAfterShadow(F,ll,hl,dl,cl,Da,null)}}const Al=ll.children;for(let F=0,Da=Al.length;F<Da;F++)renderObject(Al[F],hl,dl,pl,fl)}function onMaterialDispose(F){F.target.removeEventListener("dispose",onMaterialDispose);for(const Da in Wl){const ll=Wl[Da],cl=F.target.uuid;if(cl in ll){ll[cl].dispose(),delete ll[cl]}}}this.render=function(Da,ll,hl){if(!1===cu.enabled)return;if(!1===cu.autoUpdate&&!1===cu.needsUpdate)return;if(0===Da.length)return;const dl=F.getRenderTarget(),pl=F.getActiveCubeFace(),kl=F.getActiveMipmapLevel(),Dl=F.state;Dl.setBlending(0),Dl.buffers.color.setClear(1,1,1,1),Dl.buffers.depth.setTest(!0),Dl.setScissorTest(!1);const Wl=3!==uu&&3===this.type,wc=3===uu&&3!==this.type;for(let Sc=0,eu=Da.length;Sc<eu;Sc++){const dl=Da[Sc],pl=dl.shadow;if(void 0===pl){console.warn("THREE.WebGLShadowMap:",dl,"has no shadow.");continue}if(!1===pl.autoUpdate&&!1===pl.needsUpdate)continue;fl.copy(pl.mapSize);const kl=pl.getFrameExtents();if(fl.multiply(kl),Al.copy(pl.mapSize),(fl.x>Ql||fl.y>Ql)&&(fl.x>Ql&&(Al.x=Math.floor(Ql/kl.x),fl.x=Al.x*kl.x,pl.mapSize.x=Al.x),fl.y>Ql&&(Al.y=Math.floor(Ql/kl.y),fl.y=Al.y*kl.y,pl.mapSize.y=Al.y)),null===pl.map||!0===Wl||!0===wc){const F=3!==this.type?{minFilter:rd,magFilter:rd}:{};null!==pl.map&&pl.map.dispose(),pl.map=new WebGLRenderTarget(fl.x,fl.y,F),pl.map.texture.name=dl.name+".shadowMap",pl.camera.updateProjectionMatrix()}F.setRenderTarget(pl.map),F.clear();const eu=pl.getViewportCount();for(let F=0;F<eu;F++){const Da=pl.getViewport(F);bl.set(Al.x*Da.x,Al.y*Da.y,Al.x*Da.z,Al.y*Da.w),Dl.viewport(bl),pl.updateMatrices(dl,F),cl=pl.getFrustum(),renderObject(ll,hl,pl.camera,dl,this.type)}!0!==pl.isPointLightShadow&&3===this.type&&VSMPass(pl,hl),pl.needsUpdate=!1}uu=this.type,cu.needsUpdate=!1,F.setRenderTarget(dl,pl,kl)}}function WebGLState(F){const Da=new function(){let Da=!1;const ll=new Vector4;let cl=null;const hl=new Vector4(0,0,0,0);return{setMask:function(ll){cl===ll||Da||(F.colorMask(ll,ll,ll,ll),cl=ll)},setLocked:function(F){Da=F},setClear:function(Da,cl,dl,pl,fl){!0===fl&&(Da*=pl,cl*=pl,dl*=pl),ll.set(Da,cl,dl,pl),!1===hl.equals(ll)&&(F.clearColor(Da,cl,dl,pl),hl.copy(ll))},reset:function(){Da=!1,cl=null,hl.set(-1,0,0,0)}}},ll=new function(){let Da=!1,ll=null,cl=null,hl=null;return{setTest:function(Da){Da?enable(F.DEPTH_TEST):disable(F.DEPTH_TEST)},setMask:function(cl){ll===cl||Da||(F.depthMask(cl),ll=cl)},setFunc:function(Da){if(cl!==Da){switch(Da){case 0:F.depthFunc(F.NEVER);break;case 1:F.depthFunc(F.ALWAYS);break;case 2:F.depthFunc(F.LESS);break;case 3:default:F.depthFunc(F.LEQUAL);break;case 4:F.depthFunc(F.EQUAL);break;case 5:F.depthFunc(F.GEQUAL);break;case 6:F.depthFunc(F.GREATER);break;case 7:F.depthFunc(F.NOTEQUAL)}cl=Da}},setLocked:function(F){Da=F},setClear:function(Da){hl!==Da&&(F.clearDepth(Da),hl=Da)},reset:function(){Da=!1,ll=null,cl=null,hl=null}}},cl=new function(){let Da=!1,ll=null,cl=null,hl=null,dl=null,pl=null,fl=null,Al=null,bl=null;return{setTest:function(ll){Da||(ll?enable(F.STENCIL_TEST):disable(F.STENCIL_TEST))},setMask:function(cl){ll===cl||Da||(F.stencilMask(cl),ll=cl)},setFunc:function(Da,ll,pl){cl===Da&&hl===ll&&dl===pl||(F.stencilFunc(Da,ll,pl),cl=Da,hl=ll,dl=pl)},setOp:function(Da,ll,cl){pl===Da&&fl===ll&&Al===cl||(F.stencilOp(Da,ll,cl),pl=Da,fl=ll,Al=cl)},setLocked:function(F){Da=F},setClear:function(Da){bl!==Da&&(F.clearStencil(Da),bl=Da)},reset:function(){Da=!1,ll=null,cl=null,hl=null,dl=null,pl=null,fl=null,Al=null,bl=null}}},hl=new WeakMap,dl=new WeakMap;let pl={},Nu={},qu=new WeakMap,ih=[],gh=null,ed=!1,td=null,id=null,nd=null,rd=null,ad=null,sd=null,od=null,ld=new Color(0,0,0),cd=0,ud=!1,hd=null,dd=null,pd=null,md=null,fd=null;const gd=F.getParameter(F.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let Ad=!1,yd=0;const vd=F.getParameter(F.VERSION);-1!==vd.indexOf("WebGL")?(yd=parseFloat(/^WebGL (\d)/.exec(vd)[1]),Ad=yd>=1):-1!==vd.indexOf("OpenGL ES")&&(yd=parseFloat(/^OpenGL ES (\d)/.exec(vd)[1]),Ad=yd>=2);let _d=null,xd={};const bd=F.getParameter(F.SCISSOR_BOX),wd=F.getParameter(F.VIEWPORT),Ed=(new Vector4).fromArray(bd),Md=(new Vector4).fromArray(wd);function createTexture(Da,ll,cl,hl){const dl=new Uint8Array(4),pl=F.createTexture();F.bindTexture(Da,pl),F.texParameteri(Da,F.TEXTURE_MIN_FILTER,F.NEAREST),F.texParameteri(Da,F.TEXTURE_MAG_FILTER,F.NEAREST);for(let fl=0;fl<cl;fl++)Da===F.TEXTURE_3D||Da===F.TEXTURE_2D_ARRAY?F.texImage3D(ll,0,F.RGBA,1,1,hl,0,F.RGBA,F.UNSIGNED_BYTE,dl):F.texImage2D(ll+fl,0,F.RGBA,1,1,0,F.RGBA,F.UNSIGNED_BYTE,dl);return pl}const Sd={};function enable(Da){!0!==pl[Da]&&(F.enable(Da),pl[Da]=!0)}function disable(Da){!1!==pl[Da]&&(F.disable(Da),pl[Da]=!1)}Sd[F.TEXTURE_2D]=createTexture(F.TEXTURE_2D,F.TEXTURE_2D,1),Sd[F.TEXTURE_CUBE_MAP]=createTexture(F.TEXTURE_CUBE_MAP,F.TEXTURE_CUBE_MAP_POSITIVE_X,6),Sd[F.TEXTURE_2D_ARRAY]=createTexture(F.TEXTURE_2D_ARRAY,F.TEXTURE_2D_ARRAY,1,1),Sd[F.TEXTURE_3D]=createTexture(F.TEXTURE_3D,F.TEXTURE_3D,1,1),Da.setClear(0,0,0,1),ll.setClear(1),cl.setClear(0),enable(F.DEPTH_TEST),ll.setFunc(3),setFlipSided(!1),setCullFace(1),enable(F.CULL_FACE),setBlending(0);const kd={[fl]:F.FUNC_ADD,[Al]:F.FUNC_SUBTRACT,[bl]:F.FUNC_REVERSE_SUBTRACT};kd[103]=F.MIN,kd[104]=F.MAX;const Td={[kl]:F.ZERO,[Dl]:F.ONE,[Wl]:F.SRC_COLOR,[wc]:F.SRC_ALPHA,[uu]:F.SRC_ALPHA_SATURATE,[su]:F.DST_COLOR,[eu]:F.DST_ALPHA,[Ql]:F.ONE_MINUS_SRC_COLOR,[Sc]:F.ONE_MINUS_SRC_ALPHA,[cu]:F.ONE_MINUS_DST_COLOR,[iu]:F.ONE_MINUS_DST_ALPHA,[hu]:F.CONSTANT_COLOR,[Lu]:F.ONE_MINUS_CONSTANT_COLOR,[zu]:F.CONSTANT_ALPHA,[Du]:F.ONE_MINUS_CONSTANT_ALPHA};function setBlending(Da,ll,cl,hl,dl,pl,Al,bl,kl,Dl){if(0!==Da){if(!1===ed&&(enable(F.BLEND),ed=!0),5===Da)dl=dl||ll,pl=pl||cl,Al=Al||hl,ll===id&&dl===ad||(F.blendEquationSeparate(kd[ll],kd[dl]),id=ll,ad=dl),cl===nd&&hl===rd&&pl===sd&&Al===od||(F.blendFuncSeparate(Td[cl],Td[hl],Td[pl],Td[Al]),nd=cl,rd=hl,sd=pl,od=Al),!1!==bl.equals(ld)&&kl===cd||(F.blendColor(bl.r,bl.g,bl.b,kl),ld.copy(bl),cd=kl),td=Da,ud=!1;else if(Da!==td||Dl!==ud){if(id===fl&&ad===fl||(F.blendEquation(F.FUNC_ADD),id=fl,ad=fl),Dl)switch(Da){case 1:F.blendFuncSeparate(F.ONE,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA);break;case 2:F.blendFunc(F.ONE,F.ONE);break;case 3:F.blendFuncSeparate(F.ZERO,F.ONE_MINUS_SRC_COLOR,F.ZERO,F.ONE);break;case 4:F.blendFuncSeparate(F.ZERO,F.SRC_COLOR,F.ZERO,F.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",Da)}else switch(Da){case 1:F.blendFuncSeparate(F.SRC_ALPHA,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA);break;case 2:F.blendFunc(F.SRC_ALPHA,F.ONE);break;case 3:F.blendFuncSeparate(F.ZERO,F.ONE_MINUS_SRC_COLOR,F.ZERO,F.ONE);break;case 4:F.blendFunc(F.ZERO,F.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",Da)}nd=null,rd=null,sd=null,od=null,ld.set(0,0,0),cd=0,td=Da,ud=Dl}}else!0===ed&&(disable(F.BLEND),ed=!1)}function setFlipSided(Da){hd!==Da&&(Da?F.frontFace(F.CW):F.frontFace(F.CCW),hd=Da)}function setCullFace(Da){0!==Da?(enable(F.CULL_FACE),Da!==dd&&(1===Da?F.cullFace(F.BACK):2===Da?F.cullFace(F.FRONT):F.cullFace(F.FRONT_AND_BACK))):disable(F.CULL_FACE),dd=Da}function setPolygonOffset(Da,ll,cl){Da?(enable(F.POLYGON_OFFSET_FILL),md===ll&&fd===cl||(F.polygonOffset(ll,cl),md=ll,fd=cl)):disable(F.POLYGON_OFFSET_FILL)}return{buffers:{color:Da,depth:ll,stencil:cl},enable:enable,disable:disable,bindFramebuffer:function(Da,ll){return Nu[Da]!==ll&&(F.bindFramebuffer(Da,ll),Nu[Da]=ll,Da===F.DRAW_FRAMEBUFFER&&(Nu[F.FRAMEBUFFER]=ll),Da===F.FRAMEBUFFER&&(Nu[F.DRAW_FRAMEBUFFER]=ll),!0)},drawBuffers:function(Da,ll){let cl=ih,hl=!1;if(Da){cl=qu.get(ll),void 0===cl&&(cl=[],qu.set(ll,cl));const dl=Da.textures;if(cl.length!==dl.length||cl[0]!==F.COLOR_ATTACHMENT0){for(let Da=0,ll=dl.length;Da<ll;Da++)cl[Da]=F.COLOR_ATTACHMENT0+Da;cl.length=dl.length,hl=!0}}else cl[0]!==F.BACK&&(cl[0]=F.BACK,hl=!0);hl&&F.drawBuffers(cl)},useProgram:function(Da){return gh!==Da&&(F.useProgram(Da),gh=Da,!0)},setBlending:setBlending,setMaterial:function(hl,dl){2===hl.side?disable(F.CULL_FACE):enable(F.CULL_FACE);let pl=1===hl.side;dl&&(pl=!pl),setFlipSided(pl),1===hl.blending&&!1===hl.transparent?setBlending(0):setBlending(hl.blending,hl.blendEquation,hl.blendSrc,hl.blendDst,hl.blendEquationAlpha,hl.blendSrcAlpha,hl.blendDstAlpha,hl.blendColor,hl.blendAlpha,hl.premultipliedAlpha),ll.setFunc(hl.depthFunc),ll.setTest(hl.depthTest),ll.setMask(hl.depthWrite),Da.setMask(hl.colorWrite);const fl=hl.stencilWrite;cl.setTest(fl),fl&&(cl.setMask(hl.stencilWriteMask),cl.setFunc(hl.stencilFunc,hl.stencilRef,hl.stencilFuncMask),cl.setOp(hl.stencilFail,hl.stencilZFail,hl.stencilZPass)),setPolygonOffset(hl.polygonOffset,hl.polygonOffsetFactor,hl.polygonOffsetUnits),!0===hl.alphaToCoverage?enable(F.SAMPLE_ALPHA_TO_COVERAGE):disable(F.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:setFlipSided,setCullFace:setCullFace,setLineWidth:function(Da){Da!==pd&&(Ad&&F.lineWidth(Da),pd=Da)},setPolygonOffset:setPolygonOffset,setScissorTest:function(Da){Da?enable(F.SCISSOR_TEST):disable(F.SCISSOR_TEST)},activeTexture:function(Da){void 0===Da&&(Da=F.TEXTURE0+gd-1),_d!==Da&&(F.activeTexture(Da),_d=Da)},bindTexture:function(Da,ll,cl){void 0===cl&&(cl=null===_d?F.TEXTURE0+gd-1:_d);let hl=xd[cl];void 0===hl&&(hl={type:void 0,texture:void 0},xd[cl]=hl),hl.type===Da&&hl.texture===ll||(_d!==cl&&(F.activeTexture(cl),_d=cl),F.bindTexture(Da,ll||Sd[Da]),hl.type=Da,hl.texture=ll)},unbindTexture:function(){const Da=xd[_d];void 0!==Da&&void 0!==Da.type&&(F.bindTexture(Da.type,null),Da.type=void 0,Da.texture=void 0)},compressedTexImage2D:function(){try{F.compressedTexImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexImage3D:function(){try{F.compressedTexImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texImage2D:function(){try{F.texImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texImage3D:function(){try{F.texImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},updateUBOMapping:function(Da,ll){let cl=dl.get(ll);void 0===cl&&(cl=new WeakMap,dl.set(ll,cl));let hl=cl.get(Da);void 0===hl&&(hl=F.getUniformBlockIndex(ll,Da.name),cl.set(Da,hl))},uniformBlockBinding:function(Da,ll){const cl=dl.get(ll).get(Da);hl.get(ll)!==cl&&(F.uniformBlockBinding(ll,cl,Da.__bindingPointIndex),hl.set(ll,cl))},texStorage2D:function(){try{F.texStorage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texStorage3D:function(){try{F.texStorage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texSubImage2D:function(){try{F.texSubImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},texSubImage3D:function(){try{F.texSubImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexSubImage2D:function(){try{F.compressedTexSubImage2D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},compressedTexSubImage3D:function(){try{F.compressedTexSubImage3D.apply(F,arguments)}catch(Da){console.error("THREE.WebGLState:",Da)}},scissor:function(Da){!1===Ed.equals(Da)&&(F.scissor(Da.x,Da.y,Da.z,Da.w),Ed.copy(Da))},viewport:function(Da){!1===Md.equals(Da)&&(F.viewport(Da.x,Da.y,Da.z,Da.w),Md.copy(Da))},reset:function(){F.disable(F.BLEND),F.disable(F.CULL_FACE),F.disable(F.DEPTH_TEST),F.disable(F.POLYGON_OFFSET_FILL),F.disable(F.SCISSOR_TEST),F.disable(F.STENCIL_TEST),F.disable(F.SAMPLE_ALPHA_TO_COVERAGE),F.blendEquation(F.FUNC_ADD),F.blendFunc(F.ONE,F.ZERO),F.blendFuncSeparate(F.ONE,F.ZERO,F.ONE,F.ZERO),F.blendColor(0,0,0,0),F.colorMask(!0,!0,!0,!0),F.clearColor(0,0,0,0),F.depthMask(!0),F.depthFunc(F.LESS),F.clearDepth(1),F.stencilMask(4294967295),F.stencilFunc(F.ALWAYS,0,4294967295),F.stencilOp(F.KEEP,F.KEEP,F.KEEP),F.clearStencil(0),F.cullFace(F.BACK),F.frontFace(F.CCW),F.polygonOffset(0,0),F.activeTexture(F.TEXTURE0),F.bindFramebuffer(F.FRAMEBUFFER,null),F.bindFramebuffer(F.DRAW_FRAMEBUFFER,null),F.bindFramebuffer(F.READ_FRAMEBUFFER,null),F.useProgram(null),F.lineWidth(1),F.scissor(0,0,F.canvas.width,F.canvas.height),F.viewport(0,0,F.canvas.width,F.canvas.height),pl={},_d=null,xd={},Nu={},qu=new WeakMap,ih=[],gh=null,ed=!1,td=null,id=null,nd=null,rd=null,ad=null,sd=null,od=null,ld=new Color(0,0,0),cd=0,ud=!1,hd=null,dd=null,pd=null,md=null,fd=null,Ed.set(0,0,F.canvas.width,F.canvas.height),Md.set(0,0,F.canvas.width,F.canvas.height),Da.reset(),ll.reset(),cl.reset()}}}function getByteLength(F,Da,ll,cl){const hl=function(F){switch(F){case ud:case hd:return{byteLength:1,components:1};case pd:case dd:case Ad:return{byteLength:2,components:1};case yd:case vd:return{byteLength:2,components:4};case fd:case md:case gd:return{byteLength:4,components:1};case xd:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${F}.`)}(cl);switch(ll){case 1021:case 1024:return F*Da;case 1025:return F*Da*2;case Md:case Sd:return F*Da/hl.components*hl.byteLength;case 1030:case kd:return F*Da*2/hl.components*hl.byteLength;case 1022:return F*Da*3/hl.components*hl.byteLength;case bd:case Td:return F*Da*4/hl.components*hl.byteLength;case Id:case Cd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*8;case Ld:case zd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*16;case Dd:case Nd:return Math.max(F,16)*Math.max(Da,8)/4;case Pd:case Rd:return Math.max(F,8)*Math.max(Da,8)/2;case Ud:case Bd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*8;case Od:case Fd:return Math.floor((F+3)/4)*Math.floor((Da+3)/4)*16;case jd:return Math.floor((F+4)/5)*Math.floor((Da+3)/4)*16;case Vd:return Math.floor((F+4)/5)*Math.floor((Da+4)/5)*16;case Gd:return Math.floor((F+5)/6)*Math.floor((Da+4)/5)*16;case Hd:return Math.floor((F+5)/6)*Math.floor((Da+5)/6)*16;case qd:return Math.floor((F+7)/8)*Math.floor((Da+4)/5)*16;case Zd:return Math.floor((F+7)/8)*Math.floor((Da+5)/6)*16;case Wd:return Math.floor((F+7)/8)*Math.floor((Da+7)/8)*16;case Kd:return Math.floor((F+9)/10)*Math.floor((Da+4)/5)*16;case Qd:return Math.floor((F+9)/10)*Math.floor((Da+5)/6)*16;case Xd:return Math.floor((F+9)/10)*Math.floor((Da+7)/8)*16;case Yd:return Math.floor((F+9)/10)*Math.floor((Da+9)/10)*16;case Jd:return Math.floor((F+11)/12)*Math.floor((Da+9)/10)*16;case $d:return Math.floor((F+11)/12)*Math.floor((Da+11)/12)*16;case lp:case mp:case gp:return Math.ceil(F/4)*Math.ceil(Da/4)*16;case 36283:case Ap:return Math.ceil(F/4)*Math.ceil(Da/4)*8;case vp:case _p:return Math.ceil(F/4)*Math.ceil(Da/4)*16}throw new Error(`Unable to determine texture byte length for ${ll} format.`)}function WebGLTextures(F,Da,ll,cl,hl,dl,pl){const fl=Da.has("WEBGL_multisampled_render_to_texture")?Da.get("WEBGL_multisampled_render_to_texture"):null,Al="undefined"!==typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),bl=new Vector2,kl=new WeakMap;let Dl;const Wl=new WeakMap;let Ql=!1;try{Ql="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(uu){}function createCanvas(F,Da){return Ql?new OffscreenCanvas(F,Da):createElementNS("canvas")}function resizeImage(F,Da,ll){let cl=1;const hl=getDimensions(F);if((hl.width>ll||hl.height>ll)&&(cl=ll/Math.max(hl.width,hl.height)),cl<1){if("undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&F instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&F instanceof ImageBitmap||"undefined"!==typeof VideoFrame&&F instanceof VideoFrame){const ll=Math.floor(cl*hl.width),dl=Math.floor(cl*hl.height);void 0===Dl&&(Dl=createCanvas(ll,dl));const pl=Da?createCanvas(ll,dl):Dl;pl.width=ll,pl.height=dl;return pl.getContext("2d").drawImage(F,0,0,ll,dl),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+hl.width+"x"+hl.height+") to ("+ll+"x"+dl+")."),pl}return"data"in F&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+hl.width+"x"+hl.height+")."),F}return F}function textureNeedsGenerateMipmaps(F){return F.generateMipmaps&&F.minFilter!==rd&&F.minFilter!==od}function generateMipmap(Da){F.generateMipmap(Da)}function getInternalFormat(ll,cl,hl,dl,pl){if(void 0===pl&&(pl=!1),null!==ll){if(void 0!==F[ll])return F[ll];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ll+"'")}let fl=cl;if(cl===F.RED&&(hl===F.FLOAT&&(fl=F.R32F),hl===F.HALF_FLOAT&&(fl=F.R16F),hl===F.UNSIGNED_BYTE&&(fl=F.R8)),cl===F.RED_INTEGER&&(hl===F.UNSIGNED_BYTE&&(fl=F.R8UI),hl===F.UNSIGNED_SHORT&&(fl=F.R16UI),hl===F.UNSIGNED_INT&&(fl=F.R32UI),hl===F.BYTE&&(fl=F.R8I),hl===F.SHORT&&(fl=F.R16I),hl===F.INT&&(fl=F.R32I)),cl===F.RG&&(hl===F.FLOAT&&(fl=F.RG32F),hl===F.HALF_FLOAT&&(fl=F.RG16F),hl===F.UNSIGNED_BYTE&&(fl=F.RG8)),cl===F.RG_INTEGER&&(hl===F.UNSIGNED_BYTE&&(fl=F.RG8UI),hl===F.UNSIGNED_SHORT&&(fl=F.RG16UI),hl===F.UNSIGNED_INT&&(fl=F.RG32UI),hl===F.BYTE&&(fl=F.RG8I),hl===F.SHORT&&(fl=F.RG16I),hl===F.INT&&(fl=F.RG32I)),cl===F.RGB&&hl===F.UNSIGNED_INT_5_9_9_9_REV&&(fl=F.RGB9_E5),cl===F.RGBA){const Da=pl?zp:sm.getTransfer(dl);hl===F.FLOAT&&(fl=F.RGBA32F),hl===F.HALF_FLOAT&&(fl=F.RGBA16F),hl===F.UNSIGNED_BYTE&&(fl=Da===Pp?F.SRGB8_ALPHA8:F.RGBA8),hl===F.UNSIGNED_SHORT_4_4_4_4&&(fl=F.RGBA4),hl===F.UNSIGNED_SHORT_5_5_5_1&&(fl=F.RGB5_A1)}return fl!==F.R16F&&fl!==F.R32F&&fl!==F.RG16F&&fl!==F.RG32F&&fl!==F.RGBA16F&&fl!==F.RGBA32F||Da.get("EXT_color_buffer_float"),fl}function getInternalDepthFormat(Da,ll){let cl;return Da?null===ll||ll===fd||ll===_d?cl=F.DEPTH24_STENCIL8:ll===gd?cl=F.DEPTH32F_STENCIL8:ll===pd&&(cl=F.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):null===ll||ll===fd||ll===_d?cl=F.DEPTH_COMPONENT24:ll===gd?cl=F.DEPTH_COMPONENT32F:ll===pd&&(cl=F.DEPTH_COMPONENT16),cl}function getMipLevels(F,Da){return!0===textureNeedsGenerateMipmaps(F)||F.isFramebufferTexture&&F.minFilter!==rd&&F.minFilter!==od?Math.log2(Math.max(Da.width,Da.height))+1:void 0!==F.mipmaps&&F.mipmaps.length>0?F.mipmaps.length:F.isCompressedTexture&&Array.isArray(F.image)?Da.mipmaps.length:1}function onTextureDispose(F){const Da=F.target;Da.removeEventListener("dispose",onTextureDispose),function(F){const Da=cl.get(F);if(void 0===Da.__webglInit)return;const ll=F.source,hl=Wl.get(ll);if(hl){const cl=hl[Da.__cacheKey];cl.usedTimes--,0===cl.usedTimes&&deleteTexture(F),0===Object.keys(hl).length&&Wl.delete(ll)}cl.remove(F)}(Da),Da.isVideoTexture&&kl.delete(Da)}function onRenderTargetDispose(Da){const ll=Da.target;ll.removeEventListener("dispose",onRenderTargetDispose),function(Da){const ll=cl.get(Da);Da.depthTexture&&Da.depthTexture.dispose();if(Da.isWebGLCubeRenderTarget)for(let cl=0;cl<6;cl++){if(Array.isArray(ll.__webglFramebuffer[cl]))for(let Da=0;Da<ll.__webglFramebuffer[cl].length;Da++)F.deleteFramebuffer(ll.__webglFramebuffer[cl][Da]);else F.deleteFramebuffer(ll.__webglFramebuffer[cl]);ll.__webglDepthbuffer&&F.deleteRenderbuffer(ll.__webglDepthbuffer[cl])}else{if(Array.isArray(ll.__webglFramebuffer))for(let Da=0;Da<ll.__webglFramebuffer.length;Da++)F.deleteFramebuffer(ll.__webglFramebuffer[Da]);else F.deleteFramebuffer(ll.__webglFramebuffer);if(ll.__webglDepthbuffer&&F.deleteRenderbuffer(ll.__webglDepthbuffer),ll.__webglMultisampledFramebuffer&&F.deleteFramebuffer(ll.__webglMultisampledFramebuffer),ll.__webglColorRenderbuffer)for(let Da=0;Da<ll.__webglColorRenderbuffer.length;Da++)ll.__webglColorRenderbuffer[Da]&&F.deleteRenderbuffer(ll.__webglColorRenderbuffer[Da]);ll.__webglDepthRenderbuffer&&F.deleteRenderbuffer(ll.__webglDepthRenderbuffer)}const hl=Da.textures;for(let dl=0,fl=hl.length;dl<fl;dl++){const Da=cl.get(hl[dl]);Da.__webglTexture&&(F.deleteTexture(Da.__webglTexture),pl.memory.textures--),cl.remove(hl[dl])}cl.remove(Da)}(ll)}function deleteTexture(Da){const ll=cl.get(Da);F.deleteTexture(ll.__webglTexture);const hl=Da.source;delete Wl.get(hl)[ll.__cacheKey],pl.memory.textures--}let wc=0;function setTexture2D(Da,hl){const dl=cl.get(Da);if(Da.isVideoTexture&&function(F){const Da=pl.render.frame;kl.get(F)!==Da&&(kl.set(F,Da),F.update())}(Da),!1===Da.isRenderTargetTexture&&Da.version>0&&dl.__version!==Da.version){const F=Da.image;if(null===F)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==F.complete)return void uploadTexture(dl,Da,hl);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}ll.bindTexture(F.TEXTURE_2D,dl.__webglTexture,F.TEXTURE0+hl)}const Sc={[td]:F.REPEAT,[id]:F.CLAMP_TO_EDGE,[nd]:F.MIRRORED_REPEAT},eu={[rd]:F.NEAREST,[ad]:F.NEAREST_MIPMAP_NEAREST,[sd]:F.NEAREST_MIPMAP_LINEAR,[od]:F.LINEAR,[ld]:F.LINEAR_MIPMAP_NEAREST,[cd]:F.LINEAR_MIPMAP_LINEAR},iu={[Up]:F.NEVER,[Hp]:F.ALWAYS,[Bp]:F.LESS,[Fp]:F.LEQUAL,[Op]:F.EQUAL,[Gp]:F.GEQUAL,[jp]:F.GREATER,[Vp]:F.NOTEQUAL};function setTextureParameters(ll,dl){if(dl.type!==gd||!1!==Da.has("OES_texture_float_linear")||dl.magFilter!==od&&dl.magFilter!==ld&&dl.magFilter!==sd&&dl.magFilter!==cd&&dl.minFilter!==od&&dl.minFilter!==ld&&dl.minFilter!==sd&&dl.minFilter!==cd||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),F.texParameteri(ll,F.TEXTURE_WRAP_S,Sc[dl.wrapS]),F.texParameteri(ll,F.TEXTURE_WRAP_T,Sc[dl.wrapT]),ll!==F.TEXTURE_3D&&ll!==F.TEXTURE_2D_ARRAY||F.texParameteri(ll,F.TEXTURE_WRAP_R,Sc[dl.wrapR]),F.texParameteri(ll,F.TEXTURE_MAG_FILTER,eu[dl.magFilter]),F.texParameteri(ll,F.TEXTURE_MIN_FILTER,eu[dl.minFilter]),dl.compareFunction&&(F.texParameteri(ll,F.TEXTURE_COMPARE_MODE,F.COMPARE_REF_TO_TEXTURE),F.texParameteri(ll,F.TEXTURE_COMPARE_FUNC,iu[dl.compareFunction])),!0===Da.has("EXT_texture_filter_anisotropic")){if(dl.magFilter===rd)return;if(dl.minFilter!==sd&&dl.minFilter!==cd)return;if(dl.type===gd&&!1===Da.has("OES_texture_float_linear"))return;if(dl.anisotropy>1||cl.get(dl).__currentAnisotropy){const pl=Da.get("EXT_texture_filter_anisotropic");F.texParameterf(ll,pl.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(dl.anisotropy,hl.getMaxAnisotropy())),cl.get(dl).__currentAnisotropy=dl.anisotropy}}}function initTexture(Da,ll){let cl=!1;void 0===Da.__webglInit&&(Da.__webglInit=!0,ll.addEventListener("dispose",onTextureDispose));const hl=ll.source;let dl=Wl.get(hl);void 0===dl&&(dl={},Wl.set(hl,dl));const fl=function(F){const Da=[];return Da.push(F.wrapS),Da.push(F.wrapT),Da.push(F.wrapR||0),Da.push(F.magFilter),Da.push(F.minFilter),Da.push(F.anisotropy),Da.push(F.internalFormat),Da.push(F.format),Da.push(F.type),Da.push(F.generateMipmaps),Da.push(F.premultiplyAlpha),Da.push(F.flipY),Da.push(F.unpackAlignment),Da.push(F.colorSpace),Da.join()}(ll);if(fl!==Da.__cacheKey){void 0===dl[fl]&&(dl[fl]={texture:F.createTexture(),usedTimes:0},pl.memory.textures++,cl=!0),dl[fl].usedTimes++;const hl=dl[Da.__cacheKey];void 0!==hl&&(dl[Da.__cacheKey].usedTimes--,0===hl.usedTimes&&deleteTexture(ll)),Da.__cacheKey=fl,Da.__webglTexture=dl[fl].texture}return cl}function uploadTexture(Da,pl,fl){let Al=F.TEXTURE_2D;(pl.isDataArrayTexture||pl.isCompressedArrayTexture)&&(Al=F.TEXTURE_2D_ARRAY),pl.isData3DTexture&&(Al=F.TEXTURE_3D);const bl=initTexture(Da,pl),kl=pl.source;ll.bindTexture(Al,Da.__webglTexture,F.TEXTURE0+fl);const Dl=cl.get(kl);if(kl.version!==Dl.__version||!0===bl){ll.activeTexture(F.TEXTURE0+fl);const Da=sm.getPrimaries(sm.workingColorSpace),cl=pl.colorSpace===kp?null:sm.getPrimaries(pl.colorSpace),Wl=pl.colorSpace===kp||Da===cl?F.NONE:F.BROWSER_DEFAULT_WEBGL;F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,pl.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pl.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,pl.unpackAlignment),F.pixelStorei(F.UNPACK_COLORSPACE_CONVERSION_WEBGL,Wl);let Ql=resizeImage(pl.image,!1,hl.maxTextureSize);Ql=verifyColorSpace(pl,Ql);const wc=dl.convert(pl.format,pl.colorSpace),Sc=dl.convert(pl.type);let eu,iu=getInternalFormat(pl.internalFormat,wc,Sc,pl.colorSpace,pl.isVideoTexture);setTextureParameters(Al,pl);const su=pl.mipmaps,cu=!0!==pl.isVideoTexture,uu=void 0===Dl.__version||!0===bl,hu=kl.dataReady,Lu=getMipLevels(pl,Ql);if(pl.isDepthTexture)iu=getInternalDepthFormat(pl.format===Ed,pl.type),uu&&(cu?ll.texStorage2D(F.TEXTURE_2D,1,iu,Ql.width,Ql.height):ll.texImage2D(F.TEXTURE_2D,0,iu,Ql.width,Ql.height,0,wc,Sc,null));else if(pl.isDataTexture)if(su.length>0){cu&&uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,su[0].width,su[0].height);for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,Sc,eu.data):ll.texImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,wc,Sc,eu.data);pl.generateMipmaps=!1}else cu?(uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Ql.width,Ql.height),hu&&ll.texSubImage2D(F.TEXTURE_2D,0,0,0,Ql.width,Ql.height,wc,Sc,Ql.data)):ll.texImage2D(F.TEXTURE_2D,0,iu,Ql.width,Ql.height,0,wc,Sc,Ql.data);else if(pl.isCompressedTexture)if(pl.isCompressedArrayTexture){cu&&uu&&ll.texStorage3D(F.TEXTURE_2D_ARRAY,Lu,iu,su[0].width,su[0].height,Ql.depth);for(let Da=0,cl=su.length;Da<cl;Da++)if(eu=su[Da],pl.format!==bd)if(null!==wc)if(cu){if(hu)if(pl.layerUpdates.size>0){const cl=getByteLength(eu.width,eu.height,pl.format,pl.type);for(const hl of pl.layerUpdates){const dl=eu.data.subarray(hl*cl/eu.data.BYTES_PER_ELEMENT,(hl+1)*cl/eu.data.BYTES_PER_ELEMENT);ll.compressedTexSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,hl,eu.width,eu.height,1,wc,dl,0,0)}pl.clearLayerUpdates()}else ll.compressedTexSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,0,eu.width,eu.height,Ql.depth,wc,eu.data,0,0)}else ll.compressedTexImage3D(F.TEXTURE_2D_ARRAY,Da,iu,eu.width,eu.height,Ql.depth,0,eu.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else cu?hu&&ll.texSubImage3D(F.TEXTURE_2D_ARRAY,Da,0,0,0,eu.width,eu.height,Ql.depth,wc,Sc,eu.data):ll.texImage3D(F.TEXTURE_2D_ARRAY,Da,iu,eu.width,eu.height,Ql.depth,0,wc,Sc,eu.data)}else{cu&&uu&&ll.texStorage2D(F.TEXTURE_2D,Lu,iu,su[0].width,su[0].height);for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],pl.format!==bd?null!==wc?cu?hu&&ll.compressedTexSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,eu.data):ll.compressedTexImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,eu.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,eu.width,eu.height,wc,Sc,eu.data):ll.texImage2D(F.TEXTURE_2D,Da,iu,eu.width,eu.height,0,wc,Sc,eu.data)}else if(pl.isDataArrayTexture)if(cu){if(uu&&ll.texStorage3D(F.TEXTURE_2D_ARRAY,Lu,iu,Ql.width,Ql.height,Ql.depth),hu)if(pl.layerUpdates.size>0){const Da=getByteLength(Ql.width,Ql.height,pl.format,pl.type);for(const cl of pl.layerUpdates){const hl=Ql.data.subarray(cl*Da/Ql.data.BYTES_PER_ELEMENT,(cl+1)*Da/Ql.data.BYTES_PER_ELEMENT);ll.texSubImage3D(F.TEXTURE_2D_ARRAY,0,0,0,cl,Ql.width,Ql.height,1,wc,Sc,hl)}pl.clearLayerUpdates()}else ll.texSubImage3D(F.TEXTURE_2D_ARRAY,0,0,0,0,Ql.width,Ql.height,Ql.depth,wc,Sc,Ql.data)}else ll.texImage3D(F.TEXTURE_2D_ARRAY,0,iu,Ql.width,Ql.height,Ql.depth,0,wc,Sc,Ql.data);else if(pl.isData3DTexture)cu?(uu&&ll.texStorage3D(F.TEXTURE_3D,Lu,iu,Ql.width,Ql.height,Ql.depth),hu&&ll.texSubImage3D(F.TEXTURE_3D,0,0,0,0,Ql.width,Ql.height,Ql.depth,wc,Sc,Ql.data)):ll.texImage3D(F.TEXTURE_3D,0,iu,Ql.width,Ql.height,Ql.depth,0,wc,Sc,Ql.data);else if(pl.isFramebufferTexture){if(uu)if(cu)ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Ql.width,Ql.height);else{let Da=Ql.width,cl=Ql.height;for(let hl=0;hl<Lu;hl++)ll.texImage2D(F.TEXTURE_2D,hl,iu,Da,cl,0,wc,Sc,null),Da>>=1,cl>>=1}}else if(su.length>0){if(cu&&uu){const Da=getDimensions(su[0]);ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Da.width,Da.height)}for(let Da=0,cl=su.length;Da<cl;Da++)eu=su[Da],cu?hu&&ll.texSubImage2D(F.TEXTURE_2D,Da,0,0,wc,Sc,eu):ll.texImage2D(F.TEXTURE_2D,Da,iu,wc,Sc,eu);pl.generateMipmaps=!1}else if(cu){if(uu){const Da=getDimensions(Ql);ll.texStorage2D(F.TEXTURE_2D,Lu,iu,Da.width,Da.height)}hu&&ll.texSubImage2D(F.TEXTURE_2D,0,0,0,wc,Sc,Ql)}else ll.texImage2D(F.TEXTURE_2D,0,iu,wc,Sc,Ql);textureNeedsGenerateMipmaps(pl)&&generateMipmap(Al),Dl.__version=kl.version,pl.onUpdate&&pl.onUpdate(pl)}Da.__version=pl.version}function setupFrameBufferTexture(Da,hl,pl,Al,bl,kl){const Dl=dl.convert(pl.format,pl.colorSpace),Wl=dl.convert(pl.type),Ql=getInternalFormat(pl.internalFormat,Dl,Wl,pl.colorSpace);if(!cl.get(hl).__hasExternalTextures){const Da=Math.max(1,hl.width>>kl),cl=Math.max(1,hl.height>>kl);bl===F.TEXTURE_3D||bl===F.TEXTURE_2D_ARRAY?ll.texImage3D(bl,kl,Ql,Da,cl,hl.depth,0,Dl,Wl,null):ll.texImage2D(bl,kl,Ql,Da,cl,0,Dl,Wl,null)}ll.bindFramebuffer(F.FRAMEBUFFER,Da),useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,Al,bl,cl.get(pl).__webglTexture,0,getRenderTargetSamples(hl)):(bl===F.TEXTURE_2D||bl>=F.TEXTURE_CUBE_MAP_POSITIVE_X&&bl<=F.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&F.framebufferTexture2D(F.FRAMEBUFFER,Al,bl,cl.get(pl).__webglTexture,kl),ll.bindFramebuffer(F.FRAMEBUFFER,null)}function setupRenderBufferStorage(Da,ll,cl){if(F.bindRenderbuffer(F.RENDERBUFFER,Da),ll.depthBuffer){const hl=ll.depthTexture,dl=hl&&hl.isDepthTexture?hl.type:null,pl=getInternalDepthFormat(ll.stencilBuffer,dl),Al=ll.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,bl=getRenderTargetSamples(ll);useMultisampledRTT(ll)?fl.renderbufferStorageMultisampleEXT(F.RENDERBUFFER,bl,pl,ll.width,ll.height):cl?F.renderbufferStorageMultisample(F.RENDERBUFFER,bl,pl,ll.width,ll.height):F.renderbufferStorage(F.RENDERBUFFER,pl,ll.width,ll.height),F.framebufferRenderbuffer(F.FRAMEBUFFER,Al,F.RENDERBUFFER,Da)}else{const Da=ll.textures;for(let hl=0;hl<Da.length;hl++){const pl=Da[hl],Al=dl.convert(pl.format,pl.colorSpace),bl=dl.convert(pl.type),kl=getInternalFormat(pl.internalFormat,Al,bl,pl.colorSpace),Dl=getRenderTargetSamples(ll);cl&&!1===useMultisampledRTT(ll)?F.renderbufferStorageMultisample(F.RENDERBUFFER,Dl,kl,ll.width,ll.height):useMultisampledRTT(ll)?fl.renderbufferStorageMultisampleEXT(F.RENDERBUFFER,Dl,kl,ll.width,ll.height):F.renderbufferStorage(F.RENDERBUFFER,kl,ll.width,ll.height)}}F.bindRenderbuffer(F.RENDERBUFFER,null)}function setupDepthRenderbuffer(Da){const hl=cl.get(Da),dl=!0===Da.isWebGLCubeRenderTarget;if(hl.__boundDepthTexture!==Da.depthTexture){const F=Da.depthTexture;if(hl.__depthDisposeCallback&&hl.__depthDisposeCallback(),F){const disposeEvent=()=>{delete hl.__boundDepthTexture,delete hl.__depthDisposeCallback,F.removeEventListener("dispose",disposeEvent)};F.addEventListener("dispose",disposeEvent),hl.__depthDisposeCallback=disposeEvent}hl.__boundDepthTexture=F}if(Da.depthTexture&&!hl.__autoAllocateDepthBuffer){if(dl)throw new Error("target.depthTexture not supported in Cube render targets");!function(Da,hl){if(hl&&hl.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(ll.bindFramebuffer(F.FRAMEBUFFER,Da),!hl.depthTexture||!hl.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");cl.get(hl.depthTexture).__webglTexture&&hl.depthTexture.image.width===hl.width&&hl.depthTexture.image.height===hl.height||(hl.depthTexture.image.width=hl.width,hl.depthTexture.image.height=hl.height,hl.depthTexture.needsUpdate=!0),setTexture2D(hl.depthTexture,0);const dl=cl.get(hl.depthTexture).__webglTexture,pl=getRenderTargetSamples(hl);if(hl.depthTexture.format===wd)useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,F.DEPTH_ATTACHMENT,F.TEXTURE_2D,dl,0,pl):F.framebufferTexture2D(F.FRAMEBUFFER,F.DEPTH_ATTACHMENT,F.TEXTURE_2D,dl,0);else{if(hl.depthTexture.format!==Ed)throw new Error("Unknown depthTexture format");useMultisampledRTT(hl)?fl.framebufferTexture2DMultisampleEXT(F.FRAMEBUFFER,F.DEPTH_STENCIL_ATTACHMENT,F.TEXTURE_2D,dl,0,pl):F.framebufferTexture2D(F.FRAMEBUFFER,F.DEPTH_STENCIL_ATTACHMENT,F.TEXTURE_2D,dl,0)}}(hl.__webglFramebuffer,Da)}else if(dl){hl.__webglDepthbuffer=[];for(let cl=0;cl<6;cl++)if(ll.bindFramebuffer(F.FRAMEBUFFER,hl.__webglFramebuffer[cl]),void 0===hl.__webglDepthbuffer[cl])hl.__webglDepthbuffer[cl]=F.createRenderbuffer(),setupRenderBufferStorage(hl.__webglDepthbuffer[cl],Da,!1);else{const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,dl=hl.__webglDepthbuffer[cl];F.bindRenderbuffer(F.RENDERBUFFER,dl),F.framebufferRenderbuffer(F.FRAMEBUFFER,ll,F.RENDERBUFFER,dl)}}else if(ll.bindFramebuffer(F.FRAMEBUFFER,hl.__webglFramebuffer),void 0===hl.__webglDepthbuffer)hl.__webglDepthbuffer=F.createRenderbuffer(),setupRenderBufferStorage(hl.__webglDepthbuffer,Da,!1);else{const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,cl=hl.__webglDepthbuffer;F.bindRenderbuffer(F.RENDERBUFFER,cl),F.framebufferRenderbuffer(F.FRAMEBUFFER,ll,F.RENDERBUFFER,cl)}ll.bindFramebuffer(F.FRAMEBUFFER,null)}const su=[],cu=[];function getRenderTargetSamples(F){return Math.min(hl.maxSamples,F.samples)}function useMultisampledRTT(F){const ll=cl.get(F);return F.samples>0&&!0===Da.has("WEBGL_multisampled_render_to_texture")&&!1!==ll.__useRenderToTexture}function verifyColorSpace(F,Da){const ll=F.colorSpace,cl=F.format,hl=F.type;return!0===F.isCompressedTexture||!0===F.isVideoTexture||ll!==Ip&&ll!==kp&&(sm.getTransfer(ll)===Pp?cl===bd&&hl===ud||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ll)),Da}function getDimensions(F){return"undefined"!==typeof HTMLImageElement&&F instanceof HTMLImageElement?(bl.width=F.naturalWidth||F.width,bl.height=F.naturalHeight||F.height):"undefined"!==typeof VideoFrame&&F instanceof VideoFrame?(bl.width=F.displayWidth,bl.height=F.displayHeight):(bl.width=F.width,bl.height=F.height),bl}this.allocateTextureUnit=function(){const F=wc;return F>=hl.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+F+" texture units while this GPU supports only "+hl.maxTextures),wc+=1,F},this.resetTextureUnits=function(){wc=0},this.setTexture2D=setTexture2D,this.setTexture2DArray=function(Da,hl){const dl=cl.get(Da);Da.version>0&&dl.__version!==Da.version?uploadTexture(dl,Da,hl):ll.bindTexture(F.TEXTURE_2D_ARRAY,dl.__webglTexture,F.TEXTURE0+hl)},this.setTexture3D=function(Da,hl){const dl=cl.get(Da);Da.version>0&&dl.__version!==Da.version?uploadTexture(dl,Da,hl):ll.bindTexture(F.TEXTURE_3D,dl.__webglTexture,F.TEXTURE0+hl)},this.setTextureCube=function(Da,pl){const fl=cl.get(Da);Da.version>0&&fl.__version!==Da.version?function(Da,pl,fl){if(6!==pl.image.length)return;const Al=initTexture(Da,pl),bl=pl.source;ll.bindTexture(F.TEXTURE_CUBE_MAP,Da.__webglTexture,F.TEXTURE0+fl);const kl=cl.get(bl);if(bl.version!==kl.__version||!0===Al){ll.activeTexture(F.TEXTURE0+fl);const Da=sm.getPrimaries(sm.workingColorSpace),cl=pl.colorSpace===kp?null:sm.getPrimaries(pl.colorSpace),Dl=pl.colorSpace===kp||Da===cl?F.NONE:F.BROWSER_DEFAULT_WEBGL;F.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,pl.flipY),F.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pl.premultiplyAlpha),F.pixelStorei(F.UNPACK_ALIGNMENT,pl.unpackAlignment),F.pixelStorei(F.UNPACK_COLORSPACE_CONVERSION_WEBGL,Dl);const Wl=pl.isCompressedTexture||pl.image[0].isCompressedTexture,Ql=pl.image[0]&&pl.image[0].isDataTexture,wc=[];for(let F=0;F<6;F++)wc[F]=Wl||Ql?Ql?pl.image[F].image:pl.image[F]:resizeImage(pl.image[F],!0,hl.maxCubemapSize),wc[F]=verifyColorSpace(pl,wc[F]);const Sc=wc[0],eu=dl.convert(pl.format,pl.colorSpace),iu=dl.convert(pl.type),su=getInternalFormat(pl.internalFormat,eu,iu,pl.colorSpace),cu=!0!==pl.isVideoTexture,uu=void 0===kl.__version||!0===Al,hu=bl.dataReady;let Lu,zu=getMipLevels(pl,Sc);if(setTextureParameters(F.TEXTURE_CUBE_MAP,pl),Wl){cu&&uu&&ll.texStorage2D(F.TEXTURE_CUBE_MAP,zu,su,Sc.width,Sc.height);for(let Da=0;Da<6;Da++){Lu=wc[Da].mipmaps;for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl];pl.format!==bd?null!==eu?cu?hu&&ll.compressedTexSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,0,0,hl.width,hl.height,eu,hl.data):ll.compressedTexImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,su,hl.width,hl.height,0,hl.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,0,0,hl.width,hl.height,eu,iu,hl.data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl,su,hl.width,hl.height,0,eu,iu,hl.data)}}}else{if(Lu=pl.mipmaps,cu&&uu){Lu.length>0&&zu++;const Da=getDimensions(wc[0]);ll.texStorage2D(F.TEXTURE_CUBE_MAP,zu,su,Da.width,Da.height)}for(let Da=0;Da<6;Da++)if(Ql){cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,0,0,wc[Da].width,wc[Da].height,eu,iu,wc[Da].data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,su,wc[Da].width,wc[Da].height,0,eu,iu,wc[Da].data);for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl].image[Da].image;cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,0,0,hl.width,hl.height,eu,iu,hl.data):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,su,hl.width,hl.height,0,eu,iu,hl.data)}}else{cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,0,0,eu,iu,wc[Da]):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,0,su,eu,iu,wc[Da]);for(let cl=0;cl<Lu.length;cl++){const hl=Lu[cl];cu?hu&&ll.texSubImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,0,0,eu,iu,hl.image[Da]):ll.texImage2D(F.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl+1,su,eu,iu,hl.image[Da])}}}textureNeedsGenerateMipmaps(pl)&&generateMipmap(F.TEXTURE_CUBE_MAP),kl.__version=bl.version,pl.onUpdate&&pl.onUpdate(pl)}Da.__version=pl.version}(fl,Da,pl):ll.bindTexture(F.TEXTURE_CUBE_MAP,fl.__webglTexture,F.TEXTURE0+pl)},this.rebindTextures=function(Da,ll,hl){const dl=cl.get(Da);void 0!==ll&&setupFrameBufferTexture(dl.__webglFramebuffer,Da,Da.texture,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,0),void 0!==hl&&setupDepthRenderbuffer(Da)},this.setupRenderTarget=function(Da){const hl=Da.texture,fl=cl.get(Da),Al=cl.get(hl);Da.addEventListener("dispose",onRenderTargetDispose);const bl=Da.textures,kl=!0===Da.isWebGLCubeRenderTarget,Dl=bl.length>1;if(Dl||(void 0===Al.__webglTexture&&(Al.__webglTexture=F.createTexture()),Al.__version=hl.version,pl.memory.textures++),kl){fl.__webglFramebuffer=[];for(let Da=0;Da<6;Da++)if(hl.mipmaps&&hl.mipmaps.length>0){fl.__webglFramebuffer[Da]=[];for(let ll=0;ll<hl.mipmaps.length;ll++)fl.__webglFramebuffer[Da][ll]=F.createFramebuffer()}else fl.__webglFramebuffer[Da]=F.createFramebuffer()}else{if(hl.mipmaps&&hl.mipmaps.length>0){fl.__webglFramebuffer=[];for(let Da=0;Da<hl.mipmaps.length;Da++)fl.__webglFramebuffer[Da]=F.createFramebuffer()}else fl.__webglFramebuffer=F.createFramebuffer();if(Dl)for(let Da=0,ll=bl.length;Da<ll;Da++){const ll=cl.get(bl[Da]);void 0===ll.__webglTexture&&(ll.__webglTexture=F.createTexture(),pl.memory.textures++)}if(Da.samples>0&&!1===useMultisampledRTT(Da)){fl.__webglMultisampledFramebuffer=F.createFramebuffer(),fl.__webglColorRenderbuffer=[],ll.bindFramebuffer(F.FRAMEBUFFER,fl.__webglMultisampledFramebuffer);for(let ll=0;ll<bl.length;ll++){const cl=bl[ll];fl.__webglColorRenderbuffer[ll]=F.createRenderbuffer(),F.bindRenderbuffer(F.RENDERBUFFER,fl.__webglColorRenderbuffer[ll]);const hl=dl.convert(cl.format,cl.colorSpace),pl=dl.convert(cl.type),Al=getInternalFormat(cl.internalFormat,hl,pl,cl.colorSpace,!0===Da.isXRRenderTarget),kl=getRenderTargetSamples(Da);F.renderbufferStorageMultisample(F.RENDERBUFFER,kl,Al,Da.width,Da.height),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+ll,F.RENDERBUFFER,fl.__webglColorRenderbuffer[ll])}F.bindRenderbuffer(F.RENDERBUFFER,null),Da.depthBuffer&&(fl.__webglDepthRenderbuffer=F.createRenderbuffer(),setupRenderBufferStorage(fl.__webglDepthRenderbuffer,Da,!0)),ll.bindFramebuffer(F.FRAMEBUFFER,null)}}if(kl){ll.bindTexture(F.TEXTURE_CUBE_MAP,Al.__webglTexture),setTextureParameters(F.TEXTURE_CUBE_MAP,hl);for(let ll=0;ll<6;ll++)if(hl.mipmaps&&hl.mipmaps.length>0)for(let cl=0;cl<hl.mipmaps.length;cl++)setupFrameBufferTexture(fl.__webglFramebuffer[ll][cl],Da,hl,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+ll,cl);else setupFrameBufferTexture(fl.__webglFramebuffer[ll],Da,hl,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+ll,0);textureNeedsGenerateMipmaps(hl)&&generateMipmap(F.TEXTURE_CUBE_MAP),ll.unbindTexture()}else if(Dl){for(let hl=0,dl=bl.length;hl<dl;hl++){const dl=bl[hl],pl=cl.get(dl);ll.bindTexture(F.TEXTURE_2D,pl.__webglTexture),setTextureParameters(F.TEXTURE_2D,dl),setupFrameBufferTexture(fl.__webglFramebuffer,Da,dl,F.COLOR_ATTACHMENT0+hl,F.TEXTURE_2D,0),textureNeedsGenerateMipmaps(dl)&&generateMipmap(F.TEXTURE_2D)}ll.unbindTexture()}else{let cl=F.TEXTURE_2D;if((Da.isWebGL3DRenderTarget||Da.isWebGLArrayRenderTarget)&&(cl=Da.isWebGL3DRenderTarget?F.TEXTURE_3D:F.TEXTURE_2D_ARRAY),ll.bindTexture(cl,Al.__webglTexture),setTextureParameters(cl,hl),hl.mipmaps&&hl.mipmaps.length>0)for(let ll=0;ll<hl.mipmaps.length;ll++)setupFrameBufferTexture(fl.__webglFramebuffer[ll],Da,hl,F.COLOR_ATTACHMENT0,cl,ll);else setupFrameBufferTexture(fl.__webglFramebuffer,Da,hl,F.COLOR_ATTACHMENT0,cl,0);textureNeedsGenerateMipmaps(hl)&&generateMipmap(cl),ll.unbindTexture()}Da.depthBuffer&&setupDepthRenderbuffer(Da)},this.updateRenderTargetMipmap=function(Da){const hl=Da.textures;for(let dl=0,pl=hl.length;dl<pl;dl++){const pl=hl[dl];if(textureNeedsGenerateMipmaps(pl)){const hl=Da.isWebGLCubeRenderTarget?F.TEXTURE_CUBE_MAP:F.TEXTURE_2D,dl=cl.get(pl).__webglTexture;ll.bindTexture(hl,dl),generateMipmap(hl),ll.unbindTexture()}}},this.updateMultisampleRenderTarget=function(Da){if(Da.samples>0)if(!1===useMultisampledRTT(Da)){const hl=Da.textures,dl=Da.width,pl=Da.height;let fl=F.COLOR_BUFFER_BIT;const bl=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT,kl=cl.get(Da),Dl=hl.length>1;if(Dl)for(let Da=0;Da<hl.length;Da++)ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglMultisampledFramebuffer),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.RENDERBUFFER,null),ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglFramebuffer),F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.TEXTURE_2D,null,0);ll.bindFramebuffer(F.READ_FRAMEBUFFER,kl.__webglMultisampledFramebuffer),ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,kl.__webglFramebuffer);for(let ll=0;ll<hl.length;ll++){if(Da.resolveDepthBuffer&&(Da.depthBuffer&&(fl|=F.DEPTH_BUFFER_BIT),Da.stencilBuffer&&Da.resolveStencilBuffer&&(fl|=F.STENCIL_BUFFER_BIT)),Dl){F.framebufferRenderbuffer(F.READ_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.RENDERBUFFER,kl.__webglColorRenderbuffer[ll]);const Da=cl.get(hl[ll]).__webglTexture;F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,Da,0)}F.blitFramebuffer(0,0,dl,pl,0,0,dl,pl,fl,F.NEAREST),!0===Al&&(su.length=0,cu.length=0,su.push(F.COLOR_ATTACHMENT0+ll),Da.depthBuffer&&!1===Da.resolveDepthBuffer&&(su.push(bl),cu.push(bl),F.invalidateFramebuffer(F.DRAW_FRAMEBUFFER,cu)),F.invalidateFramebuffer(F.READ_FRAMEBUFFER,su))}if(ll.bindFramebuffer(F.READ_FRAMEBUFFER,null),ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,null),Dl)for(let Da=0;Da<hl.length;Da++){ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglMultisampledFramebuffer),F.framebufferRenderbuffer(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.RENDERBUFFER,kl.__webglColorRenderbuffer[Da]);const dl=cl.get(hl[Da]).__webglTexture;ll.bindFramebuffer(F.FRAMEBUFFER,kl.__webglFramebuffer),F.framebufferTexture2D(F.DRAW_FRAMEBUFFER,F.COLOR_ATTACHMENT0+Da,F.TEXTURE_2D,dl,0)}ll.bindFramebuffer(F.DRAW_FRAMEBUFFER,kl.__webglMultisampledFramebuffer)}else if(Da.depthBuffer&&!1===Da.resolveDepthBuffer&&Al){const ll=Da.stencilBuffer?F.DEPTH_STENCIL_ATTACHMENT:F.DEPTH_ATTACHMENT;F.invalidateFramebuffer(F.DRAW_FRAMEBUFFER,[ll])}},this.setupDepthRenderbuffer=setupDepthRenderbuffer,this.setupFrameBufferTexture=setupFrameBufferTexture,this.useMultisampledRTT=useMultisampledRTT}function WebGLUtils(F,Da){return{convert:function(ll,cl){let hl;void 0===cl&&(cl=kp);const dl=sm.getTransfer(cl);if(ll===ud)return F.UNSIGNED_BYTE;if(ll===yd)return F.UNSIGNED_SHORT_4_4_4_4;if(ll===vd)return F.UNSIGNED_SHORT_5_5_5_1;if(ll===xd)return F.UNSIGNED_INT_5_9_9_9_REV;if(ll===hd)return F.BYTE;if(ll===dd)return F.SHORT;if(ll===pd)return F.UNSIGNED_SHORT;if(ll===md)return F.INT;if(ll===fd)return F.UNSIGNED_INT;if(ll===gd)return F.FLOAT;if(ll===Ad)return F.HALF_FLOAT;if(1021===ll)return F.ALPHA;if(1022===ll)return F.RGB;if(ll===bd)return F.RGBA;if(1024===ll)return F.LUMINANCE;if(1025===ll)return F.LUMINANCE_ALPHA;if(ll===wd)return F.DEPTH_COMPONENT;if(ll===Ed)return F.DEPTH_STENCIL;if(ll===Md)return F.RED;if(ll===Sd)return F.RED_INTEGER;if(1030===ll)return F.RG;if(ll===kd)return F.RG_INTEGER;if(ll===Td)return F.RGBA_INTEGER;if(ll===Id||ll===Cd||ll===Ld||ll===zd)if(dl===Pp){if(hl=Da.get("WEBGL_compressed_texture_s3tc_srgb"),null===hl)return null;if(ll===Id)return hl.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(ll===Cd)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(ll===Ld)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(ll===zd)return hl.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(hl=Da.get("WEBGL_compressed_texture_s3tc"),null===hl)return null;if(ll===Id)return hl.COMPRESSED_RGB_S3TC_DXT1_EXT;if(ll===Cd)return hl.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(ll===Ld)return hl.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(ll===zd)return hl.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(ll===Pd||ll===Dd||ll===Rd||ll===Nd){if(hl=Da.get("WEBGL_compressed_texture_pvrtc"),null===hl)return null;if(ll===Pd)return hl.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(ll===Dd)return hl.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(ll===Rd)return hl.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(ll===Nd)return hl.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(ll===Ud||ll===Bd||ll===Od){if(hl=Da.get("WEBGL_compressed_texture_etc"),null===hl)return null;if(ll===Ud||ll===Bd)return dl===Pp?hl.COMPRESSED_SRGB8_ETC2:hl.COMPRESSED_RGB8_ETC2;if(ll===Od)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:hl.COMPRESSED_RGBA8_ETC2_EAC}if(ll===Fd||ll===jd||ll===Vd||ll===Gd||ll===Hd||ll===qd||ll===Zd||ll===Wd||ll===Kd||ll===Qd||ll===Xd||ll===Yd||ll===Jd||ll===$d){if(hl=Da.get("WEBGL_compressed_texture_astc"),null===hl)return null;if(ll===Fd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:hl.COMPRESSED_RGBA_ASTC_4x4_KHR;if(ll===jd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:hl.COMPRESSED_RGBA_ASTC_5x4_KHR;if(ll===Vd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:hl.COMPRESSED_RGBA_ASTC_5x5_KHR;if(ll===Gd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:hl.COMPRESSED_RGBA_ASTC_6x5_KHR;if(ll===Hd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:hl.COMPRESSED_RGBA_ASTC_6x6_KHR;if(ll===qd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:hl.COMPRESSED_RGBA_ASTC_8x5_KHR;if(ll===Zd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:hl.COMPRESSED_RGBA_ASTC_8x6_KHR;if(ll===Wd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:hl.COMPRESSED_RGBA_ASTC_8x8_KHR;if(ll===Kd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:hl.COMPRESSED_RGBA_ASTC_10x5_KHR;if(ll===Qd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:hl.COMPRESSED_RGBA_ASTC_10x6_KHR;if(ll===Xd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:hl.COMPRESSED_RGBA_ASTC_10x8_KHR;if(ll===Yd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:hl.COMPRESSED_RGBA_ASTC_10x10_KHR;if(ll===Jd)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:hl.COMPRESSED_RGBA_ASTC_12x10_KHR;if(ll===$d)return dl===Pp?hl.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:hl.COMPRESSED_RGBA_ASTC_12x12_KHR}if(ll===lp||ll===mp||ll===gp){if(hl=Da.get("EXT_texture_compression_bptc"),null===hl)return null;if(ll===lp)return dl===Pp?hl.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:hl.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(ll===mp)return hl.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(ll===gp)return hl.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===ll||ll===Ap||ll===vp||ll===_p){if(hl=Da.get("EXT_texture_compression_rgtc"),null===hl)return null;if(ll===lp)return hl.COMPRESSED_RED_RGTC1_EXT;if(ll===Ap)return hl.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(ll===vp)return hl.COMPRESSED_RED_GREEN_RGTC2_EXT;if(ll===_p)return hl.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return ll===_d?F.UNSIGNED_INT_24_8:void 0!==F[ll]?F[ll]:null}}}class ArrayCamera extends PerspectiveCamera{constructor(F){void 0===F&&(F=[]),super(),this.isArrayCamera=!0,this.cameras=F}}class Group extends Object3D{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Bg={type:"move"};class WebXRController{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Group,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Group,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Vector3,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Vector3),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Group,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Vector3,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Vector3),this._grip}dispatchEvent(F){return null!==this._targetRay&&this._targetRay.dispatchEvent(F),null!==this._grip&&this._grip.dispatchEvent(F),null!==this._hand&&this._hand.dispatchEvent(F),this}connect(F){if(F&&F.hand){const Da=this._hand;if(Da)for(const ll of F.hand.values())this._getHandJoint(Da,ll)}return this.dispatchEvent({type:"connected",data:F}),this}disconnect(F){return this.dispatchEvent({type:"disconnected",data:F}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(F,Da,ll){let cl=null,hl=null,dl=null;const pl=this._targetRay,fl=this._grip,Al=this._hand;if(F&&"visible-blurred"!==Da.session.visibilityState){if(Al&&F.hand){dl=!0;for(const dl of F.hand.values()){const F=Da.getJointPose(dl,ll),cl=this._getHandJoint(Al,dl);null!==F&&(cl.matrix.fromArray(F.transform.matrix),cl.matrix.decompose(cl.position,cl.rotation,cl.scale),cl.matrixWorldNeedsUpdate=!0,cl.jointRadius=F.radius),cl.visible=null!==F}const cl=Al.joints["index-finger-tip"],hl=Al.joints["thumb-tip"],pl=cl.position.distanceTo(hl.position),fl=.02,bl=.005;Al.inputState.pinching&&pl>fl+bl?(Al.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:F.handedness,target:this})):!Al.inputState.pinching&&pl<=fl-bl&&(Al.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:F.handedness,target:this}))}else null!==fl&&F.gripSpace&&(hl=Da.getPose(F.gripSpace,ll),null!==hl&&(fl.matrix.fromArray(hl.transform.matrix),fl.matrix.decompose(fl.position,fl.rotation,fl.scale),fl.matrixWorldNeedsUpdate=!0,hl.linearVelocity?(fl.hasLinearVelocity=!0,fl.linearVelocity.copy(hl.linearVelocity)):fl.hasLinearVelocity=!1,hl.angularVelocity?(fl.hasAngularVelocity=!0,fl.angularVelocity.copy(hl.angularVelocity)):fl.hasAngularVelocity=!1));null!==pl&&(cl=Da.getPose(F.targetRaySpace,ll),null===cl&&null!==hl&&(cl=hl),null!==cl&&(pl.matrix.fromArray(cl.transform.matrix),pl.matrix.decompose(pl.position,pl.rotation,pl.scale),pl.matrixWorldNeedsUpdate=!0,cl.linearVelocity?(pl.hasLinearVelocity=!0,pl.linearVelocity.copy(cl.linearVelocity)):pl.hasLinearVelocity=!1,cl.angularVelocity?(pl.hasAngularVelocity=!0,pl.angularVelocity.copy(cl.angularVelocity)):pl.hasAngularVelocity=!1,this.dispatchEvent(Bg)))}return null!==pl&&(pl.visible=null!==cl),null!==fl&&(fl.visible=null!==hl),null!==Al&&(Al.visible=null!==dl),this}_getHandJoint(F,Da){if(void 0===F.joints[Da.jointName]){const ll=new Group;ll.matrixAutoUpdate=!1,ll.visible=!1,F.joints[Da.jointName]=ll,F.add(ll)}return F.joints[Da.jointName]}}class WebXRDepthSensing{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(F,Da,ll){if(null===this.texture){const cl=new Texture;F.properties.get(cl).__webglTexture=Da.texture,Da.depthNear==ll.depthNear&&Da.depthFar==ll.depthFar||(this.depthNear=Da.depthNear,this.depthFar=Da.depthFar),this.texture=cl}}getMesh(F){if(null!==this.texture&&null===this.mesh){const Da=F.cameras[0].viewport,ll=new ShaderMaterial({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:Da.z},depthHeight:{value:Da.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),ll)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class WebXRManager extends EventDispatcher{constructor(F,Da){super();const ll=this;let cl=null,hl=1,dl=null,pl="local-floor",fl=1,Al=null,bl=null,kl=null,Dl=null,Wl=null,Ql=null;const wc=new WebXRDepthSensing,Sc=Da.getContextAttributes();let eu=null,iu=null;const su=[],cu=[],uu=new Vector2;let hu=null;const Lu=new PerspectiveCamera;Lu.layers.enable(1),Lu.viewport=new Vector4;const zu=new PerspectiveCamera;zu.layers.enable(2),zu.viewport=new Vector4;const Du=[Lu,zu],Nu=new ArrayCamera;Nu.layers.enable(1),Nu.layers.enable(2);let qu=null,ih=null;function onSessionEvent(F){const Da=cu.indexOf(F.inputSource);if(-1===Da)return;const ll=su[Da];void 0!==ll&&(ll.update(F.inputSource,F.frame,Al||dl),ll.dispatchEvent({type:F.type,data:F.inputSource}))}function onSessionEnd(){cl.removeEventListener("select",onSessionEvent),cl.removeEventListener("selectstart",onSessionEvent),cl.removeEventListener("selectend",onSessionEvent),cl.removeEventListener("squeeze",onSessionEvent),cl.removeEventListener("squeezestart",onSessionEvent),cl.removeEventListener("squeezeend",onSessionEvent),cl.removeEventListener("end",onSessionEnd),cl.removeEventListener("inputsourceschange",onInputSourcesChange);for(let F=0;F<su.length;F++){const Da=cu[F];null!==Da&&(cu[F]=null,su[F].disconnect(Da))}qu=null,ih=null,wc.reset(),F.setRenderTarget(eu),Wl=null,Dl=null,kl=null,cl=null,iu=null,id.stop(),ll.isPresenting=!1,F.setPixelRatio(hu),F.setSize(uu.width,uu.height,!1),ll.dispatchEvent({type:"sessionend"})}function onInputSourcesChange(F){for(let Da=0;Da<F.removed.length;Da++){const ll=F.removed[Da],cl=cu.indexOf(ll);cl>=0&&(cu[cl]=null,su[cl].disconnect(ll))}for(let Da=0;Da<F.added.length;Da++){const ll=F.added[Da];let cl=cu.indexOf(ll);if(-1===cl){for(let F=0;F<su.length;F++){if(F>=cu.length){cu.push(ll),cl=F;break}if(null===cu[F]){cu[F]=ll,cl=F;break}}if(-1===cl)break}const hl=su[cl];hl&&hl.connect(ll)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getTargetRaySpace()},this.getControllerGrip=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getGripSpace()},this.getHand=function(F){let Da=su[F];return void 0===Da&&(Da=new WebXRController,su[F]=Da),Da.getHandSpace()},this.setFramebufferScaleFactor=function(F){hl=F,!0===ll.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(F){pl=F,!0===ll.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return Al||dl},this.setReferenceSpace=function(F){Al=F},this.getBaseLayer=function(){return null!==Dl?Dl:Wl},this.getBinding=function(){return kl},this.getFrame=function(){return Ql},this.getSession=function(){return cl},this.setSession=async function(bl){if(cl=bl,null!==cl){if(eu=F.getRenderTarget(),cl.addEventListener("select",onSessionEvent),cl.addEventListener("selectstart",onSessionEvent),cl.addEventListener("selectend",onSessionEvent),cl.addEventListener("squeeze",onSessionEvent),cl.addEventListener("squeezestart",onSessionEvent),cl.addEventListener("squeezeend",onSessionEvent),cl.addEventListener("end",onSessionEnd),cl.addEventListener("inputsourceschange",onInputSourcesChange),!0!==Sc.xrCompatible&&await Da.makeXRCompatible(),hu=F.getPixelRatio(),F.getSize(uu),void 0===cl.renderState.layers){const ll={antialias:Sc.antialias,alpha:!0,depth:Sc.depth,stencil:Sc.stencil,framebufferScaleFactor:hl};Wl=new XRWebGLLayer(cl,Da,ll),cl.updateRenderState({baseLayer:Wl}),F.setPixelRatio(1),F.setSize(Wl.framebufferWidth,Wl.framebufferHeight,!1),iu=new WebGLRenderTarget(Wl.framebufferWidth,Wl.framebufferHeight,{format:bd,type:ud,colorSpace:F.outputColorSpace,stencilBuffer:Sc.stencil})}else{let ll=null,dl=null,pl=null;Sc.depth&&(pl=Sc.stencil?Da.DEPTH24_STENCIL8:Da.DEPTH_COMPONENT24,ll=Sc.stencil?Ed:wd,dl=Sc.stencil?_d:fd);const fl={colorFormat:Da.RGBA8,depthFormat:pl,scaleFactor:hl};kl=new XRWebGLBinding(cl,Da),Dl=kl.createProjectionLayer(fl),cl.updateRenderState({layers:[Dl]}),F.setPixelRatio(1),F.setSize(Dl.textureWidth,Dl.textureHeight,!1),iu=new WebGLRenderTarget(Dl.textureWidth,Dl.textureHeight,{format:bd,type:ud,depthTexture:new DepthTexture(Dl.textureWidth,Dl.textureHeight,dl,void 0,void 0,void 0,void 0,void 0,void 0,ll),stencilBuffer:Sc.stencil,colorSpace:F.outputColorSpace,samples:Sc.antialias?4:0,resolveDepthBuffer:!1===Dl.ignoreDepthValues})}iu.isXRRenderTarget=!0,this.setFoveation(fl),Al=null,dl=await cl.requestReferenceSpace(pl),id.setContext(cl),id.start(),ll.isPresenting=!0,ll.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==cl)return cl.environmentBlendMode},this.getDepthTexture=function(){return wc.getDepthTexture()};const gh=new Vector3,ed=new Vector3;function updateCamera(F,Da){null===Da?F.matrixWorld.copy(F.matrix):F.matrixWorld.multiplyMatrices(Da.matrixWorld,F.matrix),F.matrixWorldInverse.copy(F.matrixWorld).invert()}this.updateCamera=function(F){if(null===cl)return;let Da=F.near,ll=F.far;null!==wc.texture&&(wc.depthNear>0&&(Da=wc.depthNear),wc.depthFar>0&&(ll=wc.depthFar)),Nu.near=zu.near=Lu.near=Da,Nu.far=zu.far=Lu.far=ll,qu===Nu.near&&ih===Nu.far||(cl.updateRenderState({depthNear:Nu.near,depthFar:Nu.far}),qu=Nu.near,ih=Nu.far);const hl=F.parent,dl=Nu.cameras;updateCamera(Nu,hl);for(let cl=0;cl<dl.length;cl++)updateCamera(dl[cl],hl);2===dl.length?function(F,Da,ll){gh.setFromMatrixPosition(Da.matrixWorld),ed.setFromMatrixPosition(ll.matrixWorld);const cl=gh.distanceTo(ed),hl=Da.projectionMatrix.elements,dl=ll.projectionMatrix.elements,pl=hl[14]/(hl[10]-1),fl=hl[14]/(hl[10]+1),Al=(hl[9]+1)/hl[5],bl=(hl[9]-1)/hl[5],kl=(hl[8]-1)/hl[0],Dl=(dl[8]+1)/dl[0],Wl=pl*kl,Ql=pl*Dl,wc=cl/(-kl+Dl),Sc=wc*-kl;if(Da.matrixWorld.decompose(F.position,F.quaternion,F.scale),F.translateX(Sc),F.translateZ(wc),F.matrixWorld.compose(F.position,F.quaternion,F.scale),F.matrixWorldInverse.copy(F.matrixWorld).invert(),-1===hl[10])F.projectionMatrix.copy(Da.projectionMatrix),F.projectionMatrixInverse.copy(Da.projectionMatrixInverse);else{const Da=pl+wc,ll=fl+wc,hl=Wl-Sc,dl=Ql+(cl-Sc),kl=Al*fl/ll*Da,Dl=bl*fl/ll*Da;F.projectionMatrix.makePerspective(hl,dl,kl,Dl,Da,ll),F.projectionMatrixInverse.copy(F.projectionMatrix).invert()}}(Nu,Lu,zu):Nu.projectionMatrix.copy(Lu.projectionMatrix),function(F,Da,ll){null===ll?F.matrix.copy(Da.matrixWorld):(F.matrix.copy(ll.matrixWorld),F.matrix.invert(),F.matrix.multiply(Da.matrixWorld));F.matrix.decompose(F.position,F.quaternion,F.scale),F.updateMatrixWorld(!0),F.projectionMatrix.copy(Da.projectionMatrix),F.projectionMatrixInverse.copy(Da.projectionMatrixInverse),F.isPerspectiveCamera&&(F.fov=2*Jp*Math.atan(1/F.projectionMatrix.elements[5]),F.zoom=1)}(F,Nu,hl)},this.getCamera=function(){return Nu},this.getFoveation=function(){if(null!==Dl||null!==Wl)return fl},this.setFoveation=function(F){fl=F,null!==Dl&&(Dl.fixedFoveation=F),null!==Wl&&void 0!==Wl.fixedFoveation&&(Wl.fixedFoveation=F)},this.hasDepthSensing=function(){return null!==wc.texture},this.getDepthSensingMesh=function(){return wc.getMesh(Nu)};let td=null;const id=new WebGLAnimation;id.setAnimationLoop((function(Da,hl){if(bl=hl.getViewerPose(Al||dl),Ql=hl,null!==bl){const Da=bl.views;null!==Wl&&(F.setRenderTargetFramebuffer(iu,Wl.framebuffer),F.setRenderTarget(iu));let ll=!1;Da.length!==Nu.cameras.length&&(Nu.cameras.length=0,ll=!0);for(let cl=0;cl<Da.length;cl++){const hl=Da[cl];let dl=null;if(null!==Wl)dl=Wl.getViewport(hl);else{const Da=kl.getViewSubImage(Dl,hl);dl=Da.viewport,0===cl&&(F.setRenderTargetTextures(iu,Da.colorTexture,Dl.ignoreDepthValues?void 0:Da.depthStencilTexture),F.setRenderTarget(iu))}let pl=Du[cl];void 0===pl&&(pl=new PerspectiveCamera,pl.layers.enable(cl),pl.viewport=new Vector4,Du[cl]=pl),pl.matrix.fromArray(hl.transform.matrix),pl.matrix.decompose(pl.position,pl.quaternion,pl.scale),pl.projectionMatrix.fromArray(hl.projectionMatrix),pl.projectionMatrixInverse.copy(pl.projectionMatrix).invert(),pl.viewport.set(dl.x,dl.y,dl.width,dl.height),0===cl&&(Nu.matrix.copy(pl.matrix),Nu.matrix.decompose(Nu.position,Nu.quaternion,Nu.scale)),!0===ll&&Nu.cameras.push(pl)}const hl=cl.enabledFeatures;if(hl&&hl.includes("depth-sensing")){const ll=kl.getDepthInformation(Da[0]);ll&&ll.isValid&&ll.texture&&wc.init(F,ll,cl.renderState)}}for(let F=0;F<su.length;F++){const Da=cu[F],ll=su[F];null!==Da&&void 0!==ll&&ll.update(Da,hl,Al||dl)}td&&td(Da,hl),hl.detectedPlanes&&ll.dispatchEvent({type:"planesdetected",data:hl}),Ql=null})),this.setAnimationLoop=function(F){td=F},this.dispose=function(){}}}const Og=new Euler,Fg=new Matrix4;function WebGLMaterials(F,Da){function refreshTransformUniform(F,Da){!0===F.matrixAutoUpdate&&F.updateMatrix(),Da.value.copy(F.matrix)}function refreshUniformsCommon(F,ll){F.opacity.value=ll.opacity,ll.color&&F.diffuse.value.copy(ll.color),ll.emissive&&F.emissive.value.copy(ll.emissive).multiplyScalar(ll.emissiveIntensity),ll.map&&(F.map.value=ll.map,refreshTransformUniform(ll.map,F.mapTransform)),ll.alphaMap&&(F.alphaMap.value=ll.alphaMap,refreshTransformUniform(ll.alphaMap,F.alphaMapTransform)),ll.bumpMap&&(F.bumpMap.value=ll.bumpMap,refreshTransformUniform(ll.bumpMap,F.bumpMapTransform),F.bumpScale.value=ll.bumpScale,1===ll.side&&(F.bumpScale.value*=-1)),ll.normalMap&&(F.normalMap.value=ll.normalMap,refreshTransformUniform(ll.normalMap,F.normalMapTransform),F.normalScale.value.copy(ll.normalScale),1===ll.side&&F.normalScale.value.negate()),ll.displacementMap&&(F.displacementMap.value=ll.displacementMap,refreshTransformUniform(ll.displacementMap,F.displacementMapTransform),F.displacementScale.value=ll.displacementScale,F.displacementBias.value=ll.displacementBias),ll.emissiveMap&&(F.emissiveMap.value=ll.emissiveMap,refreshTransformUniform(ll.emissiveMap,F.emissiveMapTransform)),ll.specularMap&&(F.specularMap.value=ll.specularMap,refreshTransformUniform(ll.specularMap,F.specularMapTransform)),ll.alphaTest>0&&(F.alphaTest.value=ll.alphaTest);const cl=Da.get(ll),hl=cl.envMap,dl=cl.envMapRotation;hl&&(F.envMap.value=hl,Og.copy(dl),Og.x*=-1,Og.y*=-1,Og.z*=-1,hl.isCubeTexture&&!1===hl.isRenderTargetTexture&&(Og.y*=-1,Og.z*=-1),F.envMapRotation.value.setFromMatrix4(Fg.makeRotationFromEuler(Og)),F.flipEnvMap.value=hl.isCubeTexture&&!1===hl.isRenderTargetTexture?-1:1,F.reflectivity.value=ll.reflectivity,F.ior.value=ll.ior,F.refractionRatio.value=ll.refractionRatio),ll.lightMap&&(F.lightMap.value=ll.lightMap,F.lightMapIntensity.value=ll.lightMapIntensity,refreshTransformUniform(ll.lightMap,F.lightMapTransform)),ll.aoMap&&(F.aoMap.value=ll.aoMap,F.aoMapIntensity.value=ll.aoMapIntensity,refreshTransformUniform(ll.aoMap,F.aoMapTransform))}return{refreshFogUniforms:function(Da,ll){ll.color.getRGB(Da.fogColor.value,getUnlitUniformColorSpace(F)),ll.isFog?(Da.fogNear.value=ll.near,Da.fogFar.value=ll.far):ll.isFogExp2&&(Da.fogDensity.value=ll.density)},refreshMaterialUniforms:function(F,ll,cl,hl,dl){ll.isMeshBasicMaterial||ll.isMeshLambertMaterial?refreshUniformsCommon(F,ll):ll.isMeshToonMaterial?(refreshUniformsCommon(F,ll),function(F,Da){Da.gradientMap&&(F.gradientMap.value=Da.gradientMap)}(F,ll)):ll.isMeshPhongMaterial?(refreshUniformsCommon(F,ll),function(F,Da){F.specular.value.copy(Da.specular),F.shininess.value=Math.max(Da.shininess,1e-4)}(F,ll)):ll.isMeshStandardMaterial?(refreshUniformsCommon(F,ll),function(F,Da){F.metalness.value=Da.metalness,Da.metalnessMap&&(F.metalnessMap.value=Da.metalnessMap,refreshTransformUniform(Da.metalnessMap,F.metalnessMapTransform));F.roughness.value=Da.roughness,Da.roughnessMap&&(F.roughnessMap.value=Da.roughnessMap,refreshTransformUniform(Da.roughnessMap,F.roughnessMapTransform));Da.envMap&&(F.envMapIntensity.value=Da.envMapIntensity)}(F,ll),ll.isMeshPhysicalMaterial&&function(F,Da,ll){F.ior.value=Da.ior,Da.sheen>0&&(F.sheenColor.value.copy(Da.sheenColor).multiplyScalar(Da.sheen),F.sheenRoughness.value=Da.sheenRoughness,Da.sheenColorMap&&(F.sheenColorMap.value=Da.sheenColorMap,refreshTransformUniform(Da.sheenColorMap,F.sheenColorMapTransform)),Da.sheenRoughnessMap&&(F.sheenRoughnessMap.value=Da.sheenRoughnessMap,refreshTransformUniform(Da.sheenRoughnessMap,F.sheenRoughnessMapTransform)));Da.clearcoat>0&&(F.clearcoat.value=Da.clearcoat,F.clearcoatRoughness.value=Da.clearcoatRoughness,Da.clearcoatMap&&(F.clearcoatMap.value=Da.clearcoatMap,refreshTransformUniform(Da.clearcoatMap,F.clearcoatMapTransform)),Da.clearcoatRoughnessMap&&(F.clearcoatRoughnessMap.value=Da.clearcoatRoughnessMap,refreshTransformUniform(Da.clearcoatRoughnessMap,F.clearcoatRoughnessMapTransform)),Da.clearcoatNormalMap&&(F.clearcoatNormalMap.value=Da.clearcoatNormalMap,refreshTransformUniform(Da.clearcoatNormalMap,F.clearcoatNormalMapTransform),F.clearcoatNormalScale.value.copy(Da.clearcoatNormalScale),1===Da.side&&F.clearcoatNormalScale.value.negate()));Da.dispersion>0&&(F.dispersion.value=Da.dispersion);Da.iridescence>0&&(F.iridescence.value=Da.iridescence,F.iridescenceIOR.value=Da.iridescenceIOR,F.iridescenceThicknessMinimum.value=Da.iridescenceThicknessRange[0],F.iridescenceThicknessMaximum.value=Da.iridescenceThicknessRange[1],Da.iridescenceMap&&(F.iridescenceMap.value=Da.iridescenceMap,refreshTransformUniform(Da.iridescenceMap,F.iridescenceMapTransform)),Da.iridescenceThicknessMap&&(F.iridescenceThicknessMap.value=Da.iridescenceThicknessMap,refreshTransformUniform(Da.iridescenceThicknessMap,F.iridescenceThicknessMapTransform)));Da.transmission>0&&(F.transmission.value=Da.transmission,F.transmissionSamplerMap.value=ll.texture,F.transmissionSamplerSize.value.set(ll.width,ll.height),Da.transmissionMap&&(F.transmissionMap.value=Da.transmissionMap,refreshTransformUniform(Da.transmissionMap,F.transmissionMapTransform)),F.thickness.value=Da.thickness,Da.thicknessMap&&(F.thicknessMap.value=Da.thicknessMap,refreshTransformUniform(Da.thicknessMap,F.thicknessMapTransform)),F.attenuationDistance.value=Da.attenuationDistance,F.attenuationColor.value.copy(Da.attenuationColor));Da.anisotropy>0&&(F.anisotropyVector.value.set(Da.anisotropy*Math.cos(Da.anisotropyRotation),Da.anisotropy*Math.sin(Da.anisotropyRotation)),Da.anisotropyMap&&(F.anisotropyMap.value=Da.anisotropyMap,refreshTransformUniform(Da.anisotropyMap,F.anisotropyMapTransform)));F.specularIntensity.value=Da.specularIntensity,F.specularColor.value.copy(Da.specularColor),Da.specularColorMap&&(F.specularColorMap.value=Da.specularColorMap,refreshTransformUniform(Da.specularColorMap,F.specularColorMapTransform));Da.specularIntensityMap&&(F.specularIntensityMap.value=Da.specularIntensityMap,refreshTransformUniform(Da.specularIntensityMap,F.specularIntensityMapTransform))}(F,ll,dl)):ll.isMeshMatcapMaterial?(refreshUniformsCommon(F,ll),function(F,Da){Da.matcap&&(F.matcap.value=Da.matcap)}(F,ll)):ll.isMeshDepthMaterial?refreshUniformsCommon(F,ll):ll.isMeshDistanceMaterial?(refreshUniformsCommon(F,ll),function(F,ll){const cl=Da.get(ll).light;F.referencePosition.value.setFromMatrixPosition(cl.matrixWorld),F.nearDistance.value=cl.shadow.camera.near,F.farDistance.value=cl.shadow.camera.far}(F,ll)):ll.isMeshNormalMaterial?refreshUniformsCommon(F,ll):ll.isLineBasicMaterial?(function(F,Da){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.mapTransform))}(F,ll),ll.isLineDashedMaterial&&function(F,Da){F.dashSize.value=Da.dashSize,F.totalSize.value=Da.dashSize+Da.gapSize,F.scale.value=Da.scale}(F,ll)):ll.isPointsMaterial?function(F,Da,ll,cl){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,F.size.value=Da.size*ll,F.scale.value=.5*cl,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.uvTransform));Da.alphaMap&&(F.alphaMap.value=Da.alphaMap,refreshTransformUniform(Da.alphaMap,F.alphaMapTransform));Da.alphaTest>0&&(F.alphaTest.value=Da.alphaTest)}(F,ll,cl,hl):ll.isSpriteMaterial?function(F,Da){F.diffuse.value.copy(Da.color),F.opacity.value=Da.opacity,F.rotation.value=Da.rotation,Da.map&&(F.map.value=Da.map,refreshTransformUniform(Da.map,F.mapTransform));Da.alphaMap&&(F.alphaMap.value=Da.alphaMap,refreshTransformUniform(Da.alphaMap,F.alphaMapTransform));Da.alphaTest>0&&(F.alphaTest.value=Da.alphaTest)}(F,ll):ll.isShadowMaterial?(F.color.value.copy(ll.color),F.opacity.value=ll.opacity):ll.isShaderMaterial&&(ll.uniformsNeedUpdate=!1)}}}function WebGLUniformsGroups(F,Da,ll,cl){let hl={},dl={},pl=[];const fl=F.getParameter(F.MAX_UNIFORM_BUFFER_BINDINGS);function hasUniformChanged(F,Da,ll,cl){const hl=F.value,dl=Da+"_"+ll;if(void 0===cl[dl])return cl[dl]="number"===typeof hl||"boolean"===typeof hl?hl:hl.clone(),!0;{const F=cl[dl];if("number"===typeof hl||"boolean"===typeof hl){if(F!==hl)return cl[dl]=hl,!0}else if(!1===F.equals(hl))return F.copy(hl),!0}return!1}function getUniformSize(F){const Da={boundary:0,storage:0};return"number"===typeof F||"boolean"===typeof F?(Da.boundary=4,Da.storage=4):F.isVector2?(Da.boundary=8,Da.storage=8):F.isVector3||F.isColor?(Da.boundary=16,Da.storage=12):F.isVector4?(Da.boundary=16,Da.storage=16):F.isMatrix3?(Da.boundary=48,Da.storage=48):F.isMatrix4?(Da.boundary=64,Da.storage=64):F.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",F),Da}function onUniformsGroupsDispose(Da){const ll=Da.target;ll.removeEventListener("dispose",onUniformsGroupsDispose);const cl=pl.indexOf(ll.__bindingPointIndex);pl.splice(cl,1),F.deleteBuffer(hl[ll.id]),delete hl[ll.id],delete dl[ll.id]}return{bind:function(F,Da){const ll=Da.program;cl.uniformBlockBinding(F,ll)},update:function(ll,Al){let bl=hl[ll.id];void 0===bl&&(!function(F){const Da=F.uniforms;let ll=0;const cl=16;for(let dl=0,pl=Da.length;dl<pl;dl++){const F=Array.isArray(Da[dl])?Da[dl]:[Da[dl]];for(let Da=0,hl=F.length;Da<hl;Da++){const hl=F[Da],dl=Array.isArray(hl.value)?hl.value:[hl.value];for(let F=0,Da=dl.length;F<Da;F++){const Da=getUniformSize(dl[F]),pl=ll%cl,fl=pl%Da.boundary,Al=pl+fl;ll+=fl,0!==Al&&cl-Al<Da.storage&&(ll+=cl-Al),hl.__data=new Float32Array(Da.storage/Float32Array.BYTES_PER_ELEMENT),hl.__offset=ll,ll+=Da.storage}}}const hl=ll%cl;hl>0&&(ll+=cl-hl);F.__size=ll,F.__cache={}}(ll),bl=function(Da){const ll=function(){for(let F=0;F<fl;F++)if(-1===pl.indexOf(F))return pl.push(F),F;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();Da.__bindingPointIndex=ll;const cl=F.createBuffer(),hl=Da.__size,dl=Da.usage;return F.bindBuffer(F.UNIFORM_BUFFER,cl),F.bufferData(F.UNIFORM_BUFFER,hl,dl),F.bindBuffer(F.UNIFORM_BUFFER,null),F.bindBufferBase(F.UNIFORM_BUFFER,ll,cl),cl}(ll),hl[ll.id]=bl,ll.addEventListener("dispose",onUniformsGroupsDispose));const kl=Al.program;cl.updateUBOMapping(ll,kl);const Dl=Da.render.frame;dl[ll.id]!==Dl&&(!function(Da){const ll=hl[Da.id],cl=Da.uniforms,dl=Da.__cache;F.bindBuffer(F.UNIFORM_BUFFER,ll);for(let hl=0,pl=cl.length;hl<pl;hl++){const Da=Array.isArray(cl[hl])?cl[hl]:[cl[hl]];for(let ll=0,cl=Da.length;ll<cl;ll++){const cl=Da[ll];if(!0===hasUniformChanged(cl,hl,ll,dl)){const Da=cl.__offset,ll=Array.isArray(cl.value)?cl.value:[cl.value];let hl=0;for(let dl=0;dl<ll.length;dl++){const pl=ll[dl],fl=getUniformSize(pl);"number"===typeof pl||"boolean"===typeof pl?(cl.__data[0]=pl,F.bufferSubData(F.UNIFORM_BUFFER,Da+hl,cl.__data)):pl.isMatrix3?(cl.__data[0]=pl.elements[0],cl.__data[1]=pl.elements[1],cl.__data[2]=pl.elements[2],cl.__data[3]=0,cl.__data[4]=pl.elements[3],cl.__data[5]=pl.elements[4],cl.__data[6]=pl.elements[5],cl.__data[7]=0,cl.__data[8]=pl.elements[6],cl.__data[9]=pl.elements[7],cl.__data[10]=pl.elements[8],cl.__data[11]=0):(pl.toArray(cl.__data,hl),hl+=fl.storage/Float32Array.BYTES_PER_ELEMENT)}F.bufferSubData(F.UNIFORM_BUFFER,Da,cl.__data)}}}F.bindBuffer(F.UNIFORM_BUFFER,null)}(ll),dl[ll.id]=Dl)},dispose:function(){for(const Da in hl)F.deleteBuffer(hl[Da]);pl=[],hl={},dl={}}}}class WebGLRenderer{constructor(F){void 0===F&&(F={});const{canvas:Da=createCanvasElement(),context:ll=null,depth:hl=!0,stencil:dl=!1,alpha:pl=!1,antialias:fl=!1,premultipliedAlpha:Al=!0,preserveDrawingBuffer:bl=!1,powerPreference:kl="default",failIfMajorPerformanceCaveat:Dl=!1}=F;let Wl;if(this.isWebGLRenderer=!0,null!==ll){if("undefined"!==typeof WebGLRenderingContext&&ll instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");Wl=ll.getContextAttributes().alpha}else Wl=pl;const Ql=new Uint32Array(4),wc=new Int32Array(4);let Sc=null,eu=null;const iu=[],su=[];this.domElement=Da,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Tp,this.toneMapping=0,this.toneMappingExposure=1;const cu=this;let uu=!1,hu=0,Lu=0,zu=null,Du=-1,Nu=null;const qu=new Vector4,ih=new Vector4;let gh=null;const ed=new Color(0);let td=0,id=Da.width,nd=Da.height,rd=1,ad=null,sd=null;const od=new Vector4(0,0,id,nd),ld=new Vector4(0,0,id,nd);let hd=!1;const dd=new Frustum;let md=!1,gd=!1;const xd=new Matrix4,bd=new Vector3,wd=new Vector4,Ed={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Md=!1;function getTargetPixelRatio(){return null===zu?rd:1}let Id,Cd,Ld,zd,Pd,Dd,Rd,Nd,Ud,Bd,Od,Fd,jd,Vd,Gd,Hd,qd,Zd,Wd,Kd,Qd,Xd,Yd,Jd,$d=ll;function getContext(F,ll){return Da.getContext(F,ll)}try{const F={alpha:!0,depth:hl,stencil:dl,antialias:fl,premultipliedAlpha:Al,preserveDrawingBuffer:bl,powerPreference:kl,failIfMajorPerformanceCaveat:Dl};if("setAttribute"in Da&&Da.setAttribute("data-engine",`three.js r${cl}`),Da.addEventListener("webglcontextlost",onContextLost,!1),Da.addEventListener("webglcontextrestored",onContextRestore,!1),Da.addEventListener("webglcontextcreationerror",onContextCreationError,!1),null===$d){const Da="webgl2";if($d=getContext(Da,F),null===$d)throw getContext(Da)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(Ap){throw console.error("THREE.WebGLRenderer: "+Ap.message),Ap}function initGLContext(){Id=new WebGLExtensions($d),Id.init(),Xd=new WebGLUtils($d,Id),Cd=new WebGLCapabilities($d,Id,F,Xd),Ld=new WebGLState($d),zd=new WebGLInfo($d),Pd=new WebGLProperties,Dd=new WebGLTextures($d,Id,Ld,Pd,Cd,Xd,zd),Rd=new WebGLCubeMaps(cu),Nd=new WebGLCubeUVMaps(cu),Ud=new WebGLAttributes($d),Yd=new WebGLBindingStates($d,Ud),Bd=new WebGLGeometries($d,Ud,zd,Yd),Od=new WebGLObjects($d,Bd,Ud,zd),Wd=new WebGLMorphtargets($d,Cd,Dd),Hd=new WebGLClipping(Pd),Fd=new WebGLPrograms(cu,Rd,Nd,Id,Cd,Yd,Hd),jd=new WebGLMaterials(cu,Pd),Vd=new WebGLRenderLists,Gd=new WebGLRenderStates(Id),Zd=new WebGLBackground(cu,Rd,Nd,Ld,Od,Wl,Al),qd=new WebGLShadowMap(cu,Od,Cd),Jd=new WebGLUniformsGroups($d,zd,Cd,Ld),Kd=new WebGLBufferRenderer($d,Id,zd),Qd=new WebGLIndexedBufferRenderer($d,Id,zd),zd.programs=Fd.programs,cu.capabilities=Cd,cu.extensions=Id,cu.properties=Pd,cu.renderLists=Vd,cu.shadowMap=qd,cu.state=Ld,cu.info=zd}initGLContext();const lp=new WebXRManager(cu,$d);function onContextLost(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),uu=!0}function onContextRestore(){console.log("THREE.WebGLRenderer: Context Restored."),uu=!1;const F=zd.autoReset,Da=qd.enabled,ll=qd.autoUpdate,cl=qd.needsUpdate,hl=qd.type;initGLContext(),zd.autoReset=F,qd.enabled=Da,qd.autoUpdate=ll,qd.needsUpdate=cl,qd.type=hl}function onContextCreationError(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function onMaterialDispose(F){const Da=F.target;Da.removeEventListener("dispose",onMaterialDispose),function(F){(function(F){const Da=Pd.get(F).programs;void 0!==Da&&(Da.forEach((function(F){Fd.releaseProgram(F)})),F.isShaderMaterial&&Fd.releaseShaderCache(F))})(F),Pd.remove(F)}(Da)}function prepareMaterial(F,Da,ll){!0===F.transparent&&2===F.side&&!1===F.forceSinglePass?(F.side=1,F.needsUpdate=!0,getProgram(F,Da,ll),F.side=0,F.needsUpdate=!0,getProgram(F,Da,ll),F.side=2):getProgram(F,Da,ll)}this.xr=lp,this.getContext=function(){return $d},this.getContextAttributes=function(){return $d.getContextAttributes()},this.forceContextLoss=function(){const F=Id.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Id.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return rd},this.setPixelRatio=function(F){void 0!==F&&(rd=F,this.setSize(id,nd,!1))},this.getSize=function(F){return F.set(id,nd)},this.setSize=function(F,ll,cl){void 0===cl&&(cl=!0),lp.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(id=F,nd=ll,Da.width=Math.floor(F*rd),Da.height=Math.floor(ll*rd),!0===cl&&(Da.style.width=F+"px",Da.style.height=ll+"px"),this.setViewport(0,0,F,ll))},this.getDrawingBufferSize=function(F){return F.set(id*rd,nd*rd).floor()},this.setDrawingBufferSize=function(F,ll,cl){id=F,nd=ll,rd=cl,Da.width=Math.floor(F*cl),Da.height=Math.floor(ll*cl),this.setViewport(0,0,F,ll)},this.getCurrentViewport=function(F){return F.copy(qu)},this.getViewport=function(F){return F.copy(od)},this.setViewport=function(F,Da,ll,cl){F.isVector4?od.set(F.x,F.y,F.z,F.w):od.set(F,Da,ll,cl),Ld.viewport(qu.copy(od).multiplyScalar(rd).round())},this.getScissor=function(F){return F.copy(ld)},this.setScissor=function(F,Da,ll,cl){F.isVector4?ld.set(F.x,F.y,F.z,F.w):ld.set(F,Da,ll,cl),Ld.scissor(ih.copy(ld).multiplyScalar(rd).round())},this.getScissorTest=function(){return hd},this.setScissorTest=function(F){Ld.setScissorTest(hd=F)},this.setOpaqueSort=function(F){ad=F},this.setTransparentSort=function(F){sd=F},this.getClearColor=function(F){return F.copy(Zd.getClearColor())},this.setClearColor=function(){Zd.setClearColor.apply(Zd,arguments)},this.getClearAlpha=function(){return Zd.getClearAlpha()},this.setClearAlpha=function(){Zd.setClearAlpha.apply(Zd,arguments)},this.clear=function(F,Da,ll){void 0===F&&(F=!0),void 0===Da&&(Da=!0),void 0===ll&&(ll=!0);let cl=0;if(F){let F=!1;if(null!==zu){const Da=zu.texture.format;F=Da===Td||Da===kd||Da===Sd}if(F){const F=zu.texture.type,Da=F===ud||F===fd||F===pd||F===_d||F===yd||F===vd,ll=Zd.getClearColor(),cl=Zd.getClearAlpha(),hl=ll.r,dl=ll.g,pl=ll.b;Da?(Ql[0]=hl,Ql[1]=dl,Ql[2]=pl,Ql[3]=cl,$d.clearBufferuiv($d.COLOR,0,Ql)):(wc[0]=hl,wc[1]=dl,wc[2]=pl,wc[3]=cl,$d.clearBufferiv($d.COLOR,0,wc))}else cl|=$d.COLOR_BUFFER_BIT}Da&&(cl|=$d.DEPTH_BUFFER_BIT),ll&&(cl|=$d.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),$d.clear(cl)},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(){Da.removeEventListener("webglcontextlost",onContextLost,!1),Da.removeEventListener("webglcontextrestored",onContextRestore,!1),Da.removeEventListener("webglcontextcreationerror",onContextCreationError,!1),Vd.dispose(),Gd.dispose(),Pd.dispose(),Rd.dispose(),Nd.dispose(),Od.dispose(),Yd.dispose(),Jd.dispose(),Fd.dispose(),lp.dispose(),lp.removeEventListener("sessionstart",onXRSessionStart),lp.removeEventListener("sessionend",onXRSessionEnd),gp.stop()},this.renderBufferDirect=function(F,Da,ll,cl,hl,dl){null===Da&&(Da=Ed);const pl=hl.isMesh&&hl.matrixWorld.determinant()<0,fl=function(F,Da,ll,cl,hl){!0!==Da.isScene&&(Da=Ed);Dd.resetTextureUnits();const dl=Da.fog,pl=cl.isMeshStandardMaterial?Da.environment:null,fl=null===zu?cu.outputColorSpace:!0===zu.isXRRenderTarget?zu.texture.colorSpace:Ip,Al=(cl.isMeshStandardMaterial?Nd:Rd).get(cl.envMap||pl),bl=!0===cl.vertexColors&&!!ll.attributes.color&&4===ll.attributes.color.itemSize,kl=!!ll.attributes.tangent&&(!!cl.normalMap||cl.anisotropy>0),Dl=!!ll.morphAttributes.position,Wl=!!ll.morphAttributes.normal,Ql=!!ll.morphAttributes.color;let wc=0;cl.toneMapped&&(null!==zu&&!0!==zu.isXRRenderTarget||(wc=cu.toneMapping));const Sc=ll.morphAttributes.position||ll.morphAttributes.normal||ll.morphAttributes.color,iu=void 0!==Sc?Sc.length:0,su=Pd.get(cl),uu=eu.state.lights;if(!0===md&&(!0===gd||F!==Nu)){const Da=F===Nu&&cl.id===Du;Hd.setState(cl,F,Da)}let hu=!1;cl.version===su.__version?su.needsLights&&su.lightsStateVersion!==uu.state.version||su.outputColorSpace!==fl||hl.isBatchedMesh&&!1===su.batching?hu=!0:hl.isBatchedMesh||!0!==su.batching?hl.isBatchedMesh&&!0===su.batchingColor&&null===hl.colorTexture||hl.isBatchedMesh&&!1===su.batchingColor&&null!==hl.colorTexture||hl.isInstancedMesh&&!1===su.instancing?hu=!0:hl.isInstancedMesh||!0!==su.instancing?hl.isSkinnedMesh&&!1===su.skinning?hu=!0:hl.isSkinnedMesh||!0!==su.skinning?hl.isInstancedMesh&&!0===su.instancingColor&&null===hl.instanceColor||hl.isInstancedMesh&&!1===su.instancingColor&&null!==hl.instanceColor||hl.isInstancedMesh&&!0===su.instancingMorph&&null===hl.morphTexture||hl.isInstancedMesh&&!1===su.instancingMorph&&null!==hl.morphTexture||su.envMap!==Al||!0===cl.fog&&su.fog!==dl?hu=!0:void 0===su.numClippingPlanes||su.numClippingPlanes===Hd.numPlanes&&su.numIntersection===Hd.numIntersection?(su.vertexAlphas!==bl||su.vertexTangents!==kl||su.morphTargets!==Dl||su.morphNormals!==Wl||su.morphColors!==Ql||su.toneMapping!==wc||su.morphTargetsCount!==iu)&&(hu=!0):hu=!0:hu=!0:hu=!0:hu=!0:(hu=!0,su.__version=cl.version);let Lu=su.currentProgram;!0===hu&&(Lu=getProgram(cl,Da,hl));let qu=!1,ih=!1,gh=!1;const ed=Lu.getUniforms(),td=su.uniforms;Ld.useProgram(Lu.program)&&(qu=!0,ih=!0,gh=!0);cl.id!==Du&&(Du=cl.id,ih=!0);if(qu||Nu!==F){ed.setValue($d,"projectionMatrix",F.projectionMatrix),ed.setValue($d,"viewMatrix",F.matrixWorldInverse);const Da=ed.map.cameraPosition;void 0!==Da&&Da.setValue($d,bd.setFromMatrixPosition(F.matrixWorld)),Cd.logarithmicDepthBuffer&&ed.setValue($d,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(cl.isMeshPhongMaterial||cl.isMeshToonMaterial||cl.isMeshLambertMaterial||cl.isMeshBasicMaterial||cl.isMeshStandardMaterial||cl.isShaderMaterial)&&ed.setValue($d,"isOrthographic",!0===F.isOrthographicCamera),Nu!==F&&(Nu=F,ih=!0,gh=!0)}if(hl.isSkinnedMesh){ed.setOptional($d,hl,"bindMatrix"),ed.setOptional($d,hl,"bindMatrixInverse");const F=hl.skeleton;F&&(null===F.boneTexture&&F.computeBoneTexture(),ed.setValue($d,"boneTexture",F.boneTexture,Dd))}hl.isBatchedMesh&&(ed.setOptional($d,hl,"batchingTexture"),ed.setValue($d,"batchingTexture",hl._matricesTexture,Dd),ed.setOptional($d,hl,"batchingIdTexture"),ed.setValue($d,"batchingIdTexture",hl._indirectTexture,Dd),ed.setOptional($d,hl,"batchingColorTexture"),null!==hl._colorsTexture&&ed.setValue($d,"batchingColorTexture",hl._colorsTexture,Dd));const id=ll.morphAttributes;void 0===id.position&&void 0===id.normal&&void 0===id.color||Wd.update(hl,ll,Lu);(ih||su.receiveShadow!==hl.receiveShadow)&&(su.receiveShadow=hl.receiveShadow,ed.setValue($d,"receiveShadow",hl.receiveShadow));cl.isMeshGouraudMaterial&&null!==cl.envMap&&(td.envMap.value=Al,td.flipEnvMap.value=Al.isCubeTexture&&!1===Al.isRenderTargetTexture?-1:1);cl.isMeshStandardMaterial&&null===cl.envMap&&null!==Da.environment&&(td.envMapIntensity.value=Da.environmentIntensity);ih&&(ed.setValue($d,"toneMappingExposure",cu.toneMappingExposure),su.needsLights&&(sd=gh,(ad=td).ambientLightColor.needsUpdate=sd,ad.lightProbe.needsUpdate=sd,ad.directionalLights.needsUpdate=sd,ad.directionalLightShadows.needsUpdate=sd,ad.pointLights.needsUpdate=sd,ad.pointLightShadows.needsUpdate=sd,ad.spotLights.needsUpdate=sd,ad.spotLightShadows.needsUpdate=sd,ad.rectAreaLights.needsUpdate=sd,ad.hemisphereLights.needsUpdate=sd),dl&&!0===cl.fog&&jd.refreshFogUniforms(td,dl),jd.refreshMaterialUniforms(td,cl,rd,nd,eu.state.transmissionRenderTarget[F.id]),WebGLUniforms.upload($d,getUniformList(su),td,Dd));var ad,sd;cl.isShaderMaterial&&!0===cl.uniformsNeedUpdate&&(WebGLUniforms.upload($d,getUniformList(su),td,Dd),cl.uniformsNeedUpdate=!1);cl.isSpriteMaterial&&ed.setValue($d,"center",hl.center);if(ed.setValue($d,"modelViewMatrix",hl.modelViewMatrix),ed.setValue($d,"normalMatrix",hl.normalMatrix),ed.setValue($d,"modelMatrix",hl.matrixWorld),cl.isShaderMaterial||cl.isRawShaderMaterial){const F=cl.uniformsGroups;for(let Da=0,ll=F.length;Da<ll;Da++){const ll=F[Da];Jd.update(ll,Lu),Jd.bind(ll,Lu)}}return Lu}(F,Da,ll,cl,hl);Ld.setMaterial(cl,pl);let Al=ll.index,bl=1;if(!0===cl.wireframe){if(Al=Bd.getWireframeAttribute(ll),void 0===Al)return;bl=2}const kl=ll.drawRange,Dl=ll.attributes.position;let Wl=kl.start*bl,Ql=(kl.start+kl.count)*bl;null!==dl&&(Wl=Math.max(Wl,dl.start*bl),Ql=Math.min(Ql,(dl.start+dl.count)*bl)),null!==Al?(Wl=Math.max(Wl,0),Ql=Math.min(Ql,Al.count)):void 0!==Dl&&null!==Dl&&(Wl=Math.max(Wl,0),Ql=Math.min(Ql,Dl.count));const wc=Ql-Wl;if(wc<0||wc===1/0)return;let Sc;Yd.setup(hl,cl,fl,ll,Al);let iu=Kd;if(null!==Al&&(Sc=Ud.get(Al),iu=Qd,iu.setIndex(Sc)),hl.isMesh)!0===cl.wireframe?(Ld.setLineWidth(cl.wireframeLinewidth*getTargetPixelRatio()),iu.setMode($d.LINES)):iu.setMode($d.TRIANGLES);else if(hl.isLine){let F=cl.linewidth;void 0===F&&(F=1),Ld.setLineWidth(F*getTargetPixelRatio()),hl.isLineSegments?iu.setMode($d.LINES):hl.isLineLoop?iu.setMode($d.LINE_LOOP):iu.setMode($d.LINE_STRIP)}else hl.isPoints?iu.setMode($d.POINTS):hl.isSprite&&iu.setMode($d.TRIANGLES);if(hl.isBatchedMesh)if(null!==hl._multiDrawInstances)iu.renderMultiDrawInstances(hl._multiDrawStarts,hl._multiDrawCounts,hl._multiDrawCount,hl._multiDrawInstances);else if(Id.get("WEBGL_multi_draw"))iu.renderMultiDraw(hl._multiDrawStarts,hl._multiDrawCounts,hl._multiDrawCount);else{const F=hl._multiDrawStarts,Da=hl._multiDrawCounts,ll=hl._multiDrawCount,dl=Al?Ud.get(Al).bytesPerElement:1,pl=Pd.get(cl).currentProgram.getUniforms();for(let cl=0;cl<ll;cl++)pl.setValue($d,"_gl_DrawID",cl),iu.render(F[cl]/dl,Da[cl])}else if(hl.isInstancedMesh)iu.renderInstances(Wl,wc,hl.count);else if(ll.isInstancedBufferGeometry){const F=void 0!==ll._maxInstanceCount?ll._maxInstanceCount:1/0,Da=Math.min(ll.instanceCount,F);iu.renderInstances(Wl,wc,Da)}else iu.render(Wl,wc)},this.compile=function(F,Da,ll){void 0===ll&&(ll=null),null===ll&&(ll=F),eu=Gd.get(ll),eu.init(Da),su.push(eu),ll.traverseVisible((function(F){F.isLight&&F.layers.test(Da.layers)&&(eu.pushLight(F),F.castShadow&&eu.pushShadow(F))})),F!==ll&&F.traverseVisible((function(F){F.isLight&&F.layers.test(Da.layers)&&(eu.pushLight(F),F.castShadow&&eu.pushShadow(F))})),eu.setupLights();const cl=new Set;return F.traverse((function(F){const Da=F.material;if(Da)if(Array.isArray(Da))for(let hl=0;hl<Da.length;hl++){const dl=Da[hl];prepareMaterial(dl,ll,F),cl.add(dl)}else prepareMaterial(Da,ll,F),cl.add(Da)})),su.pop(),eu=null,cl},this.compileAsync=function(F,Da,ll){void 0===ll&&(ll=null);const cl=this.compile(F,Da,ll);return new Promise((Da=>{function checkMaterialsReady(){cl.forEach((function(F){Pd.get(F).currentProgram.isReady()&&cl.delete(F)})),0!==cl.size?setTimeout(checkMaterialsReady,10):Da(F)}null!==Id.get("KHR_parallel_shader_compile")?checkMaterialsReady():setTimeout(checkMaterialsReady,10)}))};let mp=null;function onXRSessionStart(){gp.stop()}function onXRSessionEnd(){gp.start()}const gp=new WebGLAnimation;function projectObject(F,Da,ll,cl){if(!1===F.visible)return;if(F.layers.test(Da.layers))if(F.isGroup)ll=F.renderOrder;else if(F.isLOD)!0===F.autoUpdate&&F.update(Da);else if(F.isLight)eu.pushLight(F),F.castShadow&&eu.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||dd.intersectsSprite(F)){cl&&wd.setFromMatrixPosition(F.matrixWorld).applyMatrix4(xd);const Da=Od.update(F),hl=F.material;hl.visible&&Sc.push(F,Da,hl,ll,wd.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||dd.intersectsObject(F))){const Da=Od.update(F),hl=F.material;if(cl&&(void 0!==F.boundingSphere?(null===F.boundingSphere&&F.computeBoundingSphere(),wd.copy(F.boundingSphere.center)):(null===Da.boundingSphere&&Da.computeBoundingSphere(),wd.copy(Da.boundingSphere.center)),wd.applyMatrix4(F.matrixWorld).applyMatrix4(xd)),Array.isArray(hl)){const cl=Da.groups;for(let dl=0,pl=cl.length;dl<pl;dl++){const pl=cl[dl],fl=hl[pl.materialIndex];fl&&fl.visible&&Sc.push(F,Da,fl,ll,wd.z,pl)}}else hl.visible&&Sc.push(F,Da,hl,ll,wd.z,null)}const hl=F.children;for(let dl=0,pl=hl.length;dl<pl;dl++)projectObject(hl[dl],Da,ll,cl)}function renderScene(F,Da,ll,cl){const hl=F.opaque,dl=F.transmissive,pl=F.transparent;eu.setupLightsView(ll),!0===md&&Hd.setGlobalState(cu.clippingPlanes,ll),cl&&Ld.viewport(qu.copy(cl)),hl.length>0&&renderObjects(hl,Da,ll),dl.length>0&&renderObjects(dl,Da,ll),pl.length>0&&renderObjects(pl,Da,ll),Ld.buffers.depth.setTest(!0),Ld.buffers.depth.setMask(!0),Ld.buffers.color.setMask(!0),Ld.setPolygonOffset(!1)}function renderTransmissionPass(F,Da,ll,cl){if(null!==(!0===ll.isScene?ll.overrideMaterial:null))return;void 0===eu.state.transmissionRenderTarget[cl.id]&&(eu.state.transmissionRenderTarget[cl.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:Id.has("EXT_color_buffer_half_float")||Id.has("EXT_color_buffer_float")?Ad:ud,minFilter:cd,samples:4,stencilBuffer:dl,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:sm.workingColorSpace}));const hl=eu.state.transmissionRenderTarget[cl.id],pl=cl.viewport||qu;hl.setSize(pl.z,pl.w);const fl=cu.getRenderTarget();cu.setRenderTarget(hl),cu.getClearColor(ed),td=cu.getClearAlpha(),td<1&&cu.setClearColor(16777215,.5),cu.clear(),Md&&Zd.render(ll);const Al=cu.toneMapping;cu.toneMapping=0;const bl=cl.viewport;if(void 0!==cl.viewport&&(cl.viewport=void 0),eu.setupLightsView(cl),!0===md&&Hd.setGlobalState(cu.clippingPlanes,cl),renderObjects(F,ll,cl),Dd.updateMultisampleRenderTarget(hl),Dd.updateRenderTargetMipmap(hl),!1===Id.has("WEBGL_multisampled_render_to_texture")){let F=!1;for(let hl=0,dl=Da.length;hl<dl;hl++){const dl=Da[hl],pl=dl.object,fl=dl.geometry,Al=dl.material,bl=dl.group;if(2===Al.side&&pl.layers.test(cl.layers)){const Da=Al.side;Al.side=1,Al.needsUpdate=!0,renderObject(pl,ll,cl,fl,Al,bl),Al.side=Da,Al.needsUpdate=!0,F=!0}}!0===F&&(Dd.updateMultisampleRenderTarget(hl),Dd.updateRenderTargetMipmap(hl))}cu.setRenderTarget(fl),cu.setClearColor(ed,td),void 0!==bl&&(cl.viewport=bl),cu.toneMapping=Al}function renderObjects(F,Da,ll){const cl=!0===Da.isScene?Da.overrideMaterial:null;for(let hl=0,dl=F.length;hl<dl;hl++){const dl=F[hl],pl=dl.object,fl=dl.geometry,Al=null===cl?dl.material:cl,bl=dl.group;pl.layers.test(ll.layers)&&renderObject(pl,Da,ll,fl,Al,bl)}}function renderObject(F,Da,ll,cl,hl,dl){F.onBeforeRender(cu,Da,ll,cl,hl,dl),F.modelViewMatrix.multiplyMatrices(ll.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),hl.onBeforeRender(cu,Da,ll,cl,F,dl),!0===hl.transparent&&2===hl.side&&!1===hl.forceSinglePass?(hl.side=1,hl.needsUpdate=!0,cu.renderBufferDirect(ll,Da,cl,hl,F,dl),hl.side=0,hl.needsUpdate=!0,cu.renderBufferDirect(ll,Da,cl,hl,F,dl),hl.side=2):cu.renderBufferDirect(ll,Da,cl,hl,F,dl),F.onAfterRender(cu,Da,ll,cl,hl,dl)}function getProgram(F,Da,ll){!0!==Da.isScene&&(Da=Ed);const cl=Pd.get(F),hl=eu.state.lights,dl=eu.state.shadowsArray,pl=hl.state.version,fl=Fd.getParameters(F,hl.state,dl,Da,ll),Al=Fd.getProgramCacheKey(fl);let bl=cl.programs;cl.environment=F.isMeshStandardMaterial?Da.environment:null,cl.fog=Da.fog,cl.envMap=(F.isMeshStandardMaterial?Nd:Rd).get(F.envMap||cl.environment),cl.envMapRotation=null!==cl.environment&&null===F.envMap?Da.environmentRotation:F.envMapRotation,void 0===bl&&(F.addEventListener("dispose",onMaterialDispose),bl=new Map,cl.programs=bl);let kl=bl.get(Al);if(void 0!==kl){if(cl.currentProgram===kl&&cl.lightsStateVersion===pl)return updateCommonMaterialProperties(F,fl),kl}else fl.uniforms=Fd.getUniforms(F),F.onBeforeCompile(fl,cu),kl=Fd.acquireProgram(fl,Al),bl.set(Al,kl),cl.uniforms=fl.uniforms;const Dl=cl.uniforms;return(F.isShaderMaterial||F.isRawShaderMaterial)&&!0!==F.clipping||(Dl.clippingPlanes=Hd.uniform),updateCommonMaterialProperties(F,fl),cl.needsLights=function(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&!0===F.lights}(F),cl.lightsStateVersion=pl,cl.needsLights&&(Dl.ambientLightColor.value=hl.state.ambient,Dl.lightProbe.value=hl.state.probe,Dl.directionalLights.value=hl.state.directional,Dl.directionalLightShadows.value=hl.state.directionalShadow,Dl.spotLights.value=hl.state.spot,Dl.spotLightShadows.value=hl.state.spotShadow,Dl.rectAreaLights.value=hl.state.rectArea,Dl.ltc_1.value=hl.state.rectAreaLTC1,Dl.ltc_2.value=hl.state.rectAreaLTC2,Dl.pointLights.value=hl.state.point,Dl.pointLightShadows.value=hl.state.pointShadow,Dl.hemisphereLights.value=hl.state.hemi,Dl.directionalShadowMap.value=hl.state.directionalShadowMap,Dl.directionalShadowMatrix.value=hl.state.directionalShadowMatrix,Dl.spotShadowMap.value=hl.state.spotShadowMap,Dl.spotLightMatrix.value=hl.state.spotLightMatrix,Dl.spotLightMap.value=hl.state.spotLightMap,Dl.pointShadowMap.value=hl.state.pointShadowMap,Dl.pointShadowMatrix.value=hl.state.pointShadowMatrix),cl.currentProgram=kl,cl.uniformsList=null,kl}function getUniformList(F){if(null===F.uniformsList){const Da=F.currentProgram.getUniforms();F.uniformsList=WebGLUniforms.seqWithValue(Da.seq,F.uniforms)}return F.uniformsList}function updateCommonMaterialProperties(F,Da){const ll=Pd.get(F);ll.outputColorSpace=Da.outputColorSpace,ll.batching=Da.batching,ll.batchingColor=Da.batchingColor,ll.instancing=Da.instancing,ll.instancingColor=Da.instancingColor,ll.instancingMorph=Da.instancingMorph,ll.skinning=Da.skinning,ll.morphTargets=Da.morphTargets,ll.morphNormals=Da.morphNormals,ll.morphColors=Da.morphColors,ll.morphTargetsCount=Da.morphTargetsCount,ll.numClippingPlanes=Da.numClippingPlanes,ll.numIntersection=Da.numClipIntersection,ll.vertexAlphas=Da.vertexAlphas,ll.vertexTangents=Da.vertexTangents,ll.toneMapping=Da.toneMapping}gp.setAnimationLoop((function(F){mp&&mp(F)})),"undefined"!==typeof self&&gp.setContext(self),this.setAnimationLoop=function(F){mp=F,lp.setAnimationLoop(F),null===F?gp.stop():gp.start()},lp.addEventListener("sessionstart",onXRSessionStart),lp.addEventListener("sessionend",onXRSessionEnd),this.render=function(F,Da){if(void 0!==Da&&!0!==Da.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===uu)return;if(!0===F.matrixWorldAutoUpdate&&F.updateMatrixWorld(),null===Da.parent&&!0===Da.matrixWorldAutoUpdate&&Da.updateMatrixWorld(),!0===lp.enabled&&!0===lp.isPresenting&&(!0===lp.cameraAutoUpdate&&lp.updateCamera(Da),Da=lp.getCamera()),!0===F.isScene&&F.onBeforeRender(cu,F,Da,zu),eu=Gd.get(F,su.length),eu.init(Da),su.push(eu),xd.multiplyMatrices(Da.projectionMatrix,Da.matrixWorldInverse),dd.setFromProjectionMatrix(xd),gd=this.localClippingEnabled,md=Hd.init(this.clippingPlanes,gd),Sc=Vd.get(F,iu.length),Sc.init(),iu.push(Sc),!0===lp.enabled&&!0===lp.isPresenting){const F=cu.xr.getDepthSensingMesh();null!==F&&projectObject(F,Da,-1/0,cu.sortObjects)}projectObject(F,Da,0,cu.sortObjects),Sc.finish(),!0===cu.sortObjects&&Sc.sort(ad,sd),Md=!1===lp.enabled||!1===lp.isPresenting||!1===lp.hasDepthSensing(),Md&&Zd.addToRenderList(Sc,F),this.info.render.frame++,!0===md&&Hd.beginShadows();const ll=eu.state.shadowsArray;qd.render(ll,F,Da),!0===md&&Hd.endShadows(),!0===this.info.autoReset&&this.info.reset();const cl=Sc.opaque,hl=Sc.transmissive;if(eu.setupLights(),Da.isArrayCamera){const ll=Da.cameras;if(hl.length>0)for(let Da=0,dl=ll.length;Da<dl;Da++){renderTransmissionPass(cl,hl,F,ll[Da])}Md&&Zd.render(F);for(let Da=0,cl=ll.length;Da<cl;Da++){const cl=ll[Da];renderScene(Sc,F,cl,cl.viewport)}}else hl.length>0&&renderTransmissionPass(cl,hl,F,Da),Md&&Zd.render(F),renderScene(Sc,F,Da);null!==zu&&(Dd.updateMultisampleRenderTarget(zu),Dd.updateRenderTargetMipmap(zu)),!0===F.isScene&&F.onAfterRender(cu,F,Da),Yd.resetDefaultState(),Du=-1,Nu=null,su.pop(),su.length>0?(eu=su[su.length-1],!0===md&&Hd.setGlobalState(cu.clippingPlanes,eu.state.camera)):eu=null,iu.pop(),Sc=iu.length>0?iu[iu.length-1]:null},this.getActiveCubeFace=function(){return hu},this.getActiveMipmapLevel=function(){return Lu},this.getRenderTarget=function(){return zu},this.setRenderTargetTextures=function(F,Da,ll){Pd.get(F.texture).__webglTexture=Da,Pd.get(F.depthTexture).__webglTexture=ll;const cl=Pd.get(F);cl.__hasExternalTextures=!0,cl.__autoAllocateDepthBuffer=void 0===ll,cl.__autoAllocateDepthBuffer||!0===Id.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),cl.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,Da){const ll=Pd.get(F);ll.__webglFramebuffer=Da,ll.__useDefaultFramebuffer=void 0===Da},this.setRenderTarget=function(F,Da,ll){void 0===Da&&(Da=0),void 0===ll&&(ll=0),zu=F,hu=Da,Lu=ll;let cl=!0,hl=null,dl=!1,pl=!1;if(F){const fl=Pd.get(F);if(void 0!==fl.__useDefaultFramebuffer)Ld.bindFramebuffer($d.FRAMEBUFFER,null),cl=!1;else if(void 0===fl.__webglFramebuffer)Dd.setupRenderTarget(F);else if(fl.__hasExternalTextures)Dd.rebindTextures(F,Pd.get(F.texture).__webglTexture,Pd.get(F.depthTexture).__webglTexture);else if(F.depthBuffer){const Da=F.depthTexture;if(fl.__boundDepthTexture!==Da){if(null!==Da&&Pd.has(Da)&&(F.width!==Da.image.width||F.height!==Da.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Dd.setupDepthRenderbuffer(F)}}const Al=F.texture;(Al.isData3DTexture||Al.isDataArrayTexture||Al.isCompressedArrayTexture)&&(pl=!0);const bl=Pd.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(hl=Array.isArray(bl[Da])?bl[Da][ll]:bl[Da],dl=!0):hl=F.samples>0&&!1===Dd.useMultisampledRTT(F)?Pd.get(F).__webglMultisampledFramebuffer:Array.isArray(bl)?bl[ll]:bl,qu.copy(F.viewport),ih.copy(F.scissor),gh=F.scissorTest}else qu.copy(od).multiplyScalar(rd).floor(),ih.copy(ld).multiplyScalar(rd).floor(),gh=hd;if(Ld.bindFramebuffer($d.FRAMEBUFFER,hl)&&cl&&Ld.drawBuffers(F,hl),Ld.viewport(qu),Ld.scissor(ih),Ld.setScissorTest(gh),dl){const cl=Pd.get(F.texture);$d.framebufferTexture2D($d.FRAMEBUFFER,$d.COLOR_ATTACHMENT0,$d.TEXTURE_CUBE_MAP_POSITIVE_X+Da,cl.__webglTexture,ll)}else if(pl){const cl=Pd.get(F.texture),hl=Da||0;$d.framebufferTextureLayer($d.FRAMEBUFFER,$d.COLOR_ATTACHMENT0,cl.__webglTexture,ll||0,hl)}Du=-1},this.readRenderTargetPixels=function(F,Da,ll,cl,hl,dl,pl){if(!F||!F.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let fl=Pd.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&void 0!==pl&&(fl=fl[pl]),fl){Ld.bindFramebuffer($d.FRAMEBUFFER,fl);try{const pl=F.texture,fl=pl.format,Al=pl.type;if(!Cd.textureFormatReadable(fl))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!Cd.textureTypeReadable(Al))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Da>=0&&Da<=F.width-cl&&ll>=0&&ll<=F.height-hl&&$d.readPixels(Da,ll,cl,hl,Xd.convert(fl),Xd.convert(Al),dl)}finally{const F=null!==zu?Pd.get(zu).__webglFramebuffer:null;Ld.bindFramebuffer($d.FRAMEBUFFER,F)}}},this.readRenderTargetPixelsAsync=async function(F,Da,ll,cl,hl,dl,pl){if(!F||!F.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let fl=Pd.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&void 0!==pl&&(fl=fl[pl]),fl){Ld.bindFramebuffer($d.FRAMEBUFFER,fl);try{const pl=F.texture,fl=pl.format,Al=pl.type;if(!Cd.textureFormatReadable(fl))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Cd.textureTypeReadable(Al))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(Da>=0&&Da<=F.width-cl&&ll>=0&&ll<=F.height-hl){const F=$d.createBuffer();$d.bindBuffer($d.PIXEL_PACK_BUFFER,F),$d.bufferData($d.PIXEL_PACK_BUFFER,dl.byteLength,$d.STREAM_READ),$d.readPixels(Da,ll,cl,hl,Xd.convert(fl),Xd.convert(Al),0),$d.flush();const pl=$d.fenceSync($d.SYNC_GPU_COMMANDS_COMPLETE,0);await function(F,Da,ll){return new Promise((function(cl,hl){setTimeout((function probe(){switch(F.clientWaitSync(Da,F.SYNC_FLUSH_COMMANDS_BIT,0)){case F.WAIT_FAILED:hl();break;case F.TIMEOUT_EXPIRED:setTimeout(probe,ll);break;default:cl()}}),ll)}))}($d,pl,4);try{$d.bindBuffer($d.PIXEL_PACK_BUFFER,F),$d.getBufferSubData($d.PIXEL_PACK_BUFFER,0,dl)}finally{$d.deleteBuffer(F),$d.deleteSync(pl)}return dl}}finally{const F=null!==zu?Pd.get(zu).__webglFramebuffer:null;Ld.bindFramebuffer($d.FRAMEBUFFER,F)}}},this.copyFramebufferToTexture=function(F,Da,ll){void 0===Da&&(Da=null),void 0===ll&&(ll=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyFramebufferToTexture function signature has changed."),Da=arguments[0]||null,F=arguments[1]);const cl=Math.pow(2,-ll),hl=Math.floor(F.image.width*cl),dl=Math.floor(F.image.height*cl),pl=null!==Da?Da.x:0,fl=null!==Da?Da.y:0;Dd.setTexture2D(F,0),$d.copyTexSubImage2D($d.TEXTURE_2D,ll,0,0,pl,fl,hl,dl),Ld.unbindTexture()},this.copyTextureToTexture=function(F,Da,ll,cl,hl){let dl,pl,fl,Al,bl,kl;void 0===ll&&(ll=null),void 0===cl&&(cl=null),void 0===hl&&(hl=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyTextureToTexture function signature has changed."),cl=arguments[0]||null,F=arguments[1],Da=arguments[2],hl=arguments[3]||0,ll=null),null!==ll?(dl=ll.max.x-ll.min.x,pl=ll.max.y-ll.min.y,fl=ll.min.x,Al=ll.min.y):(dl=F.image.width,pl=F.image.height,fl=0,Al=0),null!==cl?(bl=cl.x,kl=cl.y):(bl=0,kl=0);const Dl=Xd.convert(Da.format),Wl=Xd.convert(Da.type);Dd.setTexture2D(Da,0),$d.pixelStorei($d.UNPACK_FLIP_Y_WEBGL,Da.flipY),$d.pixelStorei($d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Da.premultiplyAlpha),$d.pixelStorei($d.UNPACK_ALIGNMENT,Da.unpackAlignment);const Ql=$d.getParameter($d.UNPACK_ROW_LENGTH),wc=$d.getParameter($d.UNPACK_IMAGE_HEIGHT),Sc=$d.getParameter($d.UNPACK_SKIP_PIXELS),eu=$d.getParameter($d.UNPACK_SKIP_ROWS),iu=$d.getParameter($d.UNPACK_SKIP_IMAGES),su=F.isCompressedTexture?F.mipmaps[hl]:F.image;$d.pixelStorei($d.UNPACK_ROW_LENGTH,su.width),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,su.height),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,fl),$d.pixelStorei($d.UNPACK_SKIP_ROWS,Al),F.isDataTexture?$d.texSubImage2D($d.TEXTURE_2D,hl,bl,kl,dl,pl,Dl,Wl,su.data):F.isCompressedTexture?$d.compressedTexSubImage2D($d.TEXTURE_2D,hl,bl,kl,su.width,su.height,Dl,su.data):$d.texSubImage2D($d.TEXTURE_2D,hl,bl,kl,dl,pl,Dl,Wl,su),$d.pixelStorei($d.UNPACK_ROW_LENGTH,Ql),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,wc),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,Sc),$d.pixelStorei($d.UNPACK_SKIP_ROWS,eu),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,iu),0===hl&&Da.generateMipmaps&&$d.generateMipmap($d.TEXTURE_2D),Ld.unbindTexture()},this.copyTextureToTexture3D=function(F,Da,ll,cl,hl){let dl,pl,fl,Al,bl,kl,Dl,Wl,Ql;void 0===ll&&(ll=null),void 0===cl&&(cl=null),void 0===hl&&(hl=0),!0!==F.isTexture&&(warnOnce("WebGLRenderer: copyTextureToTexture3D function signature has changed."),ll=arguments[0]||null,cl=arguments[1]||null,F=arguments[2],Da=arguments[3],hl=arguments[4]||0);const wc=F.isCompressedTexture?F.mipmaps[hl]:F.image;null!==ll?(dl=ll.max.x-ll.min.x,pl=ll.max.y-ll.min.y,fl=ll.max.z-ll.min.z,Al=ll.min.x,bl=ll.min.y,kl=ll.min.z):(dl=wc.width,pl=wc.height,fl=wc.depth,Al=0,bl=0,kl=0),null!==cl?(Dl=cl.x,Wl=cl.y,Ql=cl.z):(Dl=0,Wl=0,Ql=0);const Sc=Xd.convert(Da.format),eu=Xd.convert(Da.type);let iu;if(Da.isData3DTexture)Dd.setTexture3D(Da,0),iu=$d.TEXTURE_3D;else{if(!Da.isDataArrayTexture&&!Da.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");Dd.setTexture2DArray(Da,0),iu=$d.TEXTURE_2D_ARRAY}$d.pixelStorei($d.UNPACK_FLIP_Y_WEBGL,Da.flipY),$d.pixelStorei($d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Da.premultiplyAlpha),$d.pixelStorei($d.UNPACK_ALIGNMENT,Da.unpackAlignment);const su=$d.getParameter($d.UNPACK_ROW_LENGTH),cu=$d.getParameter($d.UNPACK_IMAGE_HEIGHT),uu=$d.getParameter($d.UNPACK_SKIP_PIXELS),hu=$d.getParameter($d.UNPACK_SKIP_ROWS),Lu=$d.getParameter($d.UNPACK_SKIP_IMAGES);$d.pixelStorei($d.UNPACK_ROW_LENGTH,wc.width),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,wc.height),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,Al),$d.pixelStorei($d.UNPACK_SKIP_ROWS,bl),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,kl),F.isDataTexture||F.isData3DTexture?$d.texSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,eu,wc.data):Da.isCompressedArrayTexture?$d.compressedTexSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,wc.data):$d.texSubImage3D(iu,hl,Dl,Wl,Ql,dl,pl,fl,Sc,eu,wc),$d.pixelStorei($d.UNPACK_ROW_LENGTH,su),$d.pixelStorei($d.UNPACK_IMAGE_HEIGHT,cu),$d.pixelStorei($d.UNPACK_SKIP_PIXELS,uu),$d.pixelStorei($d.UNPACK_SKIP_ROWS,hu),$d.pixelStorei($d.UNPACK_SKIP_IMAGES,Lu),0===hl&&Da.generateMipmaps&&$d.generateMipmap(iu),Ld.unbindTexture()},this.initRenderTarget=function(F){void 0===Pd.get(F).__webglFramebuffer&&Dd.setupRenderTarget(F)},this.initTexture=function(F){F.isCubeTexture?Dd.setTextureCube(F,0):F.isData3DTexture?Dd.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?Dd.setTexture2DArray(F,0):Dd.setTexture2D(F,0),Ld.unbindTexture()},this.resetState=function(){hu=0,Lu=0,zu=null,Ld.reset(),Yd.reset()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Wp}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(F){this._outputColorSpace=F;const Da=this.getContext();Da.drawingBufferColorSpace=F===Cp?"display-p3":"srgb",Da.unpackColorSpace=sm.workingColorSpace===Lp?"display-p3":"srgb"}}class Scene extends Object3D{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 Euler,this.environmentIntensity=1,this.environmentRotation=new Euler,this.overrideMaterial=null,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(F,Da){return super.copy(F,Da),null!==F.background&&(this.background=F.background.clone()),null!==F.environment&&(this.environment=F.environment.clone()),null!==F.fog&&(this.fog=F.fog.clone()),this.backgroundBlurriness=F.backgroundBlurriness,this.backgroundIntensity=F.backgroundIntensity,this.backgroundRotation.copy(F.backgroundRotation),this.environmentIntensity=F.environmentIntensity,this.environmentRotation.copy(F.environmentRotation),null!==F.overrideMaterial&&(this.overrideMaterial=F.overrideMaterial.clone()),this.matrixAutoUpdate=F.matrixAutoUpdate,this}toJSON(F){const Da=super.toJSON(F);return null!==this.fog&&(Da.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(Da.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(Da.object.backgroundIntensity=this.backgroundIntensity),Da.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(Da.object.environmentIntensity=this.environmentIntensity),Da.object.environmentRotation=this.environmentRotation.toArray(),Da}}class LineBasicMaterial extends Material{constructor(F){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Color(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(F)}copy(F){return super.copy(F),this.color.copy(F.color),this.map=F.map,this.linewidth=F.linewidth,this.linecap=F.linecap,this.linejoin=F.linejoin,this.fog=F.fog,this}}const jg=new Vector3,Vg=new Vector3,Gg=new Matrix4,Hg=new Ray,qg=new Sphere,Zg=new Vector3,Wg=new Vector3;class Line extends Object3D{constructor(F,Da){void 0===F&&(F=new BufferGeometry),void 0===Da&&(Da=new LineBasicMaterial),super(),this.isLine=!0,this.type="Line",this.geometry=F,this.material=Da,this.updateMorphTargets()}copy(F,Da){return super.copy(F,Da),this.material=Array.isArray(F.material)?F.material.slice():F.material,this.geometry=F.geometry,this}computeLineDistances(){const F=this.geometry;if(null===F.index){const Da=F.attributes.position,ll=[0];for(let F=1,cl=Da.count;F<cl;F++)jg.fromBufferAttribute(Da,F-1),Vg.fromBufferAttribute(Da,F),ll[F]=ll[F-1],ll[F]+=jg.distanceTo(Vg);F.setAttribute("lineDistance",new Float32BufferAttribute(ll,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(F,Da){const ll=this.geometry,cl=this.matrixWorld,hl=F.params.Line.threshold,dl=ll.drawRange;if(null===ll.boundingSphere&&ll.computeBoundingSphere(),qg.copy(ll.boundingSphere),qg.applyMatrix4(cl),qg.radius+=hl,!1===F.ray.intersectsSphere(qg))return;Gg.copy(cl).invert(),Hg.copy(F.ray).applyMatrix4(Gg);const pl=hl/((this.scale.x+this.scale.y+this.scale.z)/3),fl=pl*pl,Al=this.isLineSegments?2:1,bl=ll.index,kl=ll.attributes.position;if(null!==bl){const ll=Math.max(0,dl.start),cl=Math.min(bl.count,dl.start+dl.count);for(let hl=ll,dl=cl-1;hl<dl;hl+=Al){const ll=bl.getX(hl),cl=bl.getX(hl+1),dl=checkIntersection(this,F,Hg,fl,ll,cl);dl&&Da.push(dl)}if(this.isLineLoop){const hl=bl.getX(cl-1),dl=bl.getX(ll),pl=checkIntersection(this,F,Hg,fl,hl,dl);pl&&Da.push(pl)}}else{const ll=Math.max(0,dl.start),cl=Math.min(kl.count,dl.start+dl.count);for(let hl=ll,dl=cl-1;hl<dl;hl+=Al){const ll=checkIntersection(this,F,Hg,fl,hl,hl+1);ll&&Da.push(ll)}if(this.isLineLoop){const hl=checkIntersection(this,F,Hg,fl,cl-1,ll);hl&&Da.push(hl)}}}updateMorphTargets(){const F=this.geometry.morphAttributes,Da=Object.keys(F);if(Da.length>0){const ll=F[Da[0]];if(void 0!==ll){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let F=0,Da=ll.length;F<Da;F++){const Da=ll[F].name||String(F);this.morphTargetInfluences.push(0),this.morphTargetDictionary[Da]=F}}}}}function checkIntersection(F,Da,ll,cl,hl,dl){const pl=F.geometry.attributes.position;jg.fromBufferAttribute(pl,hl),Vg.fromBufferAttribute(pl,dl);if(ll.distanceSqToSegment(jg,Vg,Zg,Wg)>cl)return;Zg.applyMatrix4(F.matrixWorld);const fl=Da.ray.origin.distanceTo(Zg);return fl<Da.near||fl>Da.far?void 0:{distance:fl,point:Wg.clone().applyMatrix4(F.matrixWorld),index:hl,face:null,faceIndex:null,object:F}}const Kg=new Vector3,Qg=new Vector3;class LineSegments extends Line{constructor(F,Da){super(F,Da),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const F=this.geometry;if(null===F.index){const Da=F.attributes.position,ll=[];for(let F=0,cl=Da.count;F<cl;F+=2)Kg.fromBufferAttribute(Da,F),Qg.fromBufferAttribute(Da,F+1),ll[F]=0===F?0:ll[F-1],ll[F+1]=ll[F]+Kg.distanceTo(Qg);F.setAttribute("lineDistance",new Float32BufferAttribute(ll,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class SphereGeometry extends BufferGeometry{constructor(F,Da,ll,cl,hl,dl,pl){void 0===F&&(F=1),void 0===Da&&(Da=32),void 0===ll&&(ll=16),void 0===cl&&(cl=0),void 0===hl&&(hl=2*Math.PI),void 0===dl&&(dl=0),void 0===pl&&(pl=Math.PI),super(),this.type="SphereGeometry",this.parameters={radius:F,widthSegments:Da,heightSegments:ll,phiStart:cl,phiLength:hl,thetaStart:dl,thetaLength:pl},Da=Math.max(3,Math.floor(Da)),ll=Math.max(2,Math.floor(ll));const fl=Math.min(dl+pl,Math.PI);let Al=0;const bl=[],kl=new Vector3,Dl=new Vector3,Wl=[],Ql=[],wc=[],Sc=[];for(let eu=0;eu<=ll;eu++){const Wl=[],iu=eu/ll;let su=0;0===eu&&0===dl?su=.5/Da:eu===ll&&fl===Math.PI&&(su=-.5/Da);for(let ll=0;ll<=Da;ll++){const fl=ll/Da;kl.x=-F*Math.cos(cl+fl*hl)*Math.sin(dl+iu*pl),kl.y=F*Math.cos(dl+iu*pl),kl.z=F*Math.sin(cl+fl*hl)*Math.sin(dl+iu*pl),Ql.push(kl.x,kl.y,kl.z),Dl.copy(kl).normalize(),wc.push(Dl.x,Dl.y,Dl.z),Sc.push(fl+su,1-iu),Wl.push(Al++)}bl.push(Wl)}for(let eu=0;eu<ll;eu++)for(let F=0;F<Da;F++){const Da=bl[eu][F+1],cl=bl[eu][F],hl=bl[eu+1][F],pl=bl[eu+1][F+1];(0!==eu||dl>0)&&Wl.push(Da,cl,pl),(eu!==ll-1||fl<Math.PI)&&Wl.push(cl,hl,pl)}this.setIndex(Wl),this.setAttribute("position",new Float32BufferAttribute(Ql,3)),this.setAttribute("normal",new Float32BufferAttribute(wc,3)),this.setAttribute("uv",new Float32BufferAttribute(Sc,2))}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}static fromJSON(F){return new SphereGeometry(F.radius,F.widthSegments,F.heightSegments,F.phiStart,F.phiLength,F.thetaStart,F.thetaLength)}}class WireframeGeometry extends BufferGeometry{constructor(F){if(void 0===F&&(F=null),super(),this.type="WireframeGeometry",this.parameters={geometry:F},null!==F){const Da=[],ll=new Set,cl=new Vector3,hl=new Vector3;if(null!==F.index){const dl=F.attributes.position,pl=F.index;let fl=F.groups;0===fl.length&&(fl=[{start:0,count:pl.count,materialIndex:0}]);for(let F=0,Al=fl.length;F<Al;++F){const Al=fl[F],bl=Al.start;for(let F=bl,fl=bl+Al.count;F<fl;F+=3)for(let Al=0;Al<3;Al++){const fl=pl.getX(F+Al),bl=pl.getX(F+(Al+1)%3);cl.fromBufferAttribute(dl,fl),hl.fromBufferAttribute(dl,bl),!0===isUniqueEdge(cl,hl,ll)&&(Da.push(cl.x,cl.y,cl.z),Da.push(hl.x,hl.y,hl.z))}}}else{const dl=F.attributes.position;for(let F=0,pl=dl.count/3;F<pl;F++)for(let fl=0;fl<3;fl++){const pl=3*F+fl,Al=3*F+(fl+1)%3;cl.fromBufferAttribute(dl,pl),hl.fromBufferAttribute(dl,Al),!0===isUniqueEdge(cl,hl,ll)&&(Da.push(cl.x,cl.y,cl.z),Da.push(hl.x,hl.y,hl.z))}}this.setAttribute("position",new Float32BufferAttribute(Da,3))}}copy(F){return super.copy(F),this.parameters=Object.assign({},F.parameters),this}}function isUniqueEdge(F,Da,ll){const cl=`${F.x},${F.y},${F.z}-${Da.x},${Da.y},${Da.z}`,hl=`${Da.x},${Da.y},${Da.z}-${F.x},${F.y},${F.z}`;return!0!==ll.has(cl)&&!0!==ll.has(hl)&&(ll.add(cl),ll.add(hl),!0)}function convertArray(F,Da,ll){return!F||!ll&&F.constructor===Da?F:"number"===typeof Da.BYTES_PER_ELEMENT?new Da(F):Array.prototype.slice.call(F)}function isTypedArray(F){return ArrayBuffer.isView(F)&&!(F instanceof DataView)}class Interpolant{constructor(F,Da,ll,cl){this.parameterPositions=F,this._cachedIndex=0,this.resultBuffer=void 0!==cl?cl:new Da.constructor(ll),this.sampleValues=Da,this.valueSize=ll,this.settings=null,this.DefaultSettings_={}}evaluate(F){const Da=this.parameterPositions;let ll=this._cachedIndex,cl=Da[ll],hl=Da[ll-1];e:{t:{let dl;i:{n:if(!(F<cl)){for(let dl=ll+2;;){if(void 0===cl){if(F<hl)break n;return ll=Da.length,this._cachedIndex=ll,this.copySampleValue_(ll-1)}if(ll===dl)break;if(hl=cl,cl=Da[++ll],F<cl)break t}dl=Da.length;break i}if(F>=hl)break e;{const pl=Da[1];F<pl&&(ll=2,hl=pl);for(let dl=ll-2;;){if(void 0===hl)return this._cachedIndex=0,this.copySampleValue_(0);if(ll===dl)break;if(cl=hl,hl=Da[--ll-1],F>=hl)break t}dl=ll,ll=0}}for(;ll<dl;){const cl=ll+dl>>>1;F<Da[cl]?dl=cl:ll=cl+1}if(cl=Da[ll],hl=Da[ll-1],void 0===hl)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===cl)return ll=Da.length,this._cachedIndex=ll,this.copySampleValue_(ll-1)}this._cachedIndex=ll,this.intervalChanged_(ll,hl,cl)}return this.interpolate_(ll,hl,F,cl)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(F){const Da=this.resultBuffer,ll=this.sampleValues,cl=this.valueSize,hl=F*cl;for(let dl=0;dl!==cl;++dl)Da[dl]=ll[hl+dl];return Da}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class CubicInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Ep,endingEnd:Ep}}intervalChanged_(F,Da,ll){const cl=this.parameterPositions;let hl=F-2,dl=F+1,pl=cl[hl],fl=cl[dl];if(void 0===pl)switch(this.getSettings_().endingStart){case Mp:hl=F,pl=2*Da-ll;break;case Sp:hl=cl.length-2,pl=Da+cl[hl]-cl[hl+1];break;default:hl=F,pl=ll}if(void 0===fl)switch(this.getSettings_().endingEnd){case Mp:dl=F,fl=2*ll-Da;break;case Sp:dl=1,fl=ll+cl[1]-cl[0];break;default:dl=F-1,fl=Da}const Al=.5*(ll-Da),bl=this.valueSize;this._weightPrev=Al/(Da-pl),this._weightNext=Al/(fl-ll),this._offsetPrev=hl*bl,this._offsetNext=dl*bl}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=F*pl,Al=fl-pl,bl=this._offsetPrev,kl=this._offsetNext,Dl=this._weightPrev,Wl=this._weightNext,Ql=(ll-Da)/(cl-Da),wc=Ql*Ql,Sc=wc*Ql,eu=-Dl*Sc+2*Dl*wc-Dl*Ql,iu=(1+Dl)*Sc+(-1.5-2*Dl)*wc+(-.5+Dl)*Ql+1,su=(-1-Wl)*Sc+(1.5+Wl)*wc+.5*Ql,cu=Wl*Sc-Wl*wc;for(let uu=0;uu!==pl;++uu)hl[uu]=eu*dl[bl+uu]+iu*dl[Al+uu]+su*dl[fl+uu]+cu*dl[kl+uu];return hl}}class LinearInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=F*pl,Al=fl-pl,bl=(ll-Da)/(cl-Da),kl=1-bl;for(let Dl=0;Dl!==pl;++Dl)hl[Dl]=dl[Al+Dl]*kl+dl[fl+Dl]*bl;return hl}}class DiscreteInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F){return this.copySampleValue_(F-1)}}class KeyframeTrack{constructor(F,Da,ll,cl){if(void 0===F)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===Da||0===Da.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+F);this.name=F,this.times=convertArray(Da,this.TimeBufferType),this.values=convertArray(ll,this.ValueBufferType),this.setInterpolation(cl||this.DefaultInterpolation)}static toJSON(F){const Da=F.constructor;let ll;if(Da.toJSON!==this.toJSON)ll=Da.toJSON(F);else{ll={name:F.name,times:convertArray(F.times,Array),values:convertArray(F.values,Array)};const Da=F.getInterpolation();Da!==F.DefaultInterpolation&&(ll.interpolation=Da)}return ll.type=F.ValueTypeName,ll}InterpolantFactoryMethodDiscrete(F){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),F)}InterpolantFactoryMethodLinear(F){return new LinearInterpolant(this.times,this.values,this.getValueSize(),F)}InterpolantFactoryMethodSmooth(F){return new CubicInterpolant(this.times,this.values,this.getValueSize(),F)}setInterpolation(F){let Da;switch(F){case xp:Da=this.InterpolantFactoryMethodDiscrete;break;case bp:Da=this.InterpolantFactoryMethodLinear;break;case wp:Da=this.InterpolantFactoryMethodSmooth}if(void 0===Da){const Da="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(F===this.DefaultInterpolation)throw new Error(Da);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",Da),this}return this.createInterpolant=Da,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return xp;case this.InterpolantFactoryMethodLinear:return bp;case this.InterpolantFactoryMethodSmooth:return wp}}getValueSize(){return this.values.length/this.times.length}shift(F){if(0!==F){const Da=this.times;for(let ll=0,cl=Da.length;ll!==cl;++ll)Da[ll]+=F}return this}scale(F){if(1!==F){const Da=this.times;for(let ll=0,cl=Da.length;ll!==cl;++ll)Da[ll]*=F}return this}trim(F,Da){const ll=this.times,cl=ll.length;let hl=0,dl=cl-1;for(;hl!==cl&&ll[hl]<F;)++hl;for(;-1!==dl&&ll[dl]>Da;)--dl;if(++dl,0!==hl||dl!==cl){hl>=dl&&(dl=Math.max(dl,1),hl=dl-1);const F=this.getValueSize();this.times=ll.slice(hl,dl),this.values=this.values.slice(hl*F,dl*F)}return this}validate(){let F=!0;const Da=this.getValueSize();Da-Math.floor(Da)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),F=!1);const ll=this.times,cl=this.values,hl=ll.length;0===hl&&(console.error("THREE.KeyframeTrack: Track is empty.",this),F=!1);let dl=null;for(let pl=0;pl!==hl;pl++){const Da=ll[pl];if("number"===typeof Da&&isNaN(Da)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,pl,Da),F=!1;break}if(null!==dl&&dl>Da){console.error("THREE.KeyframeTrack: Out of order keys.",this,pl,Da,dl),F=!1;break}dl=Da}if(void 0!==cl&&isTypedArray(cl))for(let pl=0,fl=cl.length;pl!==fl;++pl){const Da=cl[pl];if(isNaN(Da)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,pl,Da),F=!1;break}}return F}optimize(){const F=this.times.slice(),Da=this.values.slice(),ll=this.getValueSize(),cl=this.getInterpolation()===wp,hl=F.length-1;let dl=1;for(let pl=1;pl<hl;++pl){let hl=!1;const fl=F[pl];if(fl!==F[pl+1]&&(1!==pl||fl!==F[0]))if(cl)hl=!0;else{const F=pl*ll,cl=F-ll,dl=F+ll;for(let pl=0;pl!==ll;++pl){const ll=Da[F+pl];if(ll!==Da[cl+pl]||ll!==Da[dl+pl]){hl=!0;break}}}if(hl){if(pl!==dl){F[dl]=F[pl];const cl=pl*ll,hl=dl*ll;for(let F=0;F!==ll;++F)Da[hl+F]=Da[cl+F]}++dl}}if(hl>0){F[dl]=F[hl];for(let F=hl*ll,cl=dl*ll,pl=0;pl!==ll;++pl)Da[cl+pl]=Da[F+pl];++dl}return dl!==F.length?(this.times=F.slice(0,dl),this.values=Da.slice(0,dl*ll)):(this.times=F,this.values=Da),this}clone(){const F=this.times.slice(),Da=this.values.slice(),ll=new(0,this.constructor)(this.name,F,Da);return ll.createInterpolant=this.createInterpolant,ll}}KeyframeTrack.prototype.TimeBufferType=Float32Array,KeyframeTrack.prototype.ValueBufferType=Float32Array,KeyframeTrack.prototype.DefaultInterpolation=bp;class BooleanKeyframeTrack extends KeyframeTrack{constructor(F,Da,ll){super(F,Da,ll)}}BooleanKeyframeTrack.prototype.ValueTypeName="bool",BooleanKeyframeTrack.prototype.ValueBufferType=Array,BooleanKeyframeTrack.prototype.DefaultInterpolation=xp,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,BooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class ColorKeyframeTrack extends KeyframeTrack{}ColorKeyframeTrack.prototype.ValueTypeName="color";class NumberKeyframeTrack extends KeyframeTrack{}NumberKeyframeTrack.prototype.ValueTypeName="number";class QuaternionLinearInterpolant extends Interpolant{constructor(F,Da,ll,cl){super(F,Da,ll,cl)}interpolate_(F,Da,ll,cl){const hl=this.resultBuffer,dl=this.sampleValues,pl=this.valueSize,fl=(ll-Da)/(cl-Da);let Al=F*pl;for(let bl=Al+pl;Al!==bl;Al+=4)Quaternion.slerpFlat(hl,0,dl,Al-pl,dl,Al,fl);return hl}}class QuaternionKeyframeTrack extends KeyframeTrack{InterpolantFactoryMethodLinear(F){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),F)}}QuaternionKeyframeTrack.prototype.ValueTypeName="quaternion",QuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class StringKeyframeTrack extends KeyframeTrack{constructor(F,Da,ll){super(F,Da,ll)}}StringKeyframeTrack.prototype.ValueTypeName="string",StringKeyframeTrack.prototype.ValueBufferType=Array,StringKeyframeTrack.prototype.DefaultInterpolation=xp,StringKeyframeTrack.prototype.InterpolantFactoryMethodLinear=void 0,StringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth=void 0;class VectorKeyframeTrack extends KeyframeTrack{}VectorKeyframeTrack.prototype.ValueTypeName="vector";const Xg={enabled:!1,files:{},add:function(F,Da){!1!==this.enabled&&(this.files[F]=Da)},get:function(F){if(!1!==this.enabled)return this.files[F]},remove:function(F){delete this.files[F]},clear:function(){this.files={}}};class LoadingManager{constructor(F,Da,ll){const cl=this;let hl,dl=!1,pl=0,fl=0;const Al=[];this.onStart=void 0,this.onLoad=F,this.onProgress=Da,this.onError=ll,this.itemStart=function(F){fl++,!1===dl&&void 0!==cl.onStart&&cl.onStart(F,pl,fl),dl=!0},this.itemEnd=function(F){pl++,void 0!==cl.onProgress&&cl.onProgress(F,pl,fl),pl===fl&&(dl=!1,void 0!==cl.onLoad&&cl.onLoad())},this.itemError=function(F){void 0!==cl.onError&&cl.onError(F)},this.resolveURL=function(F){return hl?hl(F):F},this.setURLModifier=function(F){return hl=F,this},this.addHandler=function(F,Da){return Al.push(F,Da),this},this.removeHandler=function(F){const Da=Al.indexOf(F);return-1!==Da&&Al.splice(Da,2),this},this.getHandler=function(F){for(let Da=0,ll=Al.length;Da<ll;Da+=2){const ll=Al[Da],cl=Al[Da+1];if(ll.global&&(ll.lastIndex=0),ll.test(F))return cl}return null}}}const Yg=new LoadingManager;class Loader{constructor(F){this.manager=void 0!==F?F:Yg,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(F,Da){const ll=this;return new Promise((function(cl,hl){ll.load(F,cl,Da,hl)}))}parse(){}setCrossOrigin(F){return this.crossOrigin=F,this}setWithCredentials(F){return this.withCredentials=F,this}setPath(F){return this.path=F,this}setResourcePath(F){return this.resourcePath=F,this}setRequestHeader(F){return this.requestHeader=F,this}}Loader.DEFAULT_MATERIAL_NAME="__DEFAULT";Error;const Jg="\\[\\]\\.:\\/",$g=new RegExp("["+Jg+"]","g"),eA="[^"+Jg+"]",tA="[^"+Jg.replace("\\.","")+"]",iA=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",eA)+/(WCOD+)?/.source.replace("WCOD",tA)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",eA)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",eA)+"$"),nA=["material","materials","bones","map"];class PropertyBinding{constructor(F,Da,ll){this.path=Da,this.parsedPath=ll||PropertyBinding.parseTrackName(Da),this.node=PropertyBinding.findNode(F,this.parsedPath.nodeName),this.rootNode=F,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(F,Da,ll){return F&&F.isAnimationObjectGroup?new PropertyBinding.Composite(F,Da,ll):new PropertyBinding(F,Da,ll)}static sanitizeNodeName(F){return F.replace(/\s/g,"_").replace($g,"")}static parseTrackName(F){const Da=iA.exec(F);if(null===Da)throw new Error("PropertyBinding: Cannot parse trackName: "+F);const ll={nodeName:Da[2],objectName:Da[3],objectIndex:Da[4],propertyName:Da[5],propertyIndex:Da[6]},cl=ll.nodeName&&ll.nodeName.lastIndexOf(".");if(void 0!==cl&&-1!==cl){const F=ll.nodeName.substring(cl+1);-1!==nA.indexOf(F)&&(ll.nodeName=ll.nodeName.substring(0,cl),ll.objectName=F)}if(null===ll.propertyName||0===ll.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+F);return ll}static findNode(F,Da){if(void 0===Da||""===Da||"."===Da||-1===Da||Da===F.name||Da===F.uuid)return F;if(F.skeleton){const ll=F.skeleton.getBoneByName(Da);if(void 0!==ll)return ll}if(F.children){const searchNodeSubtree=function(F){for(let ll=0;ll<F.length;ll++){const cl=F[ll];if(cl.name===Da||cl.uuid===Da)return cl;const hl=searchNodeSubtree(cl.children);if(hl)return hl}return null},ll=searchNodeSubtree(F.children);if(ll)return ll}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(F,Da){F[Da]=this.targetObject[this.propertyName]}_getValue_array(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)F[Da++]=ll[cl]}_getValue_arrayElement(F,Da){F[Da]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(F,Da){this.resolvedProperty.toArray(F,Da)}_setValue_direct(F,Da){this.targetObject[this.propertyName]=F[Da]}_setValue_direct_setNeedsUpdate(F,Da){this.targetObject[this.propertyName]=F[Da],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(F,Da){this.targetObject[this.propertyName]=F[Da],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++]}_setValue_array_setNeedsUpdate(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(F,Da){const ll=this.resolvedProperty;for(let cl=0,hl=ll.length;cl!==hl;++cl)ll[cl]=F[Da++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da]}_setValue_arrayElement_setNeedsUpdate(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(F,Da){this.resolvedProperty[this.propertyIndex]=F[Da],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(F,Da){this.resolvedProperty.fromArray(F,Da)}_setValue_fromArray_setNeedsUpdate(F,Da){this.resolvedProperty.fromArray(F,Da),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(F,Da){this.resolvedProperty.fromArray(F,Da),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(F,Da){this.bind(),this.getValue(F,Da)}_setValue_unbound(F,Da){this.bind(),this.setValue(F,Da)}bind(){let F=this.node;const Da=this.parsedPath,ll=Da.objectName,cl=Da.propertyName;let hl=Da.propertyIndex;if(F||(F=PropertyBinding.findNode(this.rootNode,Da.nodeName),this.node=F),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!F)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(ll){let cl=Da.objectIndex;switch(ll){case"materials":if(!F.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!F.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);F=F.material.materials;break;case"bones":if(!F.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);F=F.skeleton.bones;for(let Da=0;Da<F.length;Da++)if(F[Da].name===cl){cl=Da;break}break;case"map":if("map"in F){F=F.map;break}if(!F.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!F.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);F=F.material.map;break;default:if(void 0===F[ll])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);F=F[ll]}if(void 0!==cl){if(void 0===F[cl])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,F);F=F[cl]}}const dl=F[cl];if(void 0===dl){const ll=Da.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+ll+"."+cl+" but it wasn't found.",F)}let pl=this.Versioning.None;this.targetObject=F,void 0!==F.needsUpdate?pl=this.Versioning.NeedsUpdate:void 0!==F.matrixWorldNeedsUpdate&&(pl=this.Versioning.MatrixWorldNeedsUpdate);let fl=this.BindingType.Direct;if(void 0!==hl){if("morphTargetInfluences"===cl){if(!F.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!F.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==F.morphTargetDictionary[hl]&&(hl=F.morphTargetDictionary[hl])}fl=this.BindingType.ArrayElement,this.resolvedProperty=dl,this.propertyIndex=hl}else void 0!==dl.fromArray&&void 0!==dl.toArray?(fl=this.BindingType.HasFromToArray,this.resolvedProperty=dl):Array.isArray(dl)?(fl=this.BindingType.EntireArray,this.resolvedProperty=dl):this.propertyName=cl;this.getValue=this.GetterByBindingType[fl],this.setValue=this.SetterByBindingTypeAndVersioning[fl][pl]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}PropertyBinding.Composite=class{constructor(F,Da,ll){const cl=ll||PropertyBinding.parseTrackName(Da);this._targetGroup=F,this._bindings=F.subscribe_(Da,cl)}getValue(F,Da){this.bind();const ll=this._targetGroup.nCachedObjects_,cl=this._bindings[ll];void 0!==cl&&cl.getValue(F,Da)}setValue(F,Da){const ll=this._bindings;for(let cl=this._targetGroup.nCachedObjects_,hl=ll.length;cl!==hl;++cl)ll[cl].setValue(F,Da)}bind(){const F=this._bindings;for(let Da=this._targetGroup.nCachedObjects_,ll=F.length;Da!==ll;++Da)F[Da].bind()}unbind(){const F=this._bindings;for(let Da=this._targetGroup.nCachedObjects_,ll=F.length;Da!==ll;++Da)F[Da].unbind()}},PropertyBinding.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},PropertyBinding.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},PropertyBinding.prototype.GetterByBindingType=[PropertyBinding.prototype._getValue_direct,PropertyBinding.prototype._getValue_array,PropertyBinding.prototype._getValue_arrayElement,PropertyBinding.prototype._getValue_toArray],PropertyBinding.prototype.SetterByBindingTypeAndVersioning=[[PropertyBinding.prototype._setValue_direct,PropertyBinding.prototype._setValue_direct_setNeedsUpdate,PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_array,PropertyBinding.prototype._setValue_array_setNeedsUpdate,PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_arrayElement,PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate,PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[PropertyBinding.prototype._setValue_fromArray,PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate,PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);const rA=new Matrix4;class Raycaster{constructor(F,Da,ll,cl){void 0===ll&&(ll=0),void 0===cl&&(cl=1/0),this.ray=new Ray(F,Da),this.near=ll,this.far=cl,this.camera=null,this.layers=new Layers,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(F,Da){this.ray.set(F,Da)}setFromCamera(F,Da){Da.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(Da.matrixWorld),this.ray.direction.set(F.x,F.y,.5).unproject(Da).sub(this.ray.origin).normalize(),this.camera=Da):Da.isOrthographicCamera?(this.ray.origin.set(F.x,F.y,(Da.near+Da.far)/(Da.near-Da.far)).unproject(Da),this.ray.direction.set(0,0,-1).transformDirection(Da.matrixWorld),this.camera=Da):console.error("THREE.Raycaster: Unsupported camera type: "+Da.type)}setFromXRController(F){return rA.identity().extractRotation(F.matrixWorld),this.ray.origin.setFromMatrixPosition(F.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(rA),this}intersectObject(F,Da,ll){return void 0===Da&&(Da=!0),void 0===ll&&(ll=[]),intersect(F,this,ll,Da),ll.sort(ascSort),ll}intersectObjects(F,Da,ll){void 0===Da&&(Da=!0),void 0===ll&&(ll=[]);for(let cl=0,hl=F.length;cl<hl;cl++)intersect(F[cl],this,ll,Da);return ll.sort(ascSort),ll}}function ascSort(F,Da){return F.distance-Da.distance}function intersect(F,Da,ll,cl){let hl=!0;if(F.layers.test(Da.layers)){!1===F.raycast(Da,ll)&&(hl=!1)}if(!0===hl&&!0===cl){const cl=F.children;for(let F=0,hl=cl.length;F<hl;F++)intersect(cl[F],Da,ll,!0)}}"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:cl}})),"undefined"!==typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=cl)},8330:F=>{"use strict";F.exports=JSON.parse('{"rE":"3.2.2","Jk":{"O":"https://gitlab.com/panoramax/clients/web-viewer"}}')},4149:F=>{"use strict";F.exports=JSON.parse('{"maplibre":{"GeolocateControl.LocationNotAvailable":"Placering ikke tilg\xe6ngelig","GeolocateControl.FindMyLocation":"Find min placering"},"gvs":{"minimize":"Skjul dette modul, du kan vise det igen ved hj\xe6lp af knappen i nederste venstre hj\xf8rne","share_embed_docs":"L\xe6s mere om indlejringskonfiguration","zoom":"Zoom","zoomOut":"Zoom ud","zoomIn":"Zoom ind","moveUp":"Ryk opad","moveDown":"Ryk nedad","moveLeft":"Ryk til venstre","moveRight":"Ryk til h\xf8jre","moveMiddle":"Centreret visning","expand":"Udvid","expand_info":"F\xe5 modulet til at blive vist p\xe5 hele siden","show_psv":"Vis billedfremviseren","show_map":"Vis kortet","options":"Valgmuligheder","filters":"Filtre","layers":"Lag","search":"S\xf8g","search_empty":"Ingen resultater fundet","search_user":"S\xf8g efter et brugernavn\u2026","share":"Del","share_links":"Links","share_page":"Link til denne side","share_image":"HD-billede","share_rss":"RSS-feed","share_rss_title":"RSS-feed med nye sekvenser i det aktuelt synlige kortomr\xe5de","share_embed":"Indlejr p\xe5 din hjemmeside","share_print":"Udskriv","copy":"Kopi\xe9r","copied":"Kopieret","error_retry":"Pr\xf8v igen senere","sequence_next":"N\xe6ste billede i sekvensen","sequence_play":"Afspil denne sekvens","sequence_more":"Flere afspilningsmuligheder","sequence_speed":"Afspillerens hastighed","legend_license":"Licens: {l}","legend_title":"Vis detaljer om billedet","error_click":"Klik for at forts\xe6tte","error":"Vi har et problem\u2026","search_address":"S\xf8g efter en adresse, by\u2026","sequence_pause":"S\xe6t sekvensen p\xe5 pause","sequence_prev":"Forrige billede i sekvensen","loading_labels_serious":["\ud83d\uddfa\ufe0f Indl\xe6ser kortdata","\ud83d\udda5\ufe0f Anmoder API","\ud83d\uddbc\ufe0f Indl\xe6ser thumbnails","\ud83d\udd0d Analyserer EXIF-metadata","\ud83c\udfd8\ufe0f 3D-rendering","\ud83d\udcf7 Initialiserer 360\xb0-billeder","\ud83d\udfe0 Farveafstemning","\ud83d\udcaf Beregning af kvalitetsscore \xa9"],"edit_osm":"Rediger OSM","josm_live":"Aktiv\xe9r automatisk JOSM-synkronisering ved indl\xe6sning af billeder","loading_labels_fun":["\ud83e\udd8c Registrering af skilte om hjortekrydsning","\ud83d\ude98 S\xf8ger Panoramax Car \xa9","\u2615 Injicerer koffein","\ud83d\ude00 Smil, du er blevet kortlagt!","\ud83d\udc08 Deler kattebilleder","\ud83d\ude34 Reducerer overspringshandlinger","\ud83e\uded6 Brygger te","\ud83d\udc27 \xc5bner kildekode","\ud83d\ude87 Indekser undergrundsstationer","\ud83e\uddf9 Metadata-oprydning","\ud83d\ude92 Sender billeder af brandstation","\ud83d\udeb2 Opdatering af Greenways","\ud83d\ude89 Gennemgang af perron p\xe5 station","\ud83d\udef0\ufe0f S\xf8ger efter satellitter","\ud83d\udc65 Skriver personaer","\ud83d\udc1f Finder fish and chip butik","\ud83e\uddd1\u200d\ud83d\udcbb Gr\xe6nseflade til fejlfinding","\ud83d\udcc8 Inkrementelle statistikker"],"error_psv":"Photo Sphere Viewer indl\xe6ses ikke korrekt","error_nopic":"Intet billede tilg\xe6ngeligt p\xe5 den givne position","error_api":"Billedserveren er ikke tilg\xe6ngelig","error_webgl":"WebGL underst\xf8ttes ikke af din browser","filter_date":"Dato","filter_date_1month":"1 m\xe5ned","filter_date_1year":"1 \xe5r","filter_user":"Bruger","filter_user_mypics":"Mine billeder","filter_picture":"Billedtype","filter_zoom_in":"Zoom ind for at se dette filter","picture_flat":"Klassisk","picture_360":"360\xb0","filter_qualityscore_help":"Klik for at aktivere eller deaktivere","map_background":"Kortbaggrund","map_background_aerial":"Luftfoto","map_background_streets":"Gader","map_theme":"Korttema","error_pic":"Det \xf8nskede billede blev ikke fundet","error_api_compatibility":"Billedserveren er ikke kompatibel med denne version af fremviseren","filter_qualityscore":"Kvalitetsscore","error_josm":"JOSM svarer ikke, k\xf8rer den, og er fjernstyring aktiveret?","metadata_general_seqid_link":"G\xe5 til JSON-beskrivelse af sekvensen","map_theme_default":"Klassisk","map_theme_age_1":"> 2 \xe5r","map_theme_age_2":"< 2 \xe5r","map_theme_age_3":"< 1 \xe5r","map_theme_age_4":"< 1 m\xe5ned","map_theme_type":"Kameratype","map_theme_score":"Kvalitetsscore","contrast":"Aktiv\xe9r h\xf8jere billedkontrast","metadata_general_picid":"Billed-identifikator","metadata_general_seqid":"Sekvens-identifikator","metadata_general_picid_link":"G\xe5 til JSON-beskrivelse af billedet","metadata_general_author":"Forfatter","metadata_general_license":"Licens","metadata_general_license_link":"Se den fulde licensbeskrivelse","metadata_general_date":"Optagelsesdato","metadata_camera":"Kamera","metadata_camera_make":"Fabrikat","metadata_camera_model":"Model","metadata_camera_type":"Type","metadata_camera_resolution":"Opl\xf8sning","metadata_camera_focal_length":"Br\xe6ndvidde","metadata_location_latitude":"Breddegrad","metadata_location_orientation":"Optageretning","metadata_location_precision":"Pr\xe6cision i positionering","metadata_quality":"Kvalitetsscore","metadata_quality_score":"Global score","metadata_quality_gps_score":"Positioneringsscore","metadata_quality_help":"F\xe5 mere at vide om kvalitetsscore","map_theme_age":"Optagelsesdato","metadata_location":"Placering","metadata":"Metadata for billede","metadata_location_longitude":"L\xe6ngdegrad","metadata_quality_resolution_score":"Opl\xf8sningsscore","metadata_quality_missing":"ingen v\xe6rdi indstillet i billedet","metadata_exif":"EXIF / XMP","metadata_exif_name":"Tag","metadata_exif_value":"V\xe6rdi","report":"Indberet billede","report_auth":"Denne indberetning vil blive sendt via din konto \\"{a}\\"","report_nature_label":"Problemets karakter","report_nature":{"":"V\xe6lg problemets art\u2026","blur_missing":"En persons ansigt eller bils nummerplade er synlig","blur_excess":"Et objekt, der ikke har brug for sl\xf8ring, sl\xf8res","inappropriate":"Billedet er upassende (ikke relevant, n\xf8genhed\u2026)","privacy":"En privat sti eller ejendom er synlig","picture_low_quality":"Billedet er af meget d\xe5rlig kvalitet","mislocated":"Billedet er d\xe5rligt placeret p\xe5 kortet","copyright":"Billedet kr\xe6nker ophavsretten","other":"Enhver anden form for problem"},"report_whole_sequence":"Det g\xe6lder hele sekvensen","report_details":"Yderligere detaljer","report_details_placeholder":"Hvis du vil, kan du tilf\xf8je detaljer om problemet, og hvad det drejer sig om","report_email":"Din e-mail","report_email_placeholder":"Valgfri","report_submit":"Indsend","report_wait":"Sender indberetning \u2026","report_success":"Indberetningen er blevet sendt. Den vil blive gennemg\xe5et s\xe5 hurtigt som muligt.","report_failure":"Der opstod en fejl under oprettelse af indberetning: {e}. Pr\xf8v venligst igen senere.","qualityscore_title":"Om kvalitetsscoren","qualityscore_doc_2":"Bed\xf8mmelsen vises for brugerne som en A/B/C/D/E-score (A er den bedste, E den d\xe5rligste) og vises grafisk via denne skala:","qualityscore_doc_3":"Den beregnes ud fra GPS-pr\xe6cision og billedopl\xf8sning. Et professionelt system vil have en A-rating, et 360\xb0 actionkamera vil have en B-rating, og en smartphone vil have en C/D/E-rating.","qualityscore_doc_link":"Yderligere oplysninger om beregningen af kvalitetsscore findes i vores dokumentation.","qualityscore_doc_1":"Panoramax tilbyder en kvalitetsscore for hvert billede. Det giver mulighed for nem kortfiltrering og overskuelig visning af tilg\xe6ngelige billeder af h\xf8j kvalitet.","minimize_short":"Skjul"},"psv":{"loadError":"Panoramaet kan ikke indl\xe6ses","twoFingers":"Brug to fingre til at navigere","ctrlZoom":"Brug ctrl + scroll til at zoome ind p\xe5 billedet"},"map":{"loading":"Indl\xe6ser\u2026","thumbnail":"Miniature af billedet, der holdes","not_public":"Ikke offentligt synlig","slow_loading":"Kortet indl\xe6ses langsomt og kan virke defekt"}}')},369:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"options":"Optionen","filters":"Filter","search":"Suche","layers":"Ebenen","share_links":"Links","share_page":"Link zu dieser Seite","loading_labels_fun":["\ud83e\udd8c Erkennung der \\"Reh kreuzt\\"-Schilder","\ud83d\ude98 Suche Panoramax-Auto \xa9","\u2615 Koffeininjektion","\ud83d\ude00 L\xe4chle, du wirst kartografiert!","\ud83d\udc08 Katzenfotos teilen","\ud83d\ude34 Reduzieren der Prokrastination","\ud83c\udf7a\ufe0f Bier brauen","\ud83d\udc27 Quellcode \xf6ffnen","\ud83d\udee3\ufe0f Indizierung der Autobahnen","\ud83e\uddf9 Metadatenreinigung","\ud83d\ude92 Senden der Fotos der Feuerwehren","\ud83d\udeb2 Gr\xfcne Radwege identifiziert","\ud83d\ude89 Durchgang zum Bahnsteig","\ud83d\udef0\ufe0f Suche Satelliten","\ud83d\udc65 Personas anlegen","\ud83c\udf2d\ufe0f Lokalisierung der Currywurst","\ud83e\uddd1\u200d\ud83d\udcbb Debugging des Interfaces","\ud83d\udcc8 Hochz\xe4hlen der Statistiken"],"search_empty":"Keine Ergebnisse gefunden","share":"Teilen","metadata_general_picid":"Bild-Identifier","zoom":"Zoom","zoomOut":"Herauszoomen","zoomIn":"Hereinzoomen","moveUp":"Nach oben","moveDown":"Nach unten","moveRight":"Nach rechts","moveMiddle":"Sicht zentrieren","map_theme_age":"Aufnahmedatum","expand":"Vergr\xf6\xdfern","expand_info":"Widget im Vollbild anzeigen","show_psv":"Bildbetrachter anzeigen","show_map":"Karte anzeigen","search_user":"Benutzernamen suchen\u2026","filter_zoom_in":"Hereinzoomen um diesen Filter zu sehen","picture_flat":"Klassisch","picture_360":"360\xb0","filter_camera_model":"Nach Kameramodell","map_background":"Kartenhintergrund","map_background_aerial":"Satelliten","map_background_streets":"Stra\xdfen","map_theme":"Karten-Art","metadata_exif_name":"Schlagwort","metadata_exif_value":"Wert","map_theme_age_2":"<2 Jahre","map_theme_age_3":"<1 Jahr","map_theme_type":"Kameratyp","contrast":"H\xf6heren Bildkontrast aktivieren","metadata":"Bildmetadaten","metadata_general_seqid":"Sequenzidentifier","metadata_general_picid_link":"Zur JOSN-Beschreibung des Bildes gehen","loading_labels_serious":["\ud83d\uddfa\ufe0f Laden der Kartendaten","\ud83d\udda5\ufe0f API anfragen","\ud83d\uddbc\ufe0f Vorschaubilder laden","\ud83d\udd0d EXIF Metadaten analysieren","\ud83c\udfd8\ufe0f 3D-Rendering","\ud83d\udcf7 360\xb0 Fotos initialisieren","\ud83d\udfe0 Farben balancieren","\ud83d\udcaf Berechnung der Qualit\xe4tsbewertung \xa9"],"search_address":"Suchen sie eine Adresse, Stadt, \u2026","share_image":"HD Bild","share_rss":"RSS Feed","share_embed":"Auf Webseite einbetten","share_print":"Druck","copy":"Kopieren","copied":"Kopiert","error":"Panoramax ist abgest\xfcrzt\u2026","sequence_next":"N\xe4chstes Foto in der Sequenz","sequence_play":"Sequenz abspielen","sequence_pause":"Sequenz pausieren","sequence_prev":"Vorheriges Foto in der Sequenz","sequence_more":"Mehr Abspieloptionen","sequence_speed":"Abspielgeschwindigkeit","legend_license":"Lizenz: {l}","edit_osm":"OSM editieren","id":"iD","josm":"JOSM","josm_live":"Einschalten der automatischen JOSM-Synchronisierung beim Laden eines Bildes","error_psv":"Betrachter f\xfcr die Photospheres wurde nicht richtig geladen","error_pic":"Gesuchtes Foto wurde nicht gefunden","error_nopic":"Kein Foto verf\xfcgbar an dieser Position","error_api":"Foto-Server ist nicht verf\xfcgbar","error_josm":"JOSM reagiert nicht, ist es ge\xf6ffnet und die Remote eingeschaltet?","error_api_compatibility":"Der Foto-Server ist nicht mit dieser Version des Betrachters kompatibel","filter_date":"Datum","filter_user":"Benutzer","filter_picture":"Foto-Art","map_theme_default":"Klassisch","map_theme_age_1":">2 Jahre","metadata_general_seqid_link":"Zur JSON-Beschreibung der Sequenz gehen","metadata_general_author":"Autor","metadata_general_license":"Lizenz","metadata_general_date":"Aufnahmedatum","metadata_camera":"Kamera","metadata_camera_make":"Hersteller","metadata_camera_model":"Modell","metadata_camera_type":"Typ","metadata_camera_focal_length":"Brennweite","metadata_location":"Ort","metadata_location_longitude":"L\xe4ngengrad","metadata_location_latitude":"Breitengrad","metadata_location_orientation":"Aufnahmerichtung","metadata_location_precision":"Pr\xe4zision der Positionierung","metadata_exif":"EXIF / XMP","minimize":"Widget verbergen, sie k\xf6nnen es \xfcber die Schaltfl\xe4che in der linken unteren Ecke wieder einblenden","map_theme_age_4":"< 1 Monat","error_subtitle":"Bitte versuchen sie es sp\xe4ter erneut, oder schauen sie in die Web-Browser-Konsole f\xfcr mehr Details.","moveLeft":"Nach links","share_rss_title":"RSS Feed neuer Sequenzen auf dem aktuell sichtbaren Kartenbereich","error_webgl":"WebGL wird von ihrem Browser nicht unterst\xfctzt","metadata_general_license_link":"Volle Lizenzbeschreibung ansehen","share_embed_docs":"Mehr \xfcber die Einbettungs-Konfiguration lesen","report_nature":{"":"Art des Problems ausw\xe4hlen\u2026","inappropriate":"Bild ist unangemessen (irrelevant, Nacktheit, ...)","picture_low_quality":"Bild hat eine sehr schlechte Qualit\xe4t","blur_missing":"Das Gesicht einer Person oder ein KFZ-Kennzeichen ist sichtbar","blur_excess":"Ein Objekt das nicht unkenntlich gemacht werden muss wurde unkenntlich gemacht","privacy":"Ein privater Pfad oder ein privates Grundst\xfcck ist sichtbar","mislocated":"Bild ist falsch auf der Karte verortet","copyright":"Bild verletzt das Urheberrecht","other":"Andere Art von Problem"},"report_details_placeholder":"Sie k\xf6nnen optionale Details \xfcber das Problem hinzuf\xfcgen","report_auth":"Dieser Report wird durch ihren Account \\"{a}\\" gesendet","report_nature_label":"Art des Problems","report_whole_sequence":"Dies betrifft die gesamte Sequenz","report_details":"Weitere Details","report_email":"Ihre Email","report_email_placeholder":"Optional","report_submit":"Absenden","report_success":"Ihr Report wurde erfolgreich gesendet. Er wird so schnell wie m\xf6glich \xfcberpr\xfcft.","report_failure":"Ein Fehler ist bei der Erstellung des Reports aufgetreten: {e}. Bitte versuchen sie es erneut.","report":"Foto melden","legend_title":"Zeige Bilderdetails","report_wait":"Bericht senden\u2026","error_click":"Klicken um fortzufahren","error_retry":"Bitte sp\xe4ter erneut versuchen","metadata_camera_resolution":"Aufl\xf6sung","filter_user_mypics":"Meine Fotos","metadata_quality_missing":"kein Wert im Foto gesetzt","filter_date_1month":"1 Monat","filter_date_1year":"1 Jahr","filter_qualityscore":"Qualit\xe4tswert","filter_qualityscore_help":"Klicken, um zu aktivieren oder deaktivieren","map_theme_score":"Qualit\xe4tswert","metadata_quality":"Qualit\xe4tswert","metadata_quality_help":"Erfahre mehr \xfcber den Qualit\xe4tswert","metadata_quality_resolution_score":"Aufl\xf6sungswertung","metadata_quality_gps_score":"Positionswertung","metadata_quality_score":"Gesamtwertung","qualityscore_title":"\xdcber den Qualit\xe4tsfaktor","qualityscore_doc_link":"Weitere Informationen zur Berechnung des Qualit\xe4tsfaktors findest du in unserer Dokumentation.","qualityscore_doc_1":"Panoramax bietet einen Qualit\xe4tsfaktor f\xfcr jedes Bild. Es erm\xf6glicht eine einfache Kartenfilterung und eine umfassende Anzeige der Verf\xfcgbarkeit hochwertiger Bilder.","qualityscore_doc_2":"Die Note wird den Benutzern als A/B/C/D/E-Bewertung angezeigt (A ist die beste, E die schlechteste) und anhand dieser Skala grafisch dargestellt:","qualityscore_doc_3":"Die Berechnung erfolgt auf der Grundlage der GPS-Genauigkeit und der Bildaufl\xf6sung. Ein professionelles System wird mit A bewertet, eine 360-Grad-Action-Kamera mit B und ein Smartphone mit C/D/E.","minimize_short":"Verbergen"},"psv":{"twoFingers":"Nutzen sie zwei Finger zum navigieren","ctrlZoom":"Nutzen sie Strg+Scrollen um das Bild zu zoomen","loadError":"Das Panorama konnte nicht geladen werden"},"map":{"thumbnail":"Vorschau des marktierten Fotos","not_public":"Nicht \xf6ffentlich sichtbar","loading":"Laden\u2026","slow_loading":"Die Karte wird nur langsam geladen und k\xf6nnte fehlerhaft erscheinen"},"maplibre":{"GeolocateControl.FindMyLocation":"Meinen Standort finden","GeolocateControl.LocationNotAvailable":"Standort nicht verf\xfcgbar"}}')},389:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Use two fingers to navigate","ctrlZoom":"Use ctrl + scroll to zoom the image","loadError":"The panorama can\'t be loaded"},"maplibre":{"GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available"},"gvs":{"zoom":"Zoom","zoomOut":"Zoom out","zoomIn":"Zoom in","moveUp":"Move up","moveDown":"Move down","moveLeft":"Move left","moveRight":"Move right","moveMiddle":"Center view","expand":"Expand","expand_info":"Make the widget appear in full page","show_psv":"Show the picture viewer","show_map":"Show the map","minimize":"Hide this widget, you can show it again using button in bottom left corner","minimize_short":"Hide","options":"Options","filters":"Filters","layers":"Layers","search":"Search","search_empty":"No results found","search_address":"Search an address, city\u2026","search_user":"Search a username\u2026","share":"Share","share_links":"Links","share_page":"Link to this page","share_image":"HD Image","share_rss":"RSS feed","share_rss_title":"RSS feed of new sequences in the currently visible map area","share_embed":"Embed on your website","share_embed_docs":"Read more about embed configuration","share_print":"Print","copy":"Copy","copied":"Copied","error":"We have a problem\u2026","error_click":"Click to continue","error_retry":"Please retry later","sequence_next":"Next picture in sequence","sequence_play":"Play along this sequence","sequence_pause":"Pause sequence","sequence_prev":"Previous picture in sequence","sequence_more":"More play options","sequence_speed":"Player speed","legend_license":"License: {l}","legend_title":"Show details of picture","edit_osm":"Edit OSM","id":"iD","josm":"JOSM","josm_live":"Enable JOSM automatic sync on picture loading","loading_labels_serious":["\ud83d\uddfa\ufe0f Loading map data","\ud83d\udda5\ufe0f Querying API","\ud83d\uddbc\ufe0f Loading thumbnails","\ud83d\udd0d Analyzing EXIF metadata","\ud83c\udfd8\ufe0f 3D rendering","\ud83d\udcf7 Initializing 360\xb0 pictures","\ud83d\udfe0 Colour balancing","\ud83d\udcaf Computing Quality Score \xa9"],"loading_labels_fun":["\ud83e\udd8c Detecting deer crossing signs","\ud83d\ude98 Searching Panoramax Car \xa9","\u2615 Injecting caffeine","\ud83d\ude00 Smile, you\'re mapped!","\ud83d\udc08 Sharing cat pictures","\ud83d\ude34 Reducing procrastination","\ud83e\uded6 Brewing tea","\ud83d\udc27 Opening source code","\ud83d\ude87 Indexing Underground stations","\ud83e\uddf9 Metadata cleanup","\ud83d\ude92 Sending fire station photos","\ud83d\udeb2 Greenways update","\ud83d\ude89 Station platform walkthrough","\ud83d\udef0\ufe0f Searching satellites","\ud83d\udc65 Writing personas","\ud83d\udc1f Locating chip shops","\ud83e\uddd1\u200d\ud83d\udcbb Debugging interface","\ud83d\udcc8 Incrementing statistics"],"error_psv":"Photo Sphere Viewer is not loading properly","error_pic":"Requested picture wasn\'t found","error_nopic":"No picture available at given position","error_api":"The pictures server is not available","error_webgl":"WebGL is not supported by your browser","error_josm":"JOSM doesn\'t respond, is it running and is remote enabled?","error_api_compatibility":"The pictures server is not compatible with this viewer version","filter_date":"Date","filter_date_1month":"1 month","filter_date_1year":"1 year","filter_user":"User","filter_user_mypics":"My pictures","filter_picture":"Picture type","filter_zoom_in":"Zoom-in to see this filter","picture_flat":"Classic","picture_360":"360\xb0","filter_qualityscore":"Quality score","filter_qualityscore_help":"Click to enable or disable","qualityscore_title":"About the quality score","qualityscore_doc_1":"Panoramax offers a Quality Score for each picture. It allows easy map filtering and comprehensive display of high-quality pictures availability.","qualityscore_doc_2":"The grade is shown to users as a A/B/C/D/E score (A is the best, E the worst), and shown graphically through this scale:","qualityscore_doc_3":"It is computed based on GPS precision and picture resolution. A professional system will have an A-rating, a 360\xb0 action camera will have a B-rating, and a smartphone will be C/D/E-rated.","qualityscore_doc_link":"More details about the Quality Score computation is available in our documentation.","map_background":"Map background","map_background_aerial":"Aerial","map_background_streets":"Streets","map_theme":"Map theme","map_theme_default":"Classic","map_theme_age":"Capture date","map_theme_age_1":"> 2 years","map_theme_age_2":"< 2 years","map_theme_age_3":"< 1 year","map_theme_age_4":"< 1 month","map_theme_type":"Camera type","map_theme_score":"Quality score","contrast":"Enable higher image contrast","metadata":"Picture metadata","metadata_general_picid":"Picture identifier","metadata_general_seqid":"Sequence identifier","metadata_general_picid_link":"Go to JSON description of the picture","metadata_general_seqid_link":"Go to JSON description of the sequence","metadata_general_author":"Author","metadata_general_license":"License","metadata_general_license_link":"See the full licence description","metadata_general_date":"Capture date","metadata_camera":"Camera","metadata_camera_make":"Make","metadata_camera_model":"Model","metadata_camera_type":"Type","metadata_camera_resolution":"Resolution","metadata_camera_focal_length":"Focal length","metadata_location":"Location","metadata_location_longitude":"Longitude","metadata_location_latitude":"Latitude","metadata_location_orientation":"Capture direction","metadata_location_precision":"Positioning precision","metadata_quality":"Quality score","metadata_quality_help":"Know more about Quality Score","metadata_quality_score":"Global score","metadata_quality_gps_score":"Positioning score","metadata_quality_resolution_score":"Resolution score","metadata_quality_missing":"no value set in picture","metadata_exif":"EXIF / XMP","metadata_exif_name":"Tag","metadata_exif_value":"Value","report":"Report picture","report_auth":"This report will be sent using your account \\"{a}\\"","report_nature_label":"Nature of the issue","report_nature":{"":"Select the nature of issue\u2026","blur_missing":"A person face or car plate is visible","blur_excess":"An object not needing blur is blurred","inappropriate":"Picture is inappropriate (unrelated, nudity\u2026)","privacy":"A private path or property is visible","picture_low_quality":"Picture is of very bad quality","mislocated":"Picture is badly positioned on map","copyright":"Picture infringes copyright","other":"Any other kind of issue"},"report_whole_sequence":"This concerns the entire sequence","report_details":"Additional details","report_details_placeholder":"Optional, you can add details about the issue and how this is concerning","report_email":"Your email","report_email_placeholder":"Optional","report_submit":"Submit","report_wait":"Sending report \u2026","report_success":"Report has been successfully sent. It will be reviewed as soon as possible.","report_failure":"An error occurred when creating report: {e}. Please try again later."},"map":{"loading":"Loading\u2026","thumbnail":"Thumbnail of hovered picture","not_public":"Not publicly visible","slow_loading":"Map is slow to load and could appear broken"}}')},9946:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Uzu du fingrojn por navigi","ctrlZoom":"Uzu ctrl + rulumo por zomi la bildon","loadError":"La bildo ne povas esti \u015dar\u011dita"},"gvs":{"zoom":"Zomo","zoomOut":"Malzomo","zoomIn":"Zomi","moveUp":"Movi supren","moveDown":"Movi malsupren","moveLeft":"Movi maldekstren","moveRight":"Movi dekstren","moveMiddle":"Centri vido","expand":"Pligrandigi","expand_info":"Aperigu la fenestra\u0135on en plena pa\u011do","show_psv":"Montri la bildspektilo","show_map":"Montri la mapo","minimize":"Maski la fenestra\u0135o, vu povas montri \u011din denove kun la butono en malsupra maldekstra angulo","sequence_prev":"Anta\u016da foto en la sekvenco","sequence_more":"Pli da ludopcioj","sequence_speed":"Rapideco de legado","sequence_next":"Sekva foto en la sekvenco","sequence_play":"Foliumi \u0109i tiun sinsekvon","sequence_pause":"Pa\u016dzi la sekvenco","copy":"Kopii","copied":"Kopiita","error":"Ni havas problemon\u2026","error_click":"Alkliku por kontinui","error_retry":"Bonvolu reprovi poste","search_address":"Ser\u0109i adreson, urbon\u2026","filters":"Filtriloj","layers":"Tavoloj","search":"Ser\u0109i","share_embed_docs":"Pli pri enigito sur via retpa\u011daro","search_empty":"Neniu rezulto trovita","search_user":"Ser\u0109i uzantnomon\u2026","share":"Kunhavigi","share_links":"Ligiloj","share_page":"Ligilo de la retpa\u011do","share_image":"HD bildo","share_rss":"RSS abonfluo","share_rss_title":"RSS abonfluo de la novaj sekvecoj en la nuntempe videbla mapzono","share_embed":"Enigita en via retpa\u011daro","share_print":"Presi","edit_osm":"Modifi OSM","legend_license":"Rajtigilo : {l}","josm_live":"Ebligas a\u016dtomatan JOSM-sinkronigon dum \u015dar\u011do de bildo","loading_labels_serious":["\ud83d\uddfa\ufe0f \u015cargo de la bazmapon","\ud83d\udda5\ufe0f API demandado","\ud83d\uddbc\ufe0f \u015car\u011do de miniaturoj","\ud83d\udd0d Analizo de EXIF-metadatumoj","\ud83c\udfd8\ufe0f 3D-rendumo","\ud83d\udcf7 Inico de 360\xb0-bildoj","\ud83d\udfe0 Kolora ekvilibrigo","\ud83d\udcaf Kalkulo de kvalitpoentaro \xa9"],"legend_title":"Montri la detaloj de la bildo","error_api":"La bildservilo ne estas disponebla","error_josm":"JOSM ne respondis. \u0108u \u011di funkcias kaj la regilo estas \u015daltita?","error_webgl":"WebGL ne estas subtenata per via retumilo","loading_labels_fun":["\ud83e\udd8c Detekto de cervinaj vojmontriloj","\ud83d\ude98 Ser\u0109o de Panoramax-a\u016dto \xa9","\u2615 Injekto de kafeino","\ud83d\ude00 Ridetu, vi estas mapita!","\ud83d\udc08 Kunhavigo de katbildoj","\ud83d\ude34 Redukto de prokrastado","\ud83d\udcd6 Lernado de Esperanto","\ud83d\udc27 Malfermo de fontkodo","\ud83d\ude87 Indekso de subteraj stacioj","\ud83e\uddf9 Purigo de metadatumoj","\ud83d\ude92 Sendado de fotoj de fajrostacioj","\ud83d\udeb2 \u011cisdatigo de verdaj vojoj","\ud83d\ude89 Promenado tra stacioplatformoj","\ud83d\udef0\ufe0f Ser\u0109o de satelitoj","\ud83d\udc65 Verkado de roluloj","\u2747\ufe0f Lokalizo de la Esperanto-flagoj","\ud83e\uddd1\u200d\ud83d\udcbb Sencimigado de la interfaco","\ud83d\udcc8 Alkrementi de la statistikoj"],"picture_360":"360\xb0","picture_flat":"Klasika","report_nature_label":"Speco de problemo","report_nature":{"":"Elektu la specon de problemo\u2026","blur_missing":"Viza\u011do a\u016d numerplato estas videbla","copyright":"La bildo malobeas kopirajton","blur_excess":"Objekto kiu ne bezonis malklari\u011don estas malklarigita","inappropriate":"La bildo estas neta\u016dga (nevera, nudeco...)","privacy":"Privata vojo a\u016d poseda\u0135o estas videbla","picture_low_quality":"La bildo estas de tre malbona kvalito","mislocated":"La bildo estas malbone poziciigita sur la mapo","other":"\u0108ia alia speco de problemo"},"report":"Raporti bildon","report_auth":"\u0108i tiu raporto estos sendita per via konto \\"{a}\\"","filter_date":"Dato","filter_user_mypics":"Miaj fotoj","options":"Opcioj","error_api_compatibility":"La fotoservilo ne kongruas kun \u0109i tiu spektilo","filter_qualityscore":"Kvalitpoentaro","filter_qualityscore_help":"Alllaku por aktivigi a\u016d mal\u015dalti","map_theme_age":"Dato de fotado","map_theme_age_1":"> 2 jaroj","map_theme_age_2":"< 2 jaroj","map_theme_age_3":"< 1 jaro","map_theme_age_4":"< 1 monato","map_theme_score":"Kvalitpoentaro","metadata":"Metadatenoj de la bildo","map_theme_type":"Fotiltipo","metadata_general_seqid":"Sekvencidentigilo","metadata_camera_resolution":"Difino","metadata_quality_resolution_score":"Rezolucia poentaro","error_psv":"Foto-Sfera Spektilo ne \u015dar\u011di\u011das \u011duste","error_pic":"La petita bildo ne estis trovita","error_nopic":"Neniu bildo disponeblas \u0109e la donita pozicio","filter_user":"Uzanto","map_theme_default":"Klasika","filter_date_1month":"1 monato","filter_date_1year":"1 jaro","contrast":"Pliigi bildkontraston","metadata_general_picid":"Fotoidentigilo","filter_picture":"Bilda tipo","filter_zoom_in":"Zomu por vidi pli da filtriloj","map_background":"Bazmapo","map_background_aerial":"Aera","map_background_streets":"Stratoj","map_theme":"Mapa etoso","metadata_general_picid_link":"Iru al la JSON-priskribo de la foto","metadata_general_seqid_link":"Iru al la JSON-priskribo de la sekvenco","metadata_general_author":"A\u016dtoro","metadata_general_license":"Rajtigilo","metadata_general_license_link":"Vidi la kompletan rajtigilon en la priskribo","metadata_general_date":"Dato de la fotado","metadata_camera":"Fotilo","metadata_camera_make":"Faristo","metadata_camera_model":"\u015cablono","metadata_camera_type":"Tipo","metadata_camera_focal_length":"Fokuslongo","metadata_location":"Loko","metadata_location_longitude":"Longitudo","metadata_location_latitude":"Latitudo","metadata_location_orientation":"Fotada direkto","metadata_location_precision":"Pozicia precizeco","metadata_quality":"Kvalitpoentaro","metadata_quality_help":"Pli pri la Kvalitapoentaro","metadata_quality_score":"Malloka poentaro","metadata_quality_gps_score":"Pozicia poentaro","metadata_quality_missing":"neniu valoro en la bildo","metadata_exif":"EXIF / XMP","metadata_exif_name":"Etikedo","metadata_exif_value":"Valoro","report_whole_sequence":"\u0108i tio koncernas la tutan sekvencon","report_details":"Aliaj detaloj","report_email":"Via retpo\u015dto","report_submit":"Sendi","report_wait":"Sendante raporton\u2026","report_success":"La raporto estis sukcese sendita. \u011ci estos reviziita balda\u016d.","report_details_placeholder":"Opcie, vi povas aldoni detalojn pri la problemo","report_email_placeholder":"Opcie","report_failure":"Eraro okazis dum kreo de la raporto: {e}. Bonvolu provi denove poste."},"maplibre":{"GeolocateControl.FindMyLocation":"Trovi mian pozicion","GeolocateControl.LocationNotAvailable":"Loko ne disponeblas"},"map":{"slow_loading":"La mapo \u015dar\u011das malrapide kaj povus aperi rompi\u011dinta","loading":"\u015car\u011danto\u2026","thumbnail":"Miniaturo de la surflikta bildo","not_public":"Ne publike videbla"}}')},8302:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"report_auth":"La denuncia se enviar\xe1 usando tu cuenta \xab{a}\xbb","report":"Denunciar imagen","report_nature_label":"Tipo de problema","report_nature":{"":"Selecciona el tipo de problema\u2026","blur_missing":"Se ve el rostro de una persona, o una matr\xedcula","blur_excess":"Est\xe1 borroso un objeto que no hac\xeda falta ocultar","inappropriate":"La imagen no es apropiada (irrelevante, desnudez, \u2026)","privacy":"Se ve un camino privado, o una propiedad privada","mislocated":"La localizaci\xf3n de la imagen en el mapa no es correcta","picture_low_quality":"La calidad de la imagen es pobre","copyright":"La imagen infringe derechos de autor","other":"Otro tipo de problema"},"sequence_more":"M\xe1s opciones de reproducci\xf3n","sequence_speed":"Velocidad de reproducci\xf3n","legend_license":"Licencia: {l}","edit_osm":"Editar OpenStreetMap","id":"iD","josm":"JOSM","josm_live":"Activar la sincronizaci\xf3n autom\xe1tica de JOSM cuando se carga una imagen","loading_labels_serious":["\ud83d\uddfa\ufe0f Cargando datos del mapa","\ud83d\udda5\ufe0f Consultando la API","\ud83d\uddbc\ufe0f Cargando vistas previas","\ud83d\udd0d Analizando metadatos EXIF","\ud83c\udfd8\ufe0f Renderizado 3D","\ud83d\udcf7 Preparando im\xe1genes 360\xb0","\ud83d\udfe0 Ajustando balance de color","\ud83d\udcaf C\xe1lculo del nivel de calidad \xa9"],"metadata":"Metadatos de la imagen","map_theme_type":"Tipo de c\xe1mara","contrast":"Dar m\xe1s contraste a la imagen","zoom":"Acercar/alejar","zoomOut":"Alejar","map_background_streets":"Calles","loading_labels_fun":["\ud83e\udd8c Detectando paneles de cruce de alces","\ud83d\ude98 Buscando el Coche Panoramax \xa9","\u2615 Inyectando cafe\xedna","\ud83d\ude00 \xa1Sonr\xede, est\xe1s siendo mapeado!","\ud83d\udc08 Compartiendo fotos de gatos","\ud83d\ude34 Reduciendo la procrastinaci\xf3n","\ud83e\uded6 Preparando el t\xe9","\ud83d\udc27 Abriendo el c\xf3digo fuente","\ud83d\ude87 Indexando estaciones del metro","\ud83e\uddf9 Limpieza de metadatos","\ud83d\ude92 Enviando fotos de estaciones de bomberos","\ud83d\udeb2 Actualizando v\xedas verdes","\ud83d\ude89 Paseo por el and\xe9n de la estaci\xf3n","\ud83d\udef0\ufe0f Buscando sat\xe9lites","\ud83d\udc65 Describiendo tipolog\xedas de persona","\ud83d\udc1f Localizando tiendas de fish & chips","\ud83e\uddd1\u200d\ud83d\udcbb Buscando gazapos de la interfaz","\ud83d\udcc8 Incrementando estad\xedsticas"],"metadata_general_license_link":"Ir a la descripci\xf3n completa de la licencia","metadata_general_picid":"Identificador de la imagen","metadata_general_license":"Licencia","report_details_placeholder":"Opcional; puedes a\xf1adir m\xe1s detalles sobre el problema y por qu\xe9 te preocupa","expand":"Expandir","expand_info":"Mostrar el elemento ocupando toda la p\xe1gina","show_psv":"Mostrar el visor de im\xe1genes","show_map":"Mostrar el mapa","zoomIn":"Acercar","moveUp":"Desplazar hacia arriba","moveDown":"Desplazar hacia abajo","moveLeft":"Desplazar hacia la izquierda","moveRight":"Desplazar hacia la derecha","moveMiddle":"Centrar la vista","minimize":"Esconder este elemento. Para mostrarlo de nuevo, pulsa el bot\xf3n en la esquina inferior izquierda","options":"Opciones","filters":"Filtros","layers":"Capas","search":"Buscar","search_empty":"No se encontraron resultados","search_address":"Buscar una direcci\xf3n, una ciudad, \u2026","search_user":"Buscar un usuario\u2026","share":"Compartir","share_links":"Enlaces","share_page":"Enlace a esta p\xe1gina","share_image":"Imagen de alta calidad","share_rss":"Flujo RSS","share_rss_title":"Flujo RSS de las nuevas secuencias en el \xe1rea visible del mapa","share_embed":"Incrustar en tu p\xe1gina web","share_embed_docs":"M\xe1s informaci\xf3n sobre c\xf3mo configurar el incrustado","share_print":"Imprimir","copy":"Copiar","copied":"Copiado","error":"Hay un problema\u2026","sequence_next":"Siguiente imagen de la secuencia","sequence_play":"Reproducir esta secuencia","sequence_pause":"Pausar la secuencia","sequence_prev":"Imagen anterior de la secuencia","error_click":"Haz click para continuar","error_retry":"Por favor, int\xe9ntalo m\xe1s tarde","error_psv":"El visor de fotos esf\xe9ricas no se carga correctamente","error_pic":"No se encuentra la imagen que quer\xedamos","error_nopic":"No hay im\xe1genes para la posici\xf3n dada","error_api":"El servidor de im\xe1genes no est\xe1 disponible","error_webgl":"Este navegador no admite WebGL","error_josm":"JOSM no responde. \xbfEst\xe1 abierto, y admite el modo de Control Remoto?","error_api_compatibility":"El servidor de im\xe1genes no es compatible con esta versi\xf3n del visor","filter_date":"Fecha","filter_user":"Usuario","filter_picture":"Tipo de imagen","filter_zoom_in":"Ac\xe9rcate para poder ver filtros","picture_flat":"Cl\xe1sico","picture_360":"360\xb0","filter_camera_model":"Por modelo de c\xe1mara","map_background":"Fondo de mapa","map_background_aerial":"Vista a\xe9rea","map_theme":"Tema de mapa","map_theme_default":"Cl\xe1sico","map_theme_age":"Fecha de toma de imagen","map_theme_age_1":"M\xe1s de dos a\xf1os","map_theme_age_2":"Menos de dos a\xf1os","map_theme_age_3":"Menos de un a\xf1o","map_theme_age_4":"Menos de un mes","metadata_general_seqid":"Identificador de la secuencia","metadata_general_picid_link":"Ir a la descripci\xf3n de la imagen en formato JSON","metadata_general_seqid_link":"Ir a la descripci\xf3n de la secuencia en formato JSON","metadata_general_author":"Autor","metadata_general_date":"Fecha de toma de imagen","metadata_camera":"C\xe1mara","metadata_camera_make":"Marca","metadata_camera_model":"Modelo","metadata_camera_type":"Tipo","metadata_camera_focal_length":"Distancia focal","metadata_location":"Localizaci\xf3n","metadata_location_longitude":"Longitud","metadata_location_latitude":"Latitud","metadata_location_orientation":"Orientaci\xf3n","metadata_location_precision":"Precisi\xf3n de la localizaci\xf3n","metadata_exif":"EXIF / XMP","metadata_exif_name":"Etiqueta","metadata_exif_value":"Valor","report_whole_sequence":"El problema afecta a la secuencia entera","report_details":"M\xe1s detalles","report_email":"Tu direcci\xf3n de correo electr\xf3nico","report_email_placeholder":"Opcional","report_submit":"Enviar","report_success":"La denuncia se ha enviado correctamente. Ser\xe1 revisada lo antes posible.","report_failure":"Ocurri\xf3 un error al crear la denuncia: {e}. Por favor, int\xe9ntalo m\xe1s tarde.","map_theme_score":"Nivel de calidad","filter_qualityscore":"Nivel de calidad","filter_qualityscore_help":"Haga clic para habilitar o deshabilitar","legend_title":"Ver detalles de la imagen","metadata_camera_resolution":"Resoluci\xf3n","metadata_quality":"Puntuaci\xf3n de calidad","metadata_quality_help":"M\xe1s informaci\xf3n sobre el nivel de calidad","metadata_quality_score":"Valoraci\xf3n general","metadata_quality_gps_score":"Puntuaci\xf3n de posicionamiento","metadata_quality_resolution_score":"Puntuaci\xf3n de resoluci\xf3n","metadata_quality_missing":"no hay informaci\xf3n en la imagen","report_wait":"Env\xedo del informe\u2026"},"psv":{"ctrlZoom":"Utiliza Control+rueda de desplazamiento para acercar/alejar","loadError":"Este panorama no se puede cargar","twoFingers":"Desplaza el mapa con dos dedos"},"maplibre":{"GeolocateControl.FindMyLocation":"Local\xedzame","GeolocateControl.LocationNotAvailable":"Localizaci\xf3n no disponible"},"map":{"loading":"Cargando\u2026","thumbnail":"Vista previa de la imagen bajo el cursor","not_public":"No es visible p\xfablicamente","slow_loading":"La mapa tarda mucho en cargarse y puede parecer rota"}}')},5222:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"Utilisez deux doigts pour vous d\xe9placer","ctrlZoom":"Utilisez ctrl + scroll pour zoomer dans l\'image","loadError":"L\'image ne peut pas \xeatre charg\xe9e"},"maplibre":{"GeolocateControl.FindMyLocation":"Afficher ma position","GeolocateControl.LocationNotAvailable":"GPS non-disponible"},"gvs":{"zoom":"Zoom","zoomOut":"D\xe9zoomer","zoomIn":"Zoomer","moveUp":"Vers le haut","moveDown":"Vers le bas","moveLeft":"Vers la gauche","moveRight":"Vers la droite","moveMiddle":"Centrer la vue","expand":"Agrandir","expand_info":"Faire appara\xeetre ce widget en pleine page","show_psv":"Afficher la visionneuse de photos","show_map":"Afficher la carte","minimize":"Masquer ce widget, vous pouvez l\'afficher de nouveau gr\xe2ce au bouton dans le coin en bas \xe0 gauche","minimize_short":"Masquer","options":"Options","filters":"Filtres","layers":"Calques","search":"Rechercher","search_empty":"Aucun r\xe9sultat","search_address":"Rechercher une adresse, ville\u2026","search_user":"Rechercher un nom d\'utilisateur\u2026","share":"Partager","share_links":"Liens utiles","share_page":"Lien de la page","share_image":"Image HD","share_rss":"Flux RSS","share_rss_title":"Flux RSS des nouvelles s\xe9quences dans la zone visible sur la carte","share_embed":"Int\xe9gration sur votre site","share_embed_docs":"D\xe9couvrir plus de possibilit\xe9s pour l\'int\xe9gration sur votre site","share_print":"Imprimer","copy":"Copier","copied":"Copi\xe9","error":"On a un probl\xe8me\u2026","error_click":"Cliquez pour continuer","error_retry":"Merci de r\xe9essayer plus tard","sequence_next":"Photo suivante dans la s\xe9quence","sequence_play":"Parcourir cette s\xe9quence","sequence_pause":"Mettre en pause la s\xe9quence","sequence_prev":"Photo pr\xe9c\xe9dente dans la s\xe9quence","sequence_more":"Plus d\'options de lecture","sequence_speed":"Vitesse de lecture","legend_license":"Licence : {l}","legend_title":"Afficher les d\xe9tails de l\'image","edit_osm":"Contribuer sur OSM","id":"iD","josm":"JOSM","josm_live":"Active la synchronisation automatique de JOSM lors du chargement d\'une photo","loading_labels_serious":["\ud83d\uddfa\ufe0f Chargement du fond de carte","\ud83d\udda5\ufe0f Interrogation de l\'API","\ud83d\uddbc\ufe0f Chargement des miniatures","\ud83d\udd0d Analyse des m\xe9tadonn\xe9es EXIF","\ud83c\udfd8\ufe0f Cr\xe9ation du rendu 3D","\ud83d\udcf7 Initialisation des vues 360\xb0","\ud83d\udfe0 \xc9quilibrage des couleurs","\ud83d\udcaf Calcul du score qualit\xe9 \xa9"],"loading_labels_fun":["\ud83e\udd8c D\xe9tection des panneaux biche","\ud83d\ude98 Recherche de la Panoramax Car \xa9","\u2615 Injection de caf\xe9ine","\ud83d\ude00 Souriez, vous \xeates mapp\xe9s !","\ud83d\udc08 Partage de photos de chats","\ud83d\ude34 R\xe9duction de la procrastination","\ud83c\uddf7\ud83c\uddea Chargement : 974%","\ud83d\udc27 Ouverture du code source","\ud83e\udd81 Indexation des traboules","\ud83e\uddf9 Nettoyage des m\xe9tadonn\xe9es","\ud83d\ude92 Envoi des photos du SDIS","\ud83d\udeb2 Mise \xe0 jour des voies vertes","\ud83d\ude89 Remont\xe9e des quais de gare","\ud83d\udef0\ufe0f Recherche de satellites","\ud83d\udc65 \xc9criture des personas","\ud83e\udd5e Localisation des cr\xeaperies","\ud83e\uddd1\u200d\ud83d\udcbb D\xe9boguage de l\'interface","\ud83d\udcc8 Incr\xe9mentation des statistiques"],"error_psv":"Photo Sphere Viewer ne s\'est pas charg\xe9 correctement","error_pic":"La photo demand\xe9e est introuvable","error_nopic":"Aucune photo disponible autour de la localisation recherch\xe9e","error_api":"Le serveur de photos n\'est pas disponible","error_webgl":"WebGL n\'est pas support\xe9 par votre navigateur","error_josm":"JOSM n\'a pas r\xe9pondu, est-il bien lanc\xe9 et la t\xe9l\xe9commande activ\xe9e ?","error_api_compatibility":"Le serveur de photos n\'est pas compatible avec cette visionneuse","filter_date":"Date","filter_date_1month":"1 mois","filter_date_1year":"1 an","filter_user":"Utilisateur","filter_user_mypics":"Mes photos","filter_picture":"Type d\'image","picture_flat":"Classique","picture_360":"360\xb0","filter_qualityscore":"Score de qualit\xe9","filter_qualityscore_help":"Cliquez pour activer ou d\xe9sactiver","qualityscore_title":"\xc0 propos du score qualit\xe9","qualityscore_doc_1":"Panoramax propose un Score de Qualit\xe9 pour chacune de ses photos. Cela facilite le filtre et la recherche de photos de bonne qualit\xe9 sur la carte.","qualityscore_doc_2":"Le score est affich\xe9 sous la forme d\'une lettre A/B/C/D/E (A \xe9tant le meilleur, E le moins bon), et visualisable gr\xe2ce \xe0 cette \xe9chelle :","qualityscore_doc_3":"Il est calcul\xe9 en fonction de la pr\xe9cision du GPS ainsi que la r\xe9solution de la photo. Un mat\xe9riel professionnel aura une note de A, une cam\xe9ra sportive 360\xb0 une note de B, et un smartphone une note de C \xe0 E.","qualityscore_doc_link":"Plus d\'infos sur le calcul du Score Qualit\xe9 dans notre documentation.","filter_zoom_in":"Zoomez plus pour voir ce filtre","map_background":"Fond de carte","map_background_aerial":"Satellite","map_background_streets":"Plan","map_theme":"Rendu de carte","map_theme_default":"Classique","map_theme_age":"Date de prise de vue","map_theme_age_1":"> 2 ans","map_theme_age_2":"< 2 ans","map_theme_age_3":"< 1 an","map_theme_age_4":"< 1 mois","map_theme_type":"Type de cam\xe9ra","map_theme_score":"Score de qualit\xe9","contrast":"Augmenter le contraste de l\'image","metadata":"M\xe9tadonn\xe9es de la photo","metadata_general_picid":"Identifiant de photo","metadata_general_seqid":"Identifiant de s\xe9quence","metadata_general_picid_link":"Aller au descriptif JSON de la photo","metadata_general_seqid_link":"Aller au descriptif JSON de la s\xe9quence","metadata_general_author":"Auteur","metadata_general_license":"Licence","metadata_general_license_link":"Voir la description compl\xe8te de la licence","metadata_general_date":"Date de prise de vue","metadata_camera":"Appareil","metadata_camera_make":"Fabricant","metadata_camera_model":"Mod\xe8le","metadata_camera_type":"Type","metadata_camera_resolution":"R\xe9solution","metadata_camera_focal_length":"Longueur focale","metadata_location":"Localisation","metadata_location_longitude":"Longitude","metadata_location_latitude":"Latitude","metadata_location_orientation":"Direction de prise de vue","metadata_location_precision":"Pr\xe9cision du positionnement","metadata_quality":"Score de qualit\xe9","metadata_quality_help":"En savoir plus sur le score de qualit\xe9","metadata_quality_score":"Note globale","metadata_quality_gps_score":"Note du positionnement","metadata_quality_resolution_score":"Note de la r\xe9solution","metadata_quality_missing":"pas d\'info dans l\'image","metadata_exif":"EXIF / XMP","metadata_exif_name":"Balise","metadata_exif_value":"Valeur","report":"Signaler la photo","report_auth":"Ce signalement sera envoy\xe9 en utilisant votre compte \\"{a}\\"","report_nature_label":"Nature du probl\xe8me","report_nature":{"":"S\xe9lectionnez la nature du probl\xe8me\u2026","blur_missing":"Un visage ou une plaque d\'immatriculation est visible","blur_excess":"Un objet qui ne n\xe9cessite pas de floutage est flout\xe9","inappropriate":"L\'image est inappropri\xe9e (non pertinente, nudit\xe9\u2026)","privacy":"Un chemin priv\xe9 ou une propri\xe9t\xe9 priv\xe9e est visible","picture_low_quality":"L\'image est de mauvaise qualit\xe9","mislocated":"L\'image est mal g\xe9olocalis\xe9e","copyright":"L\'image enfreint les droits d\'auteur","other":"Tout autre type de probl\xe8me"},"report_whole_sequence":"Cela concerne toute la s\xe9quence","report_details":"D\xe9tails suppl\xe9mentaires","report_details_placeholder":"Optionnel, vous pouvez ajouter des d\xe9tails sur le probl\xe8me","report_email":"Votre email","report_email_placeholder":"Optionnel","report_submit":"Envoyer","report_wait":"Envoi du signalement en cours\u2026","report_success":"Le signalement a \xe9t\xe9 envoy\xe9 avec succ\xe8s. Il sera examin\xe9 d\xe8s que possible.","report_failure":"Une erreur est survenue lors de la cr\xe9ation du signalement : {e}. Veuillez r\xe9essayer plus tard."},"map":{"loading":"Chargement\u2026","thumbnail":"Miniature de la photo survol\xe9e","not_public":"Masqu\xe9 au public","slow_loading":"La carte est longue \xe0 charger et pourrait appara\xeetre cass\xe9e"}}')},6909:F=>{"use strict";F.exports=JSON.parse('{"psv":{"twoFingers":"K\xe9t ujjal navig\xe1lhat","ctrlZoom":"K\xf6zel\xedt\xe9s vagy t\xe1vol\xedt\xe1s: Ctrl + g\xf6rget\xe9s","loadError":"A panor\xe1ma nem t\xf6lthet\u0151 be"},"gvs":{"zoom":"Nagy\xedt\xe1s","zoomOut":"T\xe1vol\xedt\xe1s","zoomIn":"K\xf6zel\xedt\xe9s","moveUp":"Mozg\xe1s fel","moveDown":"Mozg\xe1s le","moveLeft":"Mozg\xe1s balra","moveRight":"Mozg\xe1s jobbra","moveMiddle":"N\xe9zet k\xf6z\xe9pre hoz\xe1sa","expand":"B\u0151v\xedt\xe9s","expand_info":"Widget megjelen\xedt\xe9se teljes oldalon","show_psv":"K\xe9pn\xe9zeget\u0151 megjelen\xedt\xe9se","show_map":"T\xe9rk\xe9p megjelen\xedt\xe9se","minimize":"Widget elrejt\xe9se; a bal als\xf3 sarokban l\xe9v\u0151 gombbal \xfajra megjelen\xedtheti","options":"Be\xe1ll\xedt\xe1sok","filters":"Sz\u0171r\u0151k","layers":"R\xe9tegek","share":"Megoszt\xe1s","search":"Keres\xe9s","search_empty":"Nincs tal\xe1lat","share_links":"Linkek","share_page":"Link erre az oldalra","share_image":"Nagy felbont\xe1s\xfa (HD) k\xe9p","share_rss":"RSS h\xedrcsatorna","share_rss_title":"A t\xe9rk\xe9p l\xe1that\xf3 ter\xfclet\xe9n l\xe9v\u0151 \xfaj sorozatok RSS-h\xedrcsatorn\xe1ja","share_embed":"Be\xe1gyaz\xe1s a weboldaladon","share_print":"Nyomtat\xe1s","copy":"M\xe1sol\xe1s","copied":"M\xe1solva","error":"Ajjaj, baj van\u2026","error_subtitle":"Pr\xf3b\xe1lja \xfajra k\xe9s\u0151bb, vagy n\xe9zze meg a b\xf6ng\xe9sz\u0151konzolt a tov\xe1bbi r\xe9szletek\xe9rt.","sequence_next":"A sorozat k\xf6vetkez\u0151 k\xe9pe","sequence_play":"Sorozat lej\xe1tsz\xe1sa","sequence_pause":"Sorozatlej\xe1tsz\xe1s sz\xfcneteltet\xe9se","sequence_prev":"A sorozat el\u0151z\u0151 k\xe9pe","sequence_more":"Tov\xe1bbi lej\xe1tsz\xe1si lehet\u0151s\xe9gek","sequence_speed":"Lej\xe1tsz\xe1s sebess\xe9ge","legend_license":"Licenc: {l}","edit_osm":"OSM szerkeszt\xe9se","id":"iD","josm":"JOSM","josm_live":"JOSM automatikus szinkroniz\xe1l\xe1s\xe1nak enged\xe9lyez\xe9se k\xe9pbet\xf6lt\xe9skor","loading_labels_serious":["\ud83d\uddfa\ufe0f T\xe9rk\xe9padatok bet\xf6lt\xe9se","\ud83d\udda5\ufe0f API lek\xe9rdez\xe9se","\ud83d\uddbc\ufe0f B\xe9lyegk\xe9pek bet\xf6lt\xe9se","\ud83d\udd0d EXIF metaadatok elemz\xe9se","\ud83c\udfd8\ufe0f 3D megjelen\xedt\xe9s","\ud83d\udcf7 360\xb0-os k\xe9pek inicializ\xe1l\xe1sa","\ud83d\udfe0 Sz\xednek kiegyenl\xedt\xe9se","\ud83d\udcaf Min\u0151s\xe9gi pontsz\xe1m kisz\xe1m\xedt\xe1sa \xa9"],"loading_labels_fun":["\ud83e\udd8c Vadvesz\xe9lyt jelz\u0151 t\xe1bla \xe9szlel\xe9se","\ud83d\ude98 Panoramax aut\xf3 \xa9 keres\xe9se","\u2615 Koffeininjekci\xf3","\ud83d\ude00 Mosolyogj, fel lett\xe9l t\xe9rk\xe9pezve!","\ud83d\udc08 Kiscic\xe1s k\xe9pek megoszt\xe1sa","\ud83d\ude34 Halogat\xe1s cs\xf6kkent\xe9se","\ud83e\uded6 Tea megf\u0151z\xe9se","\ud83d\udc27 Forr\xe1sk\xf3d felnyit\xe1sa","\ud83d\ude87 Metr\xf3\xe1llom\xe1sok indexel\xe9se","\ud83e\uddf9 Metaadatok tisztogat\xe1sa","\ud83d\ude92 T\u0171zolt\xf3s\xe1gr\xf3l sz\xf3l\xf3 fot\xf3k bek\xfcld\xe9se","\ud83d\udeb2 Z\xf6ldutak friss\xedt\xe9se","\ud83d\ude89 Peronok bej\xe1r\xe1sa","\ud83d\udef0\ufe0f M\u0171holdak keres\xe9se","\ud83d\udc65 Person\xe1k meg\xedr\xe1sa","\ud83d\udc1f S\xfcltkrumplikap\xf3k lokaliz\xe1l\xe1sa","\ud83e\uddd1\u200d\ud83d\udcbb Hibakeres\u0151 fel\xfclet","\ud83d\udcc8 Statisztika n\xf6vel\xe9se"],"error_psv":"A Photo Sphere Viewer (g\xf6mbpanor\xe1ma-n\xe9zeget\u0151) nem t\xf6lt\u0151dik be megfelel\u0151en","error_pic":"A k\xe9rt k\xe9p nem tal\xe1lhat\xf3","error_nopic":"Az adott helyen nem \xe9rhet\u0151 el k\xe9p","error_api":"A k\xe9pkiszolg\xe1l\xf3 nem \xe9rhet\u0151 el","error_webgl":"A WebGL nem t\xe1mogatott ebben a b\xf6ng\xe9sz\u0151ben","error_josm":"A JOSM nem v\xe1laszol. Val\xf3ban fut \xe9s el\xe9rhet\u0151 t\xe1volr\xf3l?","error_api_compatibility":"A k\xe9pkiszolg\xe1l\xf3 nem kompatibilis a k\xe9pn\xe9zeget\u0151 ezen verzi\xf3j\xe1val","filter_date":"D\xe1tum szerint","filter_user":"Felhaszn\xe1l\xf3 szerint","filter_picture":"K\xe9pt\xedpus szerint","picture_flat":"Klasszikus","picture_360":"360\xb0","filter_camera_model":"Kameramodell szerint","map_background":"T\xe9rk\xe9ph\xe1tt\xe9r","map_background_aerial":"L\xe9gi felv\xe9tel","map_background_streets":"k\xe9pUtca","map_theme":"T\xe9rk\xe9p t\xe9m\xe1ja","map_theme_default":"Klasszikus","map_theme_age":"K\xe9pk\xe9sz\xedt\xe9s ideje","map_theme_age_1":"> 2 \xe9ve","map_theme_age_2":"< 2 \xe9ve","map_theme_age_3":"< 1 \xe9ve","map_theme_age_4":"< 1 h\xf3napja","map_theme_type":"Kamerat\xedpus","contrast":"Nagyobb k\xe9pkontraszt enged\xe9lyez\xe9se","metadata":"K\xe9p metaadatai","metadata_general_picid":"K\xe9p azonos\xedt\xf3js","metadata_general_seqid":"Sorozat azonos\xedt\xf3ja","metadata_general_picid_link":"Ugr\xe1s a k\xe9p JSON le\xedr\xe1s\xe1hoz","metadata_general_seqid_link":"Ugr\xe1s a sorozat JSON le\xedr\xe1s\xe1hoz","metadata_general_author":"Szerz\u0151","metadata_general_license":"Licenc (enged\xe9ly)","metadata_general_license_link":"Ugr\xe1s a licenc teljes le\xedr\xe1s\xe1hoz","metadata_general_date":"K\xe9sz\xedt\xe9s d\xe1tuma","metadata_camera":"Kamera","metadata_camera_make":"Gy\xe1rt\xf3","metadata_camera_model":"Modell","metadata_camera_type":"T\xedpus","metadata_camera_focal_length":"Gy\xfajt\xf3t\xe1vols\xe1g","metadata_location":"Helysz\xedn","metadata_location_longitude":"Hossz\xfas\xe1g","metadata_location_latitude":"Sz\xe9less\xe9g","metadata_location_orientation":"Felv\xe9tel ir\xe1nya","metadata_location_precision":"Helymeghat\xe1roz\xe1s pontoss\xe1ga","metadata_exif":"EXIF / XMP","metadata_exif_name":"C\xedmke","metadata_exif_value":"\xc9rt\xe9k","report":"K\xe9p bejelent\xe9se","report_auth":"A jelent\xe9s a fi\xf3kod ({a}) felhaszn\xe1l\xe1s\xe1val lesz elk\xfcldve","report_nature":{"":"Probl\xe9ma jelleg\xe9nek kiv\xe1laszt\xe1sa\u2026","blur_missing":"A k\xe9pen l\xe1tszik egy szem\xe9ly arca vagy egy rendsz\xe1mt\xe1bla","blur_excess":"A k\xe9pen el van hom\xe1lyos\xedtva egy olyan objektum, amelynek \xe9lesnek kellene lennie","inappropriate":"A k\xe9p nem megfelel\u0151 (irrelev\xe1ns, meztelens\xe9get jelen\xedt meg stb.)","privacy":"A k\xe9pen mag\xe1n\xfat vagy mag\xe1nter\xfclet l\xe1that\xf3","picture_low_quality":"A k\xe9p nagyon rossz min\u0151s\xe9g\u0171","mislocated":"A k\xe9p rosszul van elhelyezve a t\xe9rk\xe9pen","copyright":"A k\xe9p szerz\u0151i jogot s\xe9rt","other":"B\xe1rmilyen m\xe1s jelleg\u0171 probl\xe9ma"},"report_nature_label":"Probl\xe9ma jellege","report_details":"Tov\xe1bbi r\xe9szletek","filter_zoom_in":"Nagy\xedts a sz\u0171r\u0151k l\xe1that\xf3v\xe1 t\xe9tel\xe9hez","report_email":"E-mail-c\xedm","report_email_placeholder":"Nem k\xf6telez\u0151","report_submit":"Bek\xfcld\xe9s","report_success":"A jelent\xe9s sikeresen be lett k\xfcldve; a lehet\u0151 leghamarabb megvizsg\xe1ljuk.","report_failure":"Hiba t\xf6rt\xe9nt a jelent\xe9s l\xe9trehoz\xe1sakor: {e}. K\xe9rj\xfck, pr\xf3b\xe1ld meg k\xe9s\u0151bb \xfajra.","search_user":"Felhaszn\xe1l\xf3n\xe9v keres\xe9se\u2026","search_address":"C\xedm, v\xe1ros stb. keres\xe9se\u2026","share_embed_docs":"Tov\xe1bbi inform\xe1ci\xf3 a be\xe1gyaz\xe1s konfigur\xe1l\xe1s\xe1r\xf3l","error_click":"Kattints a folytat\xe1shoz","error_retry":"K\xe9rj\xfck, pr\xf3b\xe1ld meg k\xe9s\u0151bb","legend_title":"K\xe9p adatainak megjelen\xedt\xe9se","report_whole_sequence":"A teljes sorozatra vonatkozik","report_wait":"Jelent\xe9s bek\xfcld\xe9se folyamatban\u2026","report_details_placeholder":"Megadhatsz tov\xe1bbi r\xe9szleteket a probl\xe9m\xe1r\xf3l (nem k\xf6telez\u0151)","filter_qualityscore_help":"Kattints az enged\xe9lyez\xe9shez vagy a letilt\xe1shoz","filter_qualityscore":"Min\u0151s\xe9gi pontsz\xe1m","map_theme_score":"Min\u0151s\xe9gi pontsz\xe1m","metadata_camera_resolution":"Felbont\xe1s","metadata_quality":"Min\u0151s\xe9gi pontsz\xe1m","metadata_quality_help":"Tov\xe1bbi tudnival\xf3k a min\u0151s\xe9gi pontsz\xe1mr\xf3l","metadata_quality_score":"\xd6sszes\xedtett pontsz\xe1m","metadata_quality_gps_score":"Pozicion\xe1l\xe1si pontsz\xe1m","metadata_quality_resolution_score":"Felbont\xe1si pontsz\xe1m","metadata_quality_missing":"a k\xe9pben nincs megadva \xe9rt\xe9k"},"map":{"loading":"Bet\xf6lt\xe9s\u2026","thumbnail":"A kurzor alatti k\xe9p b\xe9lyegk\xe9pe","not_public":"Nem l\xe1that\xf3 nyilv\xe1nosan","slow_loading":"A t\xe9rk\xe9p lassan t\xf6lt\u0151dik be, \xe9s lehet, hogy lerobbant"},"maplibre":{"GeolocateControl.FindMyLocation":"Tart\xf3zkod\xe1si hely megtal\xe1l\xe1sa","GeolocateControl.LocationNotAvailable":"Tart\xf3zkod\xe1si hely nem \xe9rhet\u0151 el"}}')},4895:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"expand":"Espandi","zoomOut":"Rimpicciolisci","zoomIn":"Ingrandisci","zoom":"Zoom","moveUp":"Muovi in alto","moveDown":"Muovi in basso","moveLeft":"Muovi a sinistra","moveRight":"Muovi a destra","expand_info":"Fai apparire il widget a schermo pieno","options":"Opzioni","filters":"Filtri","layers":"Livelli","search":"Cerca","search_empty":"Nessun risultato trovato","search_address":"Cerca un indirizzo, citt\xe0\u2026","search_user":"Cerca un nome utente\u2026","share":"Condividi","share_links":"Collegamenti","share_page":"Collegamento a questa pagina","share_image":"Immagine HD","share_embed":"Incorpora nel tuo sito web","share_embed_docs":"Scopri di pi\xf9 sulla configurazione della incorporazione","share_print":"Stampa","copy":"Copia","copied":"Copiato","error":"Abbiamo un problema\u2026","error_click":"Clicca per continuare","error_retry":"Riprovare pi\xf9 tardi","sequence_play":"Riproduci questa sequenza","sequence_pause":"Pausa la sequenza","sequence_speed":"Velocit\xe0 di riproduzione","legend_license":"Licenza: {l}","legend_title":"Mostra dettagli della foto","edit_osm":"Modifica OSM","loading_labels_serious":["\ud83d\uddfa\ufe0f Caricamento dei dati della mappa","\ud83d\udda5\ufe0f Interrogazione delle API","\ud83d\uddbc\ufe0f Caricamento delle miniature","\ud83d\udd0d Analisi dei metadata EXIF","\ud83c\udfd8\ufe0f Creazione del rendering 3D","\ud83d\udcf7 Inizializzazione delle foto a 360\xb0","\ud83d\udfe0 Bilanciamento del colore","\ud83d\udcaf Calcolo del punteggio della qualit\xe0 \xa9"],"loading_labels_fun":["\ud83e\udd8c Rilevazione dei cartelli di attraversamento dei cervi","\ud83d\ude98 Ricerca dell\u2019auto Panoramax \xa9","\u2615 Iniezione di caffeina","\ud83d\ude00 Sorridete, siete stati mappati!","\ud83d\udc08 Condivisione delle foto di gatti","\ud83d\ude34 Riduzione della procrastinazione","\ud83e\uded6 Preparazione del t\xe8","\ud83d\udc27 Apertura del codice sorgente","\ud83d\ude87 Indicizzazione delle stazioni della metro","\ud83e\uddf9 Pulizia dei metadata","\ud83d\ude92 Invio delle foto delle stazioni dei pompieri","\ud83d\udeb2 Aggiornamento delle strade verdi","\ud83d\ude89 Passeggiata sulle banchine della stazione","\ud83d\udef0\ufe0f Ricerca dei satelliti","\ud83d\udc65 Scrittura delle persone","\ud83d\udc1f Ricerca dei negozi di patatine fritte","\ud83e\uddd1\u200d\ud83d\udcbb Debug dell\u2019interfaccia","\ud83d\udcc8 Incremento delle statistiche"],"error_psv":"Il visualizzatore delle foto sferiche non si sta caricando correttamente","error_pic":"La foto richiesta non \xe8 stata trovata","error_nopic":"Nessuna foto disponibile alla posizione richiesta","error_api":"Il server delle foto non \xe8 disponibile","error_webgl":"Il tuo browser non supporta WebGL","error_josm":"JOSM non risponde, \xe8 in esecuzione con il controllo remoto abilitato?","error_api_compatibility":"Il server delle foto non \xe8 compatibile con questa versione del visualizzatore","filter_date":"Data","filter_date_1month":"1 mese","filter_date_1year":"1 anno","filter_user_mypics":"Le mie foto","filter_picture":"Tipo di foto","filter_zoom_in":"Ingrandisci per vedere questo filtro","picture_flat":"Classica","picture_360":"360\xb0","filter_qualityscore_help":"Clicca per abilitare o disabilitare","map_background":"Sfondo della mappa","map_background_aerial":"Satellite","map_background_streets":"Strade","map_theme":"Tema della mappa","map_theme_default":"Classica","map_theme_age":"Data di acquisizione","map_theme_age_2":"< 2 anni","map_theme_age_3":"< 1 anno","map_theme_age_4":"< 1 mese","map_theme_score":"Punteggio della qualit\xe0","contrast":"Abilita un maggiore contrasto della foto","metadata":"Metadata della foto","metadata_general_picid":"Identificatore della foto","metadata_general_picid_link":"Vai alla descrizione JSON della foto","metadata_general_seqid_link":"Vai alla descrizione JSON della sequenza","metadata_general_author":"Autore","metadata_general_license":"Licenza","metadata_general_date":"Data di acquisizione","metadata_camera":"Fotocamera","metadata_camera_make":"Costruttore","metadata_camera_model":"Modello","metadata_camera_type":"Tipo","metadata_camera_resolution":"Risoluzione","metadata_location":"Posizione","metadata_location_longitude":"Longitudine","metadata_location_latitude":"Latitudine","metadata_location_precision":"Precisione della posizione","metadata_quality":"Punteggio della qualit\xe0","metadata_quality_score":"Punteggio globale","metadata_quality_gps_score":"Punteggio sulla posizione","metadata_quality_resolution_score":"Punteggio della risoluzione","metadata_exif":"EXIF / XMP","metadata_exif_name":"Attributo","report_auth":"Questa segnalazione verr\xe0 inviata usando la tua utenza \u201c{a}\u201d","report_nature_label":"Natura del problema","report_nature":{"blur_excess":"Un oggetto che non ha bisogno di essere offuscato lo \xe8","inappropriate":"La foto \xe8 inappropriata (non pertinente, nudo, \u2026)","mislocated":"La foto non \xe8 ben posizionata sulla mappa","copyright":"La foto viola il diritto d\u2019autore","other":"Qualsiasi altro tipo di problema","picture_low_quality":"La foto \xe8 di qualit\xe0 scarsa","":"Selezione la natura del problema\u2026","blur_missing":"Sono visibili la faccia di una persona o la targa di un\u2019auto","privacy":"Sono visibili un sentiero o una propriet\xe0 privati"},"report_whole_sequence":"Riguarda l\u2019intera sequenza","report_details":"Ulteriori dettagli","report_email":"La tua e-mail","report_email_placeholder":"Facoltativo","report_submit":"Invia","report_wait":"Invio della segnalazione\u2026","report_failure":"\xc8 avvenuto un errore durante la creazione della segnalazione: {e}. Riprovare pi\xf9 tardi.","moveMiddle":"Centra la visuale","show_map":"Mostra la mappa","sequence_next":"Prossima foto nella sequenza","map_theme_age_1":"> 2 anni","map_theme_type":"Tipo di fotocamera","minimize":"Nascondi il widget, puoi mostrarlo di nuovo usando il pulsante nell\u2019angolo in basso a sinistra","metadata_general_license_link":"Vedi la descrizione completa della licenza","share_rss":"Feed RSS","show_psv":"Mostra il visualizzatore delle foto","share_rss_title":"Feed RSS delle nuove sequenze nell\u2019attuale area visibile della mappa","sequence_prev":"Foto precedente della sequenza","sequence_more":"Altre opzioni di riproduzione","josm_live":"Abilita la sincronizzazione automatica di JOSM al caricamento delle foto","metadata_general_seqid":"Identificatore della sequenza","metadata_camera_focal_length":"Lunghezza focale","filter_user":"Utente","metadata_location_orientation":"Direzione dello scatto","filter_qualityscore":"Punteggio della qualit\xe0","metadata_quality_help":"Per saperne di pi\xf9 sul punteggio di qualit\xe0","metadata_quality_missing":"Nessun valore impostato nella foto","metadata_exif_value":"Valore","report":"Segnala foto","report_details_placeholder":"Facoltativo, puoi aggiungere dei dettagli sul problema e sul perch\xe9 lo ritieni rilevante","report_success":"La segnalazione \xe8 stata inviata correttamente. Non appena possibile verr\xe0 esaminata.","minimize_short":"Nascondi","qualityscore_title":"Informazioni sul punteggio di qualit\xe0","qualityscore_doc_1":"Panoramax propone un Punteggio della qualit\xe0 per ogni foto. Ci\xf2 permette di filtrare facilmente la mappa e mostrare le foto di alta qualit\xe0 disponibili.","qualityscore_doc_2":"Il voto \xe8 mostrato agli utenti con un valore tipo A/B/C/D/E (A \xe8 il voto migliore, E il peggiore) e graficamente viene mostrato con la seguente scala:","qualityscore_doc_link":"Nella nostra documentazione sono presenti maggiori dettagli sul calcolo del Punteggio della qualit\xe0.","qualityscore_doc_3":"Esso \xe8 calcolato basandosi sulla precisione del GPS e sulla risoluzione della foto. Un sistema professionale avr\xe0 un punteggio A, un action camera a 360\xb0 avr\xe0 un punteggio B e uno smartphone verr\xe0 classificato come C, D o E."},"psv":{"loadError":"Impossibile caricare l\u2019immagine panoramica","ctrlZoom":"Utilizza Ctrl + rotellina del mouse per ingrandire l\u2019immagine","twoFingers":"Usa due dita per spostarti"},"maplibre":{"GeolocateControl.FindMyLocation":"Trova la mia posizione","GeolocateControl.LocationNotAvailable":"Posizione non disponibile"},"map":{"loading":"Caricamento\u2026","thumbnail":"Miniatura della foto passata con il mouse","not_public":"Non pubblicamente visibile","slow_loading":"La mappa impiega troppo tempo a caricarsi e potrebbe apparire a pezzi"}}')},9026:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"moveRight":"Przesu\u0144 w prawo","sequence_speed":"Pr\u0119dko\u015b\u0107 odtwarzania","metadata_camera_model":"Model","search_address":"Szukaj adres, miasto\u2026","zoom":"Przybli\u017cenie","zoomIn":"Przybli\u017c","moveUp":"Przesu\u0144 w g\xf3r\u0119","moveDown":"Przesu\u0144 w d\xf3\u0142","moveLeft":"Przesu\u0144 w lewo","moveMiddle":"Wycentruj widok","expand":"Rozszerz","show_psv":"Poka\u017c przegl\u0105dark\u0119 zdj\u0119\u0107","show_map":"Poka\u017c map\u0119","options":"Opcje","filters":"Filtry","layers":"Warstwy","search":"Szukaj","search_empty":"Brak wynik\xf3w","search_user":"Szukaj nazwy u\u017cytkownika\u2026","share":"Udost\u0119pnij","share_links":"Linki","share_page":"Link do tej strony","share_rss":"Kana\u0142 RSS","share_print":"Drukuj","copy":"Kopiuj","copied":"Skopiowano","error":"Mamy problem\u2026","error_click":"Kliknij, aby kontynuowa\u0107","error_retry":"Prosz\u0119 spr\xf3buj p\xf3\u017aniej","sequence_next":"Nast\u0119pne zdj\u0119cie w sekwencji","sequence_pause":"Spauzuj sekwencj\u0119","sequence_prev":"Poprzednie zdj\u0119cie w sekwencji","sequence_more":"Wi\u0119cej opcji odtwarzania","legend_license":"Licencja: {l}","legend_title":"Poka\u017c szczeg\xf3\u0142y zdj\u0119cia","edit_osm":"Edytuj OSM","loading_labels_serious":["\ud83d\uddfa\ufe0f Wczytywanie danych mapy","\ud83d\udda5\ufe0f Odpytywanie API","\ud83d\uddbc\ufe0f Wczytywanie miniaturek","\ud83d\udd0d Analizowanie metadanych EXIF","\ud83c\udfd8\ufe0f Renderowanie 3D","\ud83d\udcf7 Inicjowanie zdj\u0119\u0107 360\xb0","\ud83d\udfe0 Balansowanie kolor\xf3w","\ud83d\udcaf Obliczanie oceny jako\u015bci \xa9"],"map_theme_age_2":"< 2 lata","map_theme_age_1":"> 2 lata","map_theme_age":"Data zrobienia","filter_picture":"Typ zdj\u0119cia","map_theme_age_3":"< rok","map_theme_age_4":"< miesi\u0105c","map_theme_type":"Typ aparatu","metadata":"Metadane zdj\u0119cia","metadata_general_picid":"Identyfikator zdj\u0119cia","metadata_general_seqid":"Identyfikator sekwencji","metadata_general_license":"Licencja","metadata_general_author":"Autor","metadata_camera":"Aparat","metadata_camera_type":"Typ","metadata_camera_resolution":"Rozdzielczo\u015b\u0107","metadata_location":"Lokalizacja","metadata_exif":"EXIF / XMP","metadata_quality_missing":"Brak warto\u015bci ustawionej w zdj\u0119ciu","metadata_exif_name":"Tag","metadata_exif_value":"Warto\u015b\u0107","report":"Zg\u0142o\u015b zdj\u0119cie","report_nature":{"privacy":"Prywatna droga lub w\u0142asno\u015b\u0107 widoczna","mislocated":"Zdj\u0119cie jest w z\u0142ym miejscu na mapie","copyright":"Zdj\u0119cie narusza prawa autorskie","picture_low_quality":"Zdj\u0119cie jest bardzo niskiej jako\u015bci","other":"Inny problem","":"Wybierz typ problemu\u2026","blur_missing":"Twarz osoby lub rejestracja samochodu jest widoczna","blur_excess":"Obiekt, kt\xf3ry nie wymaga zamazania jest zamazany","inappropriate":"Zdj\u0119cie jest niestosowne (niezwi\u0105zane, nago\u015b\u0107\u2026)"},"zoomOut":"Oddal","report_whole_sequence":"Dotyczy ca\u0142ej sekwencji","report_details":"Dodatkowe szczeg\xf3\u0142y","report_email":"Tw\xf3j adres email","report_email_placeholder":"Opcjonalne","report_submit":"Wy\u015blij","report_wait":"Wysy\u0142anie zg\u0142oszenia\u2026","report_success":"Zg\u0142oszenie zosta\u0142o wys\u0142ane. Zostanie przejrzane tak szybko jak to mo\u017cliwe.","share_rss_title":"Kana\u0142 RSS nowych sekwencji na widocznym obszarze mapy","loading_labels_fun":["\ud83e\udd8c Wykrywanie znak\xf3w przechodzenia jeleni",null,"\u2615 Wstrzykiwanie kofeiny","\ud83d\ude00 U\u015bmiechnij si\u0119, jeste\u015b mapowany!","\ud83d\udc08 Udost\u0119pnianie zdj\u0119\u0107 kot\xf3w","\ud83d\ude34 Zmniejszania prokrastynacji","\ud83e\uded6 Parzenie herbaty","\ud83d\udc27 Otwieranie kodu \u017ar\xf3d\u0142owego","\ud83d\ude87 Indeksowanie stacji metra","\ud83e\uddf9 Czyszczenie metadanych","\ud83d\ude92 Przesy\u0142anie zdj\u0119\u0107 remiz",null,"\ud83d\ude89 Przechodzenie peron\xf3w stacji","\ud83d\udef0\ufe0f Wyszukiwanie satelit",null,"\ud83d\udc1f Szukanie sklep\xf3w z frytkami i ryb\u0105","\ud83e\uddd1\u200d\ud83d\udcbb Interfejs debugowania","\ud83d\udcc8 Zwi\u0119kszanie statystyk"],"share_embed_docs":"Przeczytaj wi\u0119cej o konfiguracji osadzenia","sequence_play":"Odtw\xf3rz t\u0119 sekwencj\u0119","josm_live":"W\u0142\u0105cz automatyczn\u0105 synchronizacj\u0119 JOSM przy \u0142adowaniu zdj\u0119\u0107","error_api":"Serwer zdj\u0119\u0107 nie jest dost\u0119pny","error_webgl":"WebGL nie jest obs\u0142ugiwany przez t\u0119 przegl\u0105dark\u0119","error_api_compatibility":"Serwer zdj\u0119\u0107 nie jest kompatybilny z t\u0105 wersj\u0105 przegl\u0105darki","filter_date":"Data","filter_date_1month":"1 miesi\u0105c","filter_date_1year":"1 rok","filter_user":"U\u017cytkownik","filter_user_mypics":"Moje zdj\u0119cia","filter_zoom_in":"Przybli\u017c, aby filtry by\u0142y widoczne","picture_flat":"Klasyczne","picture_360":"360\xb0","filter_qualityscore":"Ocena jako\u015bci","map_background":"Podk\u0142ad mapowy","map_background_aerial":"Zdj\u0119cia lotnicze","map_background_streets":"Ulice","map_theme":"Motyw mapy","map_theme_default":"Klasyczny","map_theme_score":"Ocena jako\u015bci","contrast":"W\u0142\u0105cz wy\u017cszy kontrast zdj\u0119cia","metadata_general_picid_link":"Id\u017a do opisu zdj\u0119cia w JSON","metadata_general_seqid_link":"Id\u017a do opisu sekwencji w JSON","metadata_general_license_link":"Id\u017a do strony z pelnym opisem licencji","metadata_general_date":"Data zrobienia","metadata_camera_make":"Marka","metadata_camera_focal_length":"Ogniskowa","metadata_location_longitude":"D\u0142ugo\u015b\u0107 geograficzna","metadata_location_latitude":"Szeroko\u015b\u0107 geograficzna","metadata_location_orientation":"Kierunek robienia zdj\u0119cia","metadata_location_precision":"Precyzja lokalizacji","metadata_quality":"Ocena jako\u015bci","metadata_quality_help":"Dowiedz si\u0119 wi\u0119cej o ocenie jako\u015bci","metadata_quality_score":"Ocena globalna","metadata_quality_gps_score":"Ocena pozycji","metadata_quality_resolution_score":"Ocena rozdzielczo\u015bci","report_auth":"To zg\u0142oszenie b\u0119dzie wys\u0142anie przy pomocy Twojego konta \\"{a}\\"","report_nature_label":"Typ problemu","report_details_placeholder":"Opcjonalnie, mo\u017cesz doda\u0107 szczeg\xf3\u0142y o problemie","report_failure":"B\u0142\u0105d wyst\u0105pi\u0142 podczas tworzenia zg\u0142oszenia: {e}. Prosz\u0119 spr\xf3buj ponownie.","filter_qualityscore_help":"Kliknij, aby w\u0142\u0105czy\u0107 lub wy\u0142\u0105czy\u0107","error_josm":"JOSM nie odpowiada, czy jest uruchomiony i czy dost\u0119p zdalny jest w\u0142\u0105czony?"},"psv":{"twoFingers":"U\u017cyj dw\xf3ch palc\xf3w do nawigacji","ctrlZoom":"U\u017cyj ctrl + rolka myszy, aby powi\u0119kszy\u0107 zdj\u0119cie","loadError":"Panorama nie mo\u017ce by\u0107 za\u0142adowana"},"maplibre":{"GeolocateControl.FindMyLocation":"Znajd\u017a moj\u0105 lokalizacj\u0119","GeolocateControl.LocationNotAvailable":"Lokalizacja niedost\u0119pna"},"map":{"thumbnail":"Miniaturki najechanego zdj\u0119cia","not_public":"Niewidoczne publicznie","slow_loading":"Mapa \u0142aduje si\u0119 wolno i mo\u017ce si\u0119 wydawaj popsuta","loading":"\u0141adowanie\u2026"}}')},6984:F=>{"use strict";F.exports=JSON.parse('{"gvs":{"contrast":"\u589e\u52a0\u76f8\u7247\u5c0d\u6bd4\u5ea6","copied":"\u5df2\u8907\u88fd","copy":"\u8907\u88fd","edit_osm":"\u7de8\u8f2f OSM","error":"Panoramax \u7576\u6a5f\u4e86\u2026","error_api":"\u76f8\u7247\u4f3a\u670d\u5668\u7121\u6cd5\u4f7f\u7528","error_api_compatibility":"\u76f8\u7247\u4f3a\u670d\u5668\u548c\u6b64\u6aa2\u8996\u5668\u7684\u7248\u672c\u4e0d\u76f8\u5bb9","error_josm":"JOSM \u6c92\u6709\u56de\u61c9\uff0c\u5b83\u5df2\u7d93\u555f\u52d5\u4e14\u555f\u7528\u9060\u7aef\u63a7\u5236\u4e86\u55ce?","error_nopic":"\u641c\u5c0b\u7684\u4f4d\u7f6e\u9644\u8fd1\u6c92\u6709\u76f8\u7247","error_pic":"\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u76f8\u7247","error_psv":"\u7121\u6cd5\u6b63\u78ba\u8f09\u5165 Photo Sphere Viewer","error_subtitle":"\u8acb\u7a0d\u5f8c\u91cd\u8a66\u6216\u6aa2\u67e5\u700f\u89bd\u5668\u7684\u4e3b\u63a7\u53f0\u4ee5\u4e86\u89e3\u8a73\u60c5\u3002","error_webgl":"\u60a8\u7684\u700f\u89bd\u5668\u4e0d\u652f\u63f4 WebGL","expand":"\u5c55\u958b","expand_info":"\u5728\u6574\u500b\u756b\u9762\u986f\u793a\u6b64\u5c0f\u5de5\u5177","filter_camera_model":"\u6309\u76f8\u6a5f\u578b\u865f","filter_date":"\u65e5\u671f","filter_picture":"\u76f8\u7247\u985e\u578b","filter_user":"\u4f7f\u7528\u8005","filter_zoom_in":"\u62c9\u8fd1\u5730\u5716\u4ee5\u986f\u793a\u7be9\u9078\u7d50\u679c","filters":"\u7be9\u9078\u5668","id":"iD","josm":"JOSM","josm_live":"\u555f\u7528\u8f09\u5165\u76f8\u7247\u6642\u81ea\u52d5\u540c\u6b65 JOSM","layers":"\u5716\u5c64","legend_license":"\u6388\u6b0a: {l}","loading_labels_fun":["\ud83e\udd8c \u5075\u6e2c\u5230\u7576\u5fc3\u6885\u82b1\u9e7f\u6a19\u8a8c","\ud83d\ude98 \u6b63\u5728\u641c\u5c0b Panoramax \u6c7d\u8eca \xa9","\u2615 \u6ce8\u5165\u5496\u5561\u56e0","\ud83d\ude00 \u8acb\u5fae\u7b11\uff0c\u60a8\u5df2\u88ab\u6a19\u8a18\u5728\u5730\u5716\u4e0a\u4e86\uff01","\ud83d\udc08 \u6b63\u5728\u5206\u4eab\u8c93\u54aa\u7684\u76f8\u7247","\ud83d\ude34 \u6b63\u5728\u6e1b\u5c11\u5ef6\u9072","\ud83e\uded6 \u6b63\u5728\u6c8f\u58fa\u597d\u8336","\ud83d\udc27 \u6b63\u5728\u958b\u555f\u539f\u59cb\u78bc","\ud83d\ude87 \u6b63\u5728\u7d22\u5f15\u5730\u9435\u8eca\u7ad9","\ud83e\uddf9 \u6e05\u7406\u8a6e\u91cb\u8cc7\u6599","\ud83d\ude92 \u6b63\u5728\u50b3\u9001\u6d88\u9632\u968a\u7684\u76f8\u7247","\ud83d\udeb2 \u66f4\u65b0\u7da0\u9053","\ud83d\ude89 \u6b63\u5728\u901a\u904e\u8eca\u7ad9\u6708\u53f0","\ud83d\udef0\ufe0f \u6b63\u5728\u641c\u5c0b\u885b\u661f","\ud83d\udc65 \u6b63\u5728\u64b0\u5beb\u4eba\u7269\u8a8c","\ud83c\udf57 \u6b63\u5728\u5b9a\u4f4d\u9e79\u9165\u96de\u5e97","\ud83e\uddd1\u200d\ud83d\udcbb \u6b63\u5728\u5075\u932f\u4ecb\u9762","\ud83d\udcc8 \u7d71\u8a08\u6578\u64da\u6b63\u5728\u589e\u52a0"],"loading_labels_serious":["\ud83d\uddfa\ufe0f \u6b63\u5728\u8f09\u5165\u5730\u5716\u8cc7\u6599","\ud83d\udda5\ufe0f \u6b63\u5728\u67e5\u8a62 API","\ud83d\uddbc\ufe0f \u6b63\u5728\u8f09\u5165\u7e2e\u5716","\ud83d\udd0d \u6b63\u5728\u5206\u6790 EXIF \u8a6e\u91cb\u8cc7\u6599","\ud83c\udfd8\ufe0f \u6b63\u5728\u7b97\u7e6a 3D","\ud83d\udcf7 \u6b63\u5728\u521d\u59cb\u5316 360\xb0 \u76f8\u7247","\ud83d\udfe0 \u6b63\u5728\u5e73\u8861\u8272\u5f69","\ud83d\udcaf \u6b63\u5728\u8a08\u7b97\u54c1\u8cea\u5206\u6578 \xa9"],"map_background":"\u5730\u5716\u80cc\u666f","map_background_aerial":"\u885b\u661f","map_background_streets":"\u9810\u8a2d","map_theme":"\u5730\u5716\u4e3b\u984c","map_theme_age":"\u62cd\u651d\u6642\u9593","map_theme_age_1":"> 2 \u5e74","map_theme_age_2":"< 2 \u5e74","map_theme_age_3":"< 1 \u5e74","map_theme_age_4":"< 1 \u500b\u6708","map_theme_default":"\u7d93\u5178","map_theme_type":"\u76f8\u6a5f\u985e\u578b","metadata":"\u76f8\u7247\u8a6e\u91cb\u8cc7\u6599","metadata_camera":"\u76f8\u6a5f","metadata_camera_focal_length":"\u7126\u8ddd","metadata_camera_make":"\u88fd\u9020\u5546","metadata_camera_model":"\u578b\u865f","metadata_camera_type":"\u985e\u578b","metadata_exif":"EXIF / XMP","metadata_exif_name":"\u6a19\u7c64","metadata_exif_value":"\u503c","metadata_general_author":"\u4f5c\u8005","metadata_general_date":"\u62cd\u651d\u6642\u9593","metadata_general_license":"\u6388\u6b0a","metadata_general_license_link":"\u67e5\u770b\u5b8c\u6574\u6388\u6b0a\u689d\u6b3e","metadata_general_picid":"\u76f8\u7247\u8b58\u5225\u78bc","metadata_general_picid_link":"\u524d\u5f80\u672c\u76f8\u7247\u7684 JSON \u8aaa\u660e","metadata_general_seqid":"\u5e8f\u5217\u8b58\u5225\u78bc","metadata_general_seqid_link":"\u524d\u5f80\u672c\u5e8f\u5217\u7684 JSON \u8aaa\u660e","metadata_location":"\u5730\u9ede","metadata_location_latitude":"\u7def\u5ea6","metadata_location_longitude":"\u7d93\u5ea6","metadata_location_orientation":"\u62cd\u651d\u65b9\u5411","metadata_location_precision":"\u5b9a\u4f4d\u7cbe\u5ea6","minimize":"\u96b1\u85cf\u9019\u500b\u5c0f\u5de5\u5177\uff0c\u60a8\u53ef\u4ee5\u6309\u5de6\u4e0b\u89d2\u7684\u6309\u9215\u518d\u6b21\u986f\u793a\u5b83","moveDown":"\u4e0b\u79fb","moveLeft":"\u5de6\u79fb","moveMiddle":"\u756b\u9762\u7f6e\u4e2d","moveRight":"\u53f3\u79fb","moveUp":"\u4e0a\u79fb","options":"\u9078\u9805","picture_360":"360\xb0","picture_flat":"\u7d93\u5178","search":"\u641c\u5c0b","search_address":"\u641c\u5c0b\u5730\u5740\u3001\u57ce\u5e02\u2026","search_empty":"\u627e\u4e0d\u5230\u7d50\u679c","search_user":"\u641c\u5c0b\u5e33\u865f\u2026","sequence_more":"\u66f4\u591a\u64ad\u653e\u9078\u9805","sequence_next":"\u5e8f\u5217\u4e2d\u7684\u4e0b\u4e00\u5f35\u76f8\u7247","sequence_pause":"\u66ab\u505c\u5e8f\u5217","sequence_play":"\u64ad\u653e\u5e8f\u5217","sequence_prev":"\u5e8f\u5217\u4e2d\u7684\u4e0a\u4e00\u5f35\u76f8\u7247","sequence_speed":"\u64ad\u653e\u901f\u5ea6","share":"\u5206\u4eab","share_embed":"\u5d4c\u5165\u5230\u60a8\u7684\u7db2\u7ad9","share_image":"\u9ad8\u756b\u8cea\u76f8\u7247","share_links":"\u8d85\u9023\u7d50","share_page":"\u672c\u9801\u7684\u8d85\u9023\u7d50","share_print":"\u5217\u5370","share_rss":"RSS \u6458\u8981","share_rss_title":"\u76ee\u524d\u5730\u5716\u53ef\u898b\u5340\u57df\u4e2d\u65b0\u76f8\u7247\u5e8f\u5217\u7684 RSS \u6458\u8981","show_map":"\u986f\u793a\u5730\u5716","show_psv":"\u986f\u793a\u76f8\u7247\u6aa2\u8996\u5668","zoom":"\u7e2e\u653e","zoomIn":"\u62c9\u8fd1","zoomOut":"\u62c9\u9060","report_submit":"\u9001\u51fa","report_email":"\u60a8\u7684 email","report_nature_label":"\u554f\u984c\u7684\u985e\u578b","report_nature":{"":"\u9078\u64c7\u554f\u984c\u7684\u985e\u578b\u2026","blur_missing":"\u53ef\u4ee5\u770b\u898b\u4eba\u81c9\u6216\u8eca\u724c","blur_excess":"\u4e0d\u9700\u8981\u6a21\u7cca\u7684\u7269\u4ef6\u88ab\u6a21\u7cca\u8655\u7406\u4e86","inappropriate":"\u4e0d\u7576\u7684\u76f8\u7247 (\u4e0d\u76f8\u95dc\u3001\u88f8\u9ad4\u2026)","privacy":"\u53ef\u4ee5\u770b\u898b\u79c1\u4eba\u7684\u9053\u8def\u6216\u8cc7\u7522","picture_low_quality":"\u76f8\u7247\u7684\u54c1\u8cea\u5f88\u5dee","mislocated":"\u76f8\u7247\u5728\u5730\u5716\u4e0a\u7684\u4f4d\u7f6e\u4e0d\u6b63\u78ba","copyright":"\u76f8\u7247\u4fb5\u72af\u4e86\u7248\u6b0a","other":"\u4efb\u4f55\u5176\u4ed6\u985e\u578b\u7684\u554f\u984c"},"share_embed_docs":"\u6df1\u5165\u4e86\u89e3\u5d4c\u5165\u8a2d\u5b9a\u503c","error_retry":"\u8acb\u7a0d\u5f8c\u518d\u8a66","error_click":"\u9ede\u64ca\u4ee5\u7e7c\u7e8c","legend_title":"\u986f\u793a\u76f8\u7247\u7684\u8a73\u7d30\u8cc7\u6599","report_email_placeholder":"\u9078\u586b","report_whole_sequence":"\u9019\u500b\u554f\u984c\u5f71\u97ff\u6574\u500b\u5e8f\u5217","report_details":"\u66f4\u591a\u8cc7\u8a0a","report_details_placeholder":"\u9078\u586b\uff0c\u60a8\u53ef\u4ee5\u8a73\u8ff0\u6b64\u554f\u984c\u548c\u5b83\u9020\u6210\u7684\u5f71\u97ff","report_wait":"\u6b63\u5728\u50b3\u9001\u5831\u544a\u2026","report_success":"\u5df2\u6210\u529f\u767c\u9001\u5831\u544a\uff0c\u6211\u5011\u5c07\u5118\u5feb\u5c0d\u5b83\u9032\u884c\u5be9\u6838\u3002","report_failure":"\u5efa\u7acb\u5831\u544a\u6642\u767c\u9001\u932f\u8aa4: {e}\uff0c\u8acb\u7a0d\u5f8c\u518d\u8a66\u3002","report_auth":"\u6b64\u5831\u544a\u5c07\u4f7f\u7528\u60a8\u7684\u5e33\u6236\u300c{a}\u300d\u767c\u9001","filter_qualityscore":"\u54c1\u8cea\u5206\u6578","filter_qualityscore_help":"\u9ede\u64ca\u4ee5\u555f\u7528\u6216\u505c\u7528","map_theme_score":"\u54c1\u8cea\u5206\u6578","metadata_camera_resolution":"\u89e3\u6790\u5ea6","metadata_quality":"\u54c1\u8cea\u5206\u6578","metadata_quality_help":"\u6df1\u5165\u4e86\u89e3\u54c1\u8cea\u5206\u6578","metadata_quality_gps_score":"\u5b9a\u4f4d\u5206\u6578","metadata_quality_resolution_score":"\u89e3\u6790\u5ea6\u5206\u6578","metadata_quality_missing":"\u76f8\u7247\u672a\u5305\u542b\u8cc7\u8a0a","report":"\u6aa2\u8209\u76f8\u7247","metadata_quality_score":"\u6574\u9ad4\u5206\u6578","filter_user_mypics":"\u6211\u7684\u76f8\u7247","filter_date_1month":"1 \u500b\u6708","filter_date_1year":"1 \u5e74","qualityscore_doc_2":"\u5206\u6578\u4ee5 A/B/C/D/E \u7b49\u7d1a\u7684\u5f62\u5f0f\u986f\u793a (A \u6700\u4f73\u3001E \u6700\u5dee) \uff0c\u4e26\u900f\u904e\u9019\u500b\u91cf\u5c3a\u8996\u89ba\u5316\u986f\u793a:","qualityscore_doc_link":"\u95dc\u65bc\u54c1\u8cea\u5206\u6578\u7684\u8a08\u7b97\u65b9\u5f0f\uff0c\u8acb\u53c3\u95b1\u6211\u5011\u7684\u6587\u4ef6\u3002","qualityscore_title":"\u95dc\u65bc\u54c1\u8cea\u5206\u6578","qualityscore_doc_1":"Panoramax \u70ba\u6bcf\u5f35\u76f8\u7247\u63d0\u4f9b\u54c1\u8cea\u5206\u6578\uff0c\u9019\u80fd\u5e6b\u52a9\u6211\u5011\u8f15\u9b06\u5730\u5728\u5730\u5716\u4e0a\u7be9\u9078\u548c\u986f\u793a\u9ad8\u54c1\u8cea\u76f8\u7247\u3002","qualityscore_doc_3":"\u5b83\u6839\u64da GPS \u7cbe\u78ba\u5ea6\u548c\u76f8\u7247\u89e3\u6790\u5ea6\u8a08\u7b97\u5f97\u51fa\uff0c\u5c08\u696d\u8a2d\u5099\u7684\u7b49\u7d1a\u70ba A\u3001360\xb0 \u904b\u52d5\u76f8\u6a5f\u7684\u7b49\u7d1a\u70ba B\u3001\u667a\u6167\u578b\u624b\u6a5f\u7684\u7b49\u7d1a\u70ba C/D/E\u3002","minimize_short":"\u96b1\u85cf"},"map":{"loading":"\u6b63\u5728\u8f09\u5165\u2026","not_public":"\u672a\u516c\u958b\u986f\u793a","thumbnail":"\u904a\u6a19\u61f8\u505c\u76f8\u7247\u7684\u7e2e\u5716","slow_loading":"\u5730\u5716\u8f09\u5165\u901f\u5ea6\u7de9\u6162\u800c\u4e14\u53ef\u80fd\u51fa\u73fe\u640d\u58de"},"psv":{"ctrlZoom":"\u4f7f\u7528 CTRL + \u6ed1\u9f20\u6efe\u8f2a\u7e2e\u653e\u5716\u7247","loadError":"\u7121\u6cd5\u8f09\u5165\u5168\u666f\u5716","twoFingers":"\u4f7f\u7528\u96d9\u6307\u79fb\u52d5"},"maplibre":{"GeolocateControl.FindMyLocation":"\u5c0b\u627e\u6211\u7684\u4f4d\u7f6e","GeolocateControl.LocationNotAvailable":"\u7121\u6cd5\u4f7f\u7528\u4f4d\u7f6e\u8cc7\u8a0a"}}')}},Da={};function __webpack_require__(ll){var cl=Da[ll];if(void 0!==cl)return cl.exports;var hl=Da[ll]={exports:{}};return F[ll].call(hl.exports,hl,hl.exports,__webpack_require__),hl.exports}__webpack_require__.n=F=>{var Da=F&&F.__esModule?()=>F.default:()=>F;return __webpack_require__.d(Da,{a:Da}),Da},__webpack_require__.d=(F,Da)=>{for(var ll in Da)__webpack_require__.o(Da,ll)&&!__webpack_require__.o(F,ll)&&Object.defineProperty(F,ll,{enumerable:!0,get:Da[ll]})},__webpack_require__.o=(F,Da)=>Object.prototype.hasOwnProperty.call(F,Da),__webpack_require__.r=F=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(F,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(F,"__esModule",{value:!0})};var ll={};return(()=>{"use strict";__webpack_require__.r(ll),__webpack_require__.d(ll,{Editor:()=>cl.A,StandaloneMap:()=>Da.A,Viewer:()=>F.Ay,default:()=>F.Ay});var F=__webpack_require__(2968),Da=__webpack_require__(7531),cl=__webpack_require__(9555)})(),ll})()));
|
|
35
35
|
//# sourceMappingURL=index.js.map
|